ngsolve 6.2.2406__cp310-cp310-macosx_10_15_universal2.whl → 6.2.2406.post111.dev1__cp310-cp310-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 (103) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +9 -18
  3. netgen/include/basevector.hpp +43 -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 +12 -14
  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 +4 -3
  20. netgen/include/hdivfes.hpp +3 -3
  21. netgen/include/hdivhosurfacefespace.hpp +3 -3
  22. netgen/include/intrule.hpp +15 -1
  23. netgen/include/jacobi.hpp +3 -0
  24. netgen/include/la.hpp +1 -13
  25. netgen/include/matrix.hpp +21 -0
  26. netgen/include/meshaccess.hpp +21 -51
  27. netgen/include/mgpre.hpp +1 -1
  28. netgen/include/mptools.hpp +1 -2
  29. netgen/include/multivector.hpp +2 -0
  30. netgen/include/ngsobject.hpp +1 -1
  31. netgen/include/nodalhofe.hpp +3 -0
  32. netgen/include/normalfacetfespace.hpp +4 -5
  33. netgen/include/order.hpp +3 -1
  34. netgen/include/parallel_matrices.hpp +5 -0
  35. netgen/include/paralleldofs.hpp +44 -95
  36. netgen/include/parallelngs.hpp +2 -1
  37. netgen/include/parallelvector.hpp +12 -16
  38. netgen/include/pardisoinverse.hpp +1 -0
  39. netgen/include/periodic.hpp +1 -0
  40. netgen/include/pmltrafo.hpp +5 -2
  41. netgen/include/preconditioner.hpp +3 -1
  42. netgen/include/scalarfe.hpp +4 -1
  43. netgen/include/sparsecholesky.hpp +4 -0
  44. netgen/include/sparsematrix.hpp +8 -41
  45. netgen/include/sparsematrix_dyn.hpp +2 -0
  46. netgen/include/sparsematrix_impl.hpp +66 -1
  47. netgen/include/special_matrix.hpp +3 -138
  48. netgen/include/tpdiffop.hpp +1 -0
  49. netgen/include/tpintrule.hpp +2 -0
  50. netgen/include/umfpackinverse.hpp +1 -1
  51. netgen/include/vector.hpp +6 -1
  52. netgen/include/vvector.hpp +10 -1
  53. netgen/libngbla.dylib +0 -0
  54. netgen/libngcomp.dylib +0 -0
  55. netgen/libngfem.dylib +0 -0
  56. netgen/libngla.dylib +0 -0
  57. netgen/libngsolve.dylib +0 -0
  58. netgen/libngstd.dylib +0 -0
  59. ngsolve/cmake/NGSolveConfig.cmake +6 -6
  60. ngsolve/config/config.py +5 -5
  61. ngsolve/config.py +5 -5
  62. ngsolve/demos/intro/poisson.py +1 -1
  63. ngsolve/demos/mpi/mpi_navierstokes.py +2 -0
  64. ngsolve/demos/mpi/mpi_timeDG.py +3 -0
  65. ngsolve/ngslib.so +0 -0
  66. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/bin/ngscxx +2 -2
  67. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/bin/ngsld +1 -1
  68. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/METADATA +2 -2
  69. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/RECORD +103 -102
  70. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/Netgen.icns +0 -0
  71. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/bin/ngsolve.tcl +0 -0
  72. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/bin/ngspy +0 -0
  73. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  74. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  75. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  76. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  77. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  78. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  79. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  80. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  81. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  82. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  83. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  84. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  85. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  86. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  87. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  88. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  89. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  90. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  91. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  92. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  93. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  94. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  95. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  96. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  97. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  98. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  99. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  100. {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.vol +0 -0
  101. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/LICENSE +0 -0
  102. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/WHEEL +0 -0
  103. {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/top_level.txt +0 -0
@@ -8,10 +8,14 @@
8
8
  /**************************************************************************/
9
9
 
10
10
 
11
+ #include <core/mpi_wrapper.hpp>
12
+ #include <ngstd.hpp>
11
13
 
12
14
  namespace ngla
13
15
  {
16
+ using namespace ngstd;
14
17
 
18
+
15
19
  #ifdef PARALLEL
16
20
 
17
21
  /**
@@ -54,7 +58,7 @@ namespace ngla
54
58
  Table adist_procs must provide the distant processes for each dof.
55
59
  table
56
60
  */
57
- ParallelDofs (NG_MPI_Comm acomm, Table<int> && adist_procs,
61
+ ParallelDofs (NgMPI_Comm acomm, Table<int> && adist_procs,
58
62
  int dim = 1, bool iscomplex = false);
59
63
 
60
64
  shared_ptr<ParallelDofs> SubSet (shared_ptr<BitArray> take_dofs) const;
@@ -131,9 +135,9 @@ namespace ngla
131
135
  bool complex;
132
136
  BitArray masterdofs;
133
137
  public:
134
- ParallelDofs (NG_MPI_Comm acomm, Table<int> && adist_procs,
138
+ ParallelDofs (NgMPI_Comm acomm, Table<int> && adist_procs,
135
139
  int dim = 1, bool iscomplex = false)
136
- : es(dim), complex(iscomplex)
140
+ : ndof(adist_procs.Size()), es(dim), complex(iscomplex)
137
141
  { ; }
138
142
 
139
143
  int GetNDofLocal () const { return ndof; }
@@ -174,42 +178,41 @@ namespace ngla
174
178
  };
175
179
 
176
180
  #endif
181
+
177
182
 
178
-
179
-
183
+
180
184
  template <typename T>
185
+ [[deprecated("use pardofs.ReduceDofData")]]
181
186
  void ReduceDofData (FlatArray<T> data, NG_MPI_Op op, const shared_ptr<ParallelDofs> & pardofs)
182
187
  {
183
188
  if (pardofs)
184
189
  pardofs->ReduceDofData(data, op);
185
190
  }
186
-
191
+
187
192
  template <typename T>
193
+ [[deprecated("use pardofs.ScatterDofData")]]
188
194
  void ScatterDofData (FlatArray<T> data, const shared_ptr<ParallelDofs> & pardofs)
189
195
  {
190
196
  if (pardofs)
191
197
  pardofs->ScatterDofData (data);
192
198
  }
193
-
199
+
194
200
  template <typename T>
201
+ [[deprecated("use pardofs.AllReduceDofData")]]
195
202
  void AllReduceDofData (FlatArray<T> data, NG_MPI_Op op,
196
203
  const shared_ptr<ParallelDofs> & pardofs)
197
204
  {
198
205
  if (pardofs)
199
206
  pardofs->AllReduceDofData (data, op);
200
207
  }
201
-
202
-
208
+
203
209
 
204
210
 
205
211
  #ifdef PARALLEL
206
212
 
207
213
  template <typename T>
208
- void ParallelDofs::ReduceDofData (FlatArray<T> data, NG_MPI_Op op) const
214
+ void ParallelDofs :: ReduceDofData (FlatArray<T> data, NG_MPI_Op op) const
209
215
  {
210
- // if (this == NULL) // illformed C++, shall get rid of this
211
- // throw Exception("ReduceDofData for null-object");
212
-
213
216
  static Timer t0("ParallelDofs :: ReduceDofData");
214
217
  RegionTimer rt(t0);
215
218
 
@@ -224,53 +227,48 @@ namespace ngla
224
227
  nrecv = 0;
225
228
 
226
229
  /** Count send/recv size **/
227
- for (int i = 0; i < GetNDofLocal(); i++) {
228
- auto dps = GetDistantProcs(i);
229
- if(!dps.Size()) continue;
230
- int master = min2(rank, dps[0]);
231
- if(rank==master)
232
- for(auto p:dps)
233
- nrecv[p]++;
234
- else
235
- nsend[master]++;
236
- }
237
-
230
+ for (int i = 0; i < GetNDofLocal(); i++)
231
+ if (auto dps = GetDistantProcs(i); dps.Size())
232
+ {
233
+ if (rank < dps[0])
234
+ for (auto p : dps)
235
+ nrecv[p]++;
236
+ else
237
+ nsend[dps[0]]++;
238
+ }
239
+
238
240
  Table<T> send_data(nsend);
239
241
  Table<T> recv_data(nrecv);
240
242
 
241
243
  /** Fill send_data **/
242
244
  nsend = 0;
243
- for (int i = 0; i < GetNDofLocal(); i++) {
244
- auto dps = GetDistantProcs(i);
245
- if(!dps.Size()) continue;
246
- int master = min2(rank, dps[0]);
247
- if(master!=rank)
248
- send_data[master][nsend[master]++] = data[i];
249
- }
245
+ for (int i = 0; i < GetNDofLocal(); i++)
246
+ if (auto dps = GetDistantProcs(i); dps.Size())
247
+ if (rank > dps[0])
248
+ send_data[dps[0]][nsend[dps[0]]++] = data[i];
250
249
 
251
- Array<NG_MPI_Request> requests;
250
+ NgMPI_Requests send_requests;
251
+ NgMPI_Requests recv_requests;
252
252
  for (int i = 0; i < ntasks; i++)
253
253
  {
254
254
  if (nsend[i])
255
- requests.Append (comm.ISend(send_data[i], i, NG_MPI_TAG_SOLVE));
255
+ send_requests += comm.ISend(send_data[i], i, NG_MPI_TAG_SOLVE);
256
256
  if (nrecv[i])
257
- requests.Append (comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE));
257
+ recv_requests += comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE);
258
258
  }
259
259
 
260
- MyMPI_WaitAll (requests);
261
-
262
260
  Array<int> cnt(ntasks);
263
261
  cnt = 0;
264
262
 
265
263
  NG_MPI_Datatype type = GetMPIType<T>();
264
+
265
+ recv_requests.WaitAll();
266
266
  for (int i = 0; i < GetNDofLocal(); i++)
267
267
  if (IsMasterDof(i))
268
- {
269
- FlatArray<int> distprocs = GetDistantProcs (i);
270
- for (int j = 0; j < distprocs.Size(); j++)
271
- NG_MPI_Reduce_local (&recv_data[distprocs[j]][cnt[distprocs[j]]++],
272
- &data[i], 1, type, op);
273
- }
268
+ for (auto p : GetDistantProcs (i))
269
+ NG_MPI_Reduce_local (&recv_data[p][cnt[p]++], &data[i], 1, type, op);
270
+
271
+ send_requests.WaitAll();
274
272
  }
275
273
 
276
274
 
@@ -293,18 +291,6 @@ namespace ngla
293
291
  nrecv = 0;
294
292
 
295
293
  /** Count send/recv size **/
296
- /*
297
- for (int i = 0; i < GetNDofLocal(); i++) {
298
- auto dps = GetDistantProcs(i);
299
- if(!dps.Size()) continue;
300
- int master = min2(rank, dps[0]);
301
- if(rank==master)
302
- for(auto p:dps)
303
- nsend[p]++;
304
- else
305
- nrecv[master]++;
306
- }
307
- */
308
294
  for (int i = 0; i < GetNDofLocal(); i++)
309
295
  if (auto dps = GetDistantProcs(i); dps.Size() > 0)
310
296
  {
@@ -320,48 +306,25 @@ namespace ngla
320
306
 
321
307
  /** Fill send_data **/
322
308
  nsend = 0;
323
- /*
324
- for (int i = 0; i < GetNDofLocal(); i++) {
325
- auto dps = GetDistantProcs(i);
326
- if(!dps.Size()) continue;
327
- int master = min2(rank, dps[0]);
328
- if(rank==master)
329
- for(auto p:dps)
330
- send_data[p][nsend[p]++] = data[i];
331
- }
332
- */
333
309
  for (int i = 0; i < GetNDofLocal(); i++)
334
310
  if (auto dps = GetDistantProcs(i); dps.Size() > 0)
335
311
  if (rank < dps[0])
336
312
  for (auto p : dps)
337
313
  send_data[p][nsend[p]++] = data[i];
338
314
 
339
- Array<NG_MPI_Request> requests;
315
+ NgMPI_Requests requests;
340
316
  for (int i = 0; i < ntasks; i++)
341
317
  {
342
318
  if (nsend[i])
343
- requests.Append (comm.ISend (send_data[i], i, NG_MPI_TAG_SOLVE));
319
+ requests += comm.ISend (send_data[i], i, NG_MPI_TAG_SOLVE);
344
320
  if (nrecv[i])
345
- requests.Append (comm.IRecv (recv_data[i], i, NG_MPI_TAG_SOLVE));
321
+ requests += comm.IRecv (recv_data[i], i, NG_MPI_TAG_SOLVE);
346
322
  }
347
-
348
- MyMPI_WaitAll (requests);
323
+ requests.WaitAll();
349
324
 
350
325
  Array<int> cnt(ntasks);
351
326
  cnt = 0;
352
327
 
353
- /*
354
- for (int i = 0; i < GetNDofLocal(); i++)
355
- if (!IsMasterDof(i))
356
- {
357
- FlatArray<int> distprocs = GetDistantProcs (i);
358
-
359
- int master = ntasks;
360
- for (int j = 0; j < distprocs.Size(); j++)
361
- master = min (master, distprocs[j]);
362
- data[i] = recv_data[master][cnt[master]++];
363
- }
364
- */
365
328
  for (int i = 0; i < GetNDofLocal(); i++)
366
329
  if (!IsMasterDof(i))
367
330
  {
@@ -372,20 +335,6 @@ namespace ngla
372
335
 
373
336
  #endif //PARALLEL
374
337
 
375
-
376
- class DofRange : public T_Range<size_t>
377
- {
378
- shared_ptr<ParallelDofs> pardofs;
379
- public:
380
- DofRange () { }
381
- DofRange (T_Range<size_t> range, shared_ptr<ParallelDofs> apardofs)
382
- : T_Range<size_t>(range), pardofs(apardofs) { ; }
383
- shared_ptr<ParallelDofs> GetParallelDofs() const { return pardofs; }
384
- };
385
-
386
-
387
338
  }
388
339
 
389
-
390
-
391
340
  #endif
@@ -1,6 +1,7 @@
1
1
  #ifndef FILE_PARALLELNGS
2
2
  #define FILE_PARALLELNGS
3
3
 
4
+ /*
4
5
  #include <ngstd.hpp>
5
6
  #include <la.hpp>
6
7
 
@@ -9,7 +10,7 @@ namespace ngparallel
9
10
  using namespace ngstd;
10
11
  using namespace ngla;
11
12
  }
12
-
13
+ */
13
14
 
14
15
  #include "parallelvector.hpp"
15
16
  #include "parallel_matrices.hpp"
@@ -7,16 +7,13 @@
7
7
  /* Date: 2007,2011 */
8
8
  /* ************************************************************************/
9
9
 
10
-
11
-
12
- // #ifdef PARALLEL
10
+ #include <vvector.hpp>
11
+ #include <multivector.hpp>
12
+ #include <paralleldofs.hpp>
13
13
 
14
14
  namespace ngla
15
15
  {
16
- // using ngparallel::ParallelDofs;
17
- // using ngla::ParallelDofs;
18
-
19
-
16
+
20
17
  class NGS_DLL_HEADER ParallelBaseVector : virtual public BaseVector
21
18
  {
22
19
  protected:
@@ -24,8 +21,8 @@ namespace ngla
24
21
  shared_ptr<ParallelDofs> paralleldofs;
25
22
  shared_ptr<BaseVector> local_vec;
26
23
 
27
- Array<NG_MPI_Request> sreqs;
28
- Array<NG_MPI_Request> rreqs;
24
+ mutable NgMPI_Requests sreqs;
25
+ mutable NgMPI_Requests rreqs;
29
26
 
30
27
  public:
31
28
  ParallelBaseVector ()
@@ -86,10 +83,10 @@ namespace ngla
86
83
  virtual void Distribute() const override = 0;
87
84
  // { cerr << "ERROR -- Distribute called for BaseVector, is not parallel" << endl; }
88
85
 
89
- virtual void ISend ( int dest, NG_MPI_Request & request ) const;
86
+ virtual NgMPI_Request ISend ( int dest ) const;
90
87
  // virtual void Send ( int dest ) const;
91
88
 
92
- virtual void IRecvVec ( int dest, NG_MPI_Request & request ) = 0;
89
+ virtual NgMPI_Request IRecvVec ( int dest ) = 0;
93
90
  // { cerr << "ERROR -- IRecvVec called for BaseVector, is not parallel" << endl; }
94
91
 
95
92
  // virtual void RecvVec ( int dest )
@@ -105,7 +102,6 @@ namespace ngla
105
102
 
106
103
 
107
104
 
108
-
109
105
  inline ParallelBaseVector * dynamic_cast_ParallelBaseVector (BaseVector * x)
110
106
  {
111
107
  // cout << "my dynamic * cast" << endl;
@@ -126,7 +122,7 @@ namespace ngla
126
122
  }
127
123
  return dynamic_cast<const ParallelBaseVector*> (x);
128
124
  }
129
-
125
+
130
126
  inline ParallelBaseVector & dynamic_cast_ParallelBaseVector (BaseVector & x)
131
127
  {
132
128
  // cout << "my dynamic cast" << endl;
@@ -135,6 +131,7 @@ namespace ngla
135
131
  return dynamic_cast<ParallelBaseVector&> (**ax);
136
132
  return dynamic_cast<ParallelBaseVector&> (x);
137
133
  }
134
+
138
135
  inline const ParallelBaseVector & dynamic_cast_ParallelBaseVector (const BaseVector & x)
139
136
  {
140
137
  // cout << "my dynamic cast" << endl;
@@ -175,7 +172,7 @@ namespace ngla
175
172
  using ParallelBaseVector :: sreqs;
176
173
  using ParallelBaseVector :: rreqs;
177
174
 
178
- Table<SCAL> * recvvalues;
175
+ Table<SCAL> recvvalues;
179
176
 
180
177
  using S_BaseVectorPtr<TSCAL> :: pdata;
181
178
  using ParallelBaseVector :: local_vec;
@@ -192,7 +189,7 @@ namespace ngla
192
189
  virtual AutoVector Range (T_Range<size_t> range) const override;
193
190
  virtual AutoVector Range (DofRange range) const override;
194
191
 
195
- virtual void IRecvVec ( int dest, NG_MPI_Request & request ) override;
192
+ virtual NgMPI_Request IRecvVec ( int dest ) override;
196
193
  // virtual void RecvVec ( int dest );
197
194
  virtual void AddRecvValues( int sender ) override;
198
195
  virtual AutoVector CreateVector () const override;
@@ -269,5 +266,4 @@ namespace ngla
269
266
 
270
267
  }
271
268
 
272
- // #endif
273
269
  #endif
@@ -15,6 +15,7 @@
15
15
 
16
16
  ////////////////////////////////////////////////////////////////////////////////
17
17
 
18
+ #include "sparsecholesky.hpp" // for SparseFactorization
18
19
 
19
20
  namespace ngla
20
21
  {
@@ -80,6 +80,7 @@ namespace ngcomp
80
80
  { space->VTransformVC(ei, vec, tt); }
81
81
 
82
82
  auto & GetVertexMap() const { return vertex_map; }
83
+ auto & GetDofMap() const { return dofmap; }
83
84
  protected:
84
85
  // overload in quasiperiodic space
85
86
  virtual void DofMapped(size_t from, size_t to, size_t idnr) { ; }
@@ -298,13 +298,16 @@ namespace ngcomp
298
298
  Complex alpha;
299
299
  public:
300
300
 
301
- CartesianPML_Transformation(FlatMatrix<double> _bounds, Complex _alpha)
302
- : PML_TransformationDim<DIM>(), alpha(_alpha)
301
+ CartesianPML_Transformation(Mat<DIM,2> _bounds, Complex _alpha)
302
+ : PML_TransformationDim<DIM>(), bounds(_bounds), alpha(_alpha)
303
303
  {
304
+ /*
304
305
  bounds = 0.;
305
306
  for (int i : Range(min(int(_bounds.Height()),DIM)))
306
307
  for (int j : Range(min(int(_bounds.Width()),2)))
307
308
  bounds(i,j)=_bounds(i,j);
309
+ */
310
+ ;
308
311
  }
309
312
 
310
313
  ~CartesianPML_Transformation() {;}
@@ -7,8 +7,10 @@
7
7
  /* Date: 10. Jul. 2000 */
8
8
  /*********************************************************************/
9
9
 
10
- #include <la.hpp>
10
+ // #include <la.hpp>
11
+ #include <basematrix.hpp>
11
12
  #include <mgpre.hpp>
13
+ #include <chebyshev.hpp>
12
14
 
13
15
  namespace ngcomp
14
16
  {
@@ -288,6 +288,9 @@ namespace ngfem
288
288
  {
289
289
  for (int i = 0; i < avnums.Size(); i++) vnums[i] = avnums[i];
290
290
  }
291
+ DGFiniteElement * SetVertexNumbers (FlatArray<int> vnums) override
292
+ { VertexOrientedFE<ET>::SetVertexNumbers(vnums); return this; }
293
+
291
294
 
292
295
  /// assign vertex number
293
296
  void SetVertexNumber (int nr, int vnum) { vnums[nr] = vnum; }
@@ -301,7 +304,7 @@ namespace ngfem
301
304
  NGS_DLL_HEADER void CalcTraceMatrix (int facet, FlatMatrix<> trace) const;
302
305
  NGS_DLL_HEADER void CalcGradientMatrix (FlatMatrix<> gmat) const;
303
306
 
304
- HD NGS_DLL_HEADER virtual void GetDiagMassMatrix (FlatVector<> mass) const;
307
+ HD NGS_DLL_HEADER virtual void GetDiagMassMatrix (FlatVector<> mass) const override;
305
308
 
306
309
  NGS_DLL_HEADER virtual void GetGradient (FlatVector<> coefs, FlatMatrixFixWidth<D> grad) const;
307
310
  NGS_DLL_HEADER virtual void GetGradientTrans (FlatMatrixFixWidth<D> grad, FlatVector<> coefs) const;
@@ -11,6 +11,10 @@
11
11
  sparse cholesky factorization
12
12
  */
13
13
 
14
+ #include "basematrix.hpp"
15
+ #include "sparsematrix.hpp"
16
+ #include "order.hpp"
17
+
14
18
  namespace ngla
15
19
  {
16
20
 
@@ -8,6 +8,9 @@
8
8
  /**************************************************************************/
9
9
 
10
10
 
11
+ #include "vvector.hpp"
12
+ #include "basematrix.hpp"
13
+
11
14
  namespace ngla
12
15
  {
13
16
 
@@ -555,7 +558,7 @@ namespace ngla
555
558
  virtual tuple<int,int> EntrySizes() const override { return { ngbla::Height<TM>(), ngbla::Width<TM>() }; }
556
559
 
557
560
  shared_ptr<BaseSparseMatrix>
558
- CreateTransposeTM (const function<shared_ptr<SparseMatrixTM<decltype(Trans(TM()))>>(const Array<int>&, int)> & creator) const;
561
+ CreateTransposeTM (const function<shared_ptr<SparseMatrixTM<decltype(ngbla::Trans(TM()))>>(const Array<int>&, int)> & creator) const;
559
562
 
560
563
  public:
561
564
  using BaseMatrix::GetMemoryTracer;
@@ -616,37 +619,13 @@ namespace ngla
616
619
  { return { string("SparseMatrix")+typeid(TM).name(), this->Height(), this->Width() }; }
617
620
 
618
621
  virtual shared_ptr<BaseJacobiPrecond>
619
- CreateJacobiPrecond (shared_ptr<BitArray> inner) const override
620
- {
621
- // if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
622
- if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
623
- else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
624
- throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(mat_traits<TM>::HEIGHT));
625
- return nullptr;
626
- }
627
- else return make_shared<JacobiPrecond<TM,TV_ROW,TV_COL>> (*this, inner);
628
- }
622
+ CreateJacobiPrecond (shared_ptr<BitArray> inner) const override;
629
623
 
630
624
  virtual shared_ptr<BaseBlockJacobiPrecond>
631
625
  CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
632
626
  const BaseVector * constraint = 0,
633
627
  bool parallel = 1,
634
- shared_ptr<BitArray> freedofs = NULL) const override
635
- {
636
- // if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
637
- if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
638
- else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
639
- throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(ngbla::Height<TM>()));
640
- return nullptr;
641
- }
642
- else
643
- // return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>> (*this, blocks, parallel);
644
-
645
- return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>>
646
- ( dynamic_pointer_cast<const SparseMatrix>
647
- (this->shared_from_this()),
648
- blocks, parallel);
649
- }
628
+ shared_ptr<BitArray> freedofs = NULL) const override;
650
629
 
651
630
  virtual shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
652
631
  virtual shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<const Array<int>> clusters) const override;
@@ -793,24 +772,12 @@ namespace ngla
793
772
  this->AddElementMatrixSymmetric (dnums1, elmat, use_atomic);
794
773
  }
795
774
 
796
- virtual shared_ptr<BaseJacobiPrecond> CreateJacobiPrecond (shared_ptr<BitArray> inner) const override
797
- {
798
- return make_shared<JacobiPrecondSymmetric<TM,TV>> (*this, inner);
799
- }
800
-
775
+ virtual shared_ptr<BaseJacobiPrecond> CreateJacobiPrecond (shared_ptr<BitArray> inner) const override;
801
776
  virtual shared_ptr<BaseBlockJacobiPrecond>
802
777
  CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
803
778
  const BaseVector * constraint = 0,
804
779
  bool parallel = 1,
805
- shared_ptr<BitArray> freedofs = NULL) const override
806
- {
807
- // return make_shared<BlockJacobiPrecondSymmetric<TM,TV>> (*this, blocks);
808
- return make_shared<BlockJacobiPrecondSymmetric<TM,TV>>
809
- ( dynamic_pointer_cast<const SparseMatrixSymmetric>
810
- (this->shared_from_this()),
811
- blocks);
812
- }
813
-
780
+ shared_ptr<BitArray> freedofs = NULL) const override;
814
781
 
815
782
  virtual shared_ptr<BaseSparseMatrix> Restrict (const SparseMatrixTM<double> & prol,
816
783
  shared_ptr<BaseSparseMatrix> cmat = nullptr) const override;
@@ -8,6 +8,8 @@
8
8
  /**************************************************************************/
9
9
 
10
10
 
11
+ #include "sparsematrix.hpp"
12
+
11
13
  namespace ngla
12
14
  {
13
15
 
@@ -155,6 +155,44 @@ namespace ngla
155
155
  : SparseMatrixTM<TM> (std::move(agraph))
156
156
  { ; }
157
157
 
158
+
159
+
160
+ template <class TM, class TV_ROW, class TV_COL>
161
+ shared_ptr<BaseJacobiPrecond> SparseMatrix<TM,TV_ROW,TV_COL> ::
162
+ CreateJacobiPrecond (shared_ptr<BitArray> inner) const
163
+ {
164
+ // if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
165
+ if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
166
+ else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
167
+ throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(mat_traits<TM>::HEIGHT));
168
+ return nullptr;
169
+ }
170
+ else return make_shared<JacobiPrecond<TM,TV_ROW,TV_COL>> (*this, inner);
171
+ }
172
+
173
+ template <class TM, class TV_ROW, class TV_COL>
174
+ shared_ptr<BaseBlockJacobiPrecond> SparseMatrix<TM,TV_ROW,TV_COL> ::
175
+ CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
176
+ const BaseVector * constraint,
177
+ bool parallel,
178
+ shared_ptr<BitArray> freedofs) const
179
+ {
180
+ // if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
181
+ if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
182
+ else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
183
+ throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(ngbla::Height<TM>()));
184
+ return nullptr;
185
+ }
186
+ else
187
+ // return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>> (*this, blocks, parallel);
188
+
189
+ return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>>
190
+ ( dynamic_pointer_cast<const SparseMatrix>
191
+ (this->shared_from_this()),
192
+ blocks, parallel);
193
+ }
194
+
195
+
158
196
 
159
197
  template <class TM, class TV_ROW, class TV_COL>
160
198
  void SparseMatrix<TM,TV_ROW,TV_COL> ::
@@ -602,7 +640,7 @@ namespace ngla
602
640
 
603
641
  template <class TM>
604
642
  shared_ptr<BaseSparseMatrix> SparseMatrixTM<TM> ::
605
- CreateTransposeTM (const function<shared_ptr<SparseMatrixTM<decltype(Trans(TM()))>>(const Array<int>&,int)> & creator) const
643
+ CreateTransposeTM (const function<shared_ptr<SparseMatrixTM<decltype(ngbla::Trans(TM()))>>(const Array<int>&,int)> & creator) const
606
644
  {
607
645
  Array<int> cnt(this->Width());
608
646
  cnt = 0;
@@ -750,7 +788,34 @@ namespace ngla
750
788
  {
751
789
  ;
752
790
  }
791
+
792
+
793
+ template <class TM, class TV>
794
+ shared_ptr<BaseJacobiPrecond>
795
+ SparseMatrixSymmetric<TM,TV> :: CreateJacobiPrecond (shared_ptr<BitArray> inner) const
796
+ {
797
+ return make_shared<JacobiPrecondSymmetric<TM,TV>> (*this, inner);
798
+ }
799
+
753
800
 
801
+ template <class TM, class TV>
802
+ shared_ptr<BaseBlockJacobiPrecond>
803
+ SparseMatrixSymmetric<TM,TV> :: CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
804
+ const BaseVector * constraint,
805
+ bool parallel,
806
+ shared_ptr<BitArray> freedofs) const
807
+ {
808
+ // return make_shared<BlockJacobiPrecondSymmetric<TM,TV>> (*this, blocks);
809
+ return make_shared<BlockJacobiPrecondSymmetric<TM,TV>>
810
+ ( dynamic_pointer_cast<const SparseMatrixSymmetric>
811
+ (this->shared_from_this()),
812
+ blocks);
813
+ }
814
+
815
+
816
+
817
+
818
+
754
819
  template <class TM, class TV>
755
820
  void SparseMatrixSymmetric<TM,TV> ::
756
821
  MultAdd (double s, const BaseVector & x, BaseVector & y) const