ngsolve 6.2.2406__cp312-cp312-win_amd64.whl → 6.2.2406.post111.dev1__cp312-cp312-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.
- 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 +4 -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/dump.hpp +5 -5
- netgen/include/eigen.hpp +3 -0
- netgen/include/elementbyelement.hpp +4 -0
- netgen/include/elementtopology.hpp +0 -3
- netgen/include/expr.hpp +2 -0
- netgen/include/fespace.hpp +12 -14
- netgen/include/finiteelement.hpp +7 -7
- netgen/include/h1amg.hpp +3 -1
- 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 +21 -51
- netgen/include/mgpre.hpp +1 -1
- netgen/include/mptools.hpp +1 -2
- netgen/include/multivector.hpp +2 -0
- netgen/include/ngsobject.hpp +1 -1
- netgen/include/nodalhofe.hpp +3 -0
- netgen/include/normalfacetfespace.hpp +4 -5
- netgen/include/order.hpp +3 -1
- netgen/include/parallel_matrices.hpp +5 -0
- netgen/include/paralleldofs.hpp +44 -95
- netgen/include/parallelngs.hpp +2 -1
- netgen/include/parallelvector.hpp +12 -16
- netgen/include/pardisoinverse.hpp +1 -0
- netgen/include/periodic.hpp +1 -0
- netgen/include/pmltrafo.hpp +5 -2
- netgen/include/preconditioner.hpp +3 -1
- netgen/include/scalarfe.hpp +4 -1
- netgen/include/sparsecholesky.hpp +4 -0
- netgen/include/sparsematrix.hpp +8 -41
- netgen/include/sparsematrix_dyn.hpp +2 -0
- netgen/include/sparsematrix_impl.hpp +66 -1
- netgen/include/special_matrix.hpp +3 -138
- netgen/include/tpdiffop.hpp +1 -0
- 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/lib/libngsolve.lib +0 -0
- netgen/libngsolve.dll +0 -0
- ngsolve/cmake/NGSolveConfig.cmake +1 -1
- ngsolve/config/config.py +5 -5
- ngsolve/config.py +5 -5
- ngsolve/demos/intro/poisson.py +1 -1
- ngsolve/demos/mpi/mpi_navierstokes.py +2 -0
- ngsolve/demos/mpi/mpi_timeDG.py +3 -0
- ngsolve/ngslib.pyd +0 -0
- ngsolve-6.2.2406.post111.dev1.dist-info/METADATA +13 -0
- {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/RECORD +95 -94
- ngsolve-6.2.2406.dist-info/METADATA +0 -9
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.geo +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/beam.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/chip.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.geo +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coil.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.geo +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/cube.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.in2d +0 -0
- {ngsolve-6.2.2406.data → ngsolve-6.2.2406.post111.dev1.data}/data/share/ngsolve/square.vol +0 -0
- {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/LICENSE +0 -0
- {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.dev1.dist-info}/WHEEL +0 -0
- {ngsolve-6.2.2406.dist-info → ngsolve-6.2.2406.post111.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
|
@@ -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
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/dump.hpp
CHANGED
|
@@ -248,7 +248,7 @@ namespace ngstd
|
|
|
248
248
|
|
|
249
249
|
template<typename DT, NODE_TYPE NT>
|
|
250
250
|
void packaged_buffered_send(int rank, int np, DT* a, typename key_trait<NT>::TKEY* b, int n, int pkg_size, int p,
|
|
251
|
-
|
|
251
|
+
NgMPI_Requests & requests)
|
|
252
252
|
{
|
|
253
253
|
// NG_MPI_Datatype mpi_type_array = MPIT<DT>::mpi_type;
|
|
254
254
|
NG_MPI_Datatype mpi_type_array = GetMPIType<DT>();
|
|
@@ -800,7 +800,7 @@ namespace ngstd
|
|
|
800
800
|
|
|
801
801
|
if(rank == 0)
|
|
802
802
|
{
|
|
803
|
-
|
|
803
|
+
NgMPI_Requests requests;
|
|
804
804
|
//packaged_send
|
|
805
805
|
packaged_buffered_send<DT,NT>(rank, np, array, array_keys, base_array_size, pkg_size, 1, requests);
|
|
806
806
|
|
|
@@ -836,7 +836,7 @@ namespace ngstd
|
|
|
836
836
|
|
|
837
837
|
for(int j=0;(n_pkg-1)*pkg_size+j < n;j++)
|
|
838
838
|
f(end_keys[j], end[j]);
|
|
839
|
-
|
|
839
|
+
requests.WaitAll();
|
|
840
840
|
// free(end);
|
|
841
841
|
// free(end_keys);
|
|
842
842
|
}
|
|
@@ -853,10 +853,10 @@ namespace ngstd
|
|
|
853
853
|
else //regular
|
|
854
854
|
{
|
|
855
855
|
//cout << "rank " << rank << " sends to " << rank+1 << " then gets from " << p_in1 << "/" << p_in2 << " and sends to " << p_out << endl;
|
|
856
|
-
|
|
856
|
+
NgMPI_Requests requests;
|
|
857
857
|
packaged_buffered_send<DT,NT>(rank, np, array, array_keys, base_array_size, pkg_size, rank+1, requests);
|
|
858
858
|
merge_in_in_out<DT,NT>(pkg_size, rank, np, p_in1, p_in2, p_out);
|
|
859
|
-
|
|
859
|
+
requests.WaitAll();
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
else
|
netgen/include/eigen.hpp
CHANGED
netgen/include/expr.hpp
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <core/localheap.hpp>
|
|
12
12
|
#include <core/exception.hpp>
|
|
13
13
|
|
|
14
|
+
#include <cstddef>
|
|
14
15
|
#include <ngs_stdcpp_include.hpp> // for INLINE
|
|
15
16
|
#include "complex_wrapper.hpp"
|
|
16
17
|
|
|
@@ -265,6 +266,7 @@ namespace ngbla
|
|
|
265
266
|
explicit constexpr undefined_size(IC<S> s) : size(s) { }
|
|
266
267
|
explicit constexpr operator size_t() const { return size; }
|
|
267
268
|
explicit constexpr operator int() const { return size; }
|
|
269
|
+
explicit constexpr operator ptrdiff_t() const { return size; }
|
|
268
270
|
};
|
|
269
271
|
|
|
270
272
|
|