ngsolve 6.2.2406.post36.dev1__cp39-cp39-win_amd64.whl → 6.2.2406.post111.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 (85) hide show
  1. netgen/include/arnoldi.hpp +3 -0
  2. netgen/include/basematrix.hpp +9 -18
  3. netgen/include/basevector.hpp +43 -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 +11 -13
  14. netgen/include/h1amg.hpp +3 -1
  15. netgen/include/hcurlhdivfes.hpp +2 -0
  16. netgen/include/hcurlhofespace.hpp +4 -3
  17. netgen/include/hdivfes.hpp +3 -3
  18. netgen/include/hdivhosurfacefespace.hpp +3 -3
  19. netgen/include/intrule.hpp +15 -1
  20. netgen/include/jacobi.hpp +3 -0
  21. netgen/include/la.hpp +1 -13
  22. netgen/include/matrix.hpp +21 -0
  23. netgen/include/meshaccess.hpp +15 -45
  24. netgen/include/mgpre.hpp +1 -1
  25. netgen/include/multivector.hpp +2 -0
  26. netgen/include/ngsobject.hpp +1 -1
  27. netgen/include/normalfacetfespace.hpp +4 -5
  28. netgen/include/order.hpp +3 -1
  29. netgen/include/parallel_matrices.hpp +5 -0
  30. netgen/include/paralleldofs.hpp +13 -51
  31. netgen/include/parallelngs.hpp +2 -1
  32. netgen/include/parallelvector.hpp +5 -2
  33. netgen/include/pardisoinverse.hpp +1 -0
  34. netgen/include/periodic.hpp +1 -0
  35. netgen/include/preconditioner.hpp +3 -1
  36. netgen/include/sparsecholesky.hpp +4 -0
  37. netgen/include/sparsematrix.hpp +8 -41
  38. netgen/include/sparsematrix_dyn.hpp +2 -0
  39. netgen/include/sparsematrix_impl.hpp +66 -1
  40. netgen/include/special_matrix.hpp +3 -138
  41. netgen/include/tpintrule.hpp +2 -0
  42. netgen/include/umfpackinverse.hpp +1 -1
  43. netgen/include/vector.hpp +6 -1
  44. netgen/include/vvector.hpp +10 -1
  45. netgen/lib/libngsolve.lib +0 -0
  46. netgen/libngsolve.dll +0 -0
  47. ngsolve/cmake/NGSolveConfig.cmake +1 -1
  48. ngsolve/config/config.py +5 -5
  49. ngsolve/config.py +5 -5
  50. ngsolve/demos/intro/poisson.py +1 -1
  51. ngsolve/ngslib.pyd +0 -0
  52. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/METADATA +2 -2
  53. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/RECORD +85 -84
  54. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
  55. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.geo +0 -0
  56. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.vol +0 -0
  57. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
  58. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.vol +0 -0
  59. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.geo +0 -0
  60. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.vol +0 -0
  61. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
  62. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
  63. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.geo +0 -0
  64. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.vol +0 -0
  65. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
  66. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
  67. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
  68. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
  69. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
  70. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
  71. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
  72. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
  73. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
  74. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
  75. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
  76. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
  77. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
  78. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  79. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
  80. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
  81. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.in2d +0 -0
  82. {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.vol +0 -0
  83. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/LICENSE +0 -0
  84. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/WHEEL +0 -0
  85. {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post111.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,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> > >
@@ -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;
@@ -924,7 +922,7 @@ ANY 1 1 1 1 | 15
924
922
  class NGS_DLL_HEADER NonconformingFESpace : public FESpace
925
923
  {
926
924
  ///
927
- Array<int> ndlevel;
925
+ // Array<int> ndlevel;
928
926
 
929
927
  public:
930
928
  NonconformingFESpace (shared_ptr<MeshAccess> ama, const Flags & flags, bool parseflags=false);
@@ -938,7 +936,7 @@ ANY 1 1 1 1 | 15
938
936
 
939
937
  virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
940
938
  ///
941
- virtual size_t GetNDof () const throw() override;
939
+ // virtual size_t GetNDof () const throw() override;
942
940
  ///
943
941
  virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
944
942
  };
@@ -949,7 +947,7 @@ ANY 1 1 1 1 | 15
949
947
  class NGS_DLL_HEADER NonconformingSurfaceFESpace : public FESpace
950
948
  {
951
949
  ///
952
- Array<int> ndlevel;
950
+ // Array<int> ndlevel;
953
951
 
954
952
  public:
955
953
  NonconformingSurfaceFESpace (shared_ptr<MeshAccess> ama, const Flags & flags, bool parseflags=false);
@@ -963,7 +961,7 @@ ANY 1 1 1 1 | 15
963
961
 
964
962
  virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
965
963
  ///
966
- virtual size_t GetNDof () const throw() override;
964
+ // virtual size_t GetNDof () const throw() override;
967
965
  ///
968
966
  virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
969
967
  };
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
  {