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
@@ -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
 
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
  {
@@ -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;
@@ -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"
@@ -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
 
@@ -1357,21 +1354,21 @@ namespace ngcomp
1357
1354
  for (auto p : GetDistantProcs(Node(nt, i)))
1358
1355
  dist_data[p][cnt[p]++] = data[i];
1359
1356
 
1360
- Array<NG_MPI_Request> requests;
1357
+ NgMPI_Requests requests;
1361
1358
  for (auto i : cnt.Range())
1362
1359
  if (cnt[i])
1363
1360
  {
1364
- requests.Append (comm.ISend(dist_data[i], i, NG_MPI_TAG_SOLVE));
1365
- requests.Append (comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE));
1361
+ requests += comm.ISend(dist_data[i], i, NG_MPI_TAG_SOLVE);
1362
+ requests += comm.IRecv(recv_data[i], i, NG_MPI_TAG_SOLVE);
1366
1363
  }
1367
- MyMPI_WaitAll (requests);
1364
+ requests.WaitAll();
1368
1365
 
1369
1366
  cnt = 0;
1370
- NG_MPI_Datatype type = GetMPIType<T>();
1367
+ auto type = GetMPIType<T>();
1371
1368
  for (auto i : Range(GetNNodes(nt)))
1372
1369
  for (auto p : GetDistantProcs(Node(nt, i)))
1373
1370
  NG_MPI_Reduce_local (&recv_data[p][cnt[p]++],
1374
- &data[i], 1, type, op);
1371
+ &data[i], 1, type, op);
1375
1372
  }
1376
1373
 
1377
1374
 
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
  {
@@ -813,7 +813,6 @@ c
813
813
  scale = newscale;
814
814
  }
815
815
 
816
-
817
816
  template <typename TARGET>
818
817
  void Transform (MultiPole<TARGET> & target, Vec<3> dist) const
819
818
  {
@@ -2095,12 +2094,12 @@ c
2095
2094
  template <typename TARGET>
2096
2095
  void ShiftZ (double z, MultiPole<TARGET> & target) { mp.ShiftZ(z, target); }
2097
2096
 
2097
+ using CoefficientFunction::Transform;
2098
2098
  template <typename TARGET>
2099
2099
  void Transform (MultiPoleCF<TARGET> & target)
2100
2100
  {
2101
2101
  mp.Transform (target.MP(), target.Center()-center);
2102
2102
  }
2103
-
2104
2103
  };
2105
2104
 
2106
2105
 
@@ -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
  /*********************************************************************/
@@ -29,8 +29,11 @@ namespace ngfem
29
29
  using ET_trait<ET>::PolDimension;
30
30
  using ET_trait<ET>::PolBubbleDimension;
31
31
 
32
+
32
33
  public:
33
34
  using VertexOrientedFE<ET>::SetVertexNumbers;
35
+ NodalHOFE * SetVertexNumbers (FlatArray<int> vnums) override
36
+ { VertexOrientedFE<ELEMENT_TYPE(ET)>::SetVertexNumbers(vnums); return this; } // cast for msvc ?
34
37
  using ET_trait<ET>::ElementType;
35
38
 
36
39
  /// builds a functional element of order aorder.
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
  /**
@@ -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
+ : es(dim), complex(iscomplex), ndof(adist_procs.Size())
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