ngsolve 6.2.2404.post156.dev0__cp39-cp39-win_amd64.whl → 6.2.2406.post112.dev1__cp39-cp39-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 (134) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +27 -22
  3. netgen/include/basevector.hpp +43 -71
  4. netgen/include/bdbequations.hpp +14 -3
  5. netgen/include/bilinearform.hpp +8 -59
  6. netgen/include/blockjacobi.hpp +4 -0
  7. netgen/include/cg.hpp +3 -0
  8. netgen/include/chebyshev.hpp +3 -0
  9. netgen/include/coefficient.hpp +6 -2
  10. netgen/include/comp.hpp +0 -4
  11. netgen/include/diagonalmatrix.hpp +154 -0
  12. netgen/include/dump.hpp +5 -5
  13. netgen/include/eigen.hpp +3 -0
  14. netgen/include/elementbyelement.hpp +6 -0
  15. netgen/include/elementtopology.hpp +0 -3
  16. netgen/include/expr.hpp +13 -8
  17. netgen/include/fespace.hpp +12 -14
  18. netgen/include/finiteelement.hpp +7 -7
  19. netgen/include/globalspace.hpp +28 -2
  20. netgen/include/gridfunction.hpp +4 -0
  21. netgen/include/h1amg.hpp +3 -1
  22. netgen/include/h1hofe.hpp +1 -1
  23. netgen/include/hcurlhdivfes.hpp +2 -0
  24. netgen/include/hcurlhofespace.hpp +4 -3
  25. netgen/include/hdivfes.hpp +3 -3
  26. netgen/include/hdivhosurfacefespace.hpp +3 -3
  27. netgen/include/intrule.hpp +15 -1
  28. netgen/include/jacobi.hpp +3 -0
  29. netgen/include/la.hpp +1 -13
  30. netgen/include/matrix.hpp +21 -0
  31. netgen/include/meshaccess.hpp +24 -51
  32. netgen/include/mgpre.hpp +1 -1
  33. netgen/include/mptools.hpp +1 -2
  34. netgen/include/multivector.hpp +2 -0
  35. netgen/include/ngsobject.hpp +1 -1
  36. netgen/include/nodalhofe.hpp +3 -0
  37. netgen/include/normalfacetfespace.hpp +4 -5
  38. netgen/include/normalfacetsurfacefespace.hpp +1 -1
  39. netgen/include/order.hpp +3 -1
  40. netgen/include/parallel_matrices.hpp +5 -0
  41. netgen/include/paralleldofs.hpp +44 -95
  42. netgen/include/parallelngs.hpp +2 -1
  43. netgen/include/parallelvector.hpp +12 -16
  44. netgen/include/pardisoinverse.hpp +1 -0
  45. netgen/include/periodic.hpp +1 -0
  46. netgen/include/pmltrafo.hpp +5 -2
  47. netgen/include/preconditioner.hpp +3 -1
  48. netgen/include/scalarfe.hpp +4 -1
  49. netgen/include/sparsecholesky.hpp +4 -0
  50. netgen/include/sparsematrix.hpp +18 -45
  51. netgen/include/sparsematrix_dyn.hpp +2 -0
  52. netgen/include/sparsematrix_impl.hpp +66 -1
  53. netgen/include/special_matrix.hpp +7 -138
  54. netgen/include/statushandler.hpp +7 -0
  55. netgen/include/symbolicintegrator.hpp +2 -1
  56. netgen/include/tensorcoefficient.hpp +56 -54
  57. netgen/include/tpdiffop.hpp +1 -0
  58. netgen/include/tpintrule.hpp +2 -0
  59. netgen/include/umfpackinverse.hpp +58 -30
  60. netgen/include/vector.hpp +6 -1
  61. netgen/include/voxelcoefficientfunction.hpp +2 -0
  62. netgen/include/vvector.hpp +10 -1
  63. netgen/lib/libngsolve.lib +0 -0
  64. netgen/libngsolve.dll +0 -0
  65. ngsolve/_scikit_build_core_dependencies.py +8 -1
  66. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  67. ngsolve/config/config.py +6 -6
  68. ngsolve/config.py +6 -6
  69. ngsolve/demos/TensorProduct/__init__.py +0 -0
  70. ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
  71. ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
  72. ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
  73. ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
  74. ngsolve/demos/__init__.py +0 -0
  75. ngsolve/demos/howto/__init__.py +0 -0
  76. ngsolve/demos/howto/hhj.py +44 -0
  77. ngsolve/demos/howto/hybrid_dg.py +53 -0
  78. ngsolve/demos/howto/mixed.py +30 -0
  79. ngsolve/demos/howto/nonlin.py +29 -0
  80. ngsolve/demos/howto/pickling.py +26 -0
  81. ngsolve/demos/howto/pml.py +31 -0
  82. ngsolve/demos/howto/taskmanager.py +20 -0
  83. ngsolve/demos/howto/tdnns.py +47 -0
  84. ngsolve/demos/howto/timeDG-skeleton.py +45 -0
  85. ngsolve/demos/howto/timeDG.py +38 -0
  86. ngsolve/demos/howto/timeDGlap.py +42 -0
  87. ngsolve/demos/howto/timeDGwave.py +61 -0
  88. ngsolve/demos/intro/__init__.py +0 -0
  89. ngsolve/demos/intro/adaptive.py +123 -0
  90. ngsolve/demos/intro/cmagnet.py +62 -0
  91. ngsolve/demos/intro/elasticity.py +76 -0
  92. ngsolve/demos/intro/navierstokes.py +74 -0
  93. ngsolve/demos/intro/poisson.ipynb +170 -0
  94. ngsolve/demos/intro/poisson.py +41 -0
  95. ngsolve/demos/mpi/__init__.py +0 -0
  96. ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
  97. ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
  98. ngsolve/demos/mpi/mpi_poisson.py +89 -0
  99. ngsolve/demos/mpi/mpi_timeDG.py +82 -0
  100. ngsolve/ngslib.pyd +0 -0
  101. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/METADATA +2 -2
  102. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/RECORD +134 -102
  103. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
  104. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  105. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  106. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  107. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  108. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  109. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  110. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  111. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  112. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  113. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  114. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  115. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  116. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  117. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  118. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  119. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  120. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  121. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  122. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  123. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  124. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  125. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  126. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  127. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  128. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  129. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  130. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  131. {ngsolve-6.2.2404.post156.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.vol +0 -0
  132. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/LICENSE +0 -0
  133. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/WHEEL +0 -0
  134. {ngsolve-6.2.2404.post156.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/top_level.txt +0 -0
@@ -8,6 +8,9 @@
8
8
  /* Date: 5. Jul. 96 */
9
9
  /**************************************************************************/
10
10
 
11
+
12
+ #include "basematrix.hpp"
13
+
11
14
  namespace ngla
12
15
  {
13
16
  /**
@@ -8,14 +8,21 @@
8
8
  /* Date: 25. Mar. 2000 */
9
9
  /*********************************************************************/
10
10
 
11
- namespace ngla
12
- {
13
11
 
12
+ #include "basevector.hpp"
13
+ #include "multivector.hpp"
14
+ // #include "paralleldofs.hpp"
14
15
 
16
+ namespace ngla
17
+ {
18
+ class ParallelDofs;
19
+
15
20
  // sets the solver which is used for InverseMatrix
16
21
  enum INVERSETYPE { PARDISO, PARDISOSPD, SPARSECHOLESKY, SUPERLU, SUPERLU_DIST, MUMPS, MASTERINVERSE, UMFPACK };
17
22
  extern string GetInverseName (INVERSETYPE type);
18
23
 
24
+ class BaseSparseMatrix;
25
+
19
26
  /**
20
27
  The base for all matrices in the linalg.
21
28
  */
@@ -142,6 +149,16 @@ namespace ngla
142
149
  virtual INVERSETYPE SetInverseType ( INVERSETYPE ainversetype ) const;
143
150
  virtual INVERSETYPE SetInverseType ( string ainversetype ) const;
144
151
  virtual INVERSETYPE GetInverseType () const;
152
+
153
+ typedef std::function<shared_ptr<BaseMatrix>(shared_ptr<BaseMatrix>,
154
+ shared_ptr<BitArray>,
155
+ shared_ptr<const Array<int>>)> T_INVCREATOR;
156
+ mutable T_INVCREATOR invcreator;
157
+ void SetInverseCreator(T_INVCREATOR ainvcreator) const { invcreator = ainvcreator; }
158
+
159
+ static SymbolTable<T_INVCREATOR> invcreators;
160
+ static void RegisterInverseCreator(string name, T_INVCREATOR creator);
161
+
145
162
  virtual void SetInverseFlags (const Flags & flags) { ; }
146
163
  virtual shared_ptr<BaseMatrix> DeleteZeroElements(double tol) const
147
164
  {
@@ -155,7 +172,7 @@ namespace ngla
155
172
  template <typename TSCAL>
156
173
  Matrix<TSCAL> ToDense() const;
157
174
 
158
- virtual shared_ptr<BaseMatrix> CreateSparseMatrix() const;
175
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const;
159
176
 
160
177
  // time per run
161
178
  double Timing (int runs = 10) const;
@@ -256,14 +273,6 @@ namespace ngla
256
273
  void AssignTo (TS s, BaseVector & v) const
257
274
  {
258
275
  CheckSize (v);
259
- /*
260
- if (m.Height() != v.Size() || m.Width() != x.Size())
261
- throw Exception (ToString ("matrix-vector: size does not fit\n") +
262
- "matrix-type = " + typeid(m).name() +
263
- "Matrix: " + ToString(m.Height()) + " x " + ToString(m.Width()) + "\n"
264
- "Vector in : " + ToString(x.Size()) + "\n"
265
- "Vector res: " + ToString(v.Size()));
266
- */
267
276
  m.Mult (x, v);
268
277
  v *= s;
269
278
  }
@@ -272,10 +281,6 @@ namespace ngla
272
281
  void AddTo (TS s, BaseVector & v) const
273
282
  {
274
283
  CheckSize (v);
275
- /*
276
- if (m.Height() != v.Size() || m.Width() != x.Size())
277
- throw Exception ("matrix-vector MultAdd: size does not fit");
278
- */
279
284
  m.MultAdd (s, x, v);
280
285
  }
281
286
 
@@ -346,6 +351,8 @@ namespace ngla
346
351
  ///
347
352
  virtual bool IsComplex() const override { return bm.IsComplex(); }
348
353
  virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
354
+
355
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
349
356
 
350
357
  virtual AutoVector CreateRowVector () const override { return bm.CreateColVector(); }
351
358
  virtual AutoVector CreateColVector () const override { return bm.CreateRowVector(); }
@@ -570,7 +577,7 @@ namespace ngla
570
577
  return ost;
571
578
  }
572
579
 
573
- virtual shared_ptr<BaseMatrix> CreateSparseMatrix() const override;
580
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
574
581
 
575
582
  virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
576
583
  {
@@ -693,7 +700,7 @@ namespace ngla
693
700
  bmb.MultAdd (Vector(b*alpha), x, y);
694
701
  }
695
702
 
696
- virtual shared_ptr<BaseMatrix> CreateSparseMatrix() const override;
703
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
697
704
 
698
705
  virtual int VHeight() const override
699
706
  {
@@ -815,7 +822,7 @@ namespace ngla
815
822
  return info;
816
823
  }
817
824
 
818
- virtual shared_ptr<BaseMatrix> CreateSparseMatrix() const override;
825
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
819
826
 
820
827
  virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
821
828
  {
@@ -835,7 +842,6 @@ namespace ngla
835
842
  {
836
843
  bool has_format;
837
844
  size_t size;
838
- // bool is_complex;
839
845
  public:
840
846
  ///
841
847
  IdentityMatrix ()
@@ -843,7 +849,6 @@ namespace ngla
843
849
  IdentityMatrix (size_t asize, bool ais_complex)
844
850
  : has_format(true), size(asize) { is_complex=ais_complex; }
845
851
 
846
- // virtual bool IsComplex() const override { return is_complex; }
847
852
  virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
848
853
 
849
854
  ///
@@ -914,7 +919,7 @@ namespace ngla
914
919
  };
915
920
 
916
921
 
917
- /* *********************** operator<< ********************** */
922
+ /* *********************** operators ********************** */
918
923
 
919
924
  // default is ProductMatrix, but optimizations for
920
925
  // ParallelMatrices
@@ -940,8 +945,8 @@ namespace ngla
940
945
 
941
946
 
942
947
  shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat);
948
+
943
949
 
944
- /// output operator for matrices
945
950
  inline ostream & operator<< (ostream & ost, const BaseMatrix & m)
946
951
  {
947
952
  return m.Print(ost);
@@ -7,13 +7,34 @@
7
7
  /* Date: 7. Feb. 2003 */
8
8
  /*********************************************************************/
9
9
 
10
-
10
+ #include <bla.hpp>
11
+ #include <core/mpi_wrapper.hpp>
12
+ // #include "paralleldofs.hpp"
11
13
 
12
14
  namespace ngla
13
15
  {
16
+ using namespace ngbla;
17
+
14
18
  class BaseVector;
15
19
  class AutoVector;
16
20
  class MultiVector;
21
+
22
+ class ParallelDofs;
23
+
24
+ class DofRange : public T_Range<size_t>
25
+ {
26
+ shared_ptr<ParallelDofs> pardofs;
27
+ public:
28
+ DofRange () { }
29
+ DofRange (T_Range<size_t> range, shared_ptr<ParallelDofs> apardofs)
30
+ : T_Range<size_t>(range), pardofs(apardofs) { ; }
31
+ DofRange (size_t end, shared_ptr<ParallelDofs> apardofs)
32
+ : T_Range<size_t>(0, end), pardofs(apardofs) { ; }
33
+ shared_ptr<ParallelDofs> GetParallelDofs() const { return pardofs; }
34
+ };
35
+
36
+
37
+
17
38
 
18
39
  template <class SCAL> class S_BaseVector;
19
40
 
@@ -91,9 +112,6 @@ namespace ngla
91
112
  size_t size;
92
113
  /// number of doubles per entry
93
114
  int entrysize = 1;
94
- ///
95
- // shared_ptr<ParallelDofs> paralleldofs;
96
-
97
115
  ///
98
116
  BaseVector () { ; }
99
117
 
@@ -265,6 +283,7 @@ namespace ngla
265
283
  virtual void SetRandom ();
266
284
 
267
285
  inline AutoVector Range (size_t begin, size_t end) const;
286
+ inline AutoVector Range (size_t end) const;
268
287
  // { return Range(T_Range(begin, end)); }
269
288
  virtual AutoVector Range (T_Range<size_t> range) const;
270
289
  virtual AutoVector Range (DofRange range) const;
@@ -434,6 +453,7 @@ namespace ngla
434
453
  operator const BaseVector & () const { return *vec; }
435
454
 
436
455
  AutoVector Range (size_t begin, size_t end) const { return vec->Range(begin,end); }
456
+ AutoVector Range (size_t end) const { return vec->Range(0,end); }
437
457
  AutoVector Range (T_Range<size_t> range) const { return vec->Range(range); }
438
458
 
439
459
  template <typename T>
@@ -571,6 +591,11 @@ namespace ngla
571
591
  return Range(T_Range(begin, end));
572
592
  }
573
593
 
594
+ AutoVector BaseVector::Range (size_t end) const
595
+ {
596
+ return Range (0, end);
597
+ }
598
+
574
599
 
575
600
  template <>
576
601
  inline FlatVector<double> BaseVector::FV<double> () const
@@ -651,72 +676,6 @@ namespace ngla
651
676
  extern template class S_BaseVector<Complex>;
652
677
  #endif
653
678
 
654
- /*
655
- template <class SCAL>
656
- class NGS_DLL_HEADER S_BaseVector;
657
-
658
-
659
- template <>
660
- class NGS_DLL_HEADER S_BaseVector<double> : virtual public BaseVector
661
- {
662
- public:
663
- S_BaseVector () throw () { ; }
664
- virtual ~S_BaseVector() { ; }
665
-
666
- S_BaseVector & operator= (double s);
667
-
668
- virtual double InnerProduct (const BaseVector & v2) const;
669
-
670
- virtual FlatVector<double> FVDouble () const;
671
- virtual FlatVector<Complex> FVComplex () const;
672
-
673
- virtual FlatVector<double> FVScal () const
674
- {
675
- return FlatVector<double> (size * entrysize, Memory());
676
- }
677
-
678
-
679
- virtual void GetIndirect (const FlatArray<int> & ind,
680
- const FlatVector<double> & v) const;
681
- virtual void GetIndirect (const FlatArray<int> & ind,
682
- const FlatVector<Complex> & v) const;
683
-
684
- };
685
-
686
-
687
-
688
-
689
- template <>
690
- class NGS_DLL_HEADER S_BaseVector<Complex> : virtual public BaseVector
691
- {
692
- public:
693
- S_BaseVector () throw() { ; }
694
- ~S_BaseVector () { ; }
695
-
696
- virtual Complex InnerProduct (const BaseVector & v2) const;
697
-
698
- virtual FlatVector<double> FVDouble () const throw();
699
- virtual FlatVector<Complex> FVComplex () const throw();
700
- virtual FlatVector<Complex> FVScal () const throw()
701
- {
702
- return FlatVector<Complex> (size * entrysize/2, Memory());
703
- }
704
-
705
- virtual void GetIndirect (const FlatArray<int> & ind,
706
- const FlatVector<double> & v) const;
707
- virtual void GetIndirect (const FlatArray<int> & ind,
708
- const FlatVector<Complex> & v) const;
709
- };
710
-
711
- */
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
-
720
679
 
721
680
 
722
681
 
@@ -821,14 +780,20 @@ namespace ngla
821
780
  };
822
781
 
823
782
 
824
-
783
+ /*
825
784
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > >
826
785
  operator+ (const BaseVector & a, const BaseVector & b)
827
786
  {
828
787
  typedef VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > TRES;
829
788
  return TRES (a, b);
830
789
  }
790
+ */
791
+ inline auto operator+ (const BaseVector & a, const BaseVector & b)
792
+ {
793
+ return VVecExpr<VSumExpr<VVecExpr<BaseVector>,VVecExpr<BaseVector>>>{{a,b}};
794
+ }
831
795
 
796
+ /*
832
797
  template <class TA>
833
798
  inline VVecExpr<VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > >
834
799
  operator+ (const VVecExpr<TA> & a, const BaseVector & b)
@@ -836,6 +801,13 @@ namespace ngla
836
801
  typedef VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > TRES;
837
802
  return TRES (a, b);
838
803
  }
804
+ */
805
+ template <class TA>
806
+ inline auto operator+ (const VVecExpr<TA> & a, const BaseVector & b)
807
+ {
808
+ return VSumExpr<VVecExpr<TA>,VVecExpr<BaseVector>> (a,b);
809
+ }
810
+
839
811
 
840
812
  template <class TB>
841
813
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<TB> > >
@@ -747,6 +747,11 @@ namespace ngfem
747
747
  {
748
748
  Cast(fel).CalcMappedDDShape(mip, Trans(mat));
749
749
  }
750
+
751
+ static shared_ptr<CoefficientFunction>
752
+ DiffShape (shared_ptr<CoefficientFunction> proxy,
753
+ shared_ptr<CoefficientFunction> dir,
754
+ bool eulerian);
750
755
  };
751
756
 
752
757
 
@@ -933,6 +938,11 @@ namespace ngfem
933
938
  using DiffOp<DiffOpHesseBoundary<D,FEL>>::AddTransSIMDIR;
934
939
  static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & bmir,
935
940
  BareSliceMatrix<SIMD<double>> x, BareSliceVector<double> y);
941
+
942
+ static shared_ptr<CoefficientFunction>
943
+ DiffShape (shared_ptr<CoefficientFunction> proxy,
944
+ shared_ptr<CoefficientFunction> dir,
945
+ bool eulerian);
936
946
  };
937
947
 
938
948
 
@@ -1884,7 +1894,7 @@ namespace ngfem
1884
1894
 
1885
1895
 
1886
1896
  template <int DIM_SPC, VorB VB = VOL>
1887
- class DiffOpIdVectorH1 : public DiffOp<DiffOpIdVectorH1<DIM_SPC> >
1897
+ class DiffOpIdVectorH1 : public DiffOp<DiffOpIdVectorH1<DIM_SPC, VB> >
1888
1898
  {
1889
1899
  public:
1890
1900
  enum { DIM = 1 };
@@ -1949,7 +1959,7 @@ namespace ngfem
1949
1959
  }
1950
1960
  }
1951
1961
 
1952
- using DiffOp<DiffOpIdVectorH1<DIM_SPC>>::ApplySIMDIR;
1962
+ using DiffOp<DiffOpIdVectorH1<DIM_SPC, VB>>::ApplySIMDIR;
1953
1963
  static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
1954
1964
  BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
1955
1965
  {
@@ -1961,7 +1971,7 @@ namespace ngfem
1961
1971
  }
1962
1972
  }
1963
1973
 
1964
- using DiffOp<DiffOpIdVectorH1<DIM_SPC>>::AddTransSIMDIR;
1974
+ using DiffOp<DiffOpIdVectorH1<DIM_SPC, VB>>::AddTransSIMDIR;
1965
1975
  static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
1966
1976
  BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
1967
1977
  {
@@ -2703,6 +2713,7 @@ namespace ngfem
2703
2713
  extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<1,BND> >;
2704
2714
  extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<2,BND> >;
2705
2715
  extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<3,BND> >;
2716
+ extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<3,BBND> >;
2706
2717
 
2707
2718
 
2708
2719
 
@@ -10,6 +10,9 @@
10
10
 
11
11
  #include "fespace.hpp"
12
12
  #include <specialelement.hpp>
13
+ #include <sparsematrix.hpp>
14
+ #include <elementbyelement.hpp>
15
+
13
16
 
14
17
  namespace ngcomp
15
18
  {
@@ -746,40 +749,6 @@ namespace ngcomp
746
749
 
747
750
 
748
751
 
749
- template <class TM>
750
- class NGS_DLL_HEADER T_BilinearFormDiagonal : public S_BilinearForm<typename mat_traits<TM>::TSCAL>
751
- {
752
-
753
- public:
754
- typedef typename mat_traits<TM>::TSCAL TSCAL;
755
- typedef typename mat_traits<TM>::TV_COL TV_COL;
756
- typedef DiagonalMatrix<TM> TMATRIX;
757
- shared_ptr<TMATRIX> mymatrix;
758
-
759
- protected:
760
-
761
- public:
762
- T_BilinearFormDiagonal (shared_ptr<FESpace> afespace, const string & aname,
763
- const Flags & flags);
764
- virtual ~T_BilinearFormDiagonal ();
765
-
766
- virtual void AllocateMatrix () override;
767
-
768
- virtual void AddElementMatrix (FlatArray<int> dnums1,
769
- FlatArray<int> dnums2,
770
- BareSliceMatrix<TSCAL> elmat,
771
- ElementId id, bool addatomic,
772
- LocalHeap & lh) override;
773
-
774
- virtual void AddDiagElementMatrix (FlatArray<int> dnums1,
775
- FlatVector<TSCAL> diag,
776
- bool inner_element, int elnr,
777
- LocalHeap & lh) override;
778
- };
779
-
780
-
781
-
782
-
783
752
 
784
753
  class ComponentBilinearForm : public BilinearForm
785
754
  {
@@ -953,17 +922,21 @@ namespace ngcomp
953
922
  Array<ProxyFunction*> trialproxies;
954
923
 
955
924
  typedef void (*lib_function)(size_t nip, double * input, size_t dist_input,
956
- double * output, size_t dist_output);
925
+ double * output, size_t dist_output,
926
+ size_t dist, double * points, double * normals);
957
927
 
958
928
  unique_ptr<SharedLibrary> library;
959
929
  lib_function compiled_function = nullptr;
960
930
 
961
931
  size_t dimx, dimy;
962
932
  size_t nip;
933
+ Matrix<double> points;
934
+ Matrix<double> normals;
963
935
 
964
936
  public:
965
937
  ApplyIntegrationPoints (Array<shared_ptr<CoefficientFunction>> acoefs,
966
938
  const Array<ProxyFunction*> & atrialproxies,
939
+ Matrix<double> apoints, Matrix<double> anormals,
967
940
  size_t adimx, size_t adimy, size_t anip);
968
941
 
969
942
  AutoVector CreateColVector() const override;
@@ -983,30 +956,6 @@ namespace ngcomp
983
956
 
984
957
 
985
958
 
986
-
987
- /**
988
- This bilinearform stores the element-matrices
989
- */
990
- template<class SCAL>
991
- class ElementByElement_BilinearForm : public S_BilinearForm<SCAL>
992
- {
993
- public:
994
- ElementByElement_BilinearForm (shared_ptr<FESpace> afespace,
995
- const string & aname,
996
- const Flags & flags);
997
- virtual ~ElementByElement_BilinearForm () override;
998
-
999
- virtual void AllocateMatrix () override;
1000
- // virtual AutoVector CreateRowVector() const override;
1001
- // virtual AutoVector CreateColVector() const override;
1002
-
1003
- virtual void AddElementMatrix (FlatArray<int> dnums1,
1004
- FlatArray<int> dnums2,
1005
- BareSliceMatrix<SCAL> elmat,
1006
- ElementId id, bool addatomic,
1007
- LocalHeap & lh) override;
1008
- };
1009
-
1010
959
 
1011
960
 
1012
961
  }
@@ -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
 
@@ -172,6 +175,7 @@ namespace ngla
172
175
  return { MemoryUsage ("BlockJac", nels*sizeof(TM), blocktable->Size()) };
173
176
  }
174
177
 
178
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
175
179
  const Array<FlatMatrix<TM>> & GetInverses() const { return invdiag; }
176
180
  const Array<TM> & MatrixData() const { return bigmem; }
177
181
  };
netgen/include/cg.hpp CHANGED
@@ -8,6 +8,9 @@
8
8
  /* Date: 5. Jul. 96 */
9
9
  /**************************************************************************/
10
10
 
11
+
12
+ #include "basematrix.hpp"
13
+
11
14
  namespace ngla
12
15
  {
13
16
 
@@ -7,6 +7,9 @@
7
7
  /* Date: 30. Jun. 01 */
8
8
  /**************************************************************************/
9
9
 
10
+
11
+ #include "basematrix.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
@@ -291,7 +291,9 @@ namespace ngfem
291
291
  virtual shared_ptr<CoefficientFunction>
292
292
  DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const;
293
293
 
294
-
294
+
295
+ // returns primary operator
296
+ virtual shared_ptr<CoefficientFunction> Primary () const;
295
297
  virtual shared_ptr<CoefficientFunction> Operator (const string & name) const;
296
298
  virtual shared_ptr<CoefficientFunction> Operator (shared_ptr<class DifferentialOperator> diffop) const;
297
299
 
@@ -1186,6 +1188,7 @@ public:
1186
1188
  if(transformation.replace.count(thisptr))
1187
1189
  return transformation.replace[thisptr];
1188
1190
  auto newcf = make_shared<cl_UnaryOpCF>(c1->Transform(transformation), lam, name);
1191
+ newcf->SetDimensions(BASE::Dimensions());
1189
1192
  transformation.cache[thisptr] = newcf;
1190
1193
  return newcf;
1191
1194
  }
@@ -1782,7 +1785,8 @@ INLINE shared_ptr<CoefficientFunction> BinaryOpCF(shared_ptr<CoefficientFunction
1782
1785
 
1783
1786
 
1784
1787
  NGS_DLL_HEADER shared_ptr<CoefficientFunction>
1785
- MakeDomainWiseCoefficientFunction (Array<shared_ptr<CoefficientFunction>> aci);
1788
+ MakeDomainWiseCoefficientFunction (Array<shared_ptr<CoefficientFunction>> aci,
1789
+ optional<VorB> vb=nullopt);
1786
1790
 
1787
1791
 
1788
1792
 
netgen/include/comp.hpp CHANGED
@@ -39,10 +39,6 @@ namespace ngmg
39
39
 
40
40
 
41
41
  #include <parallelngs.hpp>
42
- namespace ngcomp
43
- {
44
- using namespace ngparallel;
45
- }
46
42
 
47
43
 
48
44
  // #include "pmltrafo.hpp"