ngsolve 6.2.2406.post36.dev1__cp313-cp313-win_amd64.whl → 6.2.2406.post57.dev1__cp313-cp313-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 (78) 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 +3 -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/eigen.hpp +3 -0
  11. netgen/include/elementbyelement.hpp +4 -0
  12. netgen/include/elementtopology.hpp +0 -3
  13. netgen/include/fespace.hpp +7 -9
  14. netgen/include/h1amg.hpp +3 -1
  15. netgen/include/hcurlhdivfes.hpp +2 -0
  16. netgen/include/hcurlhofespace.hpp +2 -1
  17. netgen/include/intrule.hpp +15 -1
  18. netgen/include/jacobi.hpp +3 -0
  19. netgen/include/la.hpp +1 -13
  20. netgen/include/meshaccess.hpp +0 -3
  21. netgen/include/mgpre.hpp +1 -1
  22. netgen/include/multivector.hpp +2 -0
  23. netgen/include/ngsobject.hpp +1 -1
  24. netgen/include/order.hpp +3 -1
  25. netgen/include/parallel_matrices.hpp +5 -0
  26. netgen/include/paralleldofs.hpp +13 -51
  27. netgen/include/parallelngs.hpp +2 -1
  28. netgen/include/parallelvector.hpp +5 -2
  29. netgen/include/pardisoinverse.hpp +1 -0
  30. netgen/include/preconditioner.hpp +3 -1
  31. netgen/include/sparsecholesky.hpp +4 -0
  32. netgen/include/sparsematrix.hpp +8 -41
  33. netgen/include/sparsematrix_dyn.hpp +2 -0
  34. netgen/include/sparsematrix_impl.hpp +66 -1
  35. netgen/include/special_matrix.hpp +3 -138
  36. netgen/include/tpintrule.hpp +2 -0
  37. netgen/include/umfpackinverse.hpp +1 -1
  38. netgen/include/vvector.hpp +10 -1
  39. netgen/lib/libngsolve.lib +0 -0
  40. netgen/libngsolve.dll +0 -0
  41. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  42. ngsolve/config/config.py +5 -5
  43. ngsolve/config.py +5 -5
  44. ngsolve/ngslib.pyd +0 -0
  45. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/METADATA +2 -2
  46. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/RECORD +78 -77
  47. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
  48. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  49. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  50. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  51. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  52. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  53. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  54. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  55. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  56. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  57. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  58. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  59. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  60. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  61. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  62. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  63. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  64. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  65. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  66. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  67. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  68. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  69. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  70. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  71. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  72. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  73. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  74. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  75. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.vol +0 -0
  76. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/LICENSE +0 -0
  77. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/WHEEL +0 -0
  78. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/top_level.txt +0 -0
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"
@@ -9,8 +9,6 @@
9
9
 
10
10
 
11
11
  #include <nginterface_v2.hpp>
12
- #include <core/ranges.hpp>
13
-
14
12
  #include <elementtopology.hpp>
15
13
 
16
14
  namespace ngfem
@@ -26,7 +24,6 @@ namespace ngcomp
26
24
  {
27
25
  class PML_Transformation;
28
26
 
29
- // using ngcore::INT;
30
27
  using netgen::Ng_Node;
31
28
  using ngfem::ELEMENT_TYPE;
32
29
 
netgen/include/mgpre.hpp CHANGED
@@ -9,7 +9,7 @@
9
9
  /*********************************************************************/
10
10
 
11
11
  #include <bilinearform.hpp>
12
- #include <la.hpp>
12
+ // #include <la.hpp>
13
13
 
14
14
  namespace ngmg
15
15
  {
@@ -7,6 +7,8 @@
7
7
  /* Date: June 2020 */
8
8
  /*********************************************************************/
9
9
 
10
+ #include "basevector.hpp"
11
+
10
12
  namespace ngla {
11
13
 
12
14
  /* TODO:
@@ -2,7 +2,7 @@
2
2
  #define FILE_NGSOBJECT
3
3
 
4
4
  /*********************************************************************/
5
- /* File: ngsobject.hh */
5
+ /* File: ngsobject.hpp */
6
6
  /* Author: Joachim Schoeberl */
7
7
  /* Date: 2. Aug. 2000 */
8
8
  /*********************************************************************/
netgen/include/order.hpp CHANGED
@@ -2,7 +2,7 @@
2
2
  #define FILE_ORDER
3
3
 
4
4
  /* *************************************************************************/
5
- /* File: order.hh */
5
+ /* File: order.hpp */
6
6
  /* Author: Joachim Schoeberl */
7
7
  /* Date: 18. Jun. 97 */
8
8
  /* *************************************************************************/
@@ -10,6 +10,8 @@
10
10
 
11
11
  namespace ngla
12
12
  {
13
+ using namespace ngcore;
14
+ using namespace ngstd;
13
15
 
14
16
  /*
15
17
  reordering for sparse cholesky factoriztion
@@ -7,6 +7,11 @@
7
7
  /* Date: 2007,2011 */
8
8
  /* ************************************************************************/
9
9
 
10
+
11
+ #include <basematrix.hpp>
12
+ #include <sparsematrix.hpp>
13
+ #include <paralleldofs.hpp>
14
+
10
15
  namespace ngla
11
16
  {
12
17
 
@@ -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
  /**
@@ -133,7 +137,7 @@ namespace ngla
133
137
  public:
134
138
  ParallelDofs (NgMPI_Comm acomm, Table<int> && adist_procs,
135
139
  int dim = 1, bool iscomplex = false)
136
- : es(dim), complex(iscomplex)
140
+ : es(dim), complex(iscomplex), ndof(adist_procs.Size())
137
141
  { ; }
138
142
 
139
143
  int GetNDofLocal () const { return ndof; }
@@ -223,18 +227,6 @@ namespace ngla
223
227
  nrecv = 0;
224
228
 
225
229
  /** Count send/recv size **/
226
- /*
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
- */
238
230
  for (int i = 0; i < GetNDofLocal(); i++)
239
231
  if (auto dps = GetDistantProcs(i); dps.Size())
240
232
  {
@@ -244,55 +236,39 @@ namespace ngla
244
236
  else
245
237
  nsend[dps[0]]++;
246
238
  }
247
-
248
239
 
249
240
  Table<T> send_data(nsend);
250
241
  Table<T> recv_data(nrecv);
251
242
 
252
243
  /** Fill send_data **/
253
244
  nsend = 0;
254
- /*
255
- for (int i = 0; i < GetNDofLocal(); i++) {
256
- auto dps = GetDistantProcs(i);
257
- if(!dps.Size()) continue;
258
- int master = min2(rank, dps[0]);
259
- if(master!=rank)
260
- send_data[master][nsend[master]++] = data[i];
261
- }
262
- */
263
245
  for (int i = 0; i < GetNDofLocal(); i++)
264
246
  if (auto dps = GetDistantProcs(i); dps.Size())
265
247
  if (rank > dps[0])
266
248
  send_data[dps[0]][nsend[dps[0]]++] = data[i];
267
249
 
268
- NgMPI_Requests requests;
250
+ NgMPI_Requests send_requests;
251
+ NgMPI_Requests recv_requests;
269
252
  for (int i = 0; i < ntasks; i++)
270
253
  {
271
254
  if (nsend[i])
272
- requests += comm.ISend(send_data[i], i, NG_MPI_TAG_SOLVE);
255
+ send_requests += comm.ISend(send_data[i], i, NG_MPI_TAG_SOLVE);
273
256
  if (nrecv[i])
274
- requests += comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE);
257
+ recv_requests += comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE);
275
258
  }
276
- requests.WaitAll();
277
259
 
278
260
  Array<int> cnt(ntasks);
279
261
  cnt = 0;
280
262
 
281
263
  NG_MPI_Datatype type = GetMPIType<T>();
282
- /*
283
- for (int i = 0; i < GetNDofLocal(); i++)
284
- if (IsMasterDof(i))
285
- {
286
- FlatArray<int> distprocs = GetDistantProcs (i);
287
- for (int j = 0; j < distprocs.Size(); j++)
288
- NG_MPI_Reduce_local (&recv_data[distprocs[j]][cnt[distprocs[j]]++],
289
- &data[i], 1, type, op);
290
- }
291
- */
264
+
265
+ recv_requests.WaitAll();
292
266
  for (int i = 0; i < GetNDofLocal(); i++)
293
267
  if (IsMasterDof(i))
294
268
  for (auto p : GetDistantProcs (i))
295
269
  NG_MPI_Reduce_local (&recv_data[p][cnt[p]++], &data[i], 1, type, op);
270
+
271
+ send_requests.WaitAll();
296
272
  }
297
273
 
298
274
 
@@ -359,20 +335,6 @@ namespace ngla
359
335
 
360
336
  #endif //PARALLEL
361
337
 
362
-
363
- class DofRange : public T_Range<size_t>
364
- {
365
- shared_ptr<ParallelDofs> pardofs;
366
- public:
367
- DofRange () { }
368
- DofRange (T_Range<size_t> range, shared_ptr<ParallelDofs> apardofs)
369
- : T_Range<size_t>(range), pardofs(apardofs) { ; }
370
- shared_ptr<ParallelDofs> GetParallelDofs() const { return pardofs; }
371
- };
372
-
373
-
374
338
  }
375
339
 
376
-
377
-
378
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,10 +7,13 @@
7
7
  /* Date: 2007,2011 */
8
8
  /* ************************************************************************/
9
9
 
10
-
10
+ #include <vvector.hpp>
11
+ #include <multivector.hpp>
12
+ #include <paralleldofs.hpp>
11
13
 
12
14
  namespace ngla
13
15
  {
16
+
14
17
  class NGS_DLL_HEADER ParallelBaseVector : virtual public BaseVector
15
18
  {
16
19
  protected:
@@ -169,7 +172,7 @@ namespace ngla
169
172
  using ParallelBaseVector :: sreqs;
170
173
  using ParallelBaseVector :: rreqs;
171
174
 
172
- Table<SCAL> * recvvalues;
175
+ Table<SCAL> recvvalues;
173
176
 
174
177
  using S_BaseVectorPtr<TSCAL> :: pdata;
175
178
  using ParallelBaseVector :: local_vec;
@@ -15,6 +15,7 @@
15
15
 
16
16
  ////////////////////////////////////////////////////////////////////////////////
17
17
 
18
+ #include "sparsecholesky.hpp" // for SparseFactorization
18
19
 
19
20
  namespace ngla
20
21
  {
@@ -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
  {
@@ -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
@@ -7,147 +7,12 @@
7
7
  /* Date: 14 Mar. 02 */
8
8
  /* ************************************************************************/
9
9
 
10
+ #include "basematrix.hpp"
11
+ #include "vvector.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
13
-
14
- class NGS_DLL_HEADER Projector : public BaseMatrix
15
- {
16
- shared_ptr<BitArray> bits;
17
- bool keep_values;
18
- public:
19
- // projector on true / false bits
20
- Projector (shared_ptr<BitArray> abits, bool akeep_values = true)
21
- : bits(abits), keep_values(akeep_values) { ; }
22
-
23
- virtual bool IsComplex() const override { return false; }
24
-
25
- virtual int VHeight() const override { return bits->Size(); }
26
- virtual int VWidth() const override { return bits->Size(); }
27
-
28
- virtual void Mult (const BaseVector & x, BaseVector & y) const override;
29
- virtual void MultTrans (const BaseVector & x, BaseVector & y) const override;
30
- virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
31
- virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
32
- virtual void Project (BaseVector & x) const;
33
- virtual void SetValues (BaseVector & x, double val) const;
34
-
35
- bool KeepValues() const { return keep_values; }
36
- shared_ptr<BitArray> Mask() const { return bits; }
37
-
38
- virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
39
-
40
- AutoVector CreateRowVector() const override
41
- { throw Exception("CreateRowVector not implemented for Projector!"); }
42
- AutoVector CreateColVector() const override
43
- { throw Exception("CreateColVector not implemented for Projector!"); }
44
-
45
- AutoVector Evaluate(BaseVector & v) const override
46
- {
47
- auto res = v.CreateVector();
48
- Mult (v, res);
49
- return res;
50
- }
51
-
52
- };
53
-
54
-
55
- template <typename TM=double>
56
- class NGS_DLL_HEADER DiagonalMatrix : public BaseMatrix
57
- {
58
- shared_ptr<VVector<TM>> diag;
59
- public:
60
- // typedef typename mat_traits<TM>::TV_ROW TV_ROW;
61
- // typedef typename mat_traits<TM>::TV_COL TV_COL;
62
- typedef typename mat_traits<TM>::TSCAL TSCAL;
63
-
64
- DiagonalMatrix(size_t h)
65
- : diag(make_shared<VVector<TM>>(h)) { }
66
- DiagonalMatrix(const VVector<TM> & diag_)
67
- : diag(make_shared<VVector<TM>>(diag_)) { }
68
- DiagonalMatrix(shared_ptr<VVector<TM>> diag_)
69
- : diag(diag_) { }
70
-
71
- bool IsComplex() const override { return false; }
72
- TM & operator() (size_t i) { return (*diag)(i); }
73
- const TM & operator() (size_t i) const { return (*diag)(i); }
74
- int VHeight() const override { return diag->Size(); }
75
- int VWidth() const override { return diag->Size(); }
76
-
77
- BaseVector & AsVector() override { return *diag; }
78
- const BaseVector & AsVector() const override { return *diag; }
79
- ostream & Print (ostream & ost) const override;
80
-
81
- virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
82
-
83
- AutoVector CreateRowVector () const override;
84
- AutoVector CreateColVector () const override;
85
-
86
- void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
87
- void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
88
-
89
- shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
90
- };
91
-
92
-
93
- template <typename TM=double>
94
- class BlockDiagonalMatrix : public BaseMatrix
95
- {
96
- Tensor<3,TM> blockdiag;
97
- int blocks, dimy, dimx;
98
- public:
99
- // typedef double TSCAL;
100
-
101
- BlockDiagonalMatrix(Tensor<3,TM> _blockdiag);
102
- bool IsComplex() const override { return ngbla::IsComplex<TM>(); }
103
-
104
- int VHeight() const override { return blocks*dimy; }
105
- int VWidth() const override { return blocks*dimx; }
106
-
107
- ostream & Print (ostream & ost) const override;
108
-
109
- AutoVector CreateRowVector () const override;
110
- AutoVector CreateColVector () const override;
111
-
112
- void Mult (const BaseVector & x, BaseVector & y) const override;
113
- void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
114
- void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
115
-
116
- shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
117
- };
118
-
119
- // blocks is inner-most dimension of tensor and vectors
120
- class BlockDiagonalMatrixSoA : public BaseMatrix
121
- {
122
- Tensor<3> blockdiag;
123
- int blocks, dimy, dimx;
124
- Matrix<double> nonzero;
125
- public:
126
- typedef double TSCAL;
127
-
128
- BlockDiagonalMatrixSoA(Tensor<3> _blockdiag);
129
- bool IsComplex() const override { return false; }
130
-
131
- int VHeight() const override { return blocks*dimy; }
132
- int VWidth() const override { return blocks*dimx; }
133
-
134
- ostream & Print (ostream & ost) const override;
135
- virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
136
-
137
- AutoVector CreateRowVector () const override;
138
- AutoVector CreateColVector () const override;
139
-
140
- void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
141
- void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
142
- // shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
143
-
144
- FlatTensor<3> GetBlockDiag () const { return blockdiag; }
145
- FlatMatrix<double> GetNonZeroPattern() const { return nonzero; }
146
- };
147
-
148
-
149
-
150
-
151
16
  // Convert RowMajor to ColMajor matrix (stored as vector)
152
17
  class TransposeVector : public BaseMatrix
153
18
  {
@@ -46,6 +46,8 @@ namespace ngfem
46
46
  { throw Exception("TPMappedIntegrationRule::Range not implemented"); }
47
47
  virtual SliceMatrix<> GetPoints() const
48
48
  { throw Exception("TPMappedIntegrationRule::GetPoints not implemented"); }
49
+ virtual SliceMatrix<> GetNormals() const
50
+ { throw Exception("TPMappedIntegrationRule::GetNormals not implemented"); }
49
51
  virtual void ComputeNormalsAndMeasure (ELEMENT_TYPE et, int facetnr)
50
52
  { throw Exception("TPMappedIntegrationRule::ComputeNormalsAndMeasure not implemented"); }
51
53
  virtual bool IsComplex() const
@@ -18,7 +18,7 @@
18
18
  ////////////////////////////////////////////////////////////////////////////////
19
19
 
20
20
  #include <umfpack.h>
21
-
21
+ #include "sparsecholesky.hpp" // for SparseFactorization
22
22
  namespace ngla
23
23
  {
24
24