ngsolve 6.2.2502__cp311-cp311-win_amd64.whl → 6.2.2601__cp311-cp311-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.
Files changed (107) hide show
  1. netgen/include/analytic_integrals.hpp +10 -0
  2. netgen/include/basematrix.hpp +6 -0
  3. netgen/include/bdbequations.hpp +55 -0
  4. netgen/include/bem_diffops.hpp +475 -0
  5. netgen/include/bilinearform.hpp +4 -1
  6. netgen/include/blockjacobi.hpp +17 -5
  7. netgen/include/bspline.hpp +2 -0
  8. netgen/include/cholesky.hpp +2 -2
  9. netgen/include/code_generation.hpp +2 -2
  10. netgen/include/complex_wrapper.hpp +30 -2
  11. netgen/include/contact.hpp +8 -0
  12. netgen/include/diagonalmatrix.hpp +6 -0
  13. netgen/include/diffop_impl.hpp +3 -1
  14. netgen/include/diffopwithfactor.hpp +123 -0
  15. netgen/include/elementbyelement.hpp +9 -3
  16. netgen/include/expr.hpp +45 -7
  17. netgen/include/fespace.hpp +12 -4
  18. netgen/include/gridfunction.hpp +3 -3
  19. netgen/include/h1amg.hpp +85 -2
  20. netgen/include/h1lumping.hpp +6 -0
  21. netgen/include/hcurl_equations.hpp +29 -0
  22. netgen/include/hcurlcurlfe.hpp +20 -0
  23. netgen/include/hdiv_equations.hpp +15 -0
  24. netgen/include/hdivfe_utils.hpp +1 -0
  25. netgen/include/hdivhofespace.hpp +2 -0
  26. netgen/include/integrator.hpp +4 -16
  27. netgen/include/intrule.hpp +2 -1
  28. netgen/include/intrules_SauterSchwab.hpp +25 -0
  29. netgen/include/jacobi.hpp +35 -18
  30. netgen/include/kernels.hpp +724 -0
  31. netgen/include/l2hofe.hpp +1 -0
  32. netgen/include/matrix.hpp +8 -3
  33. netgen/include/meshaccess.hpp +4 -3
  34. netgen/include/mp_coefficient.hpp +145 -0
  35. netgen/include/mptools.hpp +1331 -368
  36. netgen/include/mycomplex.hpp +1 -1
  37. netgen/include/ngblas.hpp +116 -7
  38. netgen/include/potentialtools.hpp +22 -0
  39. netgen/include/preconditioner.hpp +23 -23
  40. netgen/include/prolongation.hpp +132 -6
  41. netgen/include/recursive_pol.hpp +63 -11
  42. netgen/include/simd_complex.hpp +45 -0
  43. netgen/include/sparsecholesky.hpp +6 -2
  44. netgen/include/sparsefactorization_interface.hpp +159 -0
  45. netgen/include/sparsematrix.hpp +21 -7
  46. netgen/include/sparsematrix_dyn.hpp +6 -7
  47. netgen/include/sparsematrix_impl.hpp +175 -40
  48. netgen/include/special_matrix.hpp +2 -0
  49. netgen/include/statushandler.hpp +8 -8
  50. netgen/include/symbolicintegrator.hpp +2 -1
  51. netgen/include/tangentialfacetfespace.hpp +7 -22
  52. netgen/include/thdivfe_impl.hpp +66 -0
  53. netgen/include/tscalarfe.hpp +1 -1
  54. netgen/include/vector.hpp +272 -47
  55. netgen/lib/libngsolve.lib +0 -0
  56. netgen/libngsolve.dll +0 -0
  57. netgen/ngscxx.bat +1 -1
  58. netgen/ngsld.bat +1 -1
  59. ngsolve/__init__.py +1 -0
  60. ngsolve/cmake/NGSolveConfig.cmake +8 -8
  61. ngsolve/cmake/ngsolve-targets.cmake +24 -18
  62. ngsolve/config/config.py +7 -7
  63. ngsolve/demos/intro/cmagnet.py +19 -22
  64. ngsolve/directsolvers.py +9 -21
  65. ngsolve/krylovspace.py +172 -3
  66. ngsolve/ngslib.lib +0 -0
  67. ngsolve/ngslib.pyd +0 -0
  68. ngsolve/nonlinearsolvers.py +2 -2
  69. ngsolve/preconditioners.py +1 -0
  70. ngsolve/solve_implementation.py +168 -0
  71. ngsolve/{solvers.py → solvers/__init__.py} +1 -1
  72. ngsolve/solvers/cudss.py +112 -0
  73. ngsolve/webgui.py +2 -0
  74. {ngsolve-6.2.2502.dist-info → ngsolve-6.2.2601.dist-info}/METADATA +2 -2
  75. {ngsolve-6.2.2502.dist-info → ngsolve-6.2.2601.dist-info}/RECORD +107 -97
  76. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/Scripts/ngsolve.tcl +0 -0
  77. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/beam.geo +0 -0
  78. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/beam.vol +0 -0
  79. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/chip.in2d +0 -0
  80. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/chip.vol +0 -0
  81. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/coil.geo +0 -0
  82. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/coil.vol +0 -0
  83. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/coilshield.geo +0 -0
  84. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/coilshield.vol +0 -0
  85. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/cube.geo +0 -0
  86. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/cube.vol +0 -0
  87. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  88. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  89. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d1_square.pde +0 -0
  90. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d2_chip.pde +0 -0
  91. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  92. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d4_cube.pde +0 -0
  93. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d5_beam.pde +0 -0
  94. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  95. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d7_coil.pde +0 -0
  96. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  97. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  98. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  99. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  100. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  101. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/shaft.geo +0 -0
  102. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/shaft.vol +0 -0
  103. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/square.in2d +0 -0
  104. {ngsolve-6.2.2502.data → ngsolve-6.2.2601.data}/data/share/ngsolve/square.vol +0 -0
  105. {ngsolve-6.2.2502.dist-info → ngsolve-6.2.2601.dist-info}/LICENSE +0 -0
  106. {ngsolve-6.2.2502.dist-info → ngsolve-6.2.2601.dist-info}/WHEEL +0 -0
  107. {ngsolve-6.2.2502.dist-info → ngsolve-6.2.2601.dist-info}/top_level.txt +0 -0
@@ -88,6 +88,9 @@ namespace ngfem
88
88
  BareSliceVector<> coefs) const = 0;
89
89
 
90
90
 
91
+ virtual void CalcMappedShape (const SIMD<BaseMappedIntegrationPoint> & bmip,
92
+ BareSliceMatrix<SIMD<double>> shapes) const = 0;
93
+
91
94
  virtual void CalcMappedShape (const SIMD_BaseMappedIntegrationRule & bmir,
92
95
  BareSliceMatrix<SIMD<double>> shapes) const = 0;
93
96
 
@@ -931,6 +934,23 @@ namespace ngfem
931
934
  else
932
935
  throw Exception("HCurlCurl::CalcMappedCurlShape implemented only for TRIG and TET");
933
936
  }
937
+
938
+
939
+ virtual void CalcMappedShape (const SIMD<BaseMappedIntegrationPoint> & bmip,
940
+ BareSliceMatrix<SIMD<double>> shape) const override
941
+ {
942
+ Switch<4-DIM>
943
+ (bmip.DimSpace()-DIM,[this, &bmip, shape](auto CODIM)
944
+ {
945
+ constexpr auto DIMSPACE = DIM+CODIM.value;
946
+ auto & mip = static_cast<const SIMD<MappedIntegrationPoint<DIM,DIM+CODIM.value>>&> (bmip);
947
+ this->Cast() -> T_CalcShape (GetTIP(mip),
948
+ SBLambda ([shape,DIMSPACE] (size_t j, auto val)
949
+ {
950
+ shape.Rows(j*sqr(DIMSPACE), (j+1)*sqr(DIMSPACE)).Col(0).Range(0,sqr(DIMSPACE)) = val.Value().AsVector();
951
+ }));
952
+ });
953
+ }
934
954
 
935
955
  virtual void CalcMappedShape (const SIMD_BaseMappedIntegrationRule & bmir,
936
956
  BareSliceMatrix<SIMD<double>> shapes) const override
@@ -179,6 +179,14 @@ public:
179
179
  {
180
180
  return static_cast<const FEL&> (fel);
181
181
  }
182
+ static int DimRef() { return D-1; }
183
+
184
+ template <typename IP, typename MAT>
185
+ static void GenerateMatrixRef (const FiniteElement & fel, const IP & ip,
186
+ MAT && mat, LocalHeap & lh)
187
+ {
188
+ Cast(fel).CalcShape (ip, Trans(mat));
189
+ }
182
190
 
183
191
  template <typename AFEL, typename MIP, typename MAT>
184
192
  static void GenerateMatrix (const AFEL & fel, const MIP & mip,
@@ -188,6 +196,13 @@ public:
188
196
  Trans (Cast(fel).GetShape(mip.IP(),lh));
189
197
  }
190
198
 
199
+ template <typename MIP, typename MAT>
200
+ static void CalcTransformationMatrix (const MIP & bmip,
201
+ MAT & mat, LocalHeap & lh)
202
+ {
203
+ auto & mip = static_cast<const MappedIntegrationPoint<D-1,D>&>(bmip);
204
+ mat = 1./mip.GetJacobiDet() * mip.GetJacobian();
205
+ }
191
206
  /*
192
207
  template <typename AFEL, typename MIP, class TVX, class TVY>
193
208
  static void ApplyTrans (const AFEL & fel, const MIP & mip,
@@ -563,6 +563,7 @@ namespace ngfem
563
563
  {
564
564
  public:
565
565
  INLINE operator SCAL () const { return SCAL(0.0); }
566
+ INLINE SCAL Get() const { return SCAL(0.0); }
566
567
  };
567
568
 
568
569
  template <typename SCAL> class THDiv2DivShape<2,SCAL>
@@ -143,6 +143,8 @@ namespace ngcomp
143
143
  }
144
144
  }
145
145
 
146
+ void SelectDofs (const string & name, BitArray & dofs) const override;
147
+
146
148
  int GetFirstInnerDof(int elnr) const { return(first_inner_dof[elnr]);};
147
149
  // virtual int LowOrderDof() const { if(discont) return(0); else return(1);}
148
150
 
@@ -781,20 +781,14 @@ namespace ngfem
781
781
  const FiniteElement & volumefel2, int LocalFacetNr2,
782
782
  const ElementTransformation & eltrans2, FlatArray<int> & ElVertices2,
783
783
  FlatVector<double> elx, FlatVector<double> ely,
784
- LocalHeap & lh) const
785
- {
786
- throw Exception ("FacetBilinearFormIntegrator::ApplyFacetMatrix for inner facets not implemented!");
787
- }
784
+ LocalHeap & lh) const;
788
785
  virtual void
789
786
  ApplyFacetMatrix (const FiniteElement & volumefel1, int LocalFacetNr1,
790
787
  const ElementTransformation & eltrans1, FlatArray<int> & ElVertices1,
791
788
  const FiniteElement & volumefel2, int LocalFacetNr2,
792
789
  const ElementTransformation & eltrans2, FlatArray<int> & ElVertices2,
793
790
  FlatVector<Complex> elx, FlatVector<Complex> ely,
794
- LocalHeap & lh) const
795
- {
796
- throw Exception ("FacetBilinearFormIntegrator::ApplyFacetMatrix for inner facets not implemented!");
797
- }
791
+ LocalHeap & lh) const;
798
792
 
799
793
 
800
794
  virtual void
@@ -841,19 +835,13 @@ namespace ngfem
841
835
  const ElementTransformation & eltrans, FlatArray<int> & ElVertices,
842
836
  const ElementTransformation & seltrans, FlatArray<int> & SElVertices,
843
837
  FlatVector<double> elx, FlatVector<double> ely,
844
- LocalHeap & lh) const
845
- {
846
- throw Exception ("FacetBilinearFormIntegrator::ApplyFacetMatrix for boundary facets not implemented!");
847
- }
838
+ LocalHeap & lh) const;
848
839
  virtual void
849
840
  ApplyFacetMatrix (const FiniteElement & volumefel, int LocalFacetNr,
850
841
  const ElementTransformation & eltrans, FlatArray<int> & ElVertices,
851
842
  const ElementTransformation & seltrans, FlatArray<int> & SElVertices,
852
843
  FlatVector<Complex> elx, FlatVector<Complex> ely,
853
- LocalHeap & lh) const
854
- {
855
- throw Exception ("FacetBilinearFormIntegrator::ApplyFacetMatrix for boundary facets not implemented!");
856
- }
844
+ LocalHeap & lh) const;
857
845
 
858
846
 
859
847
  // calculate traces in integration points
@@ -1525,7 +1525,8 @@ namespace ngfem
1525
1525
  else
1526
1526
  incr = 0;
1527
1527
  }
1528
-
1528
+
1529
+ virtual ~MappedIntegrationRule() { }
1529
1530
  INLINE MappedIntegrationPoint<DIM_ELEMENT, DIM_SPACE> & operator[] (size_t i) const
1530
1531
  {
1531
1532
  // return mips[i];
@@ -0,0 +1,25 @@
1
+ #ifndef INTRULES_HPP
2
+ #define INTRULES_HPP
3
+
4
+ #include <bla.hpp>
5
+
6
+ namespace ngsbem
7
+ {
8
+ using namespace ngbla;
9
+
10
+ // x, y in triangle [(0,0), (1,0), (0,1)]
11
+ tuple<Array<Vec<2>>, Array<Vec<2>>, Array<double>> IdenticPanelIntegrationRule (int order);
12
+
13
+
14
+ // x, y in triangle [(0,0), (1,0), (0,1)]
15
+ // x=(0,0) and y=(0,0) are common vertices
16
+ tuple<Array<Vec<2>>, Array<Vec<2>>, Array<double>> CommonVertexIntegrationRule (int order);
17
+
18
+
19
+ // x, y in triangle [(0,0), (1,0), (0,1)]
20
+ // x in [(0,0),(1,0)] and y in [(0,0),(1,0)] are common edges
21
+ tuple<Array<Vec<2>>, Array<Vec<2>>, Array<double>> CommonEdgeIntegrationRule (int order);
22
+
23
+ }
24
+
25
+ #endif
netgen/include/jacobi.hpp CHANGED
@@ -17,13 +17,30 @@ namespace ngla
17
17
  Jacobi and Gauss Seidel smoother
18
18
  for scalar, block and system matrices
19
19
  */
20
+
21
+ class BaseMSMPrecond : virtual public BaseMatrix
22
+ {
23
+ public:
24
+ virtual void Smooth (BaseVector & x, const BaseVector & b, int steps = 1) const = 0;
25
+ virtual void SmoothBack (BaseVector & x, const BaseVector & b, int steps = 1) const = 0;
26
+ };
20
27
 
21
- class BaseJacobiPrecond : virtual public BaseMatrix
28
+
29
+ class BaseJacobiPrecond : public BaseMSMPrecond
22
30
  {
23
31
  public:
24
- virtual void GSSmooth (BaseVector & x, const BaseVector & b) const = 0;
32
+ virtual void Smooth (BaseVector & x, const BaseVector & b, int steps = 1) const override
33
+ {
34
+ GSSmooth (x, b, steps);
35
+ }
36
+ virtual void SmoothBack (BaseVector & x, const BaseVector & b, int steps = 1) const override
37
+ {
38
+ GSSmoothBack (x, b, steps);
39
+ }
40
+
41
+ virtual void GSSmooth (BaseVector & x, const BaseVector & b, int steps = 1) const = 0;
25
42
  virtual void GSSmooth (BaseVector & x, const BaseVector & b, BaseVector & y) const = 0;
26
- virtual void GSSmoothBack (BaseVector & x, const BaseVector & b) const = 0;
43
+ virtual void GSSmoothBack (BaseVector & x, const BaseVector & b, int steps = 1) const = 0;
27
44
  };
28
45
 
29
46
 
@@ -31,7 +48,7 @@ namespace ngla
31
48
  {
32
49
  shared_ptr<BaseJacobiPrecond> jac;
33
50
  public:
34
- SymmetricGaussSeidelPrecond (const BaseSparseMatrix & mat, shared_ptr<BitArray> freedofs);
51
+ SymmetricGaussSeidelPrecond (shared_ptr<BaseSparseMatrix> mat, shared_ptr<BitArray> freedofs);
35
52
  int VHeight() const override { return jac->VHeight(); }
36
53
  int VWidth() const override { return jac->VHeight(); }
37
54
 
@@ -44,11 +61,11 @@ namespace ngla
44
61
 
45
62
  /// A Jaboci preconditioner for general sparse matrices
46
63
  template <class TM, class TV_ROW, class TV_COL>
47
- class JacobiPrecond : virtual public BaseJacobiPrecond,
48
- virtual public S_BaseMatrix<typename mat_traits<TM>::TSCAL>
64
+ class JacobiPrecond : public BaseJacobiPrecond,
65
+ public S_BaseMatrix<typename mat_traits<TM>::TSCAL>
49
66
  {
50
67
  protected:
51
- const SparseMatrix<TM,TV_ROW,TV_COL> & mat;
68
+ shared_ptr<SparseMatrix<TM,TV_ROW,TV_COL>> mat;
52
69
  ///
53
70
  shared_ptr<BitArray> inner;
54
71
  ///
@@ -60,7 +77,7 @@ namespace ngla
60
77
  typedef typename mat_traits<TM>::TSCAL TSCAL;
61
78
 
62
79
  ///
63
- JacobiPrecond (const SparseMatrix<TM,TV_ROW,TV_COL> & amat,
80
+ JacobiPrecond (shared_ptr<SparseMatrix<TM,TV_ROW,TV_COL>> amat,
64
81
  shared_ptr<BitArray> ainner = nullptr, bool use_par = true);
65
82
 
66
83
  int VHeight() const override { return height; }
@@ -74,20 +91,20 @@ namespace ngla
74
91
  void MultTransAdd (TSCAL s, const BaseVector & x, BaseVector & y) const override
75
92
  { MultAdd (s, x, y); }
76
93
  ///
77
- AutoVector CreateRowVector() const override { return mat.CreateColVector(); }
78
- AutoVector CreateColVector() const override { return mat.CreateRowVector(); }
94
+ AutoVector CreateRowVector() const override { return mat->CreateColVector(); }
95
+ AutoVector CreateColVector() const override { return mat->CreateRowVector(); }
79
96
  ///
80
- void GSSmooth (BaseVector & x, const BaseVector & b) const override;
97
+ void GSSmooth (BaseVector & x, const BaseVector & b, int steps) const override;
81
98
 
82
99
  /// computes partial residual y
83
100
  void GSSmooth (BaseVector & x, const BaseVector & b, BaseVector & y) const override
84
101
  {
85
- GSSmooth (x, b);
102
+ GSSmooth (x, b, 1);
86
103
  }
87
104
 
88
105
 
89
106
  ///
90
- void GSSmoothBack (BaseVector & x, const BaseVector & b) const override;
107
+ void GSSmoothBack (BaseVector & x, const BaseVector & b, int steps) const override;
91
108
 
92
109
  ///
93
110
  virtual void GSSmoothNumbering (BaseVector & x, const BaseVector & b,
@@ -111,23 +128,23 @@ namespace ngla
111
128
  typedef TV TVX;
112
129
 
113
130
  ///
114
- JacobiPrecondSymmetric (const SparseMatrixSymmetric<TM,TV> & amat,
131
+ JacobiPrecondSymmetric (shared_ptr<SparseMatrixSymmetric<TM,TV>> amat,
115
132
  shared_ptr<BitArray> ainner = nullptr, bool use_par = true);
116
133
 
117
134
  ///
118
- virtual void GSSmooth (BaseVector & x, const BaseVector & b) const;
135
+ virtual void GSSmooth (BaseVector & x, const BaseVector & b, int steps) const override;
119
136
 
120
137
  /// computes partial residual y
121
- virtual void GSSmooth (BaseVector & x, const BaseVector & b, BaseVector & y /* , BaseVector & help */) const;
138
+ virtual void GSSmooth (BaseVector & x, const BaseVector & b, BaseVector & y /* , BaseVector & help */) const override;
122
139
 
123
140
  ///
124
- virtual void GSSmoothBack (BaseVector & x, const BaseVector & b) const;
141
+ virtual void GSSmoothBack (BaseVector & x, const BaseVector & b, int steps) const override;
125
142
  virtual void GSSmoothBack (BaseVector & x, const BaseVector & b, BaseVector & y) const;
126
143
 
127
144
  ///
128
145
  virtual void GSSmoothNumbering (BaseVector & x, const BaseVector & b,
129
146
  const Array<int> & numbering,
130
- int forward = 1) const;
147
+ int forward = 1) const override;
131
148
  };
132
149
 
133
150
  }