ngsolve 6.2.2404.post156.dev0__cp39-cp39-win_amd64.whl → 6.2.2406.post112.dev1__cp39-cp39-win_amd64.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 (134) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +27 -22
  3. netgen/include/basevector.hpp +43 -71
  4. netgen/include/bdbequations.hpp +14 -3
  5. netgen/include/bilinearform.hpp +8 -59
  6. netgen/include/blockjacobi.hpp +4 -0
  7. netgen/include/cg.hpp +3 -0
  8. netgen/include/chebyshev.hpp +3 -0
  9. netgen/include/coefficient.hpp +6 -2
  10. netgen/include/comp.hpp +0 -4
  11. netgen/include/diagonalmatrix.hpp +154 -0
  12. netgen/include/dump.hpp +5 -5
  13. netgen/include/eigen.hpp +3 -0
  14. netgen/include/elementbyelement.hpp +6 -0
  15. netgen/include/elementtopology.hpp +0 -3
  16. netgen/include/expr.hpp +13 -8
  17. netgen/include/fespace.hpp +12 -14
  18. netgen/include/finiteelement.hpp +7 -7
  19. netgen/include/globalspace.hpp +28 -2
  20. netgen/include/gridfunction.hpp +4 -0
  21. netgen/include/h1amg.hpp +3 -1
  22. netgen/include/h1hofe.hpp +1 -1
  23. netgen/include/hcurlhdivfes.hpp +2 -0
  24. netgen/include/hcurlhofespace.hpp +4 -3
  25. netgen/include/hdivfes.hpp +3 -3
  26. netgen/include/hdivhosurfacefespace.hpp +3 -3
  27. netgen/include/intrule.hpp +15 -1
  28. netgen/include/jacobi.hpp +3 -0
  29. netgen/include/la.hpp +1 -13
  30. netgen/include/matrix.hpp +21 -0
  31. netgen/include/meshaccess.hpp +24 -51
  32. netgen/include/mgpre.hpp +1 -1
  33. netgen/include/mptools.hpp +1 -2
  34. netgen/include/multivector.hpp +2 -0
  35. netgen/include/ngsobject.hpp +1 -1
  36. netgen/include/nodalhofe.hpp +3 -0
  37. netgen/include/normalfacetfespace.hpp +4 -5
  38. netgen/include/normalfacetsurfacefespace.hpp +1 -1
  39. netgen/include/order.hpp +3 -1
  40. netgen/include/parallel_matrices.hpp +5 -0
  41. netgen/include/paralleldofs.hpp +44 -95
  42. netgen/include/parallelngs.hpp +2 -1
  43. netgen/include/parallelvector.hpp +12 -16
  44. netgen/include/pardisoinverse.hpp +1 -0
  45. netgen/include/periodic.hpp +1 -0
  46. netgen/include/pmltrafo.hpp +5 -2
  47. netgen/include/preconditioner.hpp +3 -1
  48. netgen/include/scalarfe.hpp +4 -1
  49. netgen/include/sparsecholesky.hpp +4 -0
  50. netgen/include/sparsematrix.hpp +18 -45
  51. netgen/include/sparsematrix_dyn.hpp +2 -0
  52. netgen/include/sparsematrix_impl.hpp +66 -1
  53. netgen/include/special_matrix.hpp +7 -138
  54. netgen/include/statushandler.hpp +7 -0
  55. netgen/include/symbolicintegrator.hpp +2 -1
  56. netgen/include/tensorcoefficient.hpp +56 -54
  57. netgen/include/tpdiffop.hpp +1 -0
  58. netgen/include/tpintrule.hpp +2 -0
  59. netgen/include/umfpackinverse.hpp +58 -30
  60. netgen/include/vector.hpp +6 -1
  61. netgen/include/voxelcoefficientfunction.hpp +2 -0
  62. netgen/include/vvector.hpp +10 -1
  63. netgen/lib/libngsolve.lib +0 -0
  64. netgen/libngsolve.dll +0 -0
  65. ngsolve/_scikit_build_core_dependencies.py +8 -1
  66. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  67. ngsolve/config/config.py +6 -6
  68. ngsolve/config.py +6 -6
  69. ngsolve/demos/TensorProduct/__init__.py +0 -0
  70. ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
  71. ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
  72. ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
  73. ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
  74. ngsolve/demos/__init__.py +0 -0
  75. ngsolve/demos/howto/__init__.py +0 -0
  76. ngsolve/demos/howto/hhj.py +44 -0
  77. ngsolve/demos/howto/hybrid_dg.py +53 -0
  78. ngsolve/demos/howto/mixed.py +30 -0
  79. ngsolve/demos/howto/nonlin.py +29 -0
  80. ngsolve/demos/howto/pickling.py +26 -0
  81. ngsolve/demos/howto/pml.py +31 -0
  82. ngsolve/demos/howto/taskmanager.py +20 -0
  83. ngsolve/demos/howto/tdnns.py +47 -0
  84. ngsolve/demos/howto/timeDG-skeleton.py +45 -0
  85. ngsolve/demos/howto/timeDG.py +38 -0
  86. ngsolve/demos/howto/timeDGlap.py +42 -0
  87. ngsolve/demos/howto/timeDGwave.py +61 -0
  88. ngsolve/demos/intro/__init__.py +0 -0
  89. ngsolve/demos/intro/adaptive.py +123 -0
  90. ngsolve/demos/intro/cmagnet.py +62 -0
  91. ngsolve/demos/intro/elasticity.py +76 -0
  92. ngsolve/demos/intro/navierstokes.py +74 -0
  93. ngsolve/demos/intro/poisson.ipynb +170 -0
  94. ngsolve/demos/intro/poisson.py +41 -0
  95. ngsolve/demos/mpi/__init__.py +0 -0
  96. ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
  97. ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
  98. ngsolve/demos/mpi/mpi_poisson.py +89 -0
  99. ngsolve/demos/mpi/mpi_timeDG.py +82 -0
  100. ngsolve/ngslib.pyd +0 -0
  101. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/METADATA +2 -2
  102. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/RECORD +134 -102
  103. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
  104. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  105. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  106. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  107. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  108. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  109. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  110. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  111. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  112. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  113. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  114. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  115. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  116. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  117. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  118. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  119. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  120. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  121. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  122. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  123. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  124. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  125. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  126. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  127. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  128. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  129. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  130. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  131. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.vol +0 -0
  132. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/LICENSE +0 -0
  133. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/WHEEL +0 -0
  134. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/top_level.txt +0 -0
@@ -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
 
@@ -145,6 +149,8 @@ namespace ngla
145
149
 
146
150
  virtual AutoVector CreateRowVector () const override;
147
151
  virtual AutoVector CreateColVector () const override;
152
+
153
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
148
154
 
149
155
  FlatMatrix<SCAL> GetMatrix() const { return matrix; }
150
156
  FlatTable<int> GetRowDNums() const { return row_dnums; }
@@ -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
@@ -9,8 +9,9 @@
9
9
 
10
10
  #include <core/array.hpp>
11
11
  #include <core/localheap.hpp>
12
- // #include <core/exception.hpp>
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
 
@@ -28,15 +29,18 @@ template <typename T>
28
29
  struct SafeIndex
29
30
  {
30
31
  T i;
31
- SafeIndex(T ai) : i(ai) { };
32
- operator T() const { return i; }
33
- auto operator++() { return ++i; }
34
- auto operator++(int) { return i++; }
32
+ INLINE SafeIndex(T ai) : i(ai) { };
33
+ INLINE operator T() const { return i; }
34
+ INLINE auto operator++() { return ++i; }
35
+ INLINE auto operator++(int) { return i++; }
35
36
  };
36
37
 
37
- template <typename T>
38
- struct IsSafe<SafeIndex<T>> {
39
- constexpr operator bool() const { return true; } };
38
+ namespace ngcore
39
+ {
40
+ template <typename T>
41
+ struct IsSafe<SafeIndex<T>> {
42
+ constexpr operator bool() const { return true; } };
43
+ } // namespace ngcore
40
44
 
41
45
  /*
42
46
  namespace std {
@@ -262,6 +266,7 @@ namespace ngbla
262
266
  explicit constexpr undefined_size(IC<S> s) : size(s) { }
263
267
  explicit constexpr operator size_t() const { return size; }
264
268
  explicit constexpr operator int() const { return size; }
269
+ explicit constexpr operator ptrdiff_t() const { return size; }
265
270
  };
266
271
 
267
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;
@@ -924,7 +922,7 @@ ANY 1 1 1 1 | 15
924
922
  class NGS_DLL_HEADER NonconformingFESpace : public FESpace
925
923
  {
926
924
  ///
927
- Array<int> ndlevel;
925
+ // Array<int> ndlevel;
928
926
 
929
927
  public:
930
928
  NonconformingFESpace (shared_ptr<MeshAccess> ama, const Flags & flags, bool parseflags=false);
@@ -938,7 +936,7 @@ ANY 1 1 1 1 | 15
938
936
 
939
937
  virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
940
938
  ///
941
- virtual size_t GetNDof () const throw() override;
939
+ // virtual size_t GetNDof () const throw() override;
942
940
  ///
943
941
  virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
944
942
  };
@@ -949,7 +947,7 @@ ANY 1 1 1 1 | 15
949
947
  class NGS_DLL_HEADER NonconformingSurfaceFESpace : public FESpace
950
948
  {
951
949
  ///
952
- Array<int> ndlevel;
950
+ // Array<int> ndlevel;
953
951
 
954
952
  public:
955
953
  NonconformingSurfaceFESpace (shared_ptr<MeshAccess> ama, const Flags & flags, bool parseflags=false);
@@ -963,7 +961,7 @@ ANY 1 1 1 1 | 15
963
961
 
964
962
  virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
965
963
  ///
966
- virtual size_t GetNDof () const throw() override;
964
+ // virtual size_t GetNDof () const throw() override;
967
965
  ///
968
966
  virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
969
967
  };
@@ -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)) );
@@ -71,7 +71,7 @@ namespace ngfem
71
71
  /// the name of the element family
72
72
  virtual string ClassName() const;
73
73
 
74
- virtual void SetVertexNumbers (FlatArray<int> vnums);
74
+ virtual FiniteElement * SetVertexNumbers (FlatArray<int> vnums);
75
75
 
76
76
  virtual IntegrationRule GetIR (int order) const;
77
77
 
@@ -103,13 +103,12 @@ namespace ngfem
103
103
  {
104
104
  protected:
105
105
  /// pointers to the components
106
- // ArrayMem<const FiniteElement*,10> fea;
107
- FlatArray<const FiniteElement*> fea;
106
+ FlatArray<FiniteElement*> fea;
108
107
  bool all_the_same{true};
109
108
 
110
109
  public:
111
110
  /// initialize with pointers to components, copy pointers
112
- CompoundFiniteElement (FlatArray<const FiniteElement*> afea);
111
+ CompoundFiniteElement (FlatArray<FiniteElement*> afea);
113
112
 
114
113
  HD virtual ELEMENT_TYPE ElementType() const override { return fea[0]->ElementType(); }
115
114
  /// number of components
@@ -130,10 +129,11 @@ namespace ngfem
130
129
  /// the name of the element family
131
130
  virtual string ClassName() const override { return "CompoundFiniteElement"; }
132
131
 
133
- virtual void SetVertexNumbers (FlatArray<int> vnums) override
132
+ virtual CompoundFiniteElement * SetVertexNumbers (FlatArray<int> vnums) override
134
133
  {
135
134
  for (auto pfel : fea)
136
- const_cast<FiniteElement*>(pfel) -> SetVertexNumbers(vnums);
135
+ pfel -> SetVertexNumbers(vnums);
136
+ return this;
137
137
  }
138
138
 
139
139
  HD virtual bool ComplexShapes() const override;
@@ -174,7 +174,7 @@ namespace ngfem
174
174
  /// the name of the element family
175
175
  virtual string ClassName() const override { return "VectorFiniteElement"; }
176
176
 
177
- virtual void SetVertexNumbers (FlatArray<int> vnums) override;
177
+ virtual VectorFiniteElement * SetVertexNumbers (FlatArray<int> vnums) override;
178
178
 
179
179
  virtual void Print (ostream & ost) const override;
180
180
 
@@ -31,8 +31,8 @@ namespace ngcomp
31
31
  ELEMENT_TYPE type;
32
32
  bool complex;
33
33
  public:
34
- FE(int adim, ELEMENT_TYPE atype, bool acomplex)
35
- : FiniteElement(adim, 5), type(atype), complex(acomplex) { };
34
+ FE(int adim, int aorder, ELEMENT_TYPE atype, bool acomplex)
35
+ : FiniteElement(adim, aorder), type(atype), complex(acomplex) { };
36
36
  ELEMENT_TYPE ElementType() const override { return type; }
37
37
  bool ComplexShapes() const override { return complex; }
38
38
 
@@ -64,7 +64,33 @@ namespace ngcomp
64
64
  BareSliceVector<Complex> x,
65
65
  FlatVector<Complex> flux,
66
66
  LocalHeap & lh) const override;
67
+
68
+ void Apply (const FiniteElement & fel,
69
+ const BaseMappedIntegrationRule & mir,
70
+ BareSliceVector<double> x,
71
+ BareSliceMatrix<double> flux,
72
+ LocalHeap & lh) const override;
73
+
74
+ void ApplyTrans (const FiniteElement & fel,
75
+ const BaseMappedIntegrationRule & mir,
76
+ FlatMatrix<double> flux,
77
+ BareSliceVector<double> x,
78
+ LocalHeap & lh) const override;
79
+
80
+ void CalcMatrix (const FiniteElement & fel,
81
+ const SIMD_BaseMappedIntegrationRule & mir,
82
+ BareSliceMatrix<SIMD<double>> mat) const override;
83
+
84
+ void Apply (const FiniteElement & bfel,
85
+ const SIMD_BaseMappedIntegrationRule & bmir,
86
+ BareSliceVector<double> x,
87
+ BareSliceMatrix<SIMD<double>> flux) const override;
88
+
67
89
 
90
+ void AddTrans (const FiniteElement & bfel,
91
+ const SIMD_BaseMappedIntegrationRule & bmir,
92
+ BareSliceMatrix<SIMD<double>> flux,
93
+ BareSliceVector<double> x) const override;
68
94
  };
69
95
 
70
96
 
@@ -28,6 +28,7 @@ namespace ngcomp
28
28
  GridFunctionCoefficientFunction (shared_ptr<DifferentialOperator> adiffop,
29
29
  shared_ptr<DifferentialOperator> atrace_diffop = nullptr,
30
30
  shared_ptr<DifferentialOperator> attrace_diffop = nullptr,
31
+ shared_ptr<DifferentialOperator> atttrace_diffop = nullptr,
31
32
  int acomp = 0);
32
33
  public:
33
34
  GridFunctionCoefficientFunction () = default;
@@ -36,6 +37,7 @@ namespace ngcomp
36
37
  shared_ptr<DifferentialOperator> adiffop,
37
38
  shared_ptr<DifferentialOperator> atrace_diffop = nullptr,
38
39
  shared_ptr<DifferentialOperator> attrace_diffop = nullptr,
40
+ shared_ptr<DifferentialOperator> atttrace_diffop = nullptr,
39
41
  int acomp = 0);
40
42
  GridFunctionCoefficientFunction (shared_ptr<GridFunction> agf,
41
43
  shared_ptr<BilinearFormIntegrator> abfi, int acomp = 0);
@@ -83,6 +85,7 @@ namespace ngcomp
83
85
  virtual shared_ptr<CoefficientFunction>
84
86
  Diff (const CoefficientFunction * var, shared_ptr<CoefficientFunction> dir) const override;
85
87
 
88
+ shared_ptr<CoefficientFunction> Primary() const override;
86
89
  shared_ptr<GridFunctionCoefficientFunction> GetTrace() const;
87
90
  };
88
91
 
@@ -226,6 +229,7 @@ namespace ngcomp
226
229
  }
227
230
 
228
231
  shared_ptr<CoefficientFunction> Operator (shared_ptr<DifferentialOperator> diffop) const override;
232
+ shared_ptr<CoefficientFunction> Operator (const string& name) const override;
229
233
 
230
234
 
231
235
  ///
netgen/include/h1amg.hpp CHANGED
@@ -1,7 +1,9 @@
1
1
  #ifndef H1AMG_HPP_
2
2
  #define H1AMG_HPP_
3
3
 
4
- #include <la.hpp>
4
+ // #include <la.hpp>
5
+ #include <basematrix.hpp>
6
+ #include <sparsematrix.hpp>
5
7
 
6
8
  namespace ngcomp
7
9
  {
netgen/include/h1hofe.hpp CHANGED
@@ -139,7 +139,7 @@ namespace ngfem
139
139
  virtual bool DualityMassDiagonal () const override
140
140
  {
141
141
  return (ET == ET_SEGM) || (ET == ET_TRIG) || (ET == ET_QUAD)
142
- || (ET == ET_HEX) || (ET == ET_TET);
142
+ || (ET == ET_HEX) || (ET == ET_TET) || (ET == ET_POINT);
143
143
  }
144
144
  };
145
145
 
@@ -9,6 +9,8 @@
9
9
 
10
10
 
11
11
  #include "fespace.hpp"
12
+ #include <sparsematrix.hpp>
13
+
12
14
 
13
15
  namespace ngcomp
14
16
  {
@@ -9,6 +9,7 @@
9
9
 
10
10
  #include "fespace.hpp"
11
11
  #include "h1hofespace.hpp"
12
+ #include <sparsematrix.hpp>
12
13
 
13
14
  namespace ngcomp
14
15
  {
@@ -23,7 +24,7 @@ namespace ngcomp
23
24
  protected:
24
25
 
25
26
  typedef short TORDER;
26
-
27
+
27
28
  // Level
28
29
  int level;
29
30
  Array<DofId> first_edge_dof;
@@ -58,7 +59,7 @@ namespace ngcomp
58
59
  bool usegrad;
59
60
  bool var_order;
60
61
 
61
- int ndof;
62
+ // int ndof;
62
63
  int nedfine;
63
64
  int uniform_order_inner;
64
65
  int uniform_order_face;
@@ -95,7 +96,7 @@ namespace ngcomp
95
96
  ///
96
97
  virtual void DoArchive (Archive & archive) override;
97
98
  ///
98
- virtual size_t GetNDof () const throw() override;
99
+ // virtual size_t GetNDof () const throw() override;
99
100
  virtual void SetOrder (NodeId ni, int order) override;
100
101
  virtual int GetOrder (NodeId ni) const override;
101
102
  using FESpace::GetOrder;
@@ -19,7 +19,7 @@ namespace ngcomp
19
19
  class RaviartThomasFESpace : public FESpace
20
20
  {
21
21
  ///
22
- Array<int> ndlevel;
22
+ // Array<int> ndlevel;
23
23
  public:
24
24
  ///
25
25
  /*
@@ -42,9 +42,9 @@ namespace ngcomp
42
42
 
43
43
  virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
44
44
  ///
45
- virtual size_t GetNDof () const throw() override;
45
+ // virtual size_t GetNDof () const throw() override;
46
46
  ///
47
- virtual size_t GetNDofLevel (int level) const override;
47
+ // virtual size_t GetNDofLevel (int level) const override;
48
48
 
49
49
  ///
50
50
  virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
@@ -15,7 +15,7 @@ namespace ngcomp
15
15
  {
16
16
  protected:
17
17
 
18
- int ndof;
18
+ // int ndof;
19
19
 
20
20
  Array<DofId> first_facet_dof;
21
21
  Array<DofId> first_inner_dof;
@@ -28,7 +28,7 @@ namespace ngcomp
28
28
  Array<bool> fine_facet;
29
29
  Array<bool> boundary_facet;
30
30
 
31
- Array<int> ndlevel;
31
+ // Array<int> ndlevel;
32
32
  int uniform_order_inner;
33
33
  int uniform_order_facet;
34
34
 
@@ -64,7 +64,7 @@ namespace ngcomp
64
64
  virtual void UpdateDofTables() override;
65
65
  virtual void UpdateCouplingDofArray() override;
66
66
 
67
- virtual size_t GetNDof () const throw() override;
67
+ // virtual size_t GetNDof () const throw() override;
68
68
 
69
69
  virtual FiniteElement & GetFE (ElementId ei, Allocator & alloc) const override;
70
70
 
@@ -436,7 +436,7 @@ namespace ngfem
436
436
  INLINE SCAL operator() (int i) const { return point(i); }
437
437
 
438
438
  ///
439
- INLINE const Vec<R,SCAL> GetNV () const { return normalvec; }
439
+ INLINE const Vec<R,SCAL> & GetNV () const { return normalvec; }
440
440
  ///
441
441
  INLINE void SetNV ( Vec<R,SCAL> vec) { normalvec = vec; }
442
442
  ///
@@ -1481,6 +1481,7 @@ namespace ngfem
1481
1481
  int DimSpace() const;
1482
1482
 
1483
1483
  virtual SliceMatrix<> GetPoints() const = 0;
1484
+ virtual SliceMatrix<> GetNormals() const = 0;
1484
1485
  virtual SliceMatrix<Complex> GetPointsComplex() const
1485
1486
  { throw Exception("don't have complex ir"); }
1486
1487
  virtual void ComputeNormalsAndMeasure (ELEMENT_TYPE et) { throw Exception ("ComputeNormalsAndMeasure(ET) not overloaded"); }
@@ -1551,6 +1552,13 @@ namespace ngfem
1551
1552
  const_cast<double*> (&mips[0].GetPoint()(0)));
1552
1553
  }
1553
1554
 
1555
+ virtual SliceMatrix<> GetNormals() const
1556
+ {
1557
+ return SliceMatrix<> (mips.Size(), DIM_SPACE*sizeof(SCAL)/sizeof(double),
1558
+ sizeof(MappedIntegrationPoint<DIM_ELEMENT, DIM_SPACE, SCAL>) / sizeof(double),
1559
+ const_cast<double*> (&mips[0].GetNV()(0)));
1560
+ }
1561
+
1554
1562
  virtual void ComputeNormalsAndMeasure (ELEMENT_TYPE et);
1555
1563
  virtual void ComputeNormalsAndMeasure (ELEMENT_TYPE et, int facetnr);
1556
1564
  virtual bool IsComplex() const { return false; }
@@ -1616,6 +1624,12 @@ namespace ngfem
1616
1624
  const_cast<Complex*> (&mips[0].GetPointComplex()(0)));
1617
1625
  }
1618
1626
 
1627
+ virtual SliceMatrix<> GetNormals() const
1628
+ {
1629
+ throw Exception("never tested");
1630
+ }
1631
+
1632
+
1619
1633
  virtual void ComputeNormalsAndMeasure (ELEMENT_TYPE et, int facetnr);
1620
1634
  virtual bool IsComplex() const { return true; }
1621
1635
  };
netgen/include/jacobi.hpp CHANGED
@@ -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
 
netgen/include/la.hpp CHANGED
@@ -2,15 +2,6 @@
2
2
  #define FILE_NGLA
3
3
 
4
4
  #include <bla.hpp>
5
- #include <core/mpi_wrapper.hpp>
6
-
7
- /*
8
- namespace ngcomp
9
- {
10
- class Preconditioner;
11
- class LocalPreconditioner;
12
- }
13
- */
14
5
 
15
6
  /** namespace for linear algebra.
16
7
  */
@@ -33,13 +24,10 @@ namespace ngla
33
24
  #include "order.hpp"
34
25
  #include "sparsecholesky.hpp"
35
26
  #include "pardisoinverse.hpp"
36
- // include these only from c++-files
37
- // #include "umfpackinverse.hpp"
38
- // #include "superluinverse.hpp"
39
- // #include "mumpsinverse.hpp"
40
27
  #include "jacobi.hpp"
41
28
  #include "blockjacobi.hpp"
42
29
  #include "commutingAMG.hpp"
30
+ #include "diagonalmatrix.hpp"
43
31
  #include "special_matrix.hpp"
44
32
  #include "elementbyelement.hpp"
45
33
  #include "cg.hpp"