ngsolve 6.2.2405.post32.dev1__cp312-cp312-macosx_10_15_universal2.whl → 6.2.2405.post45.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 (84) hide show
  1. netgen/include/basematrix.hpp +8 -3
  2. netgen/include/sparsematrix.hpp +5 -2
  3. netgen/include/statushandler.hpp +7 -0
  4. netgen/include/umfpackinverse.hpp +57 -29
  5. netgen/libngcomp.dylib +0 -0
  6. netgen/libngla.dylib +0 -0
  7. netgen/libngstd.dylib +0 -0
  8. ngsolve/__init__.pyi +3 -3
  9. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  10. ngsolve/comp/__init__.pyi +5 -1
  11. ngsolve/config/__init__.pyi +6 -6
  12. ngsolve/config/config.py +5 -5
  13. ngsolve/config/config.pyi +6 -6
  14. ngsolve/config.py +5 -5
  15. ngsolve/demos/TensorProduct/__init__.py +0 -0
  16. ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
  17. ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
  18. ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
  19. ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
  20. ngsolve/demos/__init__.py +0 -0
  21. ngsolve/demos/howto/__init__.py +0 -0
  22. ngsolve/demos/howto/hhj.py +44 -0
  23. ngsolve/demos/howto/hybrid_dg.py +53 -0
  24. ngsolve/demos/howto/mixed.py +30 -0
  25. ngsolve/demos/howto/nonlin.py +29 -0
  26. ngsolve/demos/howto/pickling.py +26 -0
  27. ngsolve/demos/howto/pml.py +31 -0
  28. ngsolve/demos/howto/taskmanager.py +20 -0
  29. ngsolve/demos/howto/tdnns.py +47 -0
  30. ngsolve/demos/howto/timeDG-skeleton.py +45 -0
  31. ngsolve/demos/howto/timeDG.py +38 -0
  32. ngsolve/demos/howto/timeDGlap.py +42 -0
  33. ngsolve/demos/howto/timeDGwave.py +61 -0
  34. ngsolve/demos/intro/__init__.py +0 -0
  35. ngsolve/demos/intro/adaptive.py +123 -0
  36. ngsolve/demos/intro/cmagnet.py +62 -0
  37. ngsolve/demos/intro/elasticity.py +76 -0
  38. ngsolve/demos/intro/navierstokes.py +74 -0
  39. ngsolve/demos/intro/poisson.ipynb +170 -0
  40. ngsolve/demos/intro/poisson.py +41 -0
  41. ngsolve/demos/mpi/__init__.py +0 -0
  42. ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
  43. ngsolve/demos/mpi/mpi_navierstokes.py +115 -0
  44. ngsolve/demos/mpi/mpi_poisson.py +89 -0
  45. ngsolve/demos/mpi/mpi_timeDG.py +79 -0
  46. ngsolve/utils.pyi +1 -1
  47. {ngsolve-6.2.2405.post32.dev1.dist-info → ngsolve-6.2.2405.post45.dev1.dist-info}/METADATA +2 -2
  48. {ngsolve-6.2.2405.post32.dev1.dist-info → ngsolve-6.2.2405.post45.dev1.dist-info}/RECORD +84 -53
  49. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/Netgen.icns +0 -0
  50. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/bin/ngscxx +0 -0
  51. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/bin/ngsld +0 -0
  52. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/bin/ngsolve.tcl +0 -0
  53. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/bin/ngspy +0 -0
  54. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  55. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  56. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  57. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  58. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  59. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  60. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  61. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  62. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  63. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  64. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  65. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  66. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  67. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  68. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  69. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  70. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  71. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  72. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  73. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  74. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  75. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  76. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  77. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  78. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  79. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  80. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  81. {ngsolve-6.2.2405.post32.dev1.data → ngsolve-6.2.2405.post45.dev1.data}/data/share/ngsolve/square.vol +0 -0
  82. {ngsolve-6.2.2405.post32.dev1.dist-info → ngsolve-6.2.2405.post45.dev1.dist-info}/LICENSE +0 -0
  83. {ngsolve-6.2.2405.post32.dev1.dist-info → ngsolve-6.2.2405.post45.dev1.dist-info}/WHEEL +0 -0
  84. {ngsolve-6.2.2405.post32.dev1.dist-info → ngsolve-6.2.2405.post45.dev1.dist-info}/top_level.txt +0 -0
@@ -145,9 +145,14 @@ namespace ngla
145
145
  virtual INVERSETYPE SetInverseType ( string ainversetype ) const;
146
146
  virtual INVERSETYPE GetInverseType () const;
147
147
 
148
- mutable std::function<shared_ptr<BaseMatrix>(shared_ptr<BaseMatrix>,shared_ptr<BitArray>)> invcreator;
149
- void SetInverseCreator(std::function<shared_ptr<BaseMatrix>(shared_ptr<BaseMatrix>,shared_ptr<BitArray>)> ainvcreator) const
150
- { invcreator = ainvcreator; }
148
+ typedef std::function<shared_ptr<BaseMatrix>(shared_ptr<BaseMatrix>,
149
+ shared_ptr<BitArray>,
150
+ shared_ptr<const Array<int>>)> T_INVCREATOR;
151
+ mutable T_INVCREATOR invcreator;
152
+ void SetInverseCreator(T_INVCREATOR ainvcreator) const { invcreator = ainvcreator; }
153
+
154
+ static SymbolTable<T_INVCREATOR> invcreators;
155
+ static void RegisterInverseCreator(string name, T_INVCREATOR creator);
151
156
 
152
157
  virtual void SetInverseFlags (const Flags & flags) { ; }
153
158
  virtual shared_ptr<BaseMatrix> DeleteZeroElements(double tol) const
@@ -338,6 +338,8 @@ namespace ngla
338
338
  {
339
339
  return asvec;
340
340
  }
341
+
342
+ // tuple<int,int> EntryShape() const { return { entry_height, entry_width }; }
341
343
 
342
344
  FlatVector<TSCAL> GetRowValue (int row, int j)
343
345
  {
@@ -345,9 +347,10 @@ namespace ngla
345
347
  return FlatVector<TSCAL> (entry_size, p);
346
348
  }
347
349
 
348
- FlatMatrix<TSCAL> GetRowValueMat (int row, int j)
350
+ FlatMatrix<TSCAL> GetRowValueMat (int row, int j) const
349
351
  {
350
- TSCAL * p = asvec(entry_size * (firsti[row] + j)).Data(0);
352
+ // TSCAL * p = asvec(entry_size * (firsti[row] + j)).Data(0);
353
+ TSCAL * p = &asvec(entry_size * (firsti[row] + j));
351
354
  return FlatMatrix<TSCAL> (entry_height, entry_width, p);
352
355
  }
353
356
  };
@@ -19,6 +19,13 @@ namespace ngstd
19
19
  static void SetTerminate(void);
20
20
  static void UnSetTerminate(void);
21
21
  static bool ShouldTerminate(void);
22
+
23
+ class Region
24
+ {
25
+ public:
26
+ Region(const char * str) { PushStatus(str); }
27
+ ~Region() { PopStatus(); }
28
+ };
22
29
  };
23
30
 
24
31
  }
@@ -22,11 +22,12 @@
22
22
  namespace ngla
23
23
  {
24
24
 
25
- template<class TM>
26
- class UmfpackInverseTM : public SparseFactorization
25
+ template<class SCAL>
26
+ class S_UmfpackInverse : public SparseFactorization
27
27
  {
28
28
  public:
29
- typedef typename mat_traits<TM>::TSCAL TSCAL;
29
+ // typedef typename mat_traits<TM>::TSCAL TSCAL;
30
+ typedef SCAL TSCAL;
30
31
 
31
32
  protected:
32
33
  typedef SuiteSparse_long suite_long;
@@ -42,7 +43,8 @@ namespace ngla
42
43
  Array<suite_long> rowstart, indices;
43
44
  Array<TSCAL> values;
44
45
 
45
- bool symmetric, is_complex;
46
+ bool symmetric;
47
+ static constexpr bool is_complex = ngbla::IsComplex<TSCAL>();
46
48
 
47
49
  void SetMatrixType();
48
50
 
@@ -52,16 +54,17 @@ namespace ngla
52
54
  public:
53
55
 
54
56
  ///
55
- UmfpackInverseTM (shared_ptr<const SparseMatrixTM<TM>> a,
56
- shared_ptr<BitArray> ainner = nullptr,
57
+ S_UmfpackInverse (shared_ptr<const S_BaseSparseMatrix<TSCAL>> a,
58
+ shared_ptr<BitArray> ainner = nullptr,
57
59
  shared_ptr<const Array<int>> acluster = nullptr,
58
60
  int symmetric = 0);
61
+ virtual ~S_UmfpackInverse();
59
62
  ///
60
63
 
61
64
  template <typename TSUBSET>
62
- void GetUmfpackMatrix (const SparseMatrixTM<TM> & a, TSUBSET subset);
65
+ // void GetUmfpackMatrix (const SparseMatrixTM<TM> & a, TSUBSET subset);
66
+ void GetUmfpackMatrix (const S_BaseSparseMatrix<TSCAL> & a, TSUBSET subset);
63
67
 
64
- virtual ~UmfpackInverseTM ();
65
68
  ///
66
69
  int VHeight() const { return height/entrysize; }
67
70
  ///
@@ -74,44 +77,69 @@ namespace ngla
74
77
 
75
78
  virtual Array<MemoryUsage> GetMemoryUsage () const
76
79
  {
77
- return { MemoryUsage ("Umfpack", nze*sizeof(TM), 1) };
80
+ return { MemoryUsage ("Umfpack", nze*sizeof(TSCAL)*entrysize*entrysize, 1) };
78
81
  }
79
82
  };
80
83
 
81
84
 
85
+
86
+ template<class SCAL, class SCAL_VEC>
87
+ class S_UmfpackInverse_SVec : public S_UmfpackInverse<SCAL>
88
+ {
89
+ typedef S_UmfpackInverse<SCAL> BASE;
90
+ protected:
91
+ using typename BASE::TSCAL;
92
+ using BASE::height;
93
+ using BASE::is_complex;
94
+ using BASE::compressed_height;
95
+ using BASE::entrysize;
96
+ using BASE::rowstart;
97
+ using BASE::indices;
98
+ using BASE::compressed;
99
+ using BASE::compress;
100
+
101
+ using S_UmfpackInverse<SCAL>::S_UmfpackInverse;
102
+ static constexpr bool is_vector_complex = ngbla::IsComplex<SCAL_VEC>();
103
+
104
+ AutoVector CreateRowVector () const override { return CreateBaseVector(height/entrysize, is_vector_complex, entrysize); }
105
+ AutoVector CreateColVector () const override { return CreateBaseVector(height/entrysize, is_vector_complex, entrysize); }
106
+
107
+ void Mult (const BaseVector & x, BaseVector & y) const override;
108
+ void MultTrans (const BaseVector & x, BaseVector & y) const override;
109
+ };
110
+
111
+
82
112
  template<class TM,
83
113
  class TV_ROW = typename mat_traits<TM>::TV_ROW,
84
114
  class TV_COL = typename mat_traits<TM>::TV_COL>
85
- class UmfpackInverse : public UmfpackInverseTM<TM>
115
+ class UmfpackInverse : public S_UmfpackInverse_SVec<typename mat_traits<TM>::TSCAL, typename mat_traits<TV_COL>::TSCAL>
86
116
  {
87
- using UmfpackInverseTM<TM>::height;
88
- using UmfpackInverseTM<TM>::is_complex;
89
- using UmfpackInverseTM<TM>::compressed_height;
90
- using UmfpackInverseTM<TM>::entrysize;
91
- using UmfpackInverseTM<TM>::rowstart;
92
- using UmfpackInverseTM<TM>::indices;
93
- using UmfpackInverseTM<TM>::compressed;
94
- using UmfpackInverseTM<TM>::compress;
95
-
96
117
  public:
118
+ typedef S_UmfpackInverse_SVec<typename mat_traits<TM>::TSCAL, typename mat_traits<TV_COL>::TSCAL> BASE;
119
+
120
+ using typename BASE::TSCAL;
97
121
  typedef TV_COL TV;
98
122
  typedef TV_ROW TVX;
99
- typedef typename mat_traits<TM>::TSCAL TSCAL;
123
+
124
+ private:
125
+ using BASE::height;
126
+ using BASE::is_complex;
127
+ using BASE::is_vector_complex;
128
+ using BASE::compressed_height;
129
+ using BASE::entrysize;
130
+ using BASE::rowstart;
131
+ using BASE::indices;
132
+ using BASE::compressed;
133
+ using BASE::compress;
100
134
 
101
- ///
135
+ public:
102
136
  UmfpackInverse (shared_ptr<const SparseMatrix<TM,TV_ROW,TV_COL>> a,
103
137
  shared_ptr<BitArray> ainner = nullptr,
104
138
  shared_ptr<const Array<int>> acluster = nullptr,
105
139
  int symmetric = 0)
106
- : UmfpackInverseTM<TM> (a, ainner, acluster, symmetric) { ; }
140
+ : BASE (a, ainner, acluster, symmetric) { ; }
107
141
 
108
- virtual ~UmfpackInverse () { ; }
109
- ///
110
- void Mult (const BaseVector & x, BaseVector & y) const override;
111
- void MultTrans (const BaseVector & x, BaseVector & y) const override;
112
- ///
113
- AutoVector CreateRowVector () const override { return make_unique<VVector<TV>> (height/entrysize); }
114
- AutoVector CreateColVector () const override { return make_unique<VVector<TV>> (height/entrysize); }
142
+ // virtual ~UmfpackInverse () { ; }
115
143
  };
116
144
 
117
145
  }
netgen/libngcomp.dylib CHANGED
Binary file
netgen/libngla.dylib CHANGED
Binary file
netgen/libngstd.dylib CHANGED
Binary file
ngsolve/__init__.pyi CHANGED
@@ -44,8 +44,8 @@ from ngsolve.comp import HDiv
44
44
  from ngsolve.comp import HDivDiv
45
45
  from ngsolve.comp import HDivDivSurface
46
46
  from ngsolve.comp import HDivSurface
47
- from ngsolve.comp import Hidden
48
47
  from ngsolve.comp import Hidden as PrivateSpace
48
+ from ngsolve.comp import Hidden
49
49
  from ngsolve.comp import Integrate
50
50
  from ngsolve.comp import Interpolate
51
51
  from ngsolve.comp import L2
@@ -88,8 +88,8 @@ from ngsolve.fem import BSpline
88
88
  from ngsolve.fem import BlockBFI
89
89
  from ngsolve.fem import BlockLFI
90
90
  from ngsolve.fem import CacheCF
91
- from ngsolve.fem import CoefficientFunction as CF
92
91
  from ngsolve.fem import CoefficientFunction
92
+ from ngsolve.fem import CoefficientFunction as CF
93
93
  from ngsolve.fem import Cof
94
94
  from ngsolve.fem import CompoundBFI
95
95
  from ngsolve.fem import CompoundLFI
@@ -217,7 +217,7 @@ TET: fem.ET # value = <ET.TET: 20>
217
217
  TRIG: fem.ET # value = <ET.TRIG: 10>
218
218
  VERTEX: fem.NODE_TYPE # value = <NODE_TYPE.VERTEX: 0>
219
219
  VOL: comp.VorB # value = <VorB.VOL: 0>
220
- __version__: str = '6.2.2405-32-gc3666e0ed'
220
+ __version__: str = '6.2.2405-45-g9db16e4b7'
221
221
  ds: comp.DifferentialSymbol # value = <ngsolve.comp.DifferentialSymbol object>
222
222
  dx: comp.DifferentialSymbol # value = <ngsolve.comp.DifferentialSymbol object>
223
223
  ngsglobals: comp.GlobalVariables # value = <ngsolve.comp.GlobalVariables object>
@@ -1,4 +1,4 @@
1
- set(PACKAGE_VERSION "6.2.2405-32-gc3666e0ed")
1
+ set(PACKAGE_VERSION "6.2.2405-45-g9db16e4b7")
2
2
  find_package(Netgen CONFIG REQUIRED HINTS
3
3
  ${CMAKE_CURRENT_LIST_DIR}
4
4
  ${CMAKE_CURRENT_LIST_DIR}/..
ngsolve/comp/__init__.pyi CHANGED
@@ -222,6 +222,10 @@ class BilinearForm(NGS_Object):
222
222
  gf : ngsolve.comp.GridFunction
223
223
  input GridFunction
224
224
  """
225
+ def GetMatrixLevel(self, level: int | None = None) -> BaseMatrix:
226
+ """
227
+ returns matrix from multigrid level, default is finest level
228
+ """
225
229
  def SetPreconditioner(self, arg0: ...) -> None:
226
230
  ...
227
231
  def UnsetPreconditioner(self, arg0: ...) -> None:
@@ -785,7 +789,7 @@ class FESpace(NGS_Object):
785
789
  int is for backward compatibility with old style blocktypes
786
790
 
787
791
  condense: bool = False
788
- boolexclude dofs eliminated by static condensation
792
+ exclude dofs eliminated by static condensation
789
793
  """
790
794
  @typing.overload
791
795
  def Elements(self, VOL_or_BND: VorB = ...) -> FESpaceElementRange:
@@ -23,14 +23,14 @@ NGSOLVE_INSTALL_DIR_INCLUDE: str = 'netgen/include'
23
23
  NGSOLVE_INSTALL_DIR_LIB: str = 'netgen'
24
24
  NGSOLVE_INSTALL_DIR_PYTHON: str = '.'
25
25
  NGSOLVE_INSTALL_DIR_RES: str = 'share'
26
- NGSOLVE_VERSION: str = '6.2.2405-32-gc3666e0ed'
27
- NGSOLVE_VERSION_GIT: str = 'v6.2.2405-32-gc3666e0ed'
28
- NGSOLVE_VERSION_HASH: str = 'gc3666e0ed'
26
+ NGSOLVE_VERSION: str = '6.2.2405-45-g9db16e4b7'
27
+ NGSOLVE_VERSION_GIT: str = 'v6.2.2405-45-g9db16e4b7'
28
+ NGSOLVE_VERSION_HASH: str = 'g9db16e4b7'
29
29
  NGSOLVE_VERSION_MAJOR: str = '6'
30
30
  NGSOLVE_VERSION_MINOR: str = '2'
31
31
  NGSOLVE_VERSION_PATCH: str = '2405'
32
- NGSOLVE_VERSION_PYTHON: str = '6.2.2405.post32.dev1'
33
- NGSOLVE_VERSION_TWEAK: str = '32'
32
+ NGSOLVE_VERSION_PYTHON: str = '6.2.2405.post45.dev1'
33
+ NGSOLVE_VERSION_TWEAK: str = '45'
34
34
  USE_CCACHE: bool = True
35
35
  USE_HYPRE: bool = False
36
36
  USE_LAPACK: bool = True
@@ -39,4 +39,4 @@ USE_MUMPS: bool = False
39
39
  USE_PARDISO: bool = False
40
40
  USE_UMFPACK: bool = True
41
41
  is_python_package: bool = True
42
- version: str = 'v6.2.2405-32-gc3666e0ed'
42
+ version: str = 'v6.2.2405-45-g9db16e4b7'
ngsolve/config/config.py CHANGED
@@ -30,15 +30,15 @@ NGSOLVE_INSTALL_DIR_INCLUDE = "netgen/include"
30
30
  NGSOLVE_INSTALL_DIR_CMAKE = "ngsolve/cmake"
31
31
  NGSOLVE_INSTALL_DIR_RES = "share"
32
32
 
33
- NGSOLVE_VERSION = "6.2.2405-32-gc3666e0ed"
34
- NGSOLVE_VERSION_GIT = "v6.2.2405-32-gc3666e0ed"
35
- NGSOLVE_VERSION_PYTHON = "6.2.2405.post32.dev1"
33
+ NGSOLVE_VERSION = "6.2.2405-45-g9db16e4b7"
34
+ NGSOLVE_VERSION_GIT = "v6.2.2405-45-g9db16e4b7"
35
+ NGSOLVE_VERSION_PYTHON = "6.2.2405.post45.dev1"
36
36
 
37
37
  NGSOLVE_VERSION_MAJOR = "6"
38
38
  NGSOLVE_VERSION_MINOR = "2"
39
- NGSOLVE_VERSION_TWEAK = "32"
39
+ NGSOLVE_VERSION_TWEAK = "45"
40
40
  NGSOLVE_VERSION_PATCH = "2405"
41
- NGSOLVE_VERSION_HASH = "gc3666e0ed"
41
+ NGSOLVE_VERSION_HASH = "g9db16e4b7"
42
42
 
43
43
  CMAKE_CXX_COMPILER = "/Library/Developer/CommandLineTools/usr/bin/c++"
44
44
  CMAKE_CUDA_COMPILER = ""
ngsolve/config/config.pyi CHANGED
@@ -25,14 +25,14 @@ NGSOLVE_INSTALL_DIR_INCLUDE: str = 'netgen/include'
25
25
  NGSOLVE_INSTALL_DIR_LIB: str = 'netgen'
26
26
  NGSOLVE_INSTALL_DIR_PYTHON: str = '.'
27
27
  NGSOLVE_INSTALL_DIR_RES: str = 'share'
28
- NGSOLVE_VERSION: str = '6.2.2405-32-gc3666e0ed'
29
- NGSOLVE_VERSION_GIT: str = 'v6.2.2405-32-gc3666e0ed'
30
- NGSOLVE_VERSION_HASH: str = 'gc3666e0ed'
28
+ NGSOLVE_VERSION: str = '6.2.2405-45-g9db16e4b7'
29
+ NGSOLVE_VERSION_GIT: str = 'v6.2.2405-45-g9db16e4b7'
30
+ NGSOLVE_VERSION_HASH: str = 'g9db16e4b7'
31
31
  NGSOLVE_VERSION_MAJOR: str = '6'
32
32
  NGSOLVE_VERSION_MINOR: str = '2'
33
33
  NGSOLVE_VERSION_PATCH: str = '2405'
34
- NGSOLVE_VERSION_PYTHON: str = '6.2.2405.post32.dev1'
35
- NGSOLVE_VERSION_TWEAK: str = '32'
34
+ NGSOLVE_VERSION_PYTHON: str = '6.2.2405.post45.dev1'
35
+ NGSOLVE_VERSION_TWEAK: str = '45'
36
36
  USE_CCACHE: bool = True
37
37
  USE_HYPRE: bool = False
38
38
  USE_LAPACK: bool = True
@@ -41,4 +41,4 @@ USE_MUMPS: bool = False
41
41
  USE_PARDISO: bool = False
42
42
  USE_UMFPACK: bool = True
43
43
  is_python_package: bool = True
44
- version: str = 'v6.2.2405-32-gc3666e0ed'
44
+ version: str = 'v6.2.2405-45-g9db16e4b7'
ngsolve/config.py CHANGED
@@ -30,15 +30,15 @@ NGSOLVE_INSTALL_DIR_INCLUDE = "netgen/include"
30
30
  NGSOLVE_INSTALL_DIR_CMAKE = "ngsolve/cmake"
31
31
  NGSOLVE_INSTALL_DIR_RES = "share"
32
32
 
33
- NGSOLVE_VERSION = "6.2.2405-32-gc3666e0ed"
34
- NGSOLVE_VERSION_GIT = "v6.2.2405-32-gc3666e0ed"
35
- NGSOLVE_VERSION_PYTHON = "6.2.2405.post32.dev1"
33
+ NGSOLVE_VERSION = "6.2.2405-45-g9db16e4b7"
34
+ NGSOLVE_VERSION_GIT = "v6.2.2405-45-g9db16e4b7"
35
+ NGSOLVE_VERSION_PYTHON = "6.2.2405.post45.dev1"
36
36
 
37
37
  NGSOLVE_VERSION_MAJOR = "6"
38
38
  NGSOLVE_VERSION_MINOR = "2"
39
- NGSOLVE_VERSION_TWEAK = "32"
39
+ NGSOLVE_VERSION_TWEAK = "45"
40
40
  NGSOLVE_VERSION_PATCH = "2405"
41
- NGSOLVE_VERSION_HASH = "gc3666e0ed"
41
+ NGSOLVE_VERSION_HASH = "g9db16e4b7"
42
42
 
43
43
  CMAKE_CXX_COMPILER = "/Library/Developer/CommandLineTools/usr/bin/c++"
44
44
  CMAKE_CUDA_COMPILER = ""
File without changes
@@ -0,0 +1,80 @@
1
+ from ngsolve.TensorProductTools import *
2
+ from ngsolve.comp import *
3
+ from ngsolve import *
4
+ import netgen.gui
5
+
6
+ mesh1 = Mesh(SegMesh(20,0,1,periodic=True) )
7
+ mesh2 = Mesh(SegMesh(20,0,1,periodic=True) )
8
+
9
+ tpmesh = Mesh(MakeTensorProductMesh(mesh1,mesh2))
10
+ Draw(tpmesh)
11
+
12
+ n=5
13
+ m=5
14
+
15
+ fesx = L2(mesh1,order=n)
16
+ fesy = L2(mesh2,order=m)
17
+
18
+ tpfes = TensorProductFESpace([fesx,fesy])
19
+
20
+ fes = L2(tpmesh,order=n)
21
+ u = tpfes.TrialFunction()
22
+ v = tpfes.TestFunction()
23
+ vx = v.Operator("gradx")
24
+ vy = v.Operator("grady")
25
+ b = (-1)*CoefficientFunction( (0.25,0.5) )
26
+
27
+
28
+ uin = ProlongateCoefficientFunction(IfPos((1.0-x)*(x-0.5),sin((x-0.5)*2*3.14159),0) + IfPos((x-0.0)*(0.5-x),sin((x)*2*3.14159),0) , 0 , tpfes)
29
+
30
+ gradv = CoefficientFunction((vx,vy))
31
+
32
+ a = BilinearForm(tpfes)
33
+
34
+ n = CoefficientFunction((ProlongateCoefficientFunction(specialcf.normal(1),1,tpfes),ProlongateCoefficientFunction(specialcf.normal(1),0,tpfes)))
35
+ bn = b*n
36
+
37
+ a += SymbolicTPBFI ( (-u * b*gradv).Compile() )
38
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other( )) * (v-v.Other()).Compile(), VOL, skeleton=True)
39
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = CoefficientFunction(uin) )) * (v).Compile(), BND, skeleton=True)
40
+
41
+
42
+
43
+ u = GridFunction(tpfes)
44
+ v = GridFunction(tpfes)
45
+
46
+ uu = GridFunction(fes)
47
+ print("Setting")
48
+ u.Set(exp( ProlongateCoefficientFunction(-200*(x-0.4)*(x-0.4), 1, tpfes)+ ProlongateCoefficientFunction(-200*(x-0.4)*(x-0.4),0,tpfes) ) )
49
+ print("Done")
50
+ Transfer2StdMesh(u,uu)
51
+
52
+ Draw(uu,sd=2,autoscale=False)
53
+
54
+ h = u.vec.CreateVector()
55
+ #u.vec[:] = 1.0
56
+ print('To start the simulation type Run(n_steps)!')
57
+
58
+ def Step():
59
+ a.Apply(u.vec,v.vec)
60
+ h.data = 0.00125*v.vec.data
61
+ tpfes.SolveM(rho=CoefficientFunction(1), vec = h)
62
+ u.vec.data-=h.data
63
+ #Redraw()
64
+
65
+ def Run(nsteps):
66
+ count = 0
67
+ with TaskManager():
68
+ for i in range(nsteps):
69
+ print("Step ",i+1, "/",nsteps)
70
+ Step()
71
+ count += 1
72
+ if count % 1 == 0:
73
+ Transfer2StdMesh(u,uu)
74
+ count = 0
75
+ Redraw()
76
+
77
+ Transfer2StdMesh(u,uu)
78
+ Run(100)
79
+ for t in Timers():
80
+ print(t["counts"], t["time"], t["name"])
@@ -0,0 +1,73 @@
1
+ from ngsolve.TensorProductTools import *
2
+ from ngsolve.comp import *
3
+ from ngsolve import *
4
+ from netgen.geom2d import unit_square
5
+ import netgen.gui
6
+
7
+ mesh1 = Mesh(SegMesh(20,0,1))
8
+ mesh2 = Mesh(unit_square.GenerateMesh(maxh=0.15))
9
+
10
+ tpmesh = Mesh(MakeTensorProductMesh(mesh1,mesh2))
11
+ Draw(tpmesh)
12
+
13
+ n=3
14
+ m=3
15
+
16
+ fesx = L2(mesh1,order=n)
17
+ fesy = L2(mesh2,order=m)
18
+ tpfes = TensorProductFESpace([fesx,fesy])
19
+
20
+ fes = L2(tpmesh,order=n)
21
+
22
+ u = tpfes.TrialFunction()
23
+ v = tpfes.TestFunction()
24
+
25
+ vx = v.Operator("gradx")
26
+ vy = v.Operator("grady")
27
+
28
+ b = CoefficientFunction( (ProlongateCoefficientFunction(x-0.5,0,tpfes),ProlongateCoefficientFunction(0.5-x,1,tpfes),0) )
29
+
30
+ uin = CoefficientFunction(0.0)
31
+
32
+
33
+ gradv = CoefficientFunction((vx,vy))
34
+
35
+ a = BilinearForm(tpfes)
36
+
37
+ n = CoefficientFunction(( ProlongateCoefficientFunction(specialcf.normal(1)[0],1,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[0],0,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[1],0,tpfes)))
38
+ bn = b*n
39
+
40
+ a += SymbolicTPBFI ( -u * b*gradv )
41
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v-v.Other(bnd = 0.0)), VOL, skeleton=True)
42
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v), BND, skeleton=True)
43
+
44
+
45
+ u = GridFunction(tpfes)
46
+ v = GridFunction(tpfes)
47
+
48
+
49
+ uu = GridFunction(fes)
50
+
51
+ u.Set(exp(ProlongateCoefficientFunction( -70*(x-0.25)*(x-0.25),1,tpfes) + ProlongateCoefficientFunction(-70*(x-0.25)*(x-0.25)-70*(y-0.75)*(y-0.75),0,tpfes) ))
52
+ Transfer2StdMesh(u,uu)
53
+ Draw(uu,sd=3,autoscale=False)
54
+
55
+ h = u.vec.CreateVector()
56
+ print('To start the simulation type Run(n_steps)!')
57
+ def Step():
58
+ a.Apply(u.vec,v.vec)
59
+ h.data = 0.001*v.vec.data
60
+ tpfes.SolveM(rho=CoefficientFunction(1), vec = h)
61
+ u.vec.data-=h.data
62
+ Transfer2StdMesh(u,uu)
63
+ Redraw()
64
+
65
+ def Run(nsteps):
66
+ with TaskManager():
67
+ for i in range(nsteps):
68
+ print("Step ",i+1, "/",nsteps)
69
+ Step()
70
+
71
+ #Run(100)
72
+ for t in Timers():
73
+ print(t["counts"], t["time"], t["name"])
@@ -0,0 +1,72 @@
1
+ from ngsolve.TensorProductTools import *
2
+ from ngsolve.comp import *
3
+ from ngsolve import *
4
+ from netgen.geom2d import unit_square
5
+ import netgen.gui
6
+
7
+ mesh1 = Mesh(unit_square.GenerateMesh(maxh=0.15))
8
+ mesh2 = Mesh(SegMesh(20,0,1))
9
+
10
+ tpmesh = Mesh(MakeTensorProductMesh(mesh1,mesh2))
11
+ Draw(tpmesh)
12
+
13
+ n=3
14
+ m=3
15
+
16
+ fesx = L2(mesh1,order=n)
17
+ fesy = L2(mesh2,order=m)
18
+ tpfes = TensorProductFESpace([fesx,fesy])
19
+
20
+ fes = L2(tpmesh,order=n)
21
+
22
+ u = tpfes.TrialFunction()
23
+ v = tpfes.TestFunction()
24
+
25
+ vx = v.Operator("gradx")
26
+ vy = v.Operator("grady")
27
+
28
+ b = CoefficientFunction( (0,0,1) )
29
+
30
+ uin = CoefficientFunction(0.0)
31
+
32
+ gradv = CoefficientFunction((vx,vy))
33
+
34
+ a = BilinearForm(tpfes)
35
+
36
+ n = CoefficientFunction((ProlongateCoefficientFunction(specialcf.normal(2)[0],1,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[1],1,tpfes),ProlongateCoefficientFunction(specialcf.normal(1)[0],0,tpfes)))
37
+ bn = b*n
38
+
39
+ a += SymbolicTPBFI ( -u * b*gradv )
40
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v-v.Other(bnd = 0.0)), VOL, skeleton=True)
41
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v), BND, skeleton=True)
42
+
43
+
44
+ u = GridFunction(tpfes)
45
+ v = GridFunction(tpfes)
46
+
47
+
48
+ uu = GridFunction(fes)
49
+
50
+ u.Set(exp(ProlongateCoefficientFunction(-70*(x-0.125)*(x-0.125)-70*(y-0.125)*(y-0.125),1,tpfes)+ProlongateCoefficientFunction(-70*(x-0.75)*(x-0.75),0,tpfes) ))
51
+ Transfer2StdMesh(u,uu)
52
+ Draw(uu,sd=3,autoscale=False)
53
+
54
+ h = u.vec.CreateVector()
55
+ print('To start the simulation type Run(n_steps)!')
56
+ def Step():
57
+ a.Apply(u.vec,v.vec)
58
+ h.data = 0.001*v.vec.data
59
+ tpfes.SolveM(rho=CoefficientFunction(1), vec = h)
60
+ u.vec.data-=h.data
61
+ Transfer2StdMesh(u,uu)
62
+ Redraw()
63
+
64
+ def Run(nsteps):
65
+ with TaskManager():
66
+ for i in range(nsteps):
67
+ print("Step ",i+1, "/",nsteps)
68
+ Step()
69
+
70
+ Run(100)
71
+ for t in Timers():
72
+ print(t["counts"], t["time"], t["name"])
@@ -0,0 +1,66 @@
1
+ from ngsolve.TensorProductTools import *
2
+ from ngsolve.comp import *
3
+ from ngsolve import *
4
+ from netgen.geom2d import unit_square
5
+ import netgen.gui
6
+
7
+ mesh1 = Mesh(unit_square.GenerateMesh(maxh=0.15))
8
+ mesh2 = Mesh(MakeHexagonalMesh2D(maxh=0.2))
9
+ n=4
10
+ m=4
11
+ SetHeapSize(1000000000)
12
+
13
+ fesx = L2(mesh1,order=n)
14
+ fesy = L2(mesh2,order=m)
15
+ tpfes = TensorProductFESpace([fesx,fesy])
16
+
17
+ u = tpfes.TrialFunction()
18
+ v = tpfes.TestFunction()
19
+
20
+ vx = v.Operator("gradx")
21
+ vy = v.Operator("grady")
22
+
23
+ b = CoefficientFunction( ( ProlongateCoefficientFunction(y-0.5,1,tpfes),ProlongateCoefficientFunction(0.5-x,1,tpfes),1,1 ) )
24
+
25
+ uin = CoefficientFunction(0.0)
26
+
27
+ gradv = CoefficientFunction((vx,vy))
28
+
29
+ a = BilinearForm(tpfes)
30
+
31
+ n = CoefficientFunction((ProlongateCoefficientFunction(specialcf.normal(2)[0],1,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[1],1,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[0],0,tpfes),ProlongateCoefficientFunction(specialcf.normal(2)[1],0,tpfes)))
32
+ bn = b*n
33
+
34
+ a += SymbolicTPBFI ( -u * b*gradv )
35
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v-v.Other(bnd = 0.0)), VOL, skeleton=True)
36
+ a += SymbolicTPBFI ( (bn) *IfPos(bn, u, u.Other(bnd = uin )) * (v), BND, skeleton=True)
37
+
38
+
39
+ u = GridFunction(tpfes)
40
+ v = GridFunction(tpfes)
41
+ print(1)
42
+ with TaskManager():
43
+ u.Set(exp(ProlongateCoefficientFunction(-90*(x-0.25)*(x-0.25)-90*(y-0.5)*(y-0.5),1,tpfes)+ProlongateCoefficientFunction(-70*(x-0.75)*(x-0.75)-70*(y-0.75)*(y-0.75),0,tpfes) ))
44
+ print(2)
45
+ rho = GridFunction(fesx,name="rho")
46
+ Draw(rho)
47
+ h = u.vec.CreateVector()
48
+ print('To start the simulation type Run(n_steps)!')
49
+
50
+ def Step():
51
+ a.Apply(u.vec,v.vec)
52
+ h.data = 0.005*v.vec.data
53
+ tpfes.SolveM(rho=CoefficientFunction(1), vec = h)
54
+ u.vec.data-=h.data
55
+ TensorProductIntegrate(u,rho)
56
+ Redraw()
57
+
58
+ def Run(nsteps):
59
+ with TaskManager():
60
+ for i in range(nsteps):
61
+ print("Step ",i+1, "/",nsteps)
62
+ Step()
63
+
64
+ Run(1000)
65
+ for t in Timers():
66
+ print(t["counts"], t["time"], t["name"])
File without changes
File without changes