ngsolve 6.2.2506.post45.dev0__cp313-cp313-macosx_10_15_universal2.whl → 6.2.2506.post73.dev0__cp313-cp313-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/bdbequations.hpp +33 -0
- netgen/include/diffopwithfactor.hpp +123 -0
- netgen/include/kernels.hpp +98 -110
- netgen/include/mp_coefficient.hpp +2 -2
- netgen/include/mptools.hpp +45 -26
- netgen/include/preconditioner.hpp +2 -2
- netgen/libngbla.dylib +0 -0
- netgen/libngcomp.dylib +0 -0
- netgen/libngfem.dylib +0 -0
- netgen/libngla.dylib +0 -0
- netgen/libngsbem.dylib +0 -0
- netgen/libngstd.dylib +0 -0
- ngsolve/__init__.pyi +2 -2
- ngsolve/bla.pyi +1 -0
- ngsolve/cmake/NGSolveConfig.cmake +5 -5
- ngsolve/comp/__init__.pyi +1 -1
- ngsolve/config/__init__.pyi +6 -6
- ngsolve/config/config.py +5 -5
- ngsolve/config/config.pyi +6 -6
- ngsolve/directsolvers.pyi +1 -1
- ngsolve/krylovspace.pyi +2 -2
- ngsolve/nonlinearsolvers.pyi +1 -1
- ngsolve/solve_implementation.py +10 -1
- ngsolve/solve_implementation.pyi +4 -4
- ngsolve/timestepping.pyi +3 -3
- ngsolve/timing.pyi +1 -1
- {ngsolve-6.2.2506.post45.dev0.dist-info → ngsolve-6.2.2506.post73.dev0.dist-info}/METADATA +2 -2
- {ngsolve-6.2.2506.post45.dev0.dist-info → ngsolve-6.2.2506.post73.dev0.dist-info}/RECORD +64 -63
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/Netgen.icns +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/bin/ngscxx +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/bin/ngsld +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/bin/ngsolve.tcl +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/bin/ngspy +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/beam.geo +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/beam.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/chip.in2d +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/chip.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/coil.geo +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/coil.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/coilshield.geo +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/coilshield.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/cube.geo +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/cube.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d11_chip_nitsche.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d1_square.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d2_chip.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d3_helmholtz.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d4_cube.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d5_beam.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d6_shaft.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d7_coil.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d8_coilshield.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/d9_hybridDG.pde +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/doubleglazing.in2d +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/doubleglazing.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/shaft.geo +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/shaft.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/square.in2d +0 -0
- {ngsolve-6.2.2506.post45.dev0.data → ngsolve-6.2.2506.post73.dev0.data}/data/share/ngsolve/square.vol +0 -0
- {ngsolve-6.2.2506.post45.dev0.dist-info → ngsolve-6.2.2506.post73.dev0.dist-info}/LICENSE +0 -0
- {ngsolve-6.2.2506.post45.dev0.dist-info → ngsolve-6.2.2506.post73.dev0.dist-info}/WHEEL +0 -0
- {ngsolve-6.2.2506.post45.dev0.dist-info → ngsolve-6.2.2506.post73.dev0.dist-info}/top_level.txt +0 -0
netgen/include/bdbequations.hpp
CHANGED
|
@@ -2344,6 +2344,39 @@ namespace ngfem
|
|
|
2344
2344
|
mat.Rows(DIM_SPC*i, DIM_SPC*(i+1)).Cols(fel.GetRange(i)) = Trans(hmat);
|
|
2345
2345
|
}
|
|
2346
2346
|
|
|
2347
|
+
static int DimRef() { return DIM_SPC*DIM_ELEMENT; }
|
|
2348
|
+
|
|
2349
|
+
template <typename IP, typename MAT>
|
|
2350
|
+
static void GenerateMatrixRef (const FiniteElement & bfel, const IP & ip,
|
|
2351
|
+
MAT && mat, LocalHeap & lh)
|
|
2352
|
+
{
|
|
2353
|
+
HeapReset hr(lh);
|
|
2354
|
+
auto & fel = static_cast<const VectorFiniteElement&> (bfel);
|
|
2355
|
+
auto & feli = static_cast<const ScalarFiniteElement<DIM_ELEMENT>&> (fel[0]);
|
|
2356
|
+
FlatMatrix<> hmat(feli.GetNDof(), DIM_ELEMENT, lh);
|
|
2357
|
+
feli.CalcDShape(ip, hmat);
|
|
2358
|
+
int ndof = feli.GetNDof();
|
|
2359
|
+
mat.Rows(DIM_SPACE*DIM_ELEMENT).Cols(DIM_SPC*ndof) = 0.0;
|
|
2360
|
+
for (int i = 0; i < DIM_SPACE; i++)
|
|
2361
|
+
mat.Rows(i*DIM_ELEMENT, (i+1)*DIM_ELEMENT).Cols(i*ndof,(i+1)*ndof)
|
|
2362
|
+
= Trans(hmat);
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
template <typename MIP, typename MAT>
|
|
2366
|
+
static void CalcTransformationMatrix (const MIP & mip,
|
|
2367
|
+
MAT & mat, LocalHeap & lh)
|
|
2368
|
+
{
|
|
2369
|
+
FlatMatrix<> hmat(DIM_SPC, DIM_ELEMENT, lh);
|
|
2370
|
+
hmat = Trans(static_cast<const MappedIntegrationPoint<DIM_ELEMENT,DIM_SPC>&>(mip).GetJacobianInverse());
|
|
2371
|
+
mat.Rows(DIM_DMAT).Cols(DIM_ELEMENT*DIM_SPC) = 0.0;
|
|
2372
|
+
for (int i = 0; i < DIM_SPACE; i++)
|
|
2373
|
+
mat.Rows(i*DIM_SPC, (i+1)*DIM_SPC).Cols(i*DIM_ELEMENT, (i+1)*DIM_ELEMENT) = hmat;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
|
|
2347
2380
|
|
|
2348
2381
|
static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
|
|
2349
2382
|
const SIMD_BaseMappedIntegrationRule & mir,
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#ifndef DIFFOPWITHFACTOR_HPP
|
|
2
|
+
#define DIFFOPWITHFACTOR_HPP
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
namespace ngsbem
|
|
7
|
+
{
|
|
8
|
+
using namespace ngfem;
|
|
9
|
+
|
|
10
|
+
class DifferentialOperatorWithFactor : public DifferentialOperator
|
|
11
|
+
{
|
|
12
|
+
shared_ptr<DifferentialOperator> diffop;
|
|
13
|
+
shared_ptr<CoefficientFunction> factor;
|
|
14
|
+
|
|
15
|
+
public:
|
|
16
|
+
DifferentialOperatorWithFactor (shared_ptr<DifferentialOperator> adiffop,
|
|
17
|
+
shared_ptr<CoefficientFunction> afactor)
|
|
18
|
+
: DifferentialOperator(afactor->Dimensions()[0], 1, adiffop->VB(), adiffop->DiffOrder()),
|
|
19
|
+
diffop(adiffop), factor(afactor)
|
|
20
|
+
{
|
|
21
|
+
;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
int DimRef() const override { return diffop->DimRef(); }
|
|
25
|
+
|
|
26
|
+
virtual IntRange UsedDofs(const FiniteElement & fel) const override { return diffop->UsedDofs(fel); }
|
|
27
|
+
|
|
28
|
+
auto BaseDiffOp() const { return diffop; }
|
|
29
|
+
|
|
30
|
+
void CalcMatrix (const FiniteElement & fel,
|
|
31
|
+
const BaseMappedIntegrationPoint & mip,
|
|
32
|
+
BareSliceMatrix<double,ColMajor> mat,
|
|
33
|
+
LocalHeap & lh) const override
|
|
34
|
+
{
|
|
35
|
+
FlatMatrix<double,ColMajor> hmat(diffop->Dim(), fel.GetNDof(), lh);
|
|
36
|
+
diffop -> CalcMatrix (fel, mip, hmat, lh);
|
|
37
|
+
|
|
38
|
+
auto dims = factor->Dimensions();
|
|
39
|
+
FlatMatrix<double> factorx(dims[0], dims[1], lh);
|
|
40
|
+
factor->Evaluate (mip, factorx.AsVector());
|
|
41
|
+
|
|
42
|
+
IntRange used = diffop->UsedDofs(fel);
|
|
43
|
+
mat.Cols(used) = factorx * hmat.Cols(used);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void CalcMatrix (const FiniteElement & fel,
|
|
47
|
+
const SIMD_BaseMappedIntegrationRule & mir,
|
|
48
|
+
BareSliceMatrix<SIMD<double>> mat) const override
|
|
49
|
+
{
|
|
50
|
+
// *testout << "CalcMatrix SIMD" << endl;
|
|
51
|
+
Matrix<SIMD<double>> hmat (fel.GetNDof()*diffop->Dim(), mir.Size());
|
|
52
|
+
// hmat = SIMD<double>(0.0);
|
|
53
|
+
diffop -> CalcMatrix (fel, mir, hmat);
|
|
54
|
+
|
|
55
|
+
Matrix<SIMD<double>> fac(factor->Dimension(), mir.Size());
|
|
56
|
+
factor -> Evaluate (mir, fac);
|
|
57
|
+
|
|
58
|
+
auto dims = factor -> Dimensions();
|
|
59
|
+
|
|
60
|
+
mat.Rows(fel.GetNDof()*dims[1]).Cols(mir.Size()) = SIMD<double>(0.0);
|
|
61
|
+
|
|
62
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
63
|
+
for (size_t j = 0; j < dims[0]; j++)
|
|
64
|
+
for (size_t k = 0; k < dims[1]; k++)
|
|
65
|
+
mat.Col(i).Slice(j,dims[0]) += fac(j*dims[1]+k, i) * hmat.Col(i).Slice(k, dims[1]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
void CalcMatrix (const FiniteElement & fel,
|
|
70
|
+
const IntegrationPoint & ip,
|
|
71
|
+
BareSliceMatrix<double,ColMajor> mat,
|
|
72
|
+
LocalHeap & lh) const override
|
|
73
|
+
{
|
|
74
|
+
diffop -> CalcMatrix(fel, ip, mat, lh);
|
|
75
|
+
/*
|
|
76
|
+
*testout << "calcmatrix mip" << endl
|
|
77
|
+
<< mat.Rows(Dim()).Cols(fel.GetNDof()) << endl;
|
|
78
|
+
*/
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void CalcTransformationMatrix (const BaseMappedIntegrationPoint & mip,
|
|
82
|
+
SliceMatrix<double> trans,
|
|
83
|
+
LocalHeap & lh) const override
|
|
84
|
+
{
|
|
85
|
+
HeapReset hr(lh);
|
|
86
|
+
auto dims = factor->Dimensions();
|
|
87
|
+
|
|
88
|
+
FlatMatrix<double> factorx(dims[0], dims[1], lh);
|
|
89
|
+
factor->Evaluate (mip, factorx.AsVector());
|
|
90
|
+
|
|
91
|
+
FlatMatrix<double> basetrans(diffop->Dim(), diffop->DimRef(), lh);
|
|
92
|
+
diffop -> CalcTransformationMatrix(mip, basetrans, lh);
|
|
93
|
+
|
|
94
|
+
trans = factorx * basetrans;
|
|
95
|
+
// *testout << "trans = " << trans << endl;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
void Apply (const FiniteElement & fel,
|
|
100
|
+
const SIMD_BaseMappedIntegrationRule & mir,
|
|
101
|
+
BareSliceVector<double> x,
|
|
102
|
+
BareSliceMatrix<SIMD<double>> flux) const override
|
|
103
|
+
{
|
|
104
|
+
auto dims = factor->Dimensions();
|
|
105
|
+
|
|
106
|
+
Matrix<SIMD<double>> tmpflux(dims[1], mir.Size());
|
|
107
|
+
Matrix<SIMD<double>> factorx(dims[0]*dims[1], mir.Size());
|
|
108
|
+
|
|
109
|
+
diffop -> Apply (fel, mir, x, tmpflux);
|
|
110
|
+
factor -> Evaluate (mir, factorx);
|
|
111
|
+
flux.Rows(0, dims[0]).Cols(0, mir.Size()) = SIMD<double>(0.0);
|
|
112
|
+
for (int i = 0; i < dims[0]; i++)
|
|
113
|
+
for (int j = 0; j < dims[1]; j++)
|
|
114
|
+
flux.Row(i).Range(mir.Size()) += pw_mult(factorx.Row(i*dims[1]+j), tmpflux.Row(j));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#endif
|
netgen/include/kernels.hpp
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#define KERNELS_hpp
|
|
3
3
|
|
|
4
4
|
#include "mptools.hpp"
|
|
5
|
+
#include <type_traits>
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
// **************************** The kernels **********************************
|
|
@@ -62,18 +63,26 @@ namespace ngsbem
|
|
|
62
63
|
|
|
63
64
|
/** LaplaceSLkernel is the kernel for the single layer potential of
|
|
64
65
|
the Laplace equation $ \Delta u = 0 \,.$ */
|
|
65
|
-
template <int DIM> class LaplaceSLKernel;
|
|
66
|
+
template <int DIM, int COMPS=1> class LaplaceSLKernel;
|
|
66
67
|
|
|
67
68
|
/** LaplaceSLkernel in 3D reads
|
|
68
69
|
$$ G(x-y) = \frac{1}{4\,\pi \, | x-y| }, \quad x, y \in \mathbb R^3, \; x\not=y\,. $$ */
|
|
69
|
-
template
|
|
70
|
-
class LaplaceSLKernel<3> : public BaseKernel
|
|
70
|
+
template<int COMPS>
|
|
71
|
+
class LaplaceSLKernel<3, COMPS> : public BaseKernel
|
|
71
72
|
{
|
|
72
73
|
public:
|
|
73
|
-
LaplaceSLKernel<3>
|
|
74
|
+
LaplaceSLKernel<3,COMPS>()
|
|
75
|
+
{
|
|
76
|
+
for (size_t i = 0; i < COMPS; i++)
|
|
77
|
+
terms += {1.0, 0, i, i};
|
|
78
|
+
};
|
|
74
79
|
typedef double value_type;
|
|
80
|
+
using mp_type = typename std::conditional<COMPS == 1,
|
|
81
|
+
Complex,
|
|
82
|
+
Vec<COMPS, Complex>>::type;
|
|
83
|
+
|
|
75
84
|
static string Name() { return "LaplaceSL"; }
|
|
76
|
-
static auto Shape() { return IVec<2>(
|
|
85
|
+
static auto Shape() { return IVec<2>(COMPS,COMPS); }
|
|
77
86
|
|
|
78
87
|
template <typename T>
|
|
79
88
|
auto Evaluate (Vec<3,T> x, Vec<3,T> y, Vec<3,T> nx, Vec<3,T> ny) const
|
|
@@ -83,45 +92,59 @@ namespace ngsbem
|
|
|
83
92
|
return Vec<1,T> (1.0 / (4 * M_PI * norm));
|
|
84
93
|
}
|
|
85
94
|
|
|
86
|
-
Array<KernelTerm> terms
|
|
95
|
+
Array<KernelTerm> terms;
|
|
87
96
|
|
|
88
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
97
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
89
98
|
{
|
|
90
|
-
return make_shared<SingularMLExpansion<
|
|
99
|
+
return make_shared<SingularMLExpansion<mp_type>> (c, r, 1e-16, fmm_params);
|
|
91
100
|
}
|
|
92
101
|
|
|
93
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
102
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
94
103
|
{
|
|
95
|
-
return make_shared<RegularMLExpansion<
|
|
104
|
+
return make_shared<RegularMLExpansion<mp_type>> (c, r, 1e-16, fmm_params);
|
|
96
105
|
}
|
|
97
106
|
|
|
98
|
-
void AddSource (SingularMLExpansion<
|
|
107
|
+
void AddSource (SingularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
99
108
|
{
|
|
100
|
-
|
|
109
|
+
if constexpr (COMPS == 1)
|
|
110
|
+
mp.AddCharge (pnt, val(0));
|
|
111
|
+
else
|
|
112
|
+
mp.AddCharge (pnt, val);
|
|
101
113
|
}
|
|
102
114
|
|
|
103
|
-
void EvaluateMP (RegularMLExpansion<
|
|
115
|
+
void EvaluateMP (RegularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
104
116
|
{
|
|
105
|
-
|
|
117
|
+
if constexpr (COMPS == 1)
|
|
118
|
+
val(0) = Real(mp.Evaluate (pnt));
|
|
119
|
+
else
|
|
120
|
+
val = Real(mp.Evaluate (pnt));
|
|
106
121
|
}
|
|
107
122
|
};
|
|
108
123
|
|
|
109
124
|
|
|
110
125
|
/** LaplaceDLkernel is the kernel for the double layer potential of
|
|
111
126
|
the Laplace equation $ \Delta u = 0 \,.$ */
|
|
112
|
-
template <int DIM> class LaplaceDLKernel;
|
|
127
|
+
template <int DIM, int COMPS=1> class LaplaceDLKernel;
|
|
113
128
|
|
|
114
129
|
/** LaplaceDLkernel in 3D reads
|
|
115
130
|
$$ \frac{\partial }{ \partial n_y} G(x-y) = \frac{1}{4\,\pi} \,
|
|
116
131
|
\frac{ \langle n(y), x-y\rangle }{ | x-y|^3 },
|
|
117
132
|
\quad x, y \in \mathbb R^3, \; x\not=y\,. $$ */
|
|
118
|
-
template
|
|
119
|
-
class LaplaceDLKernel<3> : public BaseKernel
|
|
133
|
+
template<int COMPS>
|
|
134
|
+
class LaplaceDLKernel<3, COMPS> : public BaseKernel
|
|
120
135
|
{
|
|
121
136
|
public:
|
|
137
|
+
LaplaceDLKernel<3,COMPS>()
|
|
138
|
+
{
|
|
139
|
+
for (size_t i = 0; i < COMPS; i++)
|
|
140
|
+
terms += {1.0, 0, i, i};
|
|
141
|
+
};
|
|
122
142
|
typedef double value_type;
|
|
143
|
+
using mp_type = typename std::conditional<COMPS == 1,
|
|
144
|
+
Complex,
|
|
145
|
+
Vec<COMPS, Complex>>::type;
|
|
123
146
|
static string Name() { return "LaplaceDL"; }
|
|
124
|
-
static auto Shape() { return IVec<2>(
|
|
147
|
+
static auto Shape() { return IVec<2>(COMPS,COMPS); }
|
|
125
148
|
|
|
126
149
|
template <typename T>
|
|
127
150
|
auto Evaluate (Vec<3,T> x, Vec<3,T> y, Vec<3,T> nx, Vec<3,T> ny) const
|
|
@@ -132,83 +155,48 @@ namespace ngsbem
|
|
|
132
155
|
return Vec<1,T> (nxy / (4 * M_PI * norm*norm*norm));
|
|
133
156
|
}
|
|
134
157
|
|
|
135
|
-
Array<KernelTerm> terms
|
|
136
|
-
|
|
137
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
138
|
-
{
|
|
139
|
-
return make_shared<SingularMLExpansion<Complex>> (c, r, 1e-16);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
143
|
-
{
|
|
144
|
-
return make_shared<RegularMLExpansion<Complex>> (c, r, 1e-16);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
void AddSource (SingularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
148
|
-
{
|
|
149
|
-
mp.AddDipole(pnt, -nv, val(0));
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
void AddSourceTrans(SingularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
153
|
-
{
|
|
154
|
-
mp.AddCharge(pnt, val(0));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
void EvaluateMP (RegularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
158
|
-
{
|
|
159
|
-
val(0) = Real(mp.Evaluate (pnt));
|
|
160
|
-
}
|
|
158
|
+
Array<KernelTerm> terms;
|
|
161
159
|
|
|
162
|
-
|
|
160
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
163
161
|
{
|
|
164
|
-
|
|
162
|
+
return make_shared<SingularMLExpansion<mp_type>> (c, r, 1e-16, fmm_params);
|
|
165
163
|
}
|
|
166
|
-
};
|
|
167
164
|
|
|
168
|
-
|
|
169
|
-
template <int DIM> class LaplaceHSKernel;
|
|
170
|
-
|
|
171
|
-
template<>
|
|
172
|
-
class LaplaceHSKernel<3> : public BaseKernel
|
|
173
|
-
{
|
|
174
|
-
public:
|
|
175
|
-
typedef double value_type;
|
|
176
|
-
static string Name() { return "LaplaceHL"; }
|
|
177
|
-
static auto Shape() { return IVec<2>(3,3); }
|
|
178
|
-
|
|
179
|
-
template <typename T>
|
|
180
|
-
auto Evaluate (Vec<3,T> x, Vec<3,T> y, Vec<3,T> nx, Vec<3,T> ny) const
|
|
165
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
181
166
|
{
|
|
182
|
-
|
|
183
|
-
// return 1.0 / (4 * M_PI * norm);
|
|
184
|
-
return Vec<1,T> (1.0 / (4 * M_PI * norm));
|
|
167
|
+
return make_shared<RegularMLExpansion<mp_type>> (c, r, 1e-16, fmm_params);
|
|
185
168
|
}
|
|
186
|
-
|
|
187
|
-
Array<KernelTerm> terms =
|
|
188
|
-
{
|
|
189
|
-
KernelTerm{1.0, 0, 0, 0},
|
|
190
|
-
KernelTerm{1.0, 0, 1, 1},
|
|
191
|
-
KernelTerm{1.0, 0, 2, 2},
|
|
192
|
-
};
|
|
193
169
|
|
|
194
|
-
|
|
170
|
+
void AddSource (SingularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
195
171
|
{
|
|
196
|
-
|
|
172
|
+
if constexpr (COMPS == 1)
|
|
173
|
+
mp.AddDipole(pnt, -nv, val(0));
|
|
174
|
+
else
|
|
175
|
+
mp.AddDipole(pnt, -nv, val);
|
|
197
176
|
}
|
|
198
177
|
|
|
199
|
-
|
|
178
|
+
void AddSourceTrans(SingularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
200
179
|
{
|
|
201
|
-
|
|
180
|
+
if constexpr (COMPS == 1)
|
|
181
|
+
mp.AddCharge (pnt, val(0));
|
|
182
|
+
else
|
|
183
|
+
mp.AddCharge (pnt, val);
|
|
202
184
|
}
|
|
203
185
|
|
|
204
|
-
void
|
|
186
|
+
void EvaluateMP (RegularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
205
187
|
{
|
|
206
|
-
|
|
188
|
+
if constexpr (COMPS == 1)
|
|
189
|
+
val(0) = Real(mp.Evaluate (pnt));
|
|
190
|
+
else
|
|
191
|
+
val = Real(mp.Evaluate (pnt));
|
|
207
192
|
}
|
|
208
193
|
|
|
209
|
-
void
|
|
194
|
+
void EvaluateMPTrans(RegularMLExpansion<mp_type> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<double> val) const
|
|
210
195
|
{
|
|
211
|
-
|
|
196
|
+
if constexpr (COMPS == 1)
|
|
197
|
+
val(0) = Real(mp.EvaluateDirectionalDerivative(pnt, nv));
|
|
198
|
+
else
|
|
199
|
+
val = Real(mp.EvaluateDirectionalDerivative(pnt, nv));
|
|
212
200
|
}
|
|
213
201
|
};
|
|
214
202
|
|
|
@@ -243,14 +231,14 @@ namespace ngsbem
|
|
|
243
231
|
double GetKappa() const { return kappa; }
|
|
244
232
|
Array<KernelTerm> terms = { KernelTerm{1.0, 0, 0, 0}, };
|
|
245
233
|
|
|
246
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
234
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
247
235
|
{
|
|
248
|
-
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa);
|
|
236
|
+
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
249
237
|
}
|
|
250
238
|
|
|
251
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
239
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
252
240
|
{
|
|
253
|
-
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa);
|
|
241
|
+
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
254
242
|
}
|
|
255
243
|
|
|
256
244
|
void AddSource (SingularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -297,14 +285,14 @@ namespace ngsbem
|
|
|
297
285
|
double GetKappa() const { return kappa; }
|
|
298
286
|
Array<KernelTerm> terms = { KernelTerm{1.0, 0, 0, 0}, };
|
|
299
287
|
|
|
300
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
288
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
301
289
|
{
|
|
302
|
-
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa);
|
|
290
|
+
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
303
291
|
}
|
|
304
292
|
|
|
305
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
293
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
306
294
|
{
|
|
307
|
-
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa);
|
|
295
|
+
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
308
296
|
}
|
|
309
297
|
|
|
310
298
|
void AddSource (SingularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -357,14 +345,14 @@ namespace ngsbem
|
|
|
357
345
|
KernelTerm{1.0, 0, 2, 2},
|
|
358
346
|
};
|
|
359
347
|
|
|
360
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
348
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
361
349
|
{
|
|
362
|
-
return make_shared<SingularMLExpansion<Vec<3,Complex>>> (c, r, kappa);
|
|
350
|
+
return make_shared<SingularMLExpansion<Vec<3,Complex>>> (c, r, kappa, fmm_params);
|
|
363
351
|
}
|
|
364
352
|
|
|
365
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
353
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
366
354
|
{
|
|
367
|
-
return make_shared<RegularMLExpansion<Vec<3,Complex>>> (c, r, kappa);
|
|
355
|
+
return make_shared<RegularMLExpansion<Vec<3,Complex>>> (c, r, kappa, fmm_params);
|
|
368
356
|
}
|
|
369
357
|
|
|
370
358
|
void AddSource (SingularMLExpansion<Vec<3,Complex>> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -410,14 +398,14 @@ namespace ngsbem
|
|
|
410
398
|
KernelTerm{1.0, 1, 3, 3},
|
|
411
399
|
};
|
|
412
400
|
|
|
413
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
401
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
414
402
|
{
|
|
415
|
-
return make_shared<SingularMLExpansion<Vec<6,Complex>>> (c, r, kappa);
|
|
403
|
+
return make_shared<SingularMLExpansion<Vec<6,Complex>>> (c, r, kappa, fmm_params);
|
|
416
404
|
}
|
|
417
405
|
|
|
418
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
406
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
419
407
|
{
|
|
420
|
-
return make_shared<RegularMLExpansion<Vec<6,Complex>>> (c, r, kappa);
|
|
408
|
+
return make_shared<RegularMLExpansion<Vec<6,Complex>>> (c, r, kappa, fmm_params);
|
|
421
409
|
}
|
|
422
410
|
|
|
423
411
|
void AddSource (SingularMLExpansion<Vec<6,Complex>> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -473,14 +461,14 @@ namespace ngsbem
|
|
|
473
461
|
double GetKappa() const { return kappa; }
|
|
474
462
|
Array<KernelTerm> terms = { KernelTerm{1.0, 0, 0, 0}, };
|
|
475
463
|
|
|
476
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
464
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
477
465
|
{
|
|
478
|
-
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa);
|
|
466
|
+
return make_shared<SingularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
479
467
|
}
|
|
480
468
|
|
|
481
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
469
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
482
470
|
{
|
|
483
|
-
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa);
|
|
471
|
+
return make_shared<RegularMLExpansion<Complex>> (c, r, kappa, fmm_params);
|
|
484
472
|
}
|
|
485
473
|
|
|
486
474
|
void AddSource (SingularMLExpansion<Complex> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -531,14 +519,14 @@ namespace ngsbem
|
|
|
531
519
|
double GetKappa() const { return kappa; }
|
|
532
520
|
Array<KernelTerm> terms;
|
|
533
521
|
|
|
534
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
522
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
535
523
|
{
|
|
536
|
-
return make_shared<SingularMLExpansion<Vec<4,Complex>>> (c, r, kappa);
|
|
524
|
+
return make_shared<SingularMLExpansion<Vec<4,Complex>>> (c, r, kappa, fmm_params);
|
|
537
525
|
}
|
|
538
526
|
|
|
539
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
527
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
540
528
|
{
|
|
541
|
-
return make_shared<RegularMLExpansion<Vec<4,Complex>>> (c, r, kappa);
|
|
529
|
+
return make_shared<RegularMLExpansion<Vec<4,Complex>>> (c, r, kappa, fmm_params);
|
|
542
530
|
}
|
|
543
531
|
|
|
544
532
|
void AddSource (SingularMLExpansion<Vec<4,Complex>> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -598,14 +586,14 @@ namespace ngsbem
|
|
|
598
586
|
KernelTerm{-1.0, 2, 1, 0},
|
|
599
587
|
};
|
|
600
588
|
|
|
601
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
589
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
602
590
|
{
|
|
603
|
-
return make_shared<SingularMLExpansion<Vec<3,Complex>>> (c, r, kappa);
|
|
591
|
+
return make_shared<SingularMLExpansion<Vec<3,Complex>>> (c, r, kappa, fmm_params);
|
|
604
592
|
}
|
|
605
593
|
|
|
606
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
594
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
607
595
|
{
|
|
608
|
-
return make_shared<RegularMLExpansion<Vec<3,Complex>>> (c, r, kappa);
|
|
596
|
+
return make_shared<RegularMLExpansion<Vec<3,Complex>>> (c, r, kappa, fmm_params);
|
|
609
597
|
}
|
|
610
598
|
|
|
611
599
|
void AddSource (SingularMLExpansion<Vec<3,Complex>> & mp, Vec<3> pnt, Vec<3> nv, BareSliceVector<Complex> val) const
|
|
@@ -712,14 +700,14 @@ namespace ngsbem
|
|
|
712
700
|
}
|
|
713
701
|
|
|
714
702
|
|
|
715
|
-
auto CreateMultipoleExpansion (Vec<3> c, double r) const
|
|
703
|
+
auto CreateMultipoleExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
716
704
|
{
|
|
717
|
-
return make_shared<SingularMLExpansion<Vec<6,Complex>>> (c, r, 1e-16);
|
|
705
|
+
return make_shared<SingularMLExpansion<Vec<6,Complex>>> (c, r, 1e-16, fmm_params);
|
|
718
706
|
}
|
|
719
707
|
|
|
720
|
-
auto CreateLocalExpansion (Vec<3> c, double r) const
|
|
708
|
+
auto CreateLocalExpansion (Vec<3> c, double r, FMM_Parameters fmm_params) const
|
|
721
709
|
{
|
|
722
|
-
return make_shared<RegularMLExpansion<Vec<6,Complex>>> (c, r, 1e-16);
|
|
710
|
+
return make_shared<RegularMLExpansion<Vec<6,Complex>>> (c, r, 1e-16, fmm_params);
|
|
723
711
|
}
|
|
724
712
|
|
|
725
713
|
|
|
@@ -119,9 +119,9 @@ namespace ngsbem
|
|
|
119
119
|
shared_ptr<RegularMLExpansion<entry_type>> mlmp;
|
|
120
120
|
public:
|
|
121
121
|
RegularMLExpansionCF (shared_ptr<SingularMLExpansionCF<entry_type>> asingmp, Vec<3> center, double r)
|
|
122
|
-
: CoefficientFunction(sizeof(entry_type)/sizeof(Complex), true), mlmp{make_shared<RegularMLExpansion<entry_type>>(asingmp->MLExpansion(), center, r)} { }
|
|
122
|
+
: CoefficientFunction(sizeof(entry_type)/sizeof(Complex), true), mlmp{make_shared<RegularMLExpansion<entry_type>>(asingmp->MLExpansion(), center, r, FMM_Parameters())} { }
|
|
123
123
|
RegularMLExpansionCF (shared_ptr<SingularMLExpansion<entry_type>> asingmp, Vec<3> center, double r)
|
|
124
|
-
: CoefficientFunction(sizeof(entry_type)/sizeof(Complex), true), mlmp{make_shared<RegularMLExpansion<entry_type>>(asingmp, center, r)} { }
|
|
124
|
+
: CoefficientFunction(sizeof(entry_type)/sizeof(Complex), true), mlmp{make_shared<RegularMLExpansion<entry_type>>(asingmp, center, r, FMM_Parameters())} { }
|
|
125
125
|
|
|
126
126
|
virtual double Evaluate (const BaseMappedIntegrationPoint & ip) const override
|
|
127
127
|
{ throw Exception("real eval not available"); }
|