ngsolve 6.2.2406__cp312-cp312-macosx_10_15_universal2.whl → 6.2.2406.post57.dev1__cp312-cp312-macosx_10_15_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ngsolve might be problematic. Click here for more details.

Files changed (99) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +9 -18
  3. netgen/include/basevector.hpp +34 -71
  4. netgen/include/bilinearform.hpp +8 -59
  5. netgen/include/blockjacobi.hpp +4 -0
  6. netgen/include/cg.hpp +3 -0
  7. netgen/include/chebyshev.hpp +3 -0
  8. netgen/include/comp.hpp +0 -4
  9. netgen/include/diagonalmatrix.hpp +154 -0
  10. netgen/include/dump.hpp +5 -5
  11. netgen/include/eigen.hpp +3 -0
  12. netgen/include/elementbyelement.hpp +4 -0
  13. netgen/include/elementtopology.hpp +0 -3
  14. netgen/include/expr.hpp +2 -0
  15. netgen/include/fespace.hpp +8 -10
  16. netgen/include/finiteelement.hpp +7 -7
  17. netgen/include/h1amg.hpp +3 -1
  18. netgen/include/hcurlhdivfes.hpp +2 -0
  19. netgen/include/hcurlhofespace.hpp +2 -1
  20. netgen/include/intrule.hpp +15 -1
  21. netgen/include/jacobi.hpp +3 -0
  22. netgen/include/la.hpp +1 -13
  23. netgen/include/meshaccess.hpp +6 -9
  24. netgen/include/mgpre.hpp +1 -1
  25. netgen/include/mptools.hpp +1 -2
  26. netgen/include/multivector.hpp +2 -0
  27. netgen/include/ngsobject.hpp +1 -1
  28. netgen/include/nodalhofe.hpp +3 -0
  29. netgen/include/order.hpp +3 -1
  30. netgen/include/parallel_matrices.hpp +5 -0
  31. netgen/include/paralleldofs.hpp +44 -95
  32. netgen/include/parallelngs.hpp +2 -1
  33. netgen/include/parallelvector.hpp +12 -16
  34. netgen/include/pardisoinverse.hpp +1 -0
  35. netgen/include/pmltrafo.hpp +5 -2
  36. netgen/include/preconditioner.hpp +3 -1
  37. netgen/include/scalarfe.hpp +4 -1
  38. netgen/include/sparsecholesky.hpp +4 -0
  39. netgen/include/sparsematrix.hpp +8 -41
  40. netgen/include/sparsematrix_dyn.hpp +2 -0
  41. netgen/include/sparsematrix_impl.hpp +66 -1
  42. netgen/include/special_matrix.hpp +3 -138
  43. netgen/include/tpdiffop.hpp +1 -0
  44. netgen/include/tpintrule.hpp +2 -0
  45. netgen/include/umfpackinverse.hpp +1 -1
  46. netgen/include/vvector.hpp +10 -1
  47. netgen/libngcomp.dylib +0 -0
  48. netgen/libngfem.dylib +0 -0
  49. netgen/libngla.dylib +0 -0
  50. netgen/libngsolve.dylib +0 -0
  51. netgen/libngstd.dylib +0 -0
  52. ngsolve/__init__.pyi +1 -1
  53. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  54. ngsolve/comp/__init__.pyi +94 -1
  55. ngsolve/config/__init__.pyi +6 -6
  56. ngsolve/config/config.py +5 -5
  57. ngsolve/config/config.pyi +6 -6
  58. ngsolve/config.py +5 -5
  59. ngsolve/demos/mpi/mpi_navierstokes.py +2 -0
  60. ngsolve/demos/mpi/mpi_timeDG.py +3 -0
  61. ngsolve/utils.pyi +2 -1
  62. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/METADATA +2 -2
  63. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/RECORD +99 -98
  64. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/Netgen.icns +0 -0
  65. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/bin/ngscxx +0 -0
  66. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/bin/ngsld +0 -0
  67. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/bin/ngsolve.tcl +0 -0
  68. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/bin/ngspy +0 -0
  69. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  70. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  71. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  72. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  73. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  74. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  75. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  76. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  77. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  78. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  79. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  80. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  81. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  82. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  83. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  84. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  85. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  86. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  87. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  88. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  89. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  90. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  91. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  92. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  93. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  94. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  95. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  96. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.vol +0 -0
  97. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/LICENSE +0 -0
  98. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/WHEEL +0 -0
  99. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/top_level.txt +0 -0
@@ -8,6 +8,9 @@
8
8
  /* Date: 5. Jul. 96 */
9
9
  /**************************************************************************/
10
10
 
11
+
12
+ #include "basematrix.hpp"
13
+
11
14
  namespace ngla
12
15
  {
13
16
  /**
@@ -8,10 +8,15 @@
8
8
  /* Date: 25. Mar. 2000 */
9
9
  /*********************************************************************/
10
10
 
11
- namespace ngla
12
- {
13
11
 
12
+ #include "basevector.hpp"
13
+ #include "multivector.hpp"
14
+ // #include "paralleldofs.hpp"
14
15
 
16
+ namespace ngla
17
+ {
18
+ class ParallelDofs;
19
+
15
20
  // sets the solver which is used for InverseMatrix
16
21
  enum INVERSETYPE { PARDISO, PARDISOSPD, SPARSECHOLESKY, SUPERLU, SUPERLU_DIST, MUMPS, MASTERINVERSE, UMFPACK };
17
22
  extern string GetInverseName (INVERSETYPE type);
@@ -268,14 +273,6 @@ namespace ngla
268
273
  void AssignTo (TS s, BaseVector & v) const
269
274
  {
270
275
  CheckSize (v);
271
- /*
272
- if (m.Height() != v.Size() || m.Width() != x.Size())
273
- throw Exception (ToString ("matrix-vector: size does not fit\n") +
274
- "matrix-type = " + typeid(m).name() +
275
- "Matrix: " + ToString(m.Height()) + " x " + ToString(m.Width()) + "\n"
276
- "Vector in : " + ToString(x.Size()) + "\n"
277
- "Vector res: " + ToString(v.Size()));
278
- */
279
276
  m.Mult (x, v);
280
277
  v *= s;
281
278
  }
@@ -284,10 +281,6 @@ namespace ngla
284
281
  void AddTo (TS s, BaseVector & v) const
285
282
  {
286
283
  CheckSize (v);
287
- /*
288
- if (m.Height() != v.Size() || m.Width() != x.Size())
289
- throw Exception ("matrix-vector MultAdd: size does not fit");
290
- */
291
284
  m.MultAdd (s, x, v);
292
285
  }
293
286
 
@@ -849,7 +842,6 @@ namespace ngla
849
842
  {
850
843
  bool has_format;
851
844
  size_t size;
852
- // bool is_complex;
853
845
  public:
854
846
  ///
855
847
  IdentityMatrix ()
@@ -857,7 +849,6 @@ namespace ngla
857
849
  IdentityMatrix (size_t asize, bool ais_complex)
858
850
  : has_format(true), size(asize) { is_complex=ais_complex; }
859
851
 
860
- // virtual bool IsComplex() const override { return is_complex; }
861
852
  virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
862
853
 
863
854
  ///
@@ -928,7 +919,7 @@ namespace ngla
928
919
  };
929
920
 
930
921
 
931
- /* *********************** operator<< ********************** */
922
+ /* *********************** operators ********************** */
932
923
 
933
924
  // default is ProductMatrix, but optimizations for
934
925
  // ParallelMatrices
@@ -954,8 +945,8 @@ namespace ngla
954
945
 
955
946
 
956
947
  shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat);
948
+
957
949
 
958
- /// output operator for matrices
959
950
  inline ostream & operator<< (ostream & ost, const BaseMatrix & m)
960
951
  {
961
952
  return m.Print(ost);
@@ -7,13 +7,32 @@
7
7
  /* Date: 7. Feb. 2003 */
8
8
  /*********************************************************************/
9
9
 
10
-
10
+ #include <bla.hpp>
11
+ #include <core/mpi_wrapper.hpp>
12
+ // #include "paralleldofs.hpp"
11
13
 
12
14
  namespace ngla
13
15
  {
16
+ using namespace ngbla;
17
+
14
18
  class BaseVector;
15
19
  class AutoVector;
16
20
  class MultiVector;
21
+
22
+ class ParallelDofs;
23
+
24
+ class DofRange : public T_Range<size_t>
25
+ {
26
+ shared_ptr<ParallelDofs> pardofs;
27
+ public:
28
+ DofRange () { }
29
+ DofRange (T_Range<size_t> range, shared_ptr<ParallelDofs> apardofs)
30
+ : T_Range<size_t>(range), pardofs(apardofs) { ; }
31
+ shared_ptr<ParallelDofs> GetParallelDofs() const { return pardofs; }
32
+ };
33
+
34
+
35
+
17
36
 
18
37
  template <class SCAL> class S_BaseVector;
19
38
 
@@ -91,9 +110,6 @@ namespace ngla
91
110
  size_t size;
92
111
  /// number of doubles per entry
93
112
  int entrysize = 1;
94
- ///
95
- // shared_ptr<ParallelDofs> paralleldofs;
96
-
97
113
  ///
98
114
  BaseVector () { ; }
99
115
 
@@ -651,72 +667,6 @@ namespace ngla
651
667
  extern template class S_BaseVector<Complex>;
652
668
  #endif
653
669
 
654
- /*
655
- template <class SCAL>
656
- class NGS_DLL_HEADER S_BaseVector;
657
-
658
-
659
- template <>
660
- class NGS_DLL_HEADER S_BaseVector<double> : virtual public BaseVector
661
- {
662
- public:
663
- S_BaseVector () throw () { ; }
664
- virtual ~S_BaseVector() { ; }
665
-
666
- S_BaseVector & operator= (double s);
667
-
668
- virtual double InnerProduct (const BaseVector & v2) const;
669
-
670
- virtual FlatVector<double> FVDouble () const;
671
- virtual FlatVector<Complex> FVComplex () const;
672
-
673
- virtual FlatVector<double> FVScal () const
674
- {
675
- return FlatVector<double> (size * entrysize, Memory());
676
- }
677
-
678
-
679
- virtual void GetIndirect (const FlatArray<int> & ind,
680
- const FlatVector<double> & v) const;
681
- virtual void GetIndirect (const FlatArray<int> & ind,
682
- const FlatVector<Complex> & v) const;
683
-
684
- };
685
-
686
-
687
-
688
-
689
- template <>
690
- class NGS_DLL_HEADER S_BaseVector<Complex> : virtual public BaseVector
691
- {
692
- public:
693
- S_BaseVector () throw() { ; }
694
- ~S_BaseVector () { ; }
695
-
696
- virtual Complex InnerProduct (const BaseVector & v2) const;
697
-
698
- virtual FlatVector<double> FVDouble () const throw();
699
- virtual FlatVector<Complex> FVComplex () const throw();
700
- virtual FlatVector<Complex> FVScal () const throw()
701
- {
702
- return FlatVector<Complex> (size * entrysize/2, Memory());
703
- }
704
-
705
- virtual void GetIndirect (const FlatArray<int> & ind,
706
- const FlatVector<double> & v) const;
707
- virtual void GetIndirect (const FlatArray<int> & ind,
708
- const FlatVector<Complex> & v) const;
709
- };
710
-
711
- */
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
-
720
670
 
721
671
 
722
672
 
@@ -821,14 +771,20 @@ namespace ngla
821
771
  };
822
772
 
823
773
 
824
-
774
+ /*
825
775
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > >
826
776
  operator+ (const BaseVector & a, const BaseVector & b)
827
777
  {
828
778
  typedef VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > TRES;
829
779
  return TRES (a, b);
830
780
  }
781
+ */
782
+ inline auto operator+ (const BaseVector & a, const BaseVector & b)
783
+ {
784
+ return VVecExpr<VSumExpr<VVecExpr<BaseVector>,VVecExpr<BaseVector>>>{{a,b}};
785
+ }
831
786
 
787
+ /*
832
788
  template <class TA>
833
789
  inline VVecExpr<VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > >
834
790
  operator+ (const VVecExpr<TA> & a, const BaseVector & b)
@@ -836,6 +792,13 @@ namespace ngla
836
792
  typedef VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > TRES;
837
793
  return TRES (a, b);
838
794
  }
795
+ */
796
+ template <class TA>
797
+ inline auto operator+ (const VVecExpr<TA> & a, const BaseVector & b)
798
+ {
799
+ return VSumExpr<VVecExpr<TA>,VVecExpr<BaseVector>> (a,b);
800
+ }
801
+
839
802
 
840
803
  template <class TB>
841
804
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<TB> > >
@@ -10,6 +10,9 @@
10
10
 
11
11
  #include "fespace.hpp"
12
12
  #include <specialelement.hpp>
13
+ #include <sparsematrix.hpp>
14
+ #include <elementbyelement.hpp>
15
+
13
16
 
14
17
  namespace ngcomp
15
18
  {
@@ -746,40 +749,6 @@ namespace ngcomp
746
749
 
747
750
 
748
751
 
749
- template <class TM>
750
- class NGS_DLL_HEADER T_BilinearFormDiagonal : public S_BilinearForm<typename mat_traits<TM>::TSCAL>
751
- {
752
-
753
- public:
754
- typedef typename mat_traits<TM>::TSCAL TSCAL;
755
- typedef typename mat_traits<TM>::TV_COL TV_COL;
756
- typedef DiagonalMatrix<TM> TMATRIX;
757
- shared_ptr<TMATRIX> mymatrix;
758
-
759
- protected:
760
-
761
- public:
762
- T_BilinearFormDiagonal (shared_ptr<FESpace> afespace, const string & aname,
763
- const Flags & flags);
764
- virtual ~T_BilinearFormDiagonal ();
765
-
766
- virtual void AllocateMatrix () override;
767
-
768
- virtual void AddElementMatrix (FlatArray<int> dnums1,
769
- FlatArray<int> dnums2,
770
- BareSliceMatrix<TSCAL> elmat,
771
- ElementId id, bool addatomic,
772
- LocalHeap & lh) override;
773
-
774
- virtual void AddDiagElementMatrix (FlatArray<int> dnums1,
775
- FlatVector<TSCAL> diag,
776
- bool inner_element, int elnr,
777
- LocalHeap & lh) override;
778
- };
779
-
780
-
781
-
782
-
783
752
 
784
753
  class ComponentBilinearForm : public BilinearForm
785
754
  {
@@ -953,17 +922,21 @@ namespace ngcomp
953
922
  Array<ProxyFunction*> trialproxies;
954
923
 
955
924
  typedef void (*lib_function)(size_t nip, double * input, size_t dist_input,
956
- double * output, size_t dist_output);
925
+ double * output, size_t dist_output,
926
+ size_t dist, double * points, double * normals);
957
927
 
958
928
  unique_ptr<SharedLibrary> library;
959
929
  lib_function compiled_function = nullptr;
960
930
 
961
931
  size_t dimx, dimy;
962
932
  size_t nip;
933
+ Matrix<double> points;
934
+ Matrix<double> normals;
963
935
 
964
936
  public:
965
937
  ApplyIntegrationPoints (Array<shared_ptr<CoefficientFunction>> acoefs,
966
938
  const Array<ProxyFunction*> & atrialproxies,
939
+ Matrix<double> apoints, Matrix<double> anormals,
967
940
  size_t adimx, size_t adimy, size_t anip);
968
941
 
969
942
  AutoVector CreateColVector() const override;
@@ -983,30 +956,6 @@ namespace ngcomp
983
956
 
984
957
 
985
958
 
986
-
987
- /**
988
- This bilinearform stores the element-matrices
989
- */
990
- template<class SCAL>
991
- class ElementByElement_BilinearForm : public S_BilinearForm<SCAL>
992
- {
993
- public:
994
- ElementByElement_BilinearForm (shared_ptr<FESpace> afespace,
995
- const string & aname,
996
- const Flags & flags);
997
- virtual ~ElementByElement_BilinearForm () override;
998
-
999
- virtual void AllocateMatrix () override;
1000
- // virtual AutoVector CreateRowVector() const override;
1001
- // virtual AutoVector CreateColVector() const override;
1002
-
1003
- virtual void AddElementMatrix (FlatArray<int> dnums1,
1004
- FlatArray<int> dnums2,
1005
- BareSliceMatrix<SCAL> elmat,
1006
- ElementId id, bool addatomic,
1007
- LocalHeap & lh) override;
1008
- };
1009
-
1010
959
 
1011
960
 
1012
961
  }
@@ -7,6 +7,9 @@
7
7
  /* Date: 06. Oct. 96 */
8
8
  /* *************************************************************************/
9
9
 
10
+
11
+ #include "sparsematrix.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
@@ -172,6 +175,7 @@ namespace ngla
172
175
  return { MemoryUsage ("BlockJac", nels*sizeof(TM), blocktable->Size()) };
173
176
  }
174
177
 
178
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
175
179
  const Array<FlatMatrix<TM>> & GetInverses() const { return invdiag; }
176
180
  const Array<TM> & MatrixData() const { return bigmem; }
177
181
  };
netgen/include/cg.hpp CHANGED
@@ -8,6 +8,9 @@
8
8
  /* Date: 5. Jul. 96 */
9
9
  /**************************************************************************/
10
10
 
11
+
12
+ #include "basematrix.hpp"
13
+
11
14
  namespace ngla
12
15
  {
13
16
 
@@ -7,6 +7,9 @@
7
7
  /* Date: 30. Jun. 01 */
8
8
  /**************************************************************************/
9
9
 
10
+
11
+ #include "basematrix.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
netgen/include/comp.hpp CHANGED
@@ -39,10 +39,6 @@ namespace ngmg
39
39
 
40
40
 
41
41
  #include <parallelngs.hpp>
42
- namespace ngcomp
43
- {
44
- using namespace ngparallel;
45
- }
46
42
 
47
43
 
48
44
  // #include "pmltrafo.hpp"
@@ -0,0 +1,154 @@
1
+ #ifndef FILE_NGS_DIAGONALMATRIX
2
+ #define FILE_NGS_DIAGONALMATRIX
3
+
4
+
5
+
6
+ #include "basematrix.hpp"
7
+ #include "vvector.hpp"
8
+
9
+
10
+ namespace ngla
11
+ {
12
+
13
+ class NGS_DLL_HEADER Projector : public BaseMatrix
14
+ {
15
+ shared_ptr<BitArray> bits;
16
+ bool keep_values;
17
+ public:
18
+ // projector on true / false bits
19
+ Projector (shared_ptr<BitArray> abits, bool akeep_values = true)
20
+ : bits(abits), keep_values(akeep_values) { ; }
21
+
22
+ virtual bool IsComplex() const override { return false; }
23
+
24
+ virtual int VHeight() const override { return bits->Size(); }
25
+ virtual int VWidth() const override { return bits->Size(); }
26
+
27
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override;
28
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override;
29
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
30
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
31
+ virtual void Project (BaseVector & x) const;
32
+ virtual void SetValues (BaseVector & x, double val) const;
33
+
34
+ bool KeepValues() const { return keep_values; }
35
+ shared_ptr<BitArray> Mask() const { return bits; }
36
+
37
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
38
+
39
+ AutoVector CreateRowVector() const override
40
+ { throw Exception("CreateRowVector not implemented for Projector!"); }
41
+ AutoVector CreateColVector() const override
42
+ { throw Exception("CreateColVector not implemented for Projector!"); }
43
+
44
+ AutoVector Evaluate(BaseVector & v) const override
45
+ {
46
+ auto res = v.CreateVector();
47
+ Mult (v, res);
48
+ return res;
49
+ }
50
+
51
+ };
52
+
53
+
54
+ template <typename TM=double>
55
+ class NGS_DLL_HEADER DiagonalMatrix : public BaseMatrix
56
+ {
57
+ shared_ptr<VVector<TM>> diag;
58
+ public:
59
+ // typedef typename mat_traits<TM>::TV_ROW TV_ROW;
60
+ // typedef typename mat_traits<TM>::TV_COL TV_COL;
61
+ typedef typename mat_traits<TM>::TSCAL TSCAL;
62
+
63
+ DiagonalMatrix(size_t h)
64
+ : diag(make_shared<VVector<TM>>(h)) { }
65
+ DiagonalMatrix(const VVector<TM> & diag_);
66
+ DiagonalMatrix(shared_ptr<VVector<TM>> diag_);
67
+ virtual ~DiagonalMatrix();
68
+
69
+ bool IsComplex() const override { return false; }
70
+ TM & operator() (size_t i) { return (*diag)(i); }
71
+ const TM & operator() (size_t i) const { return (*diag)(i); }
72
+ int VHeight() const override { return diag->Size(); }
73
+ int VWidth() const override { return diag->Size(); }
74
+
75
+ BaseVector & AsVector() override { return *diag; }
76
+ const BaseVector & AsVector() const override { return *diag; }
77
+ ostream & Print (ostream & ost) const override;
78
+
79
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
80
+
81
+ AutoVector CreateRowVector () const override;
82
+ AutoVector CreateColVector () const override;
83
+
84
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
85
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
86
+
87
+ shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
88
+ };
89
+
90
+
91
+ template <typename TM=double>
92
+ class BlockDiagonalMatrix : public BaseMatrix
93
+ {
94
+ Tensor<3,TM> blockdiag;
95
+ int blocks, dimy, dimx;
96
+ public:
97
+ // typedef double TSCAL;
98
+
99
+ BlockDiagonalMatrix(Tensor<3,TM> _blockdiag);
100
+ bool IsComplex() const override { return ngbla::IsComplex<TM>(); }
101
+
102
+ int VHeight() const override { return blocks*dimy; }
103
+ int VWidth() const override { return blocks*dimx; }
104
+
105
+ ostream & Print (ostream & ost) const override;
106
+
107
+ AutoVector CreateRowVector () const override;
108
+ AutoVector CreateColVector () const override;
109
+
110
+ void Mult (const BaseVector & x, BaseVector & y) const override;
111
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
112
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
113
+
114
+ shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
115
+ };
116
+
117
+ // blocks is inner-most dimension of tensor and vectors
118
+ class BlockDiagonalMatrixSoA : public BaseMatrix
119
+ {
120
+ Tensor<3> blockdiag;
121
+ int blocks, dimy, dimx;
122
+ Matrix<bool> nonzero;
123
+ Table<int> sparse, sparseT; // sparse non-zero pattern
124
+ public:
125
+ typedef double TSCAL;
126
+
127
+ BlockDiagonalMatrixSoA(Tensor<3> _blockdiag);
128
+ bool IsComplex() const override { return false; }
129
+
130
+ int VHeight() const override { return blocks*dimy; }
131
+ int VWidth() const override { return blocks*dimx; }
132
+
133
+ ostream & Print (ostream & ost) const override;
134
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
135
+
136
+ AutoVector CreateRowVector () const override;
137
+ AutoVector CreateColVector () const override;
138
+
139
+ void Mult (const BaseVector & x, BaseVector & y) const override;
140
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
141
+ void MultTrans (const BaseVector & x, BaseVector & y) const override;
142
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
143
+ // shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
144
+
145
+ FlatTensor<3> GetBlockDiag () const { return blockdiag; }
146
+ FlatMatrix<bool> GetNonZeroPattern() const { return nonzero; }
147
+ };
148
+
149
+ }
150
+
151
+
152
+
153
+ #endif
154
+
netgen/include/dump.hpp CHANGED
@@ -248,7 +248,7 @@ namespace ngstd
248
248
 
249
249
  template<typename DT, NODE_TYPE NT>
250
250
  void packaged_buffered_send(int rank, int np, DT* a, typename key_trait<NT>::TKEY* b, int n, int pkg_size, int p,
251
- Array<NG_MPI_Request> & requests)
251
+ NgMPI_Requests & requests)
252
252
  {
253
253
  // NG_MPI_Datatype mpi_type_array = MPIT<DT>::mpi_type;
254
254
  NG_MPI_Datatype mpi_type_array = GetMPIType<DT>();
@@ -800,7 +800,7 @@ namespace ngstd
800
800
 
801
801
  if(rank == 0)
802
802
  {
803
- Array<NG_MPI_Request> requests;
803
+ NgMPI_Requests requests;
804
804
  //packaged_send
805
805
  packaged_buffered_send<DT,NT>(rank, np, array, array_keys, base_array_size, pkg_size, 1, requests);
806
806
 
@@ -836,7 +836,7 @@ namespace ngstd
836
836
 
837
837
  for(int j=0;(n_pkg-1)*pkg_size+j < n;j++)
838
838
  f(end_keys[j], end[j]);
839
- MyMPI_WaitAll (requests);
839
+ requests.WaitAll();
840
840
  // free(end);
841
841
  // free(end_keys);
842
842
  }
@@ -853,10 +853,10 @@ namespace ngstd
853
853
  else //regular
854
854
  {
855
855
  //cout << "rank " << rank << " sends to " << rank+1 << " then gets from " << p_in1 << "/" << p_in2 << " and sends to " << p_out << endl;
856
- Array<NG_MPI_Request> requests;
856
+ NgMPI_Requests requests;
857
857
  packaged_buffered_send<DT,NT>(rank, np, array, array_keys, base_array_size, pkg_size, rank+1, requests);
858
858
  merge_in_in_out<DT,NT>(pkg_size, rank, np, p_in1, p_in2, p_out);
859
- MyMPI_WaitAll (requests);
859
+ requests.WaitAll();
860
860
  }
861
861
  }
862
862
  else
netgen/include/eigen.hpp CHANGED
@@ -7,6 +7,9 @@
7
7
  /* Date: 5. Jul. 96 */
8
8
  /**************************************************************************/
9
9
 
10
+
11
+ #include "basematrix.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
@@ -11,6 +11,10 @@
11
11
  Element by element matrix
12
12
  */
13
13
 
14
+
15
+ #include "basematrix.hpp"
16
+ #include "blockjacobi.hpp"
17
+
14
18
  namespace ngla
15
19
  {
16
20
 
@@ -14,9 +14,6 @@
14
14
  namespace ngfem
15
15
  {
16
16
  using namespace ngbla;
17
- // using ngcore::INT;
18
-
19
-
20
17
 
21
18
  /*
22
19
  Toplogy of reference elements
netgen/include/expr.hpp CHANGED
@@ -11,6 +11,7 @@
11
11
  #include <core/localheap.hpp>
12
12
  #include <core/exception.hpp>
13
13
 
14
+ #include <cstddef>
14
15
  #include <ngs_stdcpp_include.hpp> // for INLINE
15
16
  #include "complex_wrapper.hpp"
16
17
 
@@ -265,6 +266,7 @@ namespace ngbla
265
266
  explicit constexpr undefined_size(IC<S> s) : size(s) { }
266
267
  explicit constexpr operator size_t() const { return size; }
267
268
  explicit constexpr operator int() const { return size; }
269
+ explicit constexpr operator ptrdiff_t() const { return size; }
268
270
  };
269
271
 
270
272
 
@@ -12,7 +12,12 @@
12
12
  #include <finiteelement.hpp>
13
13
  #include <diffop.hpp>
14
14
  #include <symbolicintegrator.hpp> // for ProxyFunction
15
- #include <la.hpp>
15
+
16
+ #include <basevector.hpp>
17
+ #include <basematrix.hpp>
18
+
19
+ // #include <paralleldofs.hpp>
20
+
16
21
 
17
22
  #include "ngsobject.hpp"
18
23
 
@@ -283,14 +288,7 @@ ANY 1 1 1 1 | 15
283
288
  order_policy = op;
284
289
  }
285
290
 
286
- virtual void SetOrder (ELEMENT_TYPE et, TORDER order)
287
- {
288
- if (order_policy == CONSTANT_ORDER || order_policy == OLDSTYLE_ORDER)
289
- order_policy = NODE_TYPE_ORDER;
290
- et_bonus_order[et] = order - this->order;
291
-
292
- timestamp = 0; // rerun first_update
293
- }
291
+ virtual void SetOrder (ELEMENT_TYPE et, TORDER order);
294
292
 
295
293
  virtual void SetOrder (NodeId ni, int order);
296
294
  virtual int GetOrder (NodeId ni) const;
@@ -1433,7 +1431,7 @@ namespace ngcore
1433
1431
  template<>
1434
1432
  struct MPI_typetrait<ngcomp::COUPLING_TYPE>
1435
1433
  {
1436
- static NG_MPI_Datatype MPIType ()
1434
+ static auto MPIType ()
1437
1435
  {
1438
1436
  static_assert ( (sizeof(ngcomp::COUPLING_TYPE) == sizeof(char)) ||
1439
1437
  (sizeof(ngcomp::COUPLING_TYPE) == sizeof(int)) );