ngsolve 6.2.2406.post36.dev1__cp39-cp39-macosx_10_15_universal2.whl → 6.2.2406.post134.dev1__cp39-cp39-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.
- netgen/include/arnoldi.hpp +3 -0
- netgen/include/basematrix.hpp +9 -18
- netgen/include/basevector.hpp +43 -71
- netgen/include/bilinearform.hpp +8 -59
- netgen/include/blockjacobi.hpp +3 -0
- netgen/include/cg.hpp +3 -0
- netgen/include/chebyshev.hpp +3 -0
- netgen/include/comp.hpp +0 -4
- netgen/include/diagonalmatrix.hpp +154 -0
- netgen/include/eigen.hpp +3 -0
- netgen/include/elementbyelement.hpp +6 -0
- netgen/include/elementtopology.hpp +0 -3
- netgen/include/fespace.hpp +11 -13
- netgen/include/h1amg.hpp +3 -1
- netgen/include/hcurlcurlfespace.hpp +78 -0
- netgen/include/hcurlhdivfes.hpp +2 -0
- netgen/include/hcurlhofespace.hpp +4 -3
- netgen/include/hdivfes.hpp +3 -3
- netgen/include/hdivhosurfacefespace.hpp +3 -3
- netgen/include/intrule.hpp +15 -1
- netgen/include/jacobi.hpp +3 -0
- netgen/include/la.hpp +1 -13
- netgen/include/matrix.hpp +21 -0
- netgen/include/meshaccess.hpp +15 -45
- netgen/include/mgpre.hpp +1 -1
- netgen/include/mptools.hpp +1 -1
- netgen/include/multivector.hpp +2 -0
- netgen/include/ngsobject.hpp +1 -1
- netgen/include/normalfacetfespace.hpp +4 -5
- netgen/include/order.hpp +3 -1
- netgen/include/parallel_matrices.hpp +5 -0
- netgen/include/paralleldofs.hpp +13 -51
- netgen/include/parallelngs.hpp +2 -1
- netgen/include/parallelvector.hpp +5 -2
- netgen/include/pardisoinverse.hpp +1 -0
- netgen/include/periodic.hpp +1 -0
- netgen/include/preconditioner.hpp +3 -1
- netgen/include/sparsecholesky.hpp +4 -0
- netgen/include/sparsematrix.hpp +11 -41
- netgen/include/sparsematrix_dyn.hpp +2 -0
- netgen/include/sparsematrix_impl.hpp +66 -1
- netgen/include/special_matrix.hpp +7 -138
- netgen/include/tpintrule.hpp +2 -0
- netgen/include/umfpackinverse.hpp +1 -1
- netgen/include/vector.hpp +6 -1
- netgen/include/vvector.hpp +10 -1
- netgen/libngbla.dylib +0 -0
- netgen/libngcomp.dylib +0 -0
- netgen/libngfem.dylib +0 -0
- netgen/libngla.dylib +0 -0
- netgen/libngsolve.dylib +0 -0
- netgen/libngstd.dylib +0 -0
- ngsolve/cmake/NGSolveConfig.cmake +2 -2
- ngsolve/config/config.py +5 -5
- ngsolve/config.py +5 -5
- ngsolve/demos/intro/poisson.py +1 -1
- ngsolve/ngslib.so +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/bin/ngscxx +2 -2
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/bin/ngsld +1 -1
- {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post134.dev1.dist-info}/METADATA +2 -2
- {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post134.dev1.dist-info}/RECORD +95 -93
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/Netgen.icns +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/bin/ngsolve.tcl +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/bin/ngspy +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/beam.geo +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/beam.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/chip.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/coil.geo +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/coil.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/cube.geo +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/cube.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/square.in2d +0 -0
- {ngsolve-6.2.2406.post36.dev1.data → ngsolve-6.2.2406.post134.dev1.data}/data/share/ngsolve/square.vol +0 -0
- {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post134.dev1.dist-info}/LICENSE +0 -0
- {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post134.dev1.dist-info}/WHEEL +0 -0
- {ngsolve-6.2.2406.post36.dev1.dist-info → ngsolve-6.2.2406.post134.dev1.dist-info}/top_level.txt +0 -0
netgen/include/arnoldi.hpp
CHANGED
netgen/include/basematrix.hpp
CHANGED
|
@@ -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
|
-
/* ***********************
|
|
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);
|
netgen/include/basevector.hpp
CHANGED
|
@@ -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> > >
|
netgen/include/bilinearform.hpp
CHANGED
|
@@ -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
|
}
|
netgen/include/blockjacobi.hpp
CHANGED
netgen/include/cg.hpp
CHANGED
netgen/include/chebyshev.hpp
CHANGED
netgen/include/comp.hpp
CHANGED
|
@@ -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
|
@@ -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
|
|
|
@@ -145,6 +149,8 @@ namespace ngla
|
|
|
145
149
|
|
|
146
150
|
virtual AutoVector CreateRowVector () const override;
|
|
147
151
|
virtual AutoVector CreateColVector () const override;
|
|
152
|
+
|
|
153
|
+
virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
|
|
148
154
|
|
|
149
155
|
FlatMatrix<SCAL> GetMatrix() const { return matrix; }
|
|
150
156
|
FlatTable<int> GetRowDNums() const { return row_dnums; }
|
netgen/include/fespace.hpp
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
#include <finiteelement.hpp>
|
|
13
13
|
#include <diffop.hpp>
|
|
14
14
|
#include <symbolicintegrator.hpp> // for ProxyFunction
|
|
15
|
-
|
|
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
|
};
|