ngsolve 6.2.2406.post36.dev1__cp313-cp313-win_amd64.whl → 6.2.2406.post57.dev1__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ngsolve might be problematic. Click here for more details.

Files changed (78) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +9 -18
  3. netgen/include/basevector.hpp +34 -71
  4. netgen/include/bilinearform.hpp +8 -59
  5. netgen/include/blockjacobi.hpp +3 -0
  6. netgen/include/cg.hpp +3 -0
  7. netgen/include/chebyshev.hpp +3 -0
  8. netgen/include/comp.hpp +0 -4
  9. netgen/include/diagonalmatrix.hpp +154 -0
  10. netgen/include/eigen.hpp +3 -0
  11. netgen/include/elementbyelement.hpp +4 -0
  12. netgen/include/elementtopology.hpp +0 -3
  13. netgen/include/fespace.hpp +7 -9
  14. netgen/include/h1amg.hpp +3 -1
  15. netgen/include/hcurlhdivfes.hpp +2 -0
  16. netgen/include/hcurlhofespace.hpp +2 -1
  17. netgen/include/intrule.hpp +15 -1
  18. netgen/include/jacobi.hpp +3 -0
  19. netgen/include/la.hpp +1 -13
  20. netgen/include/meshaccess.hpp +0 -3
  21. netgen/include/mgpre.hpp +1 -1
  22. netgen/include/multivector.hpp +2 -0
  23. netgen/include/ngsobject.hpp +1 -1
  24. netgen/include/order.hpp +3 -1
  25. netgen/include/parallel_matrices.hpp +5 -0
  26. netgen/include/paralleldofs.hpp +13 -51
  27. netgen/include/parallelngs.hpp +2 -1
  28. netgen/include/parallelvector.hpp +5 -2
  29. netgen/include/pardisoinverse.hpp +1 -0
  30. netgen/include/preconditioner.hpp +3 -1
  31. netgen/include/sparsecholesky.hpp +4 -0
  32. netgen/include/sparsematrix.hpp +8 -41
  33. netgen/include/sparsematrix_dyn.hpp +2 -0
  34. netgen/include/sparsematrix_impl.hpp +66 -1
  35. netgen/include/special_matrix.hpp +3 -138
  36. netgen/include/tpintrule.hpp +2 -0
  37. netgen/include/umfpackinverse.hpp +1 -1
  38. netgen/include/vvector.hpp +10 -1
  39. netgen/lib/libngsolve.lib +0 -0
  40. netgen/libngsolve.dll +0 -0
  41. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  42. ngsolve/config/config.py +5 -5
  43. ngsolve/config.py +5 -5
  44. ngsolve/ngslib.pyd +0 -0
  45. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/METADATA +2 -2
  46. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/RECORD +78 -77
  47. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
  48. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  49. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  50. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  51. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  52. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  53. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  54. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  55. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  56. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  57. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  58. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  59. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  60. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  61. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  62. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  63. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  64. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  65. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  66. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  67. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  68. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  69. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  70. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  71. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  72. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  73. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  74. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  75. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post57.dev1.data}/data/share/ngsolve/square.vol +0 -0
  76. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/LICENSE +0 -0
  77. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/WHEEL +0 -0
  78. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post57.dev1.dist-info}/top_level.txt +0 -0
@@ -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,10 +8,15 @@
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);
@@ -268,14 +273,6 @@ namespace ngla
268
273
  void AssignTo (TS s, BaseVector & v) const
269
274
  {
270
275
  CheckSize (v);
271
- /*
272
- if (m.Height() != v.Size() || m.Width() != x.Size())
273
- throw Exception (ToString ("matrix-vector: size does not fit\n") +
274
- "matrix-type = " + typeid(m).name() +
275
- "Matrix: " + ToString(m.Height()) + " x " + ToString(m.Width()) + "\n"
276
- "Vector in : " + ToString(x.Size()) + "\n"
277
- "Vector res: " + ToString(v.Size()));
278
- */
279
276
  m.Mult (x, v);
280
277
  v *= s;
281
278
  }
@@ -284,10 +281,6 @@ namespace ngla
284
281
  void AddTo (TS s, BaseVector & v) const
285
282
  {
286
283
  CheckSize (v);
287
- /*
288
- if (m.Height() != v.Size() || m.Width() != x.Size())
289
- throw Exception ("matrix-vector MultAdd: size does not fit");
290
- */
291
284
  m.MultAdd (s, x, v);
292
285
  }
293
286
 
@@ -849,7 +842,6 @@ namespace ngla
849
842
  {
850
843
  bool has_format;
851
844
  size_t size;
852
- // bool is_complex;
853
845
  public:
854
846
  ///
855
847
  IdentityMatrix ()
@@ -857,7 +849,6 @@ namespace ngla
857
849
  IdentityMatrix (size_t asize, bool ais_complex)
858
850
  : has_format(true), size(asize) { is_complex=ais_complex; }
859
851
 
860
- // virtual bool IsComplex() const override { return is_complex; }
861
852
  virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
862
853
 
863
854
  ///
@@ -928,7 +919,7 @@ namespace ngla
928
919
  };
929
920
 
930
921
 
931
- /* *********************** operator<< ********************** */
922
+ /* *********************** operators ********************** */
932
923
 
933
924
  // default is ProductMatrix, but optimizations for
934
925
  // ParallelMatrices
@@ -954,8 +945,8 @@ namespace ngla
954
945
 
955
946
 
956
947
  shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat);
948
+
957
949
 
958
- /// output operator for matrices
959
950
  inline ostream & operator<< (ostream & ost, const BaseMatrix & m)
960
951
  {
961
952
  return m.Print(ost);
@@ -7,13 +7,32 @@
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
+ shared_ptr<ParallelDofs> GetParallelDofs() const { return pardofs; }
32
+ };
33
+
34
+
35
+
17
36
 
18
37
  template <class SCAL> class S_BaseVector;
19
38
 
@@ -91,9 +110,6 @@ namespace ngla
91
110
  size_t size;
92
111
  /// number of doubles per entry
93
112
  int entrysize = 1;
94
- ///
95
- // shared_ptr<ParallelDofs> paralleldofs;
96
-
97
113
  ///
98
114
  BaseVector () { ; }
99
115
 
@@ -651,72 +667,6 @@ namespace ngla
651
667
  extern template class S_BaseVector<Complex>;
652
668
  #endif
653
669
 
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
670
 
721
671
 
722
672
 
@@ -821,14 +771,20 @@ namespace ngla
821
771
  };
822
772
 
823
773
 
824
-
774
+ /*
825
775
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > >
826
776
  operator+ (const BaseVector & a, const BaseVector & b)
827
777
  {
828
778
  typedef VSumExpr<VVecExpr<BaseVector>, VVecExpr<BaseVector> > TRES;
829
779
  return TRES (a, b);
830
780
  }
781
+ */
782
+ inline auto operator+ (const BaseVector & a, const BaseVector & b)
783
+ {
784
+ return VVecExpr<VSumExpr<VVecExpr<BaseVector>,VVecExpr<BaseVector>>>{{a,b}};
785
+ }
831
786
 
787
+ /*
832
788
  template <class TA>
833
789
  inline VVecExpr<VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > >
834
790
  operator+ (const VVecExpr<TA> & a, const BaseVector & b)
@@ -836,6 +792,13 @@ namespace ngla
836
792
  typedef VSumExpr<VVecExpr<TA>, VVecExpr<BaseVector> > TRES;
837
793
  return TRES (a, b);
838
794
  }
795
+ */
796
+ template <class TA>
797
+ inline auto operator+ (const VVecExpr<TA> & a, const BaseVector & b)
798
+ {
799
+ return VSumExpr<VVecExpr<TA>,VVecExpr<BaseVector>> (a,b);
800
+ }
801
+
839
802
 
840
803
  template <class TB>
841
804
  inline VVecExpr<VSumExpr<VVecExpr<BaseVector>, VVecExpr<TB> > >
@@ -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
 
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
 
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"
@@ -0,0 +1,154 @@
1
+ #ifndef FILE_NGS_DIAGONALMATRIX
2
+ #define FILE_NGS_DIAGONALMATRIX
3
+
4
+
5
+
6
+ #include "basematrix.hpp"
7
+ #include "vvector.hpp"
8
+
9
+
10
+ namespace ngla
11
+ {
12
+
13
+ class NGS_DLL_HEADER Projector : public BaseMatrix
14
+ {
15
+ shared_ptr<BitArray> bits;
16
+ bool keep_values;
17
+ public:
18
+ // projector on true / false bits
19
+ Projector (shared_ptr<BitArray> abits, bool akeep_values = true)
20
+ : bits(abits), keep_values(akeep_values) { ; }
21
+
22
+ virtual bool IsComplex() const override { return false; }
23
+
24
+ virtual int VHeight() const override { return bits->Size(); }
25
+ virtual int VWidth() const override { return bits->Size(); }
26
+
27
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override;
28
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override;
29
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
30
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
31
+ virtual void Project (BaseVector & x) const;
32
+ virtual void SetValues (BaseVector & x, double val) const;
33
+
34
+ bool KeepValues() const { return keep_values; }
35
+ shared_ptr<BitArray> Mask() const { return bits; }
36
+
37
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
38
+
39
+ AutoVector CreateRowVector() const override
40
+ { throw Exception("CreateRowVector not implemented for Projector!"); }
41
+ AutoVector CreateColVector() const override
42
+ { throw Exception("CreateColVector not implemented for Projector!"); }
43
+
44
+ AutoVector Evaluate(BaseVector & v) const override
45
+ {
46
+ auto res = v.CreateVector();
47
+ Mult (v, res);
48
+ return res;
49
+ }
50
+
51
+ };
52
+
53
+
54
+ template <typename TM=double>
55
+ class NGS_DLL_HEADER DiagonalMatrix : public BaseMatrix
56
+ {
57
+ shared_ptr<VVector<TM>> diag;
58
+ public:
59
+ // typedef typename mat_traits<TM>::TV_ROW TV_ROW;
60
+ // typedef typename mat_traits<TM>::TV_COL TV_COL;
61
+ typedef typename mat_traits<TM>::TSCAL TSCAL;
62
+
63
+ DiagonalMatrix(size_t h)
64
+ : diag(make_shared<VVector<TM>>(h)) { }
65
+ DiagonalMatrix(const VVector<TM> & diag_);
66
+ DiagonalMatrix(shared_ptr<VVector<TM>> diag_);
67
+ virtual ~DiagonalMatrix();
68
+
69
+ bool IsComplex() const override { return false; }
70
+ TM & operator() (size_t i) { return (*diag)(i); }
71
+ const TM & operator() (size_t i) const { return (*diag)(i); }
72
+ int VHeight() const override { return diag->Size(); }
73
+ int VWidth() const override { return diag->Size(); }
74
+
75
+ BaseVector & AsVector() override { return *diag; }
76
+ const BaseVector & AsVector() const override { return *diag; }
77
+ ostream & Print (ostream & ost) const override;
78
+
79
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
80
+
81
+ AutoVector CreateRowVector () const override;
82
+ AutoVector CreateColVector () const override;
83
+
84
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
85
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
86
+
87
+ shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
88
+ };
89
+
90
+
91
+ template <typename TM=double>
92
+ class BlockDiagonalMatrix : public BaseMatrix
93
+ {
94
+ Tensor<3,TM> blockdiag;
95
+ int blocks, dimy, dimx;
96
+ public:
97
+ // typedef double TSCAL;
98
+
99
+ BlockDiagonalMatrix(Tensor<3,TM> _blockdiag);
100
+ bool IsComplex() const override { return ngbla::IsComplex<TM>(); }
101
+
102
+ int VHeight() const override { return blocks*dimy; }
103
+ int VWidth() const override { return blocks*dimx; }
104
+
105
+ ostream & Print (ostream & ost) const override;
106
+
107
+ AutoVector CreateRowVector () const override;
108
+ AutoVector CreateColVector () const override;
109
+
110
+ void Mult (const BaseVector & x, BaseVector & y) const override;
111
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
112
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
113
+
114
+ shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
115
+ };
116
+
117
+ // blocks is inner-most dimension of tensor and vectors
118
+ class BlockDiagonalMatrixSoA : public BaseMatrix
119
+ {
120
+ Tensor<3> blockdiag;
121
+ int blocks, dimy, dimx;
122
+ Matrix<bool> nonzero;
123
+ Table<int> sparse, sparseT; // sparse non-zero pattern
124
+ public:
125
+ typedef double TSCAL;
126
+
127
+ BlockDiagonalMatrixSoA(Tensor<3> _blockdiag);
128
+ bool IsComplex() const override { return false; }
129
+
130
+ int VHeight() const override { return blocks*dimy; }
131
+ int VWidth() const override { return blocks*dimx; }
132
+
133
+ ostream & Print (ostream & ost) const override;
134
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
135
+
136
+ AutoVector CreateRowVector () const override;
137
+ AutoVector CreateColVector () const override;
138
+
139
+ void Mult (const BaseVector & x, BaseVector & y) const override;
140
+ void MultAdd (double s, const BaseVector & x, BaseVector & y) const override;
141
+ void MultTrans (const BaseVector & x, BaseVector & y) const override;
142
+ void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override;
143
+ // shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const override;
144
+
145
+ FlatTensor<3> GetBlockDiag () const { return blockdiag; }
146
+ FlatMatrix<bool> GetNonZeroPattern() const { return nonzero; }
147
+ };
148
+
149
+ }
150
+
151
+
152
+
153
+ #endif
154
+
netgen/include/eigen.hpp CHANGED
@@ -7,6 +7,9 @@
7
7
  /* Date: 5. Jul. 96 */
8
8
  /**************************************************************************/
9
9
 
10
+
11
+ #include "basematrix.hpp"
12
+
10
13
  namespace ngla
11
14
  {
12
15
 
@@ -11,6 +11,10 @@
11
11
  Element by element matrix
12
12
  */
13
13
 
14
+
15
+ #include "basematrix.hpp"
16
+ #include "blockjacobi.hpp"
17
+
14
18
  namespace ngla
15
19
  {
16
20
 
@@ -14,9 +14,6 @@
14
14
  namespace ngfem
15
15
  {
16
16
  using namespace ngbla;
17
- // using ngcore::INT;
18
-
19
-
20
17
 
21
18
  /*
22
19
  Toplogy of reference elements
@@ -12,7 +12,12 @@
12
12
  #include <finiteelement.hpp>
13
13
  #include <diffop.hpp>
14
14
  #include <symbolicintegrator.hpp> // for ProxyFunction
15
- #include <la.hpp>
15
+
16
+ #include <basevector.hpp>
17
+ #include <basematrix.hpp>
18
+
19
+ // #include <paralleldofs.hpp>
20
+
16
21
 
17
22
  #include "ngsobject.hpp"
18
23
 
@@ -283,14 +288,7 @@ ANY 1 1 1 1 | 15
283
288
  order_policy = op;
284
289
  }
285
290
 
286
- virtual void SetOrder (ELEMENT_TYPE et, TORDER order)
287
- {
288
- if (order_policy == CONSTANT_ORDER || order_policy == OLDSTYLE_ORDER)
289
- order_policy = NODE_TYPE_ORDER;
290
- et_bonus_order[et] = order - this->order;
291
-
292
- timestamp = 0; // rerun first_update
293
- }
291
+ virtual void SetOrder (ELEMENT_TYPE et, TORDER order);
294
292
 
295
293
  virtual void SetOrder (NodeId ni, int order);
296
294
  virtual int GetOrder (NodeId ni) const;
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
  };