ngsolve 6.2.2404.post109.dev0__cp39-cp39-win_amd64.whl → 6.2.2406.post112.dev1__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ngsolve might be problematic. Click here for more details.
- netgen/include/arnoldi.hpp +3 -0
- netgen/include/basematrix.hpp +30 -19
- netgen/include/basevector.hpp +43 -71
- netgen/include/bdbequations.hpp +14 -3
- 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/coefficient.hpp +6 -2
- 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 +6 -0
- netgen/include/elementtopology.hpp +0 -3
- netgen/include/expr.hpp +13 -8
- netgen/include/fespace.hpp +12 -14
- netgen/include/finiteelement.hpp +7 -7
- netgen/include/globalspace.hpp +28 -2
- netgen/include/gridfunction.hpp +4 -0
- netgen/include/h1amg.hpp +3 -1
- netgen/include/h1hofe.hpp +1 -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/integratorcf.hpp +14 -9
- 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 +30 -51
- netgen/include/mgpre.hpp +1 -1
- netgen/include/mptools.hpp +2145 -0
- 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/normalfacetsurfacefespace.hpp +1 -1
- 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/shapefunction_utils.hpp +40 -1
- netgen/include/sparsecholesky.hpp +4 -0
- netgen/include/sparsematrix.hpp +25 -43
- netgen/include/sparsematrix_dyn.hpp +2 -0
- netgen/include/sparsematrix_impl.hpp +66 -1
- netgen/include/special_matrix.hpp +7 -134
- netgen/include/statushandler.hpp +7 -0
- netgen/include/symbolicintegrator.hpp +2 -1
- netgen/include/tensorcoefficient.hpp +56 -54
- netgen/include/tpdiffop.hpp +1 -0
- netgen/include/tpintrule.hpp +2 -0
- netgen/include/umfpackinverse.hpp +58 -30
- netgen/include/vector.hpp +8 -2
- netgen/include/voxelcoefficientfunction.hpp +2 -0
- netgen/include/vvector.hpp +10 -1
- netgen/lib/libngsolve.lib +0 -0
- netgen/libngsolve.dll +0 -0
- ngsolve/_scikit_build_core_dependencies.py +8 -1
- ngsolve/cmake/NGSolveConfig.cmake +5 -5
- ngsolve/config/config.py +6 -6
- ngsolve/config.py +6 -6
- ngsolve/demos/TensorProduct/__init__.py +0 -0
- ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
- ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
- ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
- ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
- ngsolve/demos/__init__.py +0 -0
- ngsolve/demos/howto/__init__.py +0 -0
- ngsolve/demos/howto/hhj.py +44 -0
- ngsolve/demos/howto/hybrid_dg.py +53 -0
- ngsolve/demos/howto/mixed.py +30 -0
- ngsolve/demos/howto/nonlin.py +29 -0
- ngsolve/demos/howto/pickling.py +26 -0
- ngsolve/demos/howto/pml.py +31 -0
- ngsolve/demos/howto/taskmanager.py +20 -0
- ngsolve/demos/howto/tdnns.py +47 -0
- ngsolve/demos/howto/timeDG-skeleton.py +45 -0
- ngsolve/demos/howto/timeDG.py +38 -0
- ngsolve/demos/howto/timeDGlap.py +42 -0
- ngsolve/demos/howto/timeDGwave.py +61 -0
- ngsolve/demos/intro/__init__.py +0 -0
- ngsolve/demos/intro/adaptive.py +123 -0
- ngsolve/demos/intro/cmagnet.py +62 -0
- ngsolve/demos/intro/elasticity.py +76 -0
- ngsolve/demos/intro/navierstokes.py +74 -0
- ngsolve/demos/intro/poisson.ipynb +170 -0
- ngsolve/demos/intro/poisson.py +41 -0
- ngsolve/demos/mpi/__init__.py +0 -0
- ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
- ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
- ngsolve/demos/mpi/mpi_poisson.py +89 -0
- ngsolve/demos/mpi/mpi_timeDG.py +82 -0
- ngsolve/internal.py +5 -0
- ngsolve/ngslib.pyd +0 -0
- {ngsolve-6.2.2404.post109.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/METADATA +2 -2
- {ngsolve-6.2.2404.post109.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/RECORD +137 -104
- {ngsolve-6.2.2404.post109.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/WHEEL +1 -1
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/Scripts/ngsolve.tcl +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.geo +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/beam.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.in2d +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/chip.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.geo +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coil.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.geo +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/coilshield.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.geo +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/cube.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d1_square.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d2_chip.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d4_cube.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d5_beam.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d6_shaft.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d7_coil.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/doubleglazing.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.geo +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/shaft.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.in2d +0 -0
- {ngsolve-6.2.2404.post109.dev0.data → ngsolve-6.2.2406.post112.dev1.data}/data/share/ngsolve/square.vol +0 -0
- {ngsolve-6.2.2404.post109.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/LICENSE +0 -0
- {ngsolve-6.2.2404.post109.dev0.dist-info → ngsolve-6.2.2406.post112.dev1.dist-info}/top_level.txt +0 -0
|
@@ -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
|
@@ -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/expr.hpp
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
#include <core/array.hpp>
|
|
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
|
|
|
@@ -28,15 +29,18 @@ template <typename T>
|
|
|
28
29
|
struct SafeIndex
|
|
29
30
|
{
|
|
30
31
|
T i;
|
|
31
|
-
SafeIndex(T ai) : i(ai) { };
|
|
32
|
-
operator T() const { return i; }
|
|
33
|
-
auto operator++() { return ++i; }
|
|
34
|
-
auto operator++(int) { return i++; }
|
|
32
|
+
INLINE SafeIndex(T ai) : i(ai) { };
|
|
33
|
+
INLINE operator T() const { return i; }
|
|
34
|
+
INLINE auto operator++() { return ++i; }
|
|
35
|
+
INLINE auto operator++(int) { return i++; }
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
namespace ngcore
|
|
39
|
+
{
|
|
40
|
+
template <typename T>
|
|
41
|
+
struct IsSafe<SafeIndex<T>> {
|
|
42
|
+
constexpr operator bool() const { return true; } };
|
|
43
|
+
} // namespace ngcore
|
|
40
44
|
|
|
41
45
|
/*
|
|
42
46
|
namespace std {
|
|
@@ -262,6 +266,7 @@ namespace ngbla
|
|
|
262
266
|
explicit constexpr undefined_size(IC<S> s) : size(s) { }
|
|
263
267
|
explicit constexpr operator size_t() const { return size; }
|
|
264
268
|
explicit constexpr operator int() const { return size; }
|
|
269
|
+
explicit constexpr operator ptrdiff_t() const { return size; }
|
|
265
270
|
};
|
|
266
271
|
|
|
267
272
|
|
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
|
};
|
|
@@ -1433,7 +1431,7 @@ namespace ngcore
|
|
|
1433
1431
|
template<>
|
|
1434
1432
|
struct MPI_typetrait<ngcomp::COUPLING_TYPE>
|
|
1435
1433
|
{
|
|
1436
|
-
static
|
|
1434
|
+
static auto MPIType ()
|
|
1437
1435
|
{
|
|
1438
1436
|
static_assert ( (sizeof(ngcomp::COUPLING_TYPE) == sizeof(char)) ||
|
|
1439
1437
|
(sizeof(ngcomp::COUPLING_TYPE) == sizeof(int)) );
|
netgen/include/finiteelement.hpp
CHANGED
|
@@ -71,7 +71,7 @@ namespace ngfem
|
|
|
71
71
|
/// the name of the element family
|
|
72
72
|
virtual string ClassName() const;
|
|
73
73
|
|
|
74
|
-
virtual
|
|
74
|
+
virtual FiniteElement * SetVertexNumbers (FlatArray<int> vnums);
|
|
75
75
|
|
|
76
76
|
virtual IntegrationRule GetIR (int order) const;
|
|
77
77
|
|
|
@@ -103,13 +103,12 @@ namespace ngfem
|
|
|
103
103
|
{
|
|
104
104
|
protected:
|
|
105
105
|
/// pointers to the components
|
|
106
|
-
|
|
107
|
-
FlatArray<const FiniteElement*> fea;
|
|
106
|
+
FlatArray<FiniteElement*> fea;
|
|
108
107
|
bool all_the_same{true};
|
|
109
108
|
|
|
110
109
|
public:
|
|
111
110
|
/// initialize with pointers to components, copy pointers
|
|
112
|
-
CompoundFiniteElement (FlatArray<
|
|
111
|
+
CompoundFiniteElement (FlatArray<FiniteElement*> afea);
|
|
113
112
|
|
|
114
113
|
HD virtual ELEMENT_TYPE ElementType() const override { return fea[0]->ElementType(); }
|
|
115
114
|
/// number of components
|
|
@@ -130,10 +129,11 @@ namespace ngfem
|
|
|
130
129
|
/// the name of the element family
|
|
131
130
|
virtual string ClassName() const override { return "CompoundFiniteElement"; }
|
|
132
131
|
|
|
133
|
-
virtual
|
|
132
|
+
virtual CompoundFiniteElement * SetVertexNumbers (FlatArray<int> vnums) override
|
|
134
133
|
{
|
|
135
134
|
for (auto pfel : fea)
|
|
136
|
-
|
|
135
|
+
pfel -> SetVertexNumbers(vnums);
|
|
136
|
+
return this;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
HD virtual bool ComplexShapes() const override;
|
|
@@ -174,7 +174,7 @@ namespace ngfem
|
|
|
174
174
|
/// the name of the element family
|
|
175
175
|
virtual string ClassName() const override { return "VectorFiniteElement"; }
|
|
176
176
|
|
|
177
|
-
virtual
|
|
177
|
+
virtual VectorFiniteElement * SetVertexNumbers (FlatArray<int> vnums) override;
|
|
178
178
|
|
|
179
179
|
virtual void Print (ostream & ost) const override;
|
|
180
180
|
|
netgen/include/globalspace.hpp
CHANGED
|
@@ -31,8 +31,8 @@ namespace ngcomp
|
|
|
31
31
|
ELEMENT_TYPE type;
|
|
32
32
|
bool complex;
|
|
33
33
|
public:
|
|
34
|
-
FE(int adim, ELEMENT_TYPE atype, bool acomplex)
|
|
35
|
-
: FiniteElement(adim,
|
|
34
|
+
FE(int adim, int aorder, ELEMENT_TYPE atype, bool acomplex)
|
|
35
|
+
: FiniteElement(adim, aorder), type(atype), complex(acomplex) { };
|
|
36
36
|
ELEMENT_TYPE ElementType() const override { return type; }
|
|
37
37
|
bool ComplexShapes() const override { return complex; }
|
|
38
38
|
|
|
@@ -64,7 +64,33 @@ namespace ngcomp
|
|
|
64
64
|
BareSliceVector<Complex> x,
|
|
65
65
|
FlatVector<Complex> flux,
|
|
66
66
|
LocalHeap & lh) const override;
|
|
67
|
+
|
|
68
|
+
void Apply (const FiniteElement & fel,
|
|
69
|
+
const BaseMappedIntegrationRule & mir,
|
|
70
|
+
BareSliceVector<double> x,
|
|
71
|
+
BareSliceMatrix<double> flux,
|
|
72
|
+
LocalHeap & lh) const override;
|
|
73
|
+
|
|
74
|
+
void ApplyTrans (const FiniteElement & fel,
|
|
75
|
+
const BaseMappedIntegrationRule & mir,
|
|
76
|
+
FlatMatrix<double> flux,
|
|
77
|
+
BareSliceVector<double> x,
|
|
78
|
+
LocalHeap & lh) const override;
|
|
79
|
+
|
|
80
|
+
void CalcMatrix (const FiniteElement & fel,
|
|
81
|
+
const SIMD_BaseMappedIntegrationRule & mir,
|
|
82
|
+
BareSliceMatrix<SIMD<double>> mat) const override;
|
|
83
|
+
|
|
84
|
+
void Apply (const FiniteElement & bfel,
|
|
85
|
+
const SIMD_BaseMappedIntegrationRule & bmir,
|
|
86
|
+
BareSliceVector<double> x,
|
|
87
|
+
BareSliceMatrix<SIMD<double>> flux) const override;
|
|
88
|
+
|
|
67
89
|
|
|
90
|
+
void AddTrans (const FiniteElement & bfel,
|
|
91
|
+
const SIMD_BaseMappedIntegrationRule & bmir,
|
|
92
|
+
BareSliceMatrix<SIMD<double>> flux,
|
|
93
|
+
BareSliceVector<double> x) const override;
|
|
68
94
|
};
|
|
69
95
|
|
|
70
96
|
|
netgen/include/gridfunction.hpp
CHANGED
|
@@ -28,6 +28,7 @@ namespace ngcomp
|
|
|
28
28
|
GridFunctionCoefficientFunction (shared_ptr<DifferentialOperator> adiffop,
|
|
29
29
|
shared_ptr<DifferentialOperator> atrace_diffop = nullptr,
|
|
30
30
|
shared_ptr<DifferentialOperator> attrace_diffop = nullptr,
|
|
31
|
+
shared_ptr<DifferentialOperator> atttrace_diffop = nullptr,
|
|
31
32
|
int acomp = 0);
|
|
32
33
|
public:
|
|
33
34
|
GridFunctionCoefficientFunction () = default;
|
|
@@ -36,6 +37,7 @@ namespace ngcomp
|
|
|
36
37
|
shared_ptr<DifferentialOperator> adiffop,
|
|
37
38
|
shared_ptr<DifferentialOperator> atrace_diffop = nullptr,
|
|
38
39
|
shared_ptr<DifferentialOperator> attrace_diffop = nullptr,
|
|
40
|
+
shared_ptr<DifferentialOperator> atttrace_diffop = nullptr,
|
|
39
41
|
int acomp = 0);
|
|
40
42
|
GridFunctionCoefficientFunction (shared_ptr<GridFunction> agf,
|
|
41
43
|
shared_ptr<BilinearFormIntegrator> abfi, int acomp = 0);
|
|
@@ -83,6 +85,7 @@ namespace ngcomp
|
|
|
83
85
|
virtual shared_ptr<CoefficientFunction>
|
|
84
86
|
Diff (const CoefficientFunction * var, shared_ptr<CoefficientFunction> dir) const override;
|
|
85
87
|
|
|
88
|
+
shared_ptr<CoefficientFunction> Primary() const override;
|
|
86
89
|
shared_ptr<GridFunctionCoefficientFunction> GetTrace() const;
|
|
87
90
|
};
|
|
88
91
|
|
|
@@ -226,6 +229,7 @@ namespace ngcomp
|
|
|
226
229
|
}
|
|
227
230
|
|
|
228
231
|
shared_ptr<CoefficientFunction> Operator (shared_ptr<DifferentialOperator> diffop) const override;
|
|
232
|
+
shared_ptr<CoefficientFunction> Operator (const string& name) const override;
|
|
229
233
|
|
|
230
234
|
|
|
231
235
|
///
|
netgen/include/h1amg.hpp
CHANGED
netgen/include/h1hofe.hpp
CHANGED
|
@@ -139,7 +139,7 @@ namespace ngfem
|
|
|
139
139
|
virtual bool DualityMassDiagonal () const override
|
|
140
140
|
{
|
|
141
141
|
return (ET == ET_SEGM) || (ET == ET_TRIG) || (ET == ET_QUAD)
|
|
142
|
-
|| (ET == ET_HEX) || (ET == ET_TET);
|
|
142
|
+
|| (ET == ET_HEX) || (ET == ET_TET) || (ET == ET_POINT);
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
|
netgen/include/hcurlhdivfes.hpp
CHANGED
|
@@ -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;
|
|
@@ -58,7 +59,7 @@ namespace ngcomp
|
|
|
58
59
|
bool usegrad;
|
|
59
60
|
bool var_order;
|
|
60
61
|
|
|
61
|
-
int ndof;
|
|
62
|
+
// int ndof;
|
|
62
63
|
int nedfine;
|
|
63
64
|
int uniform_order_inner;
|
|
64
65
|
int uniform_order_face;
|
|
@@ -95,7 +96,7 @@ namespace ngcomp
|
|
|
95
96
|
///
|
|
96
97
|
virtual void DoArchive (Archive & archive) override;
|
|
97
98
|
///
|
|
98
|
-
virtual size_t GetNDof () const throw() override;
|
|
99
|
+
// virtual size_t GetNDof () const throw() override;
|
|
99
100
|
virtual void SetOrder (NodeId ni, int order) override;
|
|
100
101
|
virtual int GetOrder (NodeId ni) const override;
|
|
101
102
|
using FESpace::GetOrder;
|
netgen/include/hdivfes.hpp
CHANGED
|
@@ -19,7 +19,7 @@ namespace ngcomp
|
|
|
19
19
|
class RaviartThomasFESpace : public FESpace
|
|
20
20
|
{
|
|
21
21
|
///
|
|
22
|
-
Array<int> ndlevel;
|
|
22
|
+
// Array<int> ndlevel;
|
|
23
23
|
public:
|
|
24
24
|
///
|
|
25
25
|
/*
|
|
@@ -42,9 +42,9 @@ namespace ngcomp
|
|
|
42
42
|
|
|
43
43
|
virtual FiniteElement & GetFE (ElementId ei, Allocator & lh) const override;
|
|
44
44
|
///
|
|
45
|
-
virtual size_t GetNDof () const throw() override;
|
|
45
|
+
// virtual size_t GetNDof () const throw() override;
|
|
46
46
|
///
|
|
47
|
-
virtual size_t GetNDofLevel (int level) const override;
|
|
47
|
+
// virtual size_t GetNDofLevel (int level) const override;
|
|
48
48
|
|
|
49
49
|
///
|
|
50
50
|
virtual void GetDofNrs (ElementId ei, Array<DofId> & dnums) const override;
|
|
@@ -15,7 +15,7 @@ namespace ngcomp
|
|
|
15
15
|
{
|
|
16
16
|
protected:
|
|
17
17
|
|
|
18
|
-
int ndof;
|
|
18
|
+
// int ndof;
|
|
19
19
|
|
|
20
20
|
Array<DofId> first_facet_dof;
|
|
21
21
|
Array<DofId> first_inner_dof;
|
|
@@ -28,7 +28,7 @@ namespace ngcomp
|
|
|
28
28
|
Array<bool> fine_facet;
|
|
29
29
|
Array<bool> boundary_facet;
|
|
30
30
|
|
|
31
|
-
Array<int> ndlevel;
|
|
31
|
+
// Array<int> ndlevel;
|
|
32
32
|
int uniform_order_inner;
|
|
33
33
|
int uniform_order_facet;
|
|
34
34
|
|
|
@@ -64,7 +64,7 @@ namespace ngcomp
|
|
|
64
64
|
virtual void UpdateDofTables() override;
|
|
65
65
|
virtual void UpdateCouplingDofArray() override;
|
|
66
66
|
|
|
67
|
-
virtual size_t GetNDof () const throw() override;
|
|
67
|
+
// virtual size_t GetNDof () const throw() override;
|
|
68
68
|
|
|
69
69
|
virtual FiniteElement & GetFE (ElementId ei, Allocator & alloc) const override;
|
|
70
70
|
|
netgen/include/integratorcf.hpp
CHANGED
|
@@ -59,6 +59,11 @@ namespace ngfem
|
|
|
59
59
|
|
|
60
60
|
NGS_DLL_HEADER virtual shared_ptr<BilinearFormIntegrator> MakeBilinearFormIntegrator() const;
|
|
61
61
|
NGS_DLL_HEADER virtual shared_ptr<LinearFormIntegrator> MakeLinearFormIntegrator() const;
|
|
62
|
+
|
|
63
|
+
NGS_DLL_HEADER virtual shared_ptr<Integral> CreateSameIntegralType (shared_ptr<CoefficientFunction> _cf)
|
|
64
|
+
{
|
|
65
|
+
return make_shared<Integral> (_cf, dx);
|
|
66
|
+
}
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
inline Integral operator* (double fac, const Integral & cf)
|
|
@@ -99,7 +104,7 @@ namespace ngfem
|
|
|
99
104
|
CoefficientFunction::T_Transform transform;
|
|
100
105
|
transform.replace = replace;
|
|
101
106
|
for (auto & icf : icfs)
|
|
102
|
-
repl->icfs +=
|
|
107
|
+
repl->icfs += icf->CreateSameIntegralType (icf->cf->Transform(transform));
|
|
103
108
|
return repl;
|
|
104
109
|
}
|
|
105
110
|
|
|
@@ -131,7 +136,7 @@ namespace ngfem
|
|
|
131
136
|
{
|
|
132
137
|
auto deriv = make_shared<SumOfIntegrals>();
|
|
133
138
|
for (auto & icf : icfs)
|
|
134
|
-
deriv->icfs +=
|
|
139
|
+
deriv->icfs += icf->CreateSameIntegralType (icf->cf->Diff(var.get(), dir));
|
|
135
140
|
return deriv;
|
|
136
141
|
}
|
|
137
142
|
|
|
@@ -158,17 +163,17 @@ namespace ngfem
|
|
|
158
163
|
{
|
|
159
164
|
case VOL:
|
|
160
165
|
if (icf->dx.element_vb == VOL)
|
|
161
|
-
deriv->icfs +=
|
|
166
|
+
deriv->icfs += icf->CreateSameIntegralType ( icf->cf->Diff(&shape, dir) + divdir*icf->cf);
|
|
162
167
|
else
|
|
163
168
|
throw Exception("In DiffShape: for vb=VOL only element_vb=VOL implemented!");
|
|
164
169
|
break;
|
|
165
170
|
case BND:
|
|
166
171
|
if (icf->dx.element_vb == VOL)
|
|
167
|
-
deriv->icfs +=
|
|
172
|
+
deriv->icfs += icf->CreateSameIntegralType ( icf->cf->Diff(&shape, dir) + sdivdir*icf->cf);
|
|
168
173
|
else if (icf->dx.element_vb == BND && dir->Dimension() == 3)
|
|
169
|
-
deriv->icfs +=
|
|
174
|
+
deriv->icfs += icf->CreateSameIntegralType ( icf->cf->Diff(&shape, dir) + bsdivdir*icf->cf);
|
|
170
175
|
else if (icf->dx.element_vb == BND && dir->Dimension() == 2)
|
|
171
|
-
deriv->icfs +=
|
|
176
|
+
deriv->icfs += icf->CreateSameIntegralType ( icf->cf->Diff(&shape, dir));
|
|
172
177
|
else
|
|
173
178
|
throw Exception("In DiffShape: for vb=BND something went wrong!");
|
|
174
179
|
break;
|
|
@@ -185,7 +190,7 @@ namespace ngfem
|
|
|
185
190
|
{
|
|
186
191
|
auto compiled = make_shared<SumOfIntegrals>();
|
|
187
192
|
for (auto & icf : icfs)
|
|
188
|
-
compiled->icfs +=
|
|
193
|
+
compiled->icfs += icf->CreateSameIntegralType (::ngfem::Compile (icf->cf, realcompile, 2, wait, keep_files));
|
|
189
194
|
return compiled;
|
|
190
195
|
}
|
|
191
196
|
|
|
@@ -207,14 +212,14 @@ namespace ngfem
|
|
|
207
212
|
inline auto operator* (double fac, SumOfIntegrals c1)
|
|
208
213
|
{
|
|
209
214
|
SumOfIntegrals faccf;
|
|
210
|
-
for (auto & ci : c1.icfs) faccf.icfs +=
|
|
215
|
+
for (auto & ci : c1.icfs) faccf.icfs += ci->CreateSameIntegralType(fac*(ci->cf));
|
|
211
216
|
return faccf;
|
|
212
217
|
}
|
|
213
218
|
|
|
214
219
|
inline auto operator* (Complex fac, SumOfIntegrals c1)
|
|
215
220
|
{
|
|
216
221
|
SumOfIntegrals faccf;
|
|
217
|
-
for (auto & ci : c1.icfs) faccf.icfs +=
|
|
222
|
+
for (auto & ci : c1.icfs) faccf.icfs += ci->CreateSameIntegralType(fac*(ci->cf));
|
|
218
223
|
return faccf;
|
|
219
224
|
}
|
|
220
225
|
|