ngsolve 6.2.2501.post16.dev1__cp313-cp313-macosx_10_15_universal2.whl → 6.2.2501.post34.dev1__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.

Files changed (286) hide show
  1. ngsolve/webgui.py +1 -1
  2. {ngsolve-6.2.2501.post16.dev1.dist-info → ngsolve-6.2.2501.post34.dev1.dist-info}/METADATA +2 -2
  3. ngsolve-6.2.2501.post34.dev1.dist-info/RECORD +25 -0
  4. netgen/include/arnoldi.hpp +0 -55
  5. netgen/include/bandmatrix.hpp +0 -334
  6. netgen/include/basematrix.hpp +0 -957
  7. netgen/include/basevector.hpp +0 -1268
  8. netgen/include/bdbequations.hpp +0 -2752
  9. netgen/include/bdbintegrator.hpp +0 -1659
  10. netgen/include/bessel.hpp +0 -1064
  11. netgen/include/bilinearform.hpp +0 -963
  12. netgen/include/bla.hpp +0 -29
  13. netgen/include/blockalloc.hpp +0 -95
  14. netgen/include/blockjacobi.hpp +0 -316
  15. netgen/include/bspline.hpp +0 -114
  16. netgen/include/calcinverse.hpp +0 -141
  17. netgen/include/cg.hpp +0 -368
  18. netgen/include/chebyshev.hpp +0 -44
  19. netgen/include/cholesky.hpp +0 -720
  20. netgen/include/clapack.h +0 -7254
  21. netgen/include/code_generation.hpp +0 -296
  22. netgen/include/coefficient.hpp +0 -2006
  23. netgen/include/coefficient_impl.hpp +0 -18
  24. netgen/include/coefficient_stdmath.hpp +0 -157
  25. netgen/include/commutingAMG.hpp +0 -106
  26. netgen/include/comp.hpp +0 -79
  27. netgen/include/compatibility.hpp +0 -41
  28. netgen/include/complex_wrapper.hpp +0 -73
  29. netgen/include/compressedfespace.hpp +0 -110
  30. netgen/include/contact.hpp +0 -231
  31. netgen/include/diagonalmatrix.hpp +0 -154
  32. netgen/include/differentialoperator.hpp +0 -276
  33. netgen/include/diffop.hpp +0 -1286
  34. netgen/include/diffop_impl.hpp +0 -326
  35. netgen/include/discontinuous.hpp +0 -84
  36. netgen/include/dump.hpp +0 -949
  37. netgen/include/eigen.hpp +0 -60
  38. netgen/include/eigensystem.hpp +0 -18
  39. netgen/include/elasticity_equations.hpp +0 -595
  40. netgen/include/elementbyelement.hpp +0 -195
  41. netgen/include/elementtopology.hpp +0 -1760
  42. netgen/include/elementtransformation.hpp +0 -339
  43. netgen/include/evalfunc.hpp +0 -405
  44. netgen/include/expr.hpp +0 -1655
  45. netgen/include/facetfe.hpp +0 -175
  46. netgen/include/facetfespace.hpp +0 -178
  47. netgen/include/facethofe.hpp +0 -111
  48. netgen/include/facetsurffespace.hpp +0 -112
  49. netgen/include/fe_interfaces.hpp +0 -32
  50. netgen/include/fem.hpp +0 -87
  51. netgen/include/fesconvert.hpp +0 -14
  52. netgen/include/fespace.hpp +0 -1445
  53. netgen/include/finiteelement.hpp +0 -286
  54. netgen/include/globalinterfacespace.hpp +0 -77
  55. netgen/include/globalspace.hpp +0 -115
  56. netgen/include/gridfunction.hpp +0 -525
  57. netgen/include/h1amg.hpp +0 -41
  58. netgen/include/h1hofe.hpp +0 -188
  59. netgen/include/h1hofe_impl.hpp +0 -1262
  60. netgen/include/h1hofefo.hpp +0 -148
  61. netgen/include/h1hofefo_impl.hpp +0 -185
  62. netgen/include/h1hofespace.hpp +0 -167
  63. netgen/include/h1lofe.hpp +0 -1237
  64. netgen/include/h1lumping.hpp +0 -35
  65. netgen/include/hcurl_equations.hpp +0 -1352
  66. netgen/include/hcurlcurlfe.hpp +0 -2221
  67. netgen/include/hcurlcurlfespace.hpp +0 -78
  68. netgen/include/hcurlfe.hpp +0 -259
  69. netgen/include/hcurlfe_utils.hpp +0 -107
  70. netgen/include/hcurlhdiv_dshape.hpp +0 -857
  71. netgen/include/hcurlhdivfes.hpp +0 -308
  72. netgen/include/hcurlhofe.hpp +0 -175
  73. netgen/include/hcurlhofe_impl.hpp +0 -1871
  74. netgen/include/hcurlhofespace.hpp +0 -193
  75. netgen/include/hcurllofe.hpp +0 -1146
  76. netgen/include/hdiv_equations.hpp +0 -865
  77. netgen/include/hdivdivfe.hpp +0 -2923
  78. netgen/include/hdivdivsurfacespace.hpp +0 -76
  79. netgen/include/hdivfe.hpp +0 -206
  80. netgen/include/hdivfe_utils.hpp +0 -716
  81. netgen/include/hdivfes.hpp +0 -75
  82. netgen/include/hdivhofe.hpp +0 -447
  83. netgen/include/hdivhofe_impl.hpp +0 -1107
  84. netgen/include/hdivhofefo.hpp +0 -229
  85. netgen/include/hdivhofespace.hpp +0 -175
  86. netgen/include/hdivhosurfacefespace.hpp +0 -106
  87. netgen/include/hdivlofe.hpp +0 -773
  88. netgen/include/hidden.hpp +0 -74
  89. netgen/include/householder.hpp +0 -181
  90. netgen/include/hypre_ams_precond.hpp +0 -123
  91. netgen/include/hypre_precond.hpp +0 -73
  92. netgen/include/integrator.hpp +0 -2024
  93. netgen/include/integratorcf.hpp +0 -253
  94. netgen/include/interpolate.hpp +0 -49
  95. netgen/include/intrule.hpp +0 -2541
  96. netgen/include/irspace.hpp +0 -49
  97. netgen/include/jacobi.hpp +0 -136
  98. netgen/include/l2hofe.hpp +0 -193
  99. netgen/include/l2hofe_impl.hpp +0 -564
  100. netgen/include/l2hofefo.hpp +0 -542
  101. netgen/include/l2hofespace.hpp +0 -344
  102. netgen/include/la.hpp +0 -38
  103. netgen/include/linearform.hpp +0 -266
  104. netgen/include/matrix.hpp +0 -2140
  105. netgen/include/memusage.hpp +0 -41
  106. netgen/include/meshaccess.hpp +0 -1358
  107. netgen/include/mgpre.hpp +0 -204
  108. netgen/include/mptools.hpp +0 -2145
  109. netgen/include/multigrid.hpp +0 -42
  110. netgen/include/multivector.hpp +0 -447
  111. netgen/include/mumpsinverse.hpp +0 -187
  112. netgen/include/mycomplex.hpp +0 -361
  113. netgen/include/ng_lapack.hpp +0 -1661
  114. netgen/include/ngblas.hpp +0 -1099
  115. netgen/include/ngs_defines.hpp +0 -30
  116. netgen/include/ngs_stdcpp_include.hpp +0 -106
  117. netgen/include/ngs_utils.hpp +0 -121
  118. netgen/include/ngsobject.hpp +0 -1019
  119. netgen/include/ngsstream.hpp +0 -113
  120. netgen/include/ngstd.hpp +0 -72
  121. netgen/include/nodalhofe.hpp +0 -96
  122. netgen/include/nodalhofe_impl.hpp +0 -141
  123. netgen/include/normalfacetfe.hpp +0 -223
  124. netgen/include/normalfacetfespace.hpp +0 -98
  125. netgen/include/normalfacetsurfacefespace.hpp +0 -84
  126. netgen/include/order.hpp +0 -251
  127. netgen/include/parallel_matrices.hpp +0 -222
  128. netgen/include/paralleldofs.hpp +0 -340
  129. netgen/include/parallelngs.hpp +0 -23
  130. netgen/include/parallelvector.hpp +0 -269
  131. netgen/include/pardisoinverse.hpp +0 -200
  132. netgen/include/periodic.hpp +0 -125
  133. netgen/include/plateaufespace.hpp +0 -25
  134. netgen/include/pml.hpp +0 -275
  135. netgen/include/pmltrafo.hpp +0 -631
  136. netgen/include/postproc.hpp +0 -142
  137. netgen/include/precomp.hpp +0 -60
  138. netgen/include/preconditioner.hpp +0 -602
  139. netgen/include/prolongation.hpp +0 -235
  140. netgen/include/python_comp.hpp +0 -107
  141. netgen/include/python_fem.hpp +0 -89
  142. netgen/include/python_linalg.hpp +0 -58
  143. netgen/include/python_ngstd.hpp +0 -385
  144. netgen/include/recursive_pol.hpp +0 -4844
  145. netgen/include/recursive_pol_tet.hpp +0 -395
  146. netgen/include/recursive_pol_trig.hpp +0 -492
  147. netgen/include/reorderedfespace.hpp +0 -81
  148. netgen/include/sample_sort.hpp +0 -105
  149. netgen/include/scalarfe.hpp +0 -335
  150. netgen/include/shapefunction_utils.hpp +0 -113
  151. netgen/include/simd_complex.hpp +0 -284
  152. netgen/include/smoother.hpp +0 -253
  153. netgen/include/solve.hpp +0 -89
  154. netgen/include/sparsecholesky.hpp +0 -313
  155. netgen/include/sparsematrix.hpp +0 -1038
  156. netgen/include/sparsematrix_dyn.hpp +0 -91
  157. netgen/include/sparsematrix_impl.hpp +0 -920
  158. netgen/include/special_matrix.hpp +0 -461
  159. netgen/include/specialelement.hpp +0 -125
  160. netgen/include/statushandler.hpp +0 -33
  161. netgen/include/stringops.hpp +0 -12
  162. netgen/include/superluinverse.hpp +0 -136
  163. netgen/include/symbolicintegrator.hpp +0 -849
  164. netgen/include/symmetricmatrix.hpp +0 -144
  165. netgen/include/tangentialfacetfe.hpp +0 -224
  166. netgen/include/tangentialfacetfespace.hpp +0 -106
  167. netgen/include/tensor.hpp +0 -522
  168. netgen/include/tensorcoefficient.hpp +0 -446
  169. netgen/include/tensorproductintegrator.hpp +0 -113
  170. netgen/include/thcurlfe.hpp +0 -128
  171. netgen/include/thcurlfe_impl.hpp +0 -380
  172. netgen/include/thdivfe.hpp +0 -80
  173. netgen/include/thdivfe_impl.hpp +0 -426
  174. netgen/include/tpdiffop.hpp +0 -461
  175. netgen/include/tpfes.hpp +0 -133
  176. netgen/include/tpintrule.hpp +0 -224
  177. netgen/include/triangular.hpp +0 -465
  178. netgen/include/tscalarfe.hpp +0 -245
  179. netgen/include/tscalarfe_impl.hpp +0 -1029
  180. netgen/include/umfpackinverse.hpp +0 -148
  181. netgen/include/vector.hpp +0 -1219
  182. netgen/include/voxelcoefficientfunction.hpp +0 -41
  183. netgen/include/vtkoutput.hpp +0 -198
  184. netgen/include/vvector.hpp +0 -208
  185. netgen/include/webgui.hpp +0 -92
  186. netgen/libngbla.dylib +0 -0
  187. netgen/libngcomp.dylib +0 -0
  188. netgen/libngfem.dylib +0 -0
  189. netgen/libngla.dylib +0 -0
  190. netgen/libngsolve.dylib +0 -0
  191. netgen/libngstd.dylib +0 -0
  192. ngsolve/__init__.pyi +0 -231
  193. ngsolve/bla.pyi +0 -1139
  194. ngsolve/bvp.pyi +0 -32
  195. ngsolve/cmake/NGSolveConfig.cmake +0 -102
  196. ngsolve/cmake/ngsolve-targets-release.cmake +0 -69
  197. ngsolve/cmake/ngsolve-targets.cmake +0 -163
  198. ngsolve/comp/__init__.pyi +0 -5382
  199. ngsolve/comp/pml.pyi +0 -89
  200. ngsolve/config/__init__.py +0 -1
  201. ngsolve/config/__init__.pyi +0 -43
  202. ngsolve/config/__main__.py +0 -4
  203. ngsolve/config/config.py +0 -60
  204. ngsolve/config/config.pyi +0 -45
  205. ngsolve/demos/TensorProduct/__init__.py +0 -0
  206. ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +0 -80
  207. ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +0 -73
  208. ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +0 -72
  209. ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +0 -66
  210. ngsolve/demos/__init__.py +0 -0
  211. ngsolve/demos/howto/__init__.py +0 -0
  212. ngsolve/demos/howto/hhj.py +0 -44
  213. ngsolve/demos/howto/hybrid_dg.py +0 -53
  214. ngsolve/demos/howto/mixed.py +0 -30
  215. ngsolve/demos/howto/nonlin.py +0 -29
  216. ngsolve/demos/howto/pickling.py +0 -26
  217. ngsolve/demos/howto/pml.py +0 -31
  218. ngsolve/demos/howto/taskmanager.py +0 -20
  219. ngsolve/demos/howto/tdnns.py +0 -47
  220. ngsolve/demos/howto/timeDG-skeleton.py +0 -45
  221. ngsolve/demos/howto/timeDG.py +0 -38
  222. ngsolve/demos/howto/timeDGlap.py +0 -42
  223. ngsolve/demos/howto/timeDGwave.py +0 -61
  224. ngsolve/demos/intro/__init__.py +0 -0
  225. ngsolve/demos/intro/adaptive.py +0 -123
  226. ngsolve/demos/intro/cmagnet.py +0 -62
  227. ngsolve/demos/intro/elasticity.py +0 -76
  228. ngsolve/demos/intro/navierstokes.py +0 -74
  229. ngsolve/demos/intro/poisson.ipynb +0 -170
  230. ngsolve/demos/intro/poisson.py +0 -41
  231. ngsolve/demos/mpi/__init__.py +0 -0
  232. ngsolve/demos/mpi/mpi_cmagnet.py +0 -87
  233. ngsolve/demos/mpi/mpi_navierstokes.py +0 -117
  234. ngsolve/demos/mpi/mpi_poisson.py +0 -89
  235. ngsolve/demos/mpi/mpi_timeDG.py +0 -82
  236. ngsolve/directsolvers.pyi +0 -18
  237. ngsolve/eigenvalues.pyi +0 -30
  238. ngsolve/fem.pyi +0 -1707
  239. ngsolve/krylovspace.pyi +0 -309
  240. ngsolve/la.pyi +0 -1218
  241. ngsolve/ngslib.so +0 -0
  242. ngsolve/ngstd.pyi +0 -58
  243. ngsolve/nonlinearsolvers.pyi +0 -98
  244. ngsolve/preconditioners.pyi +0 -6
  245. ngsolve/solve.pyi +0 -108
  246. ngsolve/solvers.pyi +0 -14
  247. ngsolve/timestepping.pyi +0 -34
  248. ngsolve/timing.pyi +0 -57
  249. ngsolve/utils.pyi +0 -279
  250. ngsolve-6.2.2501.post16.dev1.data/data/Netgen.icns +0 -0
  251. ngsolve-6.2.2501.post16.dev1.data/data/bin/ngscxx +0 -17
  252. ngsolve-6.2.2501.post16.dev1.data/data/bin/ngsld +0 -13
  253. ngsolve-6.2.2501.post16.dev1.data/data/bin/ngsolve.tcl +0 -648
  254. ngsolve-6.2.2501.post16.dev1.data/data/bin/ngspy +0 -2
  255. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/beam.geo +0 -17
  256. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/beam.vol +0 -240
  257. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/chip.in2d +0 -41
  258. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/chip.vol +0 -614
  259. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/coil.geo +0 -12
  260. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/coil.vol +0 -2560
  261. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/coilshield.geo +0 -24
  262. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/coilshield.vol +0 -3179
  263. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/cube.geo +0 -19
  264. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/cube.vol +0 -1832
  265. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -50
  266. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d11_chip_nitsche.pde +0 -40
  267. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d1_square.pde +0 -43
  268. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d2_chip.pde +0 -35
  269. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d3_helmholtz.pde +0 -22
  270. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d4_cube.pde +0 -46
  271. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d5_beam.pde +0 -74
  272. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d6_shaft.pde +0 -73
  273. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d7_coil.pde +0 -50
  274. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d8_coilshield.pde +0 -49
  275. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/d9_hybridDG.pde +0 -72
  276. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/doubleglazing.in2d +0 -27
  277. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/doubleglazing.vol +0 -737
  278. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  279. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/shaft.geo +0 -73
  280. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/shaft.vol +0 -4291
  281. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/square.in2d +0 -17
  282. ngsolve-6.2.2501.post16.dev1.data/data/share/ngsolve/square.vol +0 -149
  283. ngsolve-6.2.2501.post16.dev1.dist-info/RECORD +0 -304
  284. {ngsolve-6.2.2501.post16.dev1.dist-info → ngsolve-6.2.2501.post34.dev1.dist-info}/LICENSE +0 -0
  285. {ngsolve-6.2.2501.post16.dev1.dist-info → ngsolve-6.2.2501.post34.dev1.dist-info}/WHEEL +0 -0
  286. {ngsolve-6.2.2501.post16.dev1.dist-info → ngsolve-6.2.2501.post34.dev1.dist-info}/top_level.txt +0 -0
@@ -1,2752 +0,0 @@
1
- #ifndef FILE_BDBEQUATIONS
2
- #define FILE_BDBEQUATIONS
3
-
4
- /*********************************************************************/
5
- /* File: bdbequations.hpp */
6
- /* Author: Joachim Schoeberl */
7
- /* Date: 25. Mar. 2000 */
8
- /*********************************************************************/
9
-
10
-
11
- #include "diffop.hpp"
12
- #include "scalarfe.hpp"
13
- #include "bdbintegrator.hpp"
14
- #include "coefficient.hpp"
15
-
16
- namespace ngfem
17
- {
18
-
19
- /*
20
- realizations of bdb integrators for many equations.
21
- The differential operators provide the B-matrix,
22
- the DMatOps provide the coefficient tensors
23
- */
24
-
25
-
26
-
27
-
28
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
29
- class DiffOpGradientBoundary; // : public DiffOp<DiffOpGradientBoundary<D, FEL> >
30
-
31
-
32
-
33
- /// Gradient operator of dimension D
34
- template <int D, typename FEL = ScalarFiniteElement<D> >
35
- class DiffOpGradient : public DiffOp<DiffOpGradient<D, FEL> >
36
- {
37
- public:
38
- enum { DIM = 1 };
39
- enum { DIM_SPACE = D };
40
- enum { DIM_ELEMENT = D };
41
- enum { DIM_DMAT = D };
42
- enum { DIFFORDER = 1 };
43
-
44
- typedef DiffOpGradientBoundary<D> DIFFOP_TRACE;
45
-
46
- static string Name() { return "grad"; }
47
- static constexpr bool SUPPORT_PML = true;
48
-
49
- static const FEL & Cast (const FiniteElement & fel)
50
- { return static_cast<const FEL&> (fel); }
51
-
52
- // using DiffOp<DiffOpGradient<D, FEL> >::GenerateMatrix;
53
- static void GenerateMatrix (const FiniteElement & fel,
54
- const MappedIntegrationPoint<D,D> & mip,
55
- BareSliceMatrix<double,ColMajor> mat, LocalHeap & lh)
56
- {
57
- Cast(fel).CalcMappedDShape (mip, Trans(mat));
58
- }
59
-
60
- template <typename SCALMIP>
61
- static void GenerateMatrix (const FiniteElement & fel,
62
- const MappedIntegrationPoint<D,D,SCALMIP> & mip,
63
- BareSliceMatrix<Complex,ColMajor> mat, LocalHeap & lh)
64
- {
65
- HeapReset hr(lh);
66
- FlatMatrixFixWidth<D> dshape(fel.GetNDof(), lh);
67
- Cast(fel).CalcDShape (mip.IP(), dshape);
68
- mat = Trans (dshape * mip.GetJacobianInverse ());
69
- // mat = Trans (Cast(fel).GetDShape(mip.IP(),lh) * mip.GetJacobianInverse ());
70
- }
71
-
72
-
73
- /*
74
- template <typename SCALMIP, typename MAT>
75
- static void GenerateMatrix (const FiniteElement & fel,
76
- const MappedIntegrationPoint<D,D,SCALMIP> & mip,
77
- MAT && mat, LocalHeap & lh)
78
- {
79
- HeapReset hr(lh);
80
- FlatMatrixFixWidth<D> dshape(fel.GetNDof(), lh);
81
- Cast(fel).CalcDShape (mip.IP(), dshape);
82
- mat = Trans (dshape * mip.GetJacobianInverse ());
83
- // mat = Trans (Cast(fel).GetDShape(mip.IP(),lh) * mip.GetJacobianInverse ());
84
- }
85
- */
86
- static int DimRef() { return D; }
87
-
88
- template <typename IP, typename MAT>
89
- static void GenerateMatrixRef (const FiniteElement & fel, const IP & ip,
90
- MAT && mat, LocalHeap & lh)
91
- {
92
- Cast(fel).CalcDShape (ip, Trans(mat));
93
- }
94
-
95
- template <typename MIP, typename MAT>
96
- static void CalcTransformationMatrix (const MIP & mip,
97
- MAT & mat, LocalHeap & lh)
98
- {
99
- mat = Trans(static_cast<const MappedIntegrationPoint<D,D>&>(mip).GetJacobianInverse());
100
- }
101
-
102
-
103
- static void GenerateMatrixIR (const FiniteElement & fel,
104
- const MappedIntegrationRule<D,D> & mir,
105
- BareSliceMatrix<double,ColMajor> mat, LocalHeap & lh)
106
- {
107
- Cast(fel).CalcMappedDShape (mir, Trans(mat));
108
- }
109
-
110
- static void GenerateMatrixSIMDIR (const FiniteElement & fel,
111
- const SIMD_BaseMappedIntegrationRule & mir,
112
- BareSliceMatrix<SIMD<double>> mat)
113
- {
114
- Cast(fel).CalcMappedDShape (mir, mat);
115
- }
116
-
117
- ///
118
- template <typename MIP, class TVX, class TVY>
119
- static void Apply (const FiniteElement & fel, const MIP & mip,
120
- const TVX & x, TVY && y,
121
- LocalHeap & lh)
122
- {
123
- HeapReset hr(lh);
124
- typedef typename TVX::TSCAL TSCAL;
125
- FlatMatrixFixWidth<D> dshape(fel.GetNDof(), lh);
126
- Cast(fel).CalcDShape (mip.IP(), dshape);
127
- Vec<D,TSCAL> hv = Trans (dshape) * x;
128
- // Vec<D,TSCAL> hv = Trans (Cast(fel).GetDShape(mip.IP(), lh)) * x;
129
- y = Trans (mip.GetJacobianInverse()) * hv;
130
- }
131
-
132
- template <class TVY>
133
- static void Apply (const FiniteElement & fel, const MappedIntegrationPoint<D,D> & mip,
134
- BareSliceVector<> x, TVY && y,
135
- LocalHeap & lh)
136
- {
137
- Vec<D> hv = Cast(fel).EvaluateGrad(mip.IP(), x);
138
- y = Trans (mip.GetJacobianInverse()) * hv;
139
- }
140
-
141
- using DiffOp<DiffOpGradient<D, FEL> >::ApplyIR;
142
-
143
- template <class MIR>
144
- static void ApplyIR (const FiniteElement & fel, const MIR & mir,
145
- BareSliceVector<double> x, SliceMatrix<double> y,
146
- LocalHeap & lh)
147
- {
148
- // FlatMatrixFixWidth<D> grad(mir.Size(), &y(0));
149
- Cast(fel).EvaluateGrad (mir.IR(), x, y);
150
- for (int i = 0; i < mir.Size(); i++)
151
- {
152
- Vec<D> hv = y.Row(i);
153
- y.Row(i) = Trans (mir[i].GetJacobianInverse()) * hv;
154
- }
155
- }
156
-
157
- using DiffOp<DiffOpGradient<D, FEL> >::ApplySIMDIR;
158
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
159
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
160
- {
161
- Cast(fel).EvaluateGrad (mir, x, y);
162
- }
163
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
164
- BareSliceVector<Complex> x, BareSliceMatrix<SIMD<Complex>> y)
165
- {
166
- Cast(fel).EvaluateGrad (mir, x, y);
167
- }
168
-
169
-
170
- ///
171
- template <typename MIP, class TVX, class TVY>
172
- static void ApplyTrans (const FiniteElement & fel, const MIP & mip,
173
- const TVX & x, TVY & y,
174
- LocalHeap & lh)
175
- {
176
- HeapReset hr(lh);
177
- typedef typename TVX::TSCAL TSCAL;
178
- Vec<D,TSCAL> vx = x;
179
- auto hv = mip.GetJacobianInverse() * vx;
180
- // y = Cast(fel).GetDShape(mip.IP(),lh) * hv;
181
- FlatMatrixFixWidth<D> dshape(fel.GetNDof(), lh);
182
- Cast(fel).CalcDShape (mip.IP(), dshape);
183
- y.Range(0,fel.GetNDof()) = dshape * hv;
184
- }
185
-
186
- using DiffOp<DiffOpGradient<D, FEL> >::AddTransSIMDIR;
187
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
188
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
189
- {
190
- Cast(fel).AddGradTrans (mir, y, x);
191
- }
192
-
193
-
194
- static shared_ptr<CoefficientFunction>
195
- DiffShape (shared_ptr<CoefficientFunction> proxy,
196
- shared_ptr<CoefficientFunction> dir,
197
- bool Eulerian);
198
- };
199
-
200
-
201
-
202
-
203
- /// Boundary Gradient operator of dimension D
204
- template <int D, typename FEL> // = ScalarFiniteElement<D-1> >
205
- class DiffOpGradientBoundary : public DiffOp<DiffOpGradientBoundary<D, FEL> >
206
- {
207
- public:
208
- enum { DIM = 1 };
209
- enum { DIM_SPACE = D };
210
- enum { DIM_ELEMENT = D-1 };
211
- enum { DIM_DMAT = D };
212
- enum { DIFFORDER = 1 };
213
-
214
- static string Name() { return "gradboundary"; }
215
-
216
- static const FEL & Cast (const FiniteElement & fel)
217
- { return static_cast<const FEL&> (fel); }
218
-
219
- ///
220
- template <typename AFEL, typename MIP, typename MAT>
221
- static void GenerateMatrix (const AFEL & fel, const MIP & mip,
222
- MAT && mat, LocalHeap & lh)
223
- {
224
- // mat = Trans (mip.GetJacobianInverse ()) * Trans (static_cast<const FEL&>(fel).GetDShape(mip.IP(),lh));
225
- // HeapReset hr(lh);
226
- // FlatMatrixFixWidth<DIM_ELEMENT> dshape(fel.GetNDof(), lh);
227
- // Cast(fel).CalcDShape (mip.IP(), dshape);
228
- // mat = Trans (dshape * mip.GetJacobianInverse ());
229
- Cast(fel).CalcMappedDShape (mip, Trans(mat));
230
- }
231
-
232
- static void GenerateMatrixSIMDIR (const FiniteElement & fel,
233
- const SIMD_BaseMappedIntegrationRule & mir,
234
- BareSliceMatrix<SIMD<double>> mat)
235
- {
236
- Cast(fel).CalcMappedDShape (mir, mat);
237
- }
238
-
239
- using DiffOp<DiffOpGradientBoundary<D, FEL> >::ApplySIMDIR;
240
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
241
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
242
- {
243
- Cast(fel).EvaluateGrad (mir, x, y);
244
- }
245
-
246
- using DiffOp<DiffOpGradientBoundary<D, FEL> >::AddTransSIMDIR;
247
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
248
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
249
- {
250
- Cast(fel).AddGradTrans (mir, y, x);
251
- }
252
-
253
- static shared_ptr<CoefficientFunction>
254
- DiffShape (shared_ptr<CoefficientFunction> proxy,
255
- shared_ptr<CoefficientFunction> dir,
256
- bool Eulerian);
257
- };
258
-
259
-
260
-
261
- /// Boundary Gradient operator of dimension D
262
- template <int D, typename FEL = ScalarFiniteElement<D-2> >
263
- class DiffOpGradientBBoundary : public DiffOp<DiffOpGradientBBoundary<D, FEL> >
264
- {
265
- public:
266
- enum { DIM = 1 };
267
- enum { DIM_SPACE = D };
268
- enum { DIM_ELEMENT = D-2 };
269
- enum { DIM_DMAT = D };
270
- enum { DIFFORDER = 1 };
271
-
272
- static string Name() { return "gradbboundary"; }
273
- static constexpr bool SUPPORT_PML = true;
274
-
275
-
276
- static const FEL & Cast (const FiniteElement & fel)
277
- { return static_cast<const FEL&> (fel); }
278
-
279
- ///
280
- template <typename AFEL, typename MIP, typename MAT>
281
- static void GenerateMatrix (const AFEL & fel, const MIP & mip,
282
- MAT && mat, LocalHeap & lh)
283
- {
284
- // mat = Trans (mip.GetJacobianInverse ()) *
285
- // Trans (static_cast<const FEL&>(fel).GetDShape(mip.IP(),lh));
286
- HeapReset hr(lh);
287
- FlatMatrixFixWidth<DIM_ELEMENT> dshape(fel.GetNDof(), lh);
288
- Cast(fel).CalcDShape (mip.IP(), dshape);
289
- mat = Trans (dshape * mip.GetJacobianInverse ());
290
- }
291
- };
292
-
293
-
294
-
295
-
296
- /// Gradient operator in r-z coordinates
297
- template <int D>
298
- class DiffOpGradientRotSym :
299
- public DiffOp<DiffOpGradientRotSym<D> >
300
- {
301
- public:
302
- enum { DIM = 1 };
303
- enum { DIM_SPACE = D };
304
- enum { DIM_ELEMENT = D };
305
- enum { DIM_DMAT = D };
306
- enum { DIFFORDER = 1 };
307
-
308
- ///
309
- template <typename FEL, typename MIP, typename MAT>
310
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
311
- MAT & mat, LocalHeap & lh)
312
- {
313
- typedef typename MAT::TSCAL TSCAL;
314
-
315
- mat = Trans (mip.GetJacobianInverse ()) *
316
- Trans (fel.GetDShape(mip.IP(),lh));
317
-
318
- double cx = mip.GetPoint()(0);
319
- if (cx == 0) cx = 1e-10;
320
- for (int i = 0; i < mat.Width(); i++)
321
- mat(0,i) += fel.GetShape(mip.IP(), lh)(i) / cx;
322
-
323
- // do the rot
324
- for (int i = 0; i < mat.Width(); i++)
325
- {
326
- TSCAL hv = mat(0,i);
327
- mat(0,i) = mat(1,i);
328
- mat(1,i) = -hv;
329
- }
330
- }
331
- };
332
-
333
-
334
-
335
- /// Identity
336
- template <int D, typename FEL = BaseScalarFiniteElement>
337
- class DiffOpId : public DiffOp<DiffOpId<D, FEL> >
338
- {
339
- public:
340
- enum { DIM = 1 };
341
- enum { DIM_SPACE = D };
342
- enum { DIM_ELEMENT = D };
343
- enum { DIM_DMAT = 1 };
344
- enum { DIFFORDER = 0 };
345
- static IVec<0> GetDimensions() { return IVec<0>(); };
346
-
347
- static bool SupportsVB (VorB checkvb) { return true; }
348
-
349
- static string Name() { return "Id"; }
350
- static constexpr bool SUPPORT_PML = true;
351
-
352
- static const FEL & Cast (const FiniteElement & fel)
353
- { return static_cast<const FEL&> (fel); }
354
-
355
- template <typename MIP, typename MAT>
356
- static void GenerateMatrix (const FiniteElement & fel, const MIP & mip,
357
- MAT && mat, LocalHeap & lh)
358
- {
359
- Cast(fel).CalcShape (mip.IP(), mat.Row(0));
360
- }
361
-
362
- static int DimRef() { return 1; }
363
-
364
- template <typename IP, typename MAT>
365
- static void GenerateMatrixRef (const FiniteElement & fel, const IP & ip,
366
- MAT && mat, LocalHeap & lh)
367
- {
368
- Cast(fel).CalcShape (ip, mat.Row(0));
369
- }
370
-
371
- template <typename MIP, typename MAT>
372
- static void CalcTransformationMatrix (const MIP & mip,
373
- MAT & mat, LocalHeap & lh)
374
- {
375
- mat(0,0) = 1;
376
- }
377
-
378
-
379
- /*
380
- static void GenerateMatrix (const FiniteElement & fel,
381
- const BaseMappedIntegrationPoint & mip,
382
- FlatMatrixFixHeight<1> & mat, LocalHeap & lh)
383
- {
384
- Cast(fel).CalcShape (mip.IP(), mat.Row(0)); // FlatVector<> (fel.GetNDof(), &mat(0,0)));
385
- }
386
-
387
- template <typename MIP>
388
- static void GenerateMatrix (const FiniteElement & fel,
389
- // const BaseMappedIntegrationPoint & mip,
390
- const MIP & mip,
391
- SliceMatrix<double,ColMajor> mat, LocalHeap & lh)
392
- {
393
- Cast(fel).CalcShape (mip.IP(), mat.Row(0));
394
- }
395
- */
396
- // using DiffOp<DiffOpId<D, FEL> > :: GenerateMatrixIR;
397
- template <typename MAT>
398
- static void GenerateMatrixIR (const FiniteElement & fel,
399
- const BaseMappedIntegrationRule & mir,
400
- MAT & mat, LocalHeap & lh)
401
- {
402
- Cast(fel).CalcShape (mir.IR(), Trans(mat));
403
- }
404
-
405
- static void GenerateMatrixSIMDIR (const FiniteElement & fel,
406
- const SIMD_BaseMappedIntegrationRule & mir,
407
- BareSliceMatrix<SIMD<double>> mat)
408
- {
409
- Cast(fel).CalcShape (mir.IR(), mat);
410
- }
411
-
412
- static void Apply (const FiniteElement & fel, const BaseMappedIntegrationPoint & mip,
413
- BareSliceVector<Complex> x, BareVector<Complex> y,
414
- LocalHeap & lh)
415
- {
416
- y(0) = Cast(fel).Evaluate(mip.IP(), x);
417
- }
418
-
419
- static void Apply (const FiniteElement & fel, const BaseMappedIntegrationPoint & mip,
420
- BareSliceVector<double> x, BareVector<double> y,
421
- LocalHeap & lh)
422
- {
423
- y(0) = Cast(fel).Evaluate(mip.IP(), x);
424
- }
425
-
426
-
427
- // using DiffOp<DiffOpId<D, FEL> >::ApplyIR;
428
-
429
- template <class MIR, class TMY>
430
- static void ApplyIR (const FiniteElement & fel, const MIR & mir,
431
- BareSliceVector<double> x, TMY y,
432
- LocalHeap & lh)
433
- {
434
- Cast(fel).Evaluate (mir.IR(), x, y.Col(0)); // FlatVector<> (mir.Size(), &y(0,0)));
435
- }
436
-
437
- template <class MIR>
438
- static void ApplyIR (const FiniteElement & fel, const MIR & mir,
439
- BareSliceVector<Complex> x, SliceMatrix<Complex> y,
440
- LocalHeap & lh)
441
- {
442
- Cast(fel).Evaluate (mir.IR(),
443
- SliceMatrix<double> (fel.GetNDof(), 2, 2, reinterpret_cast<double*> (&x(0))),
444
- SliceMatrix<double> (mir.Size(), 2, 2*y.Dist(), reinterpret_cast<double*> (&y(0))));
445
- }
446
-
447
- // using ApplySIMDIR;
448
- using DiffOp<DiffOpId<D, FEL> >::ApplySIMDIR;
449
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
450
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
451
- {
452
- Cast(fel).Evaluate (mir.IR(), x, y.Row(0));
453
- }
454
-
455
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
456
- BareSliceVector<Complex> x, BareSliceMatrix<SIMD<Complex>> y)
457
- {
458
- Cast(fel).Evaluate (mir.IR(), x, y.Row(0));
459
- }
460
-
461
-
462
-
463
- template <typename MIP, class TVX, class TVY>
464
- static void ApplyTrans (const FiniteElement & fel, const MIP & mip,
465
- const TVX & x, TVY & y,
466
- LocalHeap & lh)
467
- {
468
- HeapReset hr(lh);
469
- y.Range(0,fel.GetNDof()) = x(0) * Cast(fel).GetShape (mip.IP(), lh);
470
- }
471
-
472
-
473
- // using DiffOp<DiffOpId<D, FEL> >::ApplyTransIR;
474
- template <class MIR>
475
- static void ApplyTransIR (const FiniteElement & fel,
476
- const MIR & mir,
477
- FlatMatrix<double> x, BareSliceVector<double> y,
478
- LocalHeap & lh)
479
- {
480
- // Cast(fel).EvaluateTrans (mir.IR(), FlatVector<> (mir.Size(), &x(0,0)), y);
481
- Cast(fel).EvaluateTrans (mir.IR(), x.Col(0), y);
482
- }
483
-
484
- template <class MIR>
485
- static void ApplyTransIR (const FiniteElement & fel,
486
- const MIR & mir,
487
- FlatMatrix<Complex> x, BareSliceVector<Complex> y,
488
- LocalHeap & lh)
489
- {
490
- DiffOp<DiffOpId<D, FEL> > :: ApplyTransIR (fel, mir, x, y, lh);
491
- }
492
-
493
- using DiffOp<DiffOpId<D, FEL> >::AddTransSIMDIR;
494
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
495
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
496
- {
497
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
498
- }
499
-
500
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
501
- BareSliceMatrix<SIMD<Complex>> y, BareSliceVector<Complex> x)
502
- {
503
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
504
- }
505
-
506
-
507
-
508
- static shared_ptr<CoefficientFunction>
509
- DiffShape (shared_ptr<CoefficientFunction> proxy,
510
- shared_ptr<CoefficientFunction> dir,
511
- bool Eulerian);
512
- };
513
-
514
-
515
- template <int _DIM_SPACE, int _DIM_ELEMENT>
516
- class DiffOpIdH1 : public DiffOpId<_DIM_SPACE>
517
- {
518
- public:
519
- enum { DIM_SPACE = _DIM_SPACE };
520
- enum { DIM_ELEMENT = _DIM_ELEMENT };
521
-
522
- typedef DiffOpIdH1<_DIM_SPACE, _DIM_ELEMENT-1> DIFFOP_TRACE;
523
- };
524
-
525
- template <int _DIM_SPACE>
526
- class DiffOpIdH1<_DIM_SPACE,0> : public DiffOpId<_DIM_SPACE>
527
- {
528
- public:
529
- enum { DIM_SPACE = _DIM_SPACE };
530
- enum { DIM_ELEMENT = 0 };
531
-
532
- typedef void DIFFOP_TRACE;
533
- };
534
-
535
-
536
-
537
- /// Identity
538
- template <int D, int SYSDIM>
539
- class DiffOpIdSys : public DiffOp<DiffOpIdSys<D,SYSDIM> >
540
- {
541
- public:
542
- enum { DIM = SYSDIM };
543
- enum { DIM_SPACE = D };
544
- enum { DIM_ELEMENT = D };
545
- enum { DIM_DMAT = SYSDIM };
546
- enum { DIFFORDER = 0 };
547
-
548
- template <typename FEL, typename MIP, typename MAT>
549
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
550
- MAT & mat, LocalHeap & lh)
551
- {
552
- HeapReset hr(lh);
553
- const FlatVector<> shape = fel.GetShape (mip.IP(), lh);
554
-
555
-
556
- typedef typename MAT::TSCAL TSCAL;
557
- mat = TSCAL(0.);
558
- for (int j = 0; j < shape.Height(); j++)
559
- for (int i = 0; i < SYSDIM; i++)
560
- mat(i, j*SYSDIM+i) = shape(j);
561
- }
562
- };
563
-
564
-
565
-
566
-
567
-
568
- /// Identity on boundary
569
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
570
- class DiffOpIdBoundary : public DiffOp<DiffOpIdBoundary<D, FEL> >
571
- {
572
- public:
573
- enum { DIM = 1 };
574
- enum { DIM_SPACE = D };
575
- enum { DIM_ELEMENT = D-1 };
576
- enum { DIM_DMAT = 1 };
577
- enum { DIFFORDER = 0 };
578
-
579
- static string Name() { return "IdBoundary"; }
580
- static constexpr bool SUPPORT_PML = true;
581
- static IVec<0> GetDimensions() { return IVec<0>(); };
582
-
583
- static const FEL & Cast (const FiniteElement & fel)
584
- { return static_cast<const FEL&> (fel); }
585
-
586
- template <typename AFEL, typename MIP, typename MAT>
587
- static void GenerateMatrix (const AFEL & fel, const MIP & mip,
588
- MAT && mat, LocalHeap & lh)
589
- {
590
- Cast(fel).CalcShape (mip.IP(), mat.Row(0));
591
- }
592
-
593
-
594
- static int DimRef() { return 1; }
595
-
596
- template <typename IP, typename MAT>
597
- static void GenerateMatrixRef (const FiniteElement & fel, const IP & ip,
598
- MAT && mat, LocalHeap & lh)
599
- {
600
- Cast(fel).CalcShape (ip, mat.Row(0));
601
- }
602
-
603
- template <typename MIP, typename MAT>
604
- static void CalcTransformationMatrix (const MIP & mip,
605
- MAT & mat, LocalHeap & lh)
606
- {
607
- mat(0,0) = 1;
608
- }
609
-
610
-
611
-
612
- static void GenerateMatrixSIMDIR (const FiniteElement & fel,
613
- const SIMD_BaseMappedIntegrationRule & mir,
614
- BareSliceMatrix<SIMD<double>> mat)
615
- {
616
- Cast(fel).CalcShape (mir.IR(), mat);
617
- }
618
-
619
- template <typename AFEL, typename MIP, class TVX, class TVY>
620
- static void Apply (const AFEL & fel, const MIP & mip,
621
- const TVX & x, TVY && y,
622
- LocalHeap & lh)
623
- {
624
- HeapReset hr(lh);
625
- y = Trans (Cast(fel).GetShape (mip.IP(), lh)) * x;
626
- // y(0) = InnerProduct (x, static_cast<const FEL&>(fel).GetShape (mip.IP(), lh));
627
- }
628
-
629
- static void Apply (const ScalarFiniteElement<D-1> & fel, const MappedIntegrationPoint<D-1,D> & mip,
630
- const FlatVector<double> & x, FlatVector<double> & y,
631
- LocalHeap & lh)
632
- {
633
- y(0) = Cast(fel).Evaluate(mip.IP(), x);
634
- }
635
-
636
-
637
- template <typename AFEL, typename MIP, class TVX, class TVY>
638
- static void ApplyTrans (const AFEL & fel, const MIP & mip,
639
- const TVX & x, TVY & y,
640
- LocalHeap & lh)
641
- {
642
- HeapReset hr(lh);
643
- y.Range(0,fel.GetNDof()) = Cast(fel).GetShape (mip.IP(), lh) * x;
644
- }
645
-
646
-
647
-
648
-
649
- // using DiffOp<DiffOpIdBoundary<D, FEL> >::ApplyTransIR;
650
- template <class MIR>
651
- static void ApplyTransIR (const FiniteElement & fel, const MIR & mir,
652
- FlatMatrix<double> x, BareSliceVector<double> y,
653
- LocalHeap & lh)
654
- {
655
- Cast(fel).EvaluateTrans (mir.IR(), FlatVector<> (mir.Size(), &x(0,0)), y);
656
- }
657
-
658
- template <class MIR>
659
- static void ApplyTransIR (const FiniteElement & fel, const MIR & mir,
660
- FlatMatrix<Complex> x, BareSliceVector<Complex> y,
661
- LocalHeap & lh)
662
- {
663
- DiffOp<DiffOpIdBoundary<D, FEL> > :: ApplyTransIR (fel, mir, x, y, lh);
664
- // static_cast<const FEL&>(fel).
665
- // EvaluateTrans (mir.IR(), FlatVector<> (mir.Size(), &x(0,0)), y);
666
- }
667
-
668
- using DiffOp<DiffOpIdBoundary<D, FEL> >::ApplySIMDIR;
669
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
670
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
671
- {
672
- Cast(fel).Evaluate (mir.IR(), x, y.Row(0));
673
- }
674
-
675
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
676
- BareSliceVector<Complex> x, BareSliceMatrix<SIMD<Complex>> y)
677
- {
678
- Cast(fel).Evaluate (mir.IR(), x, y.Row(0));
679
- }
680
-
681
- // using DiffOp<DiffOpIdBoundary<D, FEL> >::AddTransSIMDIR;
682
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
683
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
684
- {
685
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
686
- }
687
-
688
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
689
- BareSliceMatrix<SIMD<Complex>> y, BareSliceVector<Complex> x)
690
- {
691
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
692
- }
693
-
694
- };
695
-
696
-
697
-
698
- /// Identity
699
- template <int D, int SYSDIM>
700
- class DiffOpIdBoundarySys : public DiffOp<DiffOpIdBoundarySys<D,SYSDIM> >
701
- {
702
- public:
703
- enum { DIM = SYSDIM };
704
- enum { DIM_SPACE = D };
705
- enum { DIM_ELEMENT = D-1 };
706
- enum { DIM_DMAT = SYSDIM };
707
- enum { DIFFORDER = 0 };
708
-
709
- template <typename FEL, typename MIP, typename MAT>
710
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
711
- MAT & mat, LocalHeap & lh)
712
- {
713
- mat = 0.;
714
- const FlatVector<> shape = fel.GetShape (mip.IP(), lh);
715
- for (int j = 0; j < shape.Height(); j++)
716
- for (int i = 0; i < SYSDIM; i++)
717
- mat(i, j*SYSDIM+i) = shape(j);
718
- }
719
- };
720
-
721
-
722
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
723
- class DiffOpHesseBoundary;
724
-
725
- template <int D>
726
- class DiffOpHesse : public DiffOp<DiffOpHesse<D>>
727
- {
728
- public:
729
- enum { DIM = 1 };
730
- enum { DIM_SPACE = D };
731
- enum { DIM_ELEMENT = D };
732
- enum { DIM_DMAT = D*D };
733
- enum { DIFFORDER = 2 };
734
-
735
- typedef DiffOpHesseBoundary<D> DIFFOP_TRACE;
736
-
737
-
738
- static string Name() { return "hesse"; }
739
- static IVec<2> GetDimensions() { return { D,D }; }
740
-
741
- static auto & Cast (const FiniteElement & fel)
742
- { return static_cast<const ScalarFiniteElement<D>&> (fel); }
743
-
744
- template <typename MIP, typename MAT>
745
- static void GenerateMatrix (const FiniteElement & fel, const MIP & mip,
746
- MAT && mat, LocalHeap & lh)
747
- {
748
- Cast(fel).CalcMappedDDShape(mip, Trans(mat));
749
- }
750
-
751
- static shared_ptr<CoefficientFunction>
752
- DiffShape (shared_ptr<CoefficientFunction> proxy,
753
- shared_ptr<CoefficientFunction> dir,
754
- bool eulerian);
755
- };
756
-
757
-
758
- template <int D, typename FEL>
759
- class DiffOpHesseBoundary : public DiffOp<DiffOpHesseBoundary<D, FEL> >
760
- {
761
- public:
762
- enum { DIM = 1 };
763
- enum { DIM_SPACE = D };
764
- enum { DIM_ELEMENT = D-1 };
765
- enum { DIM_DMAT = D*D };
766
- enum { DIFFORDER = 2 };
767
-
768
- typedef void DIFFOP_TRACE;
769
-
770
- static string Name() { return "hesseboundary"; }
771
- static IVec<2> GetDimensions() { return { D,D }; }
772
-
773
- static auto & Cast (const FiniteElement & fel)
774
- { return static_cast<const FEL&> (fel); }
775
-
776
- ///
777
- template <typename AFEL, typename MIP, typename MAT>
778
- static void GenerateMatrix (const AFEL & fel, const MIP & mip,
779
- MAT && mat, LocalHeap & lh)
780
- {
781
- HeapReset hr(lh);
782
-
783
- /*
784
- // old
785
- int nd = Cast(fel).GetNDof();
786
- auto ddshape = Cast(fel).GetDDShape(mip.IP(), lh);
787
- auto jinv = mip.GetJacobianInverse();
788
- auto dshape = Cast(fel).GetDShape (mip.IP(), lh);
789
-
790
- for( int n = 0; n < nd; n++)
791
- {
792
- for( int i = 0; i < D; i++)
793
- {
794
- for( int j = 0; j < D; j++)
795
- {
796
- mat(i*D+j,n) = 0.0;
797
- for( int k = 0; k < D-1; k++)
798
- {
799
- for( int l = 0; l < D-1; l++)
800
- {
801
- mat(i*D+j,n) += jinv(k,i)*ddshape(n,k*(D-1)+l)*jinv(l,j);
802
- }
803
- }
804
- }
805
- }
806
- }
807
-
808
- //for non-curved elements, we are finished, otherwise derivatives of Jacobian have to be computed...
809
- if (!mip.GetTransformation().IsCurvedElement()) return;
810
-
811
-
812
- Mat<D-1,D-1> hesse[D];
813
- switch(D)
814
- {
815
- case 3:
816
- mip.CalcHesse (hesse[0], hesse[1], hesse[2]);
817
- break;
818
- case 2:
819
- mip.CalcHesse (hesse[0], hesse[1]);
820
- break;
821
- default:
822
- throw Exception("Not implemented in DiffOpHesseBoundary!");
823
- break;
824
- }
825
-
826
- FlatMatrix<> tmp(D, (D-1)*(D-1), lh);
827
-
828
- for (int i = 0; i < D; i++)
829
- {
830
- for (int j = 0; j < D-1; j++)
831
- {
832
- for (int k = 0; k < D-1; k++)
833
- tmp(i,j*(D-1)+k) = hesse[i](j,k);
834
- }
835
- }
836
-
837
- FlatMatrix<> tmpmat(nd, (D-1)*(D-1), lh);
838
- tmpmat = dshape*jinv*tmp;
839
-
840
- for( int n = 0; n < nd; n++)
841
- {
842
- for( int i = 0; i < D; i++)
843
- {
844
- for( int j = 0; j < D; j++)
845
- {
846
- for( int k = 0; k < D-1; k++)
847
- {
848
- for( int l = 0; l < D-1; l++)
849
- {
850
- mat(i*D+j,n) -= jinv(k,i)*tmpmat(n,k*(D-1)+l)*jinv(l,j);
851
- }
852
- }
853
- }
854
- }
855
- }
856
- */
857
-
858
- /*
859
- // new
860
- int nd = Cast(fel).GetNDof();
861
-
862
- auto ddshape = Cast(fel).GetDDShape(mip.IP(), lh);
863
- auto dshape = Cast(fel).GetDShape (mip.IP(), lh);
864
- Mat<D-1,D> jinv = mip.GetJacobianInverse();
865
-
866
- for( int n = 0; n < nd; n++)
867
- {
868
- Mat<D-1,D-1> ddref = ddshape.Row(n).AsMatrix(D-1,D-1);
869
- Mat<D,D> ddphys = Trans(jinv)*ddref*jinv;
870
- mat.Col(n).AsMatrix(D,D) = ddphys;
871
- }
872
-
873
- //for non-curved elements, we are finished, otherwise derivatives of Jacobian have to be computed...
874
- if (!mip.GetTransformation().IsCurvedElement()) return;
875
-
876
- Vec<D,Mat<D-1,D-1>> hesse;
877
- mip.CalcHesse(hesse);
878
-
879
- Mat<D,(D-1)*(D-1)> tmp;
880
-
881
- for (int i = 0; i < D; i++)
882
- for (int j = 0; j < D-1; j++)
883
- for (int k = 0; k < D-1; k++)
884
- tmp(i,j*(D-1)+k) = hesse[i](j,k);
885
-
886
- FlatMatrix<> tmpmat(nd, (D-1)*(D-1), lh);
887
- tmpmat = dshape*(jinv*tmp);
888
-
889
- for( int n = 0; n < nd; n++)
890
- {
891
- Mat<D-1,D-1> ddref = tmpmat.Row(n).AsMatrix(D-1,D-1);
892
- Mat<D,D> ddphys = Trans(jinv)*ddref*jinv;
893
- mat.Col(n).AsMatrix(D,D) -= ddphys;
894
- }
895
- */
896
- /*
897
- // new new
898
- auto ddshape = Cast(fel).GetDDShape(mip.IP(), lh);
899
- Mat<D-1,D> jinv = mip.GetJacobianInverse();
900
-
901
- Mat<(D-1)*(D-1),D*D> trans;
902
- for (int i = 0; i < D; i++)
903
- for (int j = 0; j < D; j++)
904
- for (int k = 0; k < D-1; k++)
905
- for (int l = 0; l < D-1; l++)
906
- trans(k*(D-1)+l, i*D+j) = jinv(k,i)*jinv(l,j);
907
-
908
- if (mip.GetTransformation().IsCurvedElement())
909
- {
910
- auto dshape = Cast(fel).GetDShape (mip.IP(), lh);
911
-
912
- Vec<D,Mat<D-1,D-1>> hesse = mip.CalcHesse();
913
- Mat<D,(D-1)*(D-1)> tmp;
914
-
915
- for (int i = 0; i < D; i++)
916
- for (int j = 0; j < D-1; j++)
917
- for (int k = 0; k < D-1; k++)
918
- tmp(i,j*(D-1)+k) = hesse[i](j,k);
919
-
920
- ddshape -= dshape*(jinv*tmp);
921
- }
922
-
923
- mat = Trans(ddshape*trans);
924
- */
925
- Cast(fel).CalcMappedDDShape(mip, Trans(mat));
926
- }
927
-
928
-
929
- static constexpr double eps() { return 1e-4; }
930
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
931
- const SIMD_BaseMappedIntegrationRule & bmir,
932
- BareSliceMatrix<SIMD<double>> mat);
933
-
934
- using DiffOp<DiffOpHesseBoundary<D,FEL>>::ApplySIMDIR;
935
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & bmir,
936
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y);
937
-
938
- using DiffOp<DiffOpHesseBoundary<D,FEL>>::AddTransSIMDIR;
939
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & bmir,
940
- BareSliceMatrix<SIMD<double>> x, BareSliceVector<double> y);
941
-
942
- static shared_ptr<CoefficientFunction>
943
- DiffShape (shared_ptr<CoefficientFunction> proxy,
944
- shared_ptr<CoefficientFunction> dir,
945
- bool eulerian);
946
- };
947
-
948
-
949
- template <typename FEL>
950
- class DiffOpHesseBoundary<1,FEL> : public DiffOp<DiffOpHesseBoundary<1, FEL> >
951
- {
952
- public:
953
- enum { DIM = 1 };
954
- enum { DIM_SPACE = 1 };
955
- enum { DIM_ELEMENT = 0 };
956
- enum { DIM_DMAT = 1 };
957
- enum { DIFFORDER = 2 };
958
-
959
- typedef void DIFFOP_TRACE;
960
-
961
- static string Name() { return "hesseboundary"; }
962
- ///
963
- template <typename AFEL, typename MIP, typename MAT>
964
- static void GenerateMatrix (const AFEL & fel, const MIP & mip,
965
- MAT && mat, LocalHeap & lh)
966
- {
967
- throw Exception("hesseboundary not implemented for 1D!");
968
- }
969
- };
970
-
971
-
972
-
973
-
974
-
975
-
976
-
977
- /// diagonal tensor, all values are the same
978
- template <int DIM>
979
- class DiagDMat : public DMatOp<DiagDMat<DIM>,DIM>
980
- {
981
- shared_ptr<CoefficientFunction> coef;
982
- public:
983
- // typedef SCAL TSCAL;
984
- enum { DIM_DMAT = DIM };
985
- DiagDMat (shared_ptr<CoefficientFunction> acoef)
986
- : coef(acoef) { ; }
987
-
988
- // compatibility
989
- DiagDMat (const CoefficientFunction * acoef)
990
- : coef(const_cast<CoefficientFunction*>(acoef), NOOP_Deleter) { ; }
991
-
992
- DiagDMat (const Array<shared_ptr<CoefficientFunction>> & acoefs)
993
- : coef(acoefs[0]) { ; }
994
-
995
- template <typename SCAL>
996
- static DiagMat<DIM_DMAT,SCAL> GetMatrixType(SCAL s) { return SCAL(0); }
997
-
998
- template <typename FEL, typename MIP, typename MAT>
999
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1000
- MAT & mat, LocalHeap & lh) const
1001
- {
1002
- typedef typename MAT::TSCAL TRESULT;
1003
- TRESULT val = coef -> T_Evaluate<TRESULT> (mip);
1004
- mat = val * Id<DIM>();
1005
- }
1006
-
1007
- template <typename FEL, typename MIR, typename MAT>
1008
- void GenerateMatrixIR (const FEL & fel, const MIR & mir,
1009
- const FlatArray<MAT> & mats, LocalHeap & lh) const
1010
- {
1011
- typedef typename MAT::TSCAL TRESULT;
1012
- FlatMatrix<TRESULT> vals(mir.IR().GetNIP(), 1, lh);
1013
- coef -> Evaluate (mir, vals);
1014
-
1015
- for (int j = 0; j < mir.IR().GetNIP(); j++)
1016
- mats[j] = vals(j,0) * Id<DIM>();
1017
- }
1018
-
1019
- template <typename FEL, class VECX, class VECY>
1020
- void Apply (const FEL & fel, const BaseMappedIntegrationPoint & mip,
1021
- const VECX & x, VECY && y, LocalHeap & lh) const
1022
- {
1023
- typedef typename remove_reference<VECY>::type::TSCAL TRESULT;
1024
- TRESULT val = coef -> T_Evaluate<TRESULT> (mip);
1025
- for (int i = 0; i < DIM; i++)
1026
- y(i) = val * x(i);
1027
- }
1028
-
1029
- template <typename FEL, class VECX>
1030
- void Apply1 (const FEL & fel, const BaseMappedIntegrationPoint & mip,
1031
- const VECX & x, LocalHeap & lh) const
1032
- {
1033
- typedef typename VECX::TSCAL TSCAL;
1034
- auto val = coef -> T_Evaluate<TSCAL> (mip);
1035
- for (int i = 0; i < DIM; i++)
1036
- x(i) *= val;
1037
- }
1038
-
1039
- template <typename FEL, typename MIR, typename TVX>
1040
- void ApplyIR (const FEL & fel, const MIR & mir,
1041
- TVX & x, LocalHeap & lh) const
1042
- {
1043
- typedef typename TVX::TSCAL TSCAL;
1044
- FlatMatrix<TSCAL> values(mir.Size(), 1, lh);
1045
- coef -> Evaluate (mir, values);
1046
- for (int i = 0; i < mir.Size(); i++)
1047
- for (int j = 0; j < DIM; j++)
1048
- x(i,j) *= values(i, 0);
1049
- }
1050
- };
1051
-
1052
-
1053
-
1054
-
1055
-
1056
-
1057
- /// orthotropic tensor.
1058
- template <int N>
1059
- class OrthoDMat
1060
- {
1061
- };
1062
-
1063
- template <> class OrthoDMat<1> : public DMatOp<OrthoDMat<1>,1>
1064
- {
1065
- shared_ptr<CoefficientFunction> coef;
1066
- public:
1067
- enum { DIM_DMAT = 1 };
1068
- OrthoDMat (shared_ptr<CoefficientFunction> acoef) : coef(acoef) { ; }
1069
- OrthoDMat (const Array<shared_ptr<CoefficientFunction>> & acoef) : coef(acoef[0]) { ; }
1070
-
1071
- template <typename FEL, typename MIP, typename MAT>
1072
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1073
- MAT & mat, LocalHeap & lh) const
1074
- {
1075
- mat(0,0) = Evaluate (*coef, mip);
1076
- }
1077
-
1078
- template <typename FEL, typename MIP, class VECX, class VECY>
1079
- void Apply (const FEL & fel, const MIP & mip,
1080
- const VECX & x, VECY & y, LocalHeap & lh) const
1081
- {
1082
- y(0) = Evaluate (*coef, mip) * x(0);
1083
- }
1084
-
1085
- template <typename FEL, typename MIP, class VECX, class VECY>
1086
- void ApplyTrans (const FEL & fel, const MIP & mip,
1087
- const VECX & x, VECY & y, LocalHeap & lh) const
1088
- {
1089
- y(0) = Evaluate (*coef, mip) * x(0);
1090
- }
1091
-
1092
- };
1093
-
1094
-
1095
- template <> class OrthoDMat<2>: public DMatOp<OrthoDMat<2>,2>
1096
- {
1097
- shared_ptr<CoefficientFunction> coef1, coef2;
1098
- public:
1099
- enum { DIM_DMAT = 2 };
1100
- OrthoDMat (const Array<shared_ptr<CoefficientFunction>> & acoefs)
1101
- : coef1(acoefs[0]), coef2(acoefs[1]) { ; }
1102
-
1103
- /*
1104
- OrthoDMat (CoefficientFunction * acoef1,
1105
- CoefficientFunction * acoef2)
1106
- : coef1(acoef1), coef2(acoef2) { ; }
1107
- OrthoDMat (CoefficientFunction * acoef1,
1108
- CoefficientFunction * acoef2,
1109
- CoefficientFunction * acoef3)
1110
- : coef1(acoef1), coef2(acoef2) { ; }
1111
- */
1112
- template <typename FEL, typename MIP, typename MAT>
1113
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1114
- MAT & mat, LocalHeap & lh) const
1115
- {
1116
- mat = 0;
1117
- mat(0,0) = Evaluate (*coef1, mip);
1118
- mat(1,1) = Evaluate (*coef2, mip);
1119
- }
1120
-
1121
- template <typename FEL, typename MIP>
1122
- void GetEigensystem (const FEL & fel, const MIP & mip,
1123
- Array<double> & eigenvalues,
1124
- Array<double> & eigenvectors,
1125
- LocalHeap & lh) const
1126
- {
1127
- eigenvalues[0] = Evaluate (*coef1, mip);
1128
- eigenvalues[1] = Evaluate (*coef2, mip);
1129
- eigenvectors[0] = eigenvectors[3] = 1.;
1130
- eigenvectors[1] = eigenvectors[2] = 0.;
1131
- }
1132
-
1133
- template <typename FEL, typename MIP, class VECX, class VECY>
1134
- void Apply (const FEL & fel, const MIP & mip,
1135
- const VECX & x, VECY && y, LocalHeap & lh) const
1136
- {
1137
- y(0) = Evaluate (*coef1, mip) * x(0);
1138
- y(1) = Evaluate (*coef2, mip) * x(1);
1139
- }
1140
-
1141
- template <typename FEL, typename MIP, class VECX, class VECY>
1142
- void ApplyTrans (const FEL & fel, const MIP & mip,
1143
- const VECX & x, VECY & y, LocalHeap & lh) const
1144
- {
1145
- y(0) = Evaluate (*coef1, mip) * x(0);
1146
- y(1) = Evaluate (*coef2, mip) * x(1);
1147
- }
1148
- };
1149
-
1150
- template <> class OrthoDMat<3> : public DMatOp<OrthoDMat<3>,3>
1151
- {
1152
- shared_ptr<CoefficientFunction> coef1, coef2, coef3;
1153
-
1154
- public:
1155
- enum { DIM_DMAT = 3 };
1156
- OrthoDMat (const Array<shared_ptr<CoefficientFunction>> & acoefs)
1157
- : coef1(acoefs[0]), coef2(acoefs[1]), coef3(acoefs[2]) { ; }
1158
- /*
1159
- OrthoDMat (CoefficientFunction * acoef1,
1160
- CoefficientFunction * acoef2)
1161
- : coef1(acoef1), coef2(acoef2), coef3(acoef2) { ; }
1162
- OrthoDMat (CoefficientFunction * acoef1,
1163
- CoefficientFunction * acoef2,
1164
- CoefficientFunction * acoef3)
1165
- : coef1(acoef1), coef2(acoef2), coef3(acoef3) { ; }
1166
- */
1167
-
1168
- template <typename FEL, typename MIP, typename MAT>
1169
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1170
- MAT & mat, LocalHeap & lh) const
1171
- {
1172
- mat = 0;
1173
- mat(0,0) = Evaluate (*coef1, mip);
1174
- mat(1,1) = Evaluate (*coef2, mip);
1175
- mat(2,2) = Evaluate (*coef3, mip);
1176
- }
1177
-
1178
-
1179
- template <typename FEL, typename MIP>
1180
- void GetEigensystem (const FEL & fel, const MIP & mip,
1181
- Array<double> & eigenvalues,
1182
- Array<double> & eigenvectors,
1183
- LocalHeap & lh) const
1184
- {
1185
-
1186
- eigenvalues[0] = Evaluate(*coef1,mip);
1187
- eigenvalues[1] = Evaluate(*coef2,mip);
1188
- eigenvalues[2] = Evaluate(*coef3,mip);
1189
-
1190
- eigenvectors = 0.;
1191
- eigenvectors[0] = eigenvectors[4] = eigenvectors[8] = 1.;
1192
- }
1193
-
1194
-
1195
- template <typename FEL, typename MIP, class VECX, class VECY>
1196
- void Apply (const FEL & fel, const MIP & mip,
1197
- const VECX & x, VECY && y, LocalHeap & lh) const
1198
- {
1199
- y(0) = Evaluate (*coef1, mip) * x(0);
1200
- y(1) = Evaluate (*coef2, mip) * x(1);
1201
- y(2) = Evaluate (*coef3, mip) * x(2);
1202
- }
1203
-
1204
- template <typename FEL, typename MIP, class VECX, class VECY>
1205
- void ApplyTrans (const FEL & fel, const MIP & mip,
1206
- const VECX & x, VECY & y, LocalHeap & lh) const
1207
- {
1208
- y(0) = Evaluate (*coef1, mip) * x(0);
1209
- y(1) = Evaluate (*coef2, mip) * x(1);
1210
- y(2) = Evaluate (*coef3, mip) * x(2);
1211
- }
1212
-
1213
- void SetCoefficientFunctions( shared_ptr<CoefficientFunction> acoef1,
1214
- shared_ptr<CoefficientFunction> acoef2,
1215
- shared_ptr<CoefficientFunction> acoef3 )
1216
- {
1217
- // NOTE: alte coefficient-functions werden nicht geloescht!
1218
- coef1 = acoef1;
1219
- coef2 = acoef2;
1220
- coef3 = acoef3;
1221
- }
1222
- };
1223
-
1224
-
1225
-
1226
-
1227
-
1228
-
1229
-
1230
-
1231
-
1232
- /// full symmetric tensor
1233
- template <int N>
1234
- class SymDMat : public DMatOp<SymDMat<N>,0>
1235
- {
1236
- };
1237
-
1238
- template <> class SymDMat<1> : public DMatOp<SymDMat<1>,1>
1239
- {
1240
- shared_ptr<CoefficientFunction> coef;
1241
- public:
1242
- enum { DIM_DMAT = 1 };
1243
-
1244
- SymDMat (shared_ptr<CoefficientFunction> acoef) : coef(acoef) { ; }
1245
- SymDMat (const Array<shared_ptr<CoefficientFunction>> & coefs) : coef(coefs[0]) { ; }
1246
-
1247
- template <typename FEL, typename MIP, typename MAT>
1248
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1249
- MAT & mat, LocalHeap & lh) const
1250
- {
1251
- mat(0,0) = Evaluate (*coef, mip);
1252
- }
1253
- };
1254
-
1255
-
1256
- template <> class SymDMat<2> : public DMatOp<SymDMat<2>,3>
1257
- {
1258
- shared_ptr<CoefficientFunction> coef00;
1259
- shared_ptr<CoefficientFunction> coef01;
1260
- shared_ptr<CoefficientFunction> coef11;
1261
- public:
1262
- enum { DIM_DMAT = 2 };
1263
-
1264
- SymDMat (shared_ptr<CoefficientFunction> acoef00,
1265
- shared_ptr<CoefficientFunction> acoef01,
1266
- shared_ptr<CoefficientFunction> acoef11)
1267
- : coef00(acoef00), coef01(acoef01), coef11(acoef11) { ; }
1268
-
1269
- SymDMat (const Array<shared_ptr<CoefficientFunction>> & coefs)
1270
- : coef00(coefs[0]), coef01(coefs[1]), coef11(coefs[2]) { ; }
1271
-
1272
-
1273
- template <typename FEL, typename MIP, typename MAT>
1274
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1275
- MAT & mat, LocalHeap & lh) const
1276
- {
1277
- mat = 0;
1278
- mat(0,0) = Evaluate (*coef00, mip);
1279
- mat(0,1) = mat(1,0) = Evaluate (*coef01, mip);
1280
- mat(1,1) = Evaluate (*coef11, mip);
1281
- }
1282
- };
1283
-
1284
- template <> class SymDMat<3> : public DMatOp<SymDMat<3>,6>
1285
- {
1286
- shared_ptr<CoefficientFunction> coef00;
1287
- shared_ptr<CoefficientFunction> coef10;
1288
- shared_ptr<CoefficientFunction> coef11;
1289
- shared_ptr<CoefficientFunction> coef20;
1290
- shared_ptr<CoefficientFunction> coef21;
1291
- shared_ptr<CoefficientFunction> coef22;
1292
- public:
1293
- enum { DIM_DMAT = 3 };
1294
-
1295
- SymDMat (shared_ptr<CoefficientFunction> acoef00,
1296
- shared_ptr<CoefficientFunction> acoef10,
1297
- shared_ptr<CoefficientFunction> acoef11,
1298
- shared_ptr<CoefficientFunction> acoef20,
1299
- shared_ptr<CoefficientFunction> acoef21,
1300
- shared_ptr<CoefficientFunction> acoef22)
1301
- : coef00(acoef00), coef10(acoef10), coef11(acoef11),
1302
- coef20(acoef20), coef21(acoef21), coef22(acoef22) { ; }
1303
-
1304
- SymDMat (const Array<shared_ptr<CoefficientFunction>> & coefs)
1305
- : coef00(coefs[0]), coef10(coefs[1]), coef11(coefs[2]),
1306
- coef20(coefs[3]), coef21(coefs[4]), coef22(coefs[5])
1307
- { ; }
1308
-
1309
-
1310
- template <typename FEL, typename MIP, typename MAT>
1311
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1312
- MAT & mat, LocalHeap & lh) const
1313
- {
1314
- mat = 0;
1315
- mat(0,0) = Evaluate (*coef00, mip);
1316
- mat(1,0) = mat(0,1) = Evaluate (*coef10, mip);
1317
- mat(1,1) = Evaluate (*coef11, mip);
1318
- mat(2,0) = mat(0,2) = Evaluate (*coef20, mip);
1319
- mat(2,1) = mat(1,2) = Evaluate (*coef21, mip);
1320
- mat(2,2) = Evaluate (*coef22, mip);
1321
- }
1322
- };
1323
-
1324
-
1325
-
1326
-
1327
-
1328
-
1329
-
1330
-
1331
-
1332
- ///
1333
- template <int DIM>
1334
- class NormalDMat : public DMatOp<NormalDMat<DIM>,DIM>
1335
- {
1336
- CoefficientFunction * coef;
1337
- public:
1338
- enum { DIM_DMAT = DIM };
1339
- NormalDMat (CoefficientFunction * acoef) : coef(acoef) { ; }
1340
-
1341
- template <typename FEL, typename MIP, typename MAT>
1342
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1343
- MAT & mat, LocalHeap & lh) const
1344
- {
1345
- mat = 0;
1346
- double val = Evaluate (*coef, mip);
1347
- Vec<DIM> nv = mip.GetNV();
1348
- for (int i = 0; i < DIM; i++)
1349
- for (int j = 0; j < DIM; j++)
1350
- mat(i, j) = val * nv(i) * nv(j);
1351
- }
1352
- };
1353
-
1354
-
1355
-
1356
-
1357
-
1358
-
1359
- template <int N>
1360
- class NGS_DLL_HEADER DVec // : public DVecBase<N,T>
1361
- {
1362
- shared_ptr<CoefficientFunction> coefs[N];
1363
- bool vectorial;
1364
- public:
1365
- DVec (const Array<shared_ptr<CoefficientFunction>> & acoeffs)
1366
- {
1367
- vectorial = (N > 1) && (N == acoeffs[0]->Dimension());
1368
-
1369
- if (vectorial)
1370
- coefs[0] = acoeffs[0];
1371
- else
1372
- {
1373
- if (acoeffs.Size() != N)
1374
- throw Exception (string("need ")+ToString(N)+" components, but have "+ToString(acoeffs.Size()));
1375
- for (int i = 0; i < N; i++)
1376
- coefs[i] = acoeffs[i];
1377
- }
1378
- }
1379
-
1380
- DVec (shared_ptr<CoefficientFunction> acoef)
1381
- {
1382
- vectorial = (N > 1) && (N == acoef->Dimension());
1383
- coefs[0] = acoef;
1384
- }
1385
-
1386
- DVec (shared_ptr<CoefficientFunction> acoef1,
1387
- shared_ptr<CoefficientFunction> acoef2,
1388
- shared_ptr<CoefficientFunction> acoef3 = NULL,
1389
- shared_ptr<CoefficientFunction> acoef4 = NULL,
1390
- shared_ptr<CoefficientFunction> acoef5 = NULL,
1391
- shared_ptr<CoefficientFunction> acoef6 = NULL)
1392
- {
1393
- vectorial = false;
1394
-
1395
- coefs[0] = acoef1;
1396
- coefs[1] = acoef2;
1397
- if (N >= 3) coefs[2] = acoef3;
1398
- if (N >= 4) coefs[3] = acoef4;
1399
- if (N >= 5) coefs[4] = acoef5;
1400
- if (N >= 6) coefs[5] = acoef6;
1401
- }
1402
-
1403
-
1404
- template <typename FEL, typename MIP, typename VEC>
1405
- void GenerateVector (const FEL & fel, const MIP & mip,
1406
- VEC & vec, LocalHeap & lh) const
1407
- {
1408
- typedef typename VEC::TSCAL TSCAL;
1409
-
1410
- if (vectorial)
1411
- {
1412
- coefs[0] -> Evaluate (mip, vec);
1413
- }
1414
- else
1415
- for (int i = 0; i < N; i++)
1416
- {
1417
- // does not compile with gcc 4.6 ...
1418
- // vec(i) = coefs[i] -> T_Evaluate<TSCAL> (mip);
1419
-
1420
- // this works ...
1421
- // CoefficientFunction * hp = coefs[i];
1422
- // vec(i) = hp -> T_Evaluate<TSCAL> (mip);
1423
-
1424
- // solution thx to Matthias Hochsteger
1425
- vec(i) = coefs[i] -> template T_Evaluate<TSCAL> (mip);
1426
- }
1427
- }
1428
-
1429
-
1430
-
1431
- template <typename FEL, typename MIR, typename VEC>
1432
- void GenerateVectorIR (const FEL & fel, const MIR & mir,
1433
- VEC & vecs, LocalHeap & lh) const
1434
- {
1435
- typedef typename VEC::TSCAL TSCAL;
1436
-
1437
- if (vectorial || N == 1)
1438
- {
1439
- coefs[0] -> Evaluate (mir, vecs);
1440
- }
1441
- else
1442
- for (int j = 0; j < mir.Size(); j++)
1443
- for (int i = 0; i < N; i++)
1444
- {
1445
- vecs(j,i) =
1446
- coefs[i] -> template T_Evaluate<TSCAL> (mir[j]);
1447
- }
1448
- }
1449
- };
1450
-
1451
-
1452
-
1453
-
1454
- template <int N, typename T = double>
1455
- class DVecN
1456
- {
1457
- shared_ptr<CoefficientFunction> coef;
1458
- public:
1459
- typedef T TSCAL;
1460
- DVecN (shared_ptr<CoefficientFunction> acoef)
1461
- : coef(acoef) { ; }
1462
- DVecN (const Array<shared_ptr<CoefficientFunction>> & acoef)
1463
- : coef(acoef[0]) { ; }
1464
-
1465
- template <typename FEL, typename MIP, typename VEC>
1466
- void GenerateVector (const FEL & fel, const MIP & mip,
1467
- VEC && vec, LocalHeap & lh) const
1468
- {
1469
- Vec<N> hv;
1470
- coef -> Evaluate (mip, hv);
1471
- for (int i = 0; i < N; i++)
1472
- vec(i) = hv(i);
1473
- }
1474
-
1475
- template <typename FEL, typename MIR, typename VEC>
1476
- void GenerateVectorIR (const FEL & fel, const MIR & mir,
1477
- VEC & vecs, LocalHeap & lh) const
1478
- {
1479
- for (int i = 0; i < mir.Size(); i++)
1480
- GenerateVector (fel, mir[i], vecs.Row(i), lh);
1481
- }
1482
- };
1483
-
1484
-
1485
-
1486
- template <int N>
1487
- class TVec
1488
- {
1489
- shared_ptr<CoefficientFunction> coef;
1490
-
1491
- public:
1492
- typedef double TSCAL;
1493
-
1494
- TVec (shared_ptr<CoefficientFunction> acoef) : coef(acoef) {;}
1495
- TVec (const Array<shared_ptr<CoefficientFunction>> & coefs) : coef(coefs[0]) {;}
1496
-
1497
-
1498
- template <typename FEL, typename MIP, typename VEC>
1499
- void GenerateVector (const FEL & fel, const MIP & mip,
1500
- VEC && vec, LocalHeap & lh) const
1501
- {
1502
- vec = 0.0;
1503
-
1504
- typedef typename remove_reference<VEC>::type::TSCAL TSCAL;
1505
-
1506
- TSCAL length = 0.;
1507
- for(int i=0; i<N; i++)
1508
- {
1509
- //vec(i) = mip.GetJacobian()(i,0);
1510
- vec(i) = mip.GetTV()(i);
1511
- length += vec(i)*vec(i);
1512
- }
1513
- //(*testout) << "point " << mip.GetPoint() << " tv " << vec;
1514
- vec *= Evaluate (*coef, mip)/sqrt(length);
1515
- //(*testout) << " retval " << vec << endl;
1516
- }
1517
-
1518
- template <typename FEL, typename MIR, typename VEC>
1519
- void GenerateVectorIR (const FEL & fel, const MIR & mir,
1520
- VEC & vecs, LocalHeap & lh) const
1521
- {
1522
- for (int i = 0; i < mir.Size(); i++)
1523
- GenerateVector (fel, mir[i], vecs.Row(i), lh);
1524
- }
1525
-
1526
- };
1527
-
1528
-
1529
-
1530
-
1531
-
1532
-
1533
-
1534
-
1535
-
1536
-
1537
-
1538
- /// DMat for rot.-sym. Laplace operator
1539
- template <int DIM>
1540
- class RotSymLaplaceDMat : public DMatOp<RotSymLaplaceDMat<DIM>,DIM>
1541
- {
1542
- shared_ptr<CoefficientFunction> coef;
1543
- public:
1544
- enum { DIM_DMAT = DIM };
1545
-
1546
- RotSymLaplaceDMat (shared_ptr<CoefficientFunction> acoef) : coef(acoef) { ; }
1547
- RotSymLaplaceDMat (const Array<shared_ptr<CoefficientFunction>> & acoef) : coef(acoef[0]) { ; }
1548
-
1549
- template <typename FEL, typename MIP, typename MAT>
1550
- void GenerateMatrix (const FEL & fel, const MIP & mip,
1551
- MAT & mat, LocalHeap & lh) const
1552
- {
1553
- mat = 0;
1554
- const double r = mip.GetPoint()(0);
1555
- double val = r*Evaluate (*coef, mip);
1556
- for (int i = 0; i < DIM; i++)
1557
- mat(i, i) = val;
1558
- }
1559
-
1560
-
1561
- template <typename FEL, typename MIP, class VECX, class VECY>
1562
- void Apply (const FEL & fel, const MIP & mip,
1563
- const VECX & x, VECY && y, LocalHeap & lh) const
1564
- {
1565
- const double r = mip.GetPoint()(0);
1566
- double val = r*Evaluate (*coef, mip);
1567
- y = val * x;
1568
- }
1569
- };
1570
-
1571
-
1572
-
1573
-
1574
-
1575
-
1576
- /// Identity on boundary
1577
- template <int D, typename FEL = ScalarFiniteElement<D> >
1578
- class DiffOpNormal : public DiffOp<DiffOpNormal<D, FEL> >
1579
- {
1580
- public:
1581
- enum { DIM = D };
1582
- enum { DIM_SPACE = D };
1583
- enum { DIM_ELEMENT = D-1 };
1584
- enum { DIM_DMAT = 1 };
1585
- enum { DIFFORDER = 0 };
1586
-
1587
- template <typename MIP, typename MAT>
1588
- static void GenerateMatrix (const FiniteElement & fel, const MIP & mip,
1589
- MAT && mat, LocalHeap & lh)
1590
- {
1591
- FlatVector<> shape = static_cast<const FEL&> (fel).GetShape (mip.IP(), lh);
1592
- // Vec<D> nv = mip.GetNV();
1593
- auto nv = mip.GetNV();
1594
- //Vec<D> p = mip.GetPoint();
1595
- for (int j = 0; j < shape.Size(); j++)
1596
- for (int i = 0; i < D; i++)
1597
- mat(0, j*D+i) = shape(j) * nv(i);
1598
-
1599
- //(*testout) << "mip = " << p << ", nv = " << nv << endl;
1600
- //p(0) = 0.0;
1601
- //p /= L2Norm(p);
1602
- //nv /= L2Norm(nv);
1603
- //(*testout) << "normalized, mip = " << p << ", nv = " << nv << endl;
1604
- //(*testout) << "mat = " << mat << endl;
1605
- }
1606
- };
1607
-
1608
-
1609
-
1610
-
1611
-
1612
- /// integrator for \f$\int_\Gamma u_n v_n \, ds\f$
1613
- template <int D>
1614
- class NormalRobinIntegrator
1615
- : public T_BDBIntegrator<DiffOpNormal<D>, DiagDMat<1>, ScalarFiniteElement<D-1> >
1616
- {
1617
- typedef T_BDBIntegrator<DiffOpNormal<D>, DiagDMat<1>, ScalarFiniteElement<D-1> > BASE;
1618
- public:
1619
- using T_BDBIntegrator<DiffOpNormal<D>, DiagDMat<1>, ScalarFiniteElement<D-1> >::T_BDBIntegrator;
1620
- /*
1621
- NormalRobinIntegrator (CoefficientFunction * coeff)
1622
- : T_BDBIntegrator<DiffOpNormal<D>, DiagDMat<1>, ScalarFiniteElement<D-1> > (DiagDMat<1> (coeff))
1623
- { ; }
1624
-
1625
-
1626
- static Integrator * Create (Array<CoefficientFunction*> & coeffs)
1627
- {
1628
- return new NormalRobinIntegrator (coeffs[0]);
1629
- }
1630
-
1631
- virtual bool BoundaryForm () const { return 1; }
1632
- */
1633
- virtual string Name () const { return "NormalRobin"; }
1634
- };
1635
-
1636
-
1637
-
1638
-
1639
-
1640
-
1641
- // ********************************* Scalar integrators: ********************
1642
-
1643
- /// Integrator for grad u grad v
1644
- template <int D, typename FEL = ScalarFiniteElement<D> >
1645
- class NGS_DLL_HEADER LaplaceIntegrator
1646
- : public T_BDBIntegrator<DiffOpGradient<D>, DiagDMat<D>, FEL>
1647
- {
1648
- typedef T_BDBIntegrator<DiffOpGradient<D>, DiagDMat<D>, FEL> BASE;
1649
-
1650
- public:
1651
- using T_BDBIntegrator<DiffOpGradient<D>, DiagDMat<D>, FEL>::T_BDBIntegrator;
1652
- virtual string Name () const { return "Laplace"; }
1653
- };
1654
-
1655
-
1656
- ///
1657
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
1658
- class LaplaceBoundaryIntegrator
1659
- : public T_BDBIntegrator<DiffOpGradientBoundary<D>, DiagDMat<D>, FEL>
1660
- {
1661
- typedef T_BDBIntegrator<DiffOpGradientBoundary<D>, DiagDMat<D>, FEL> BASE;
1662
- public:
1663
- using T_BDBIntegrator<DiffOpGradientBoundary<D>, DiagDMat<D>, FEL>::T_BDBIntegrator;
1664
- /*
1665
- LaplaceBoundaryIntegrator (shared_ptr<CoefficientFunction> coeff)
1666
- : BASE(DiagDMat<D>(coeff)) { ; }
1667
- */
1668
- virtual string Name () const { return "Laplace-Boundary"; }
1669
- };
1670
-
1671
-
1672
-
1673
- ///
1674
- template <int D, typename FEL = ScalarFiniteElement<D> >
1675
- class RotSymLaplaceIntegrator
1676
- : public T_BDBIntegrator<DiffOpGradient<D>, RotSymLaplaceDMat<D>, FEL>
1677
- {
1678
- typedef T_BDBIntegrator<DiffOpGradient<D>, RotSymLaplaceDMat<D>, FEL> BASE;
1679
- public:
1680
- using T_BDBIntegrator<DiffOpGradient<D>, RotSymLaplaceDMat<D>, FEL>::T_BDBIntegrator;
1681
- virtual string Name () const { return "RotSymLaplace"; }
1682
- };
1683
-
1684
-
1685
- ///
1686
- template <int D, typename FEL = ScalarFiniteElement<D> >
1687
- class OrthoLaplaceIntegrator
1688
- : public T_BDBIntegrator<DiffOpGradient<D>, OrthoDMat<D>, FEL>
1689
- {
1690
- typedef T_BDBIntegrator<DiffOpGradient<D>, OrthoDMat<D>, FEL> BASE;
1691
- public:
1692
- using T_BDBIntegrator<DiffOpGradient<D>, OrthoDMat<D>, FEL>::T_BDBIntegrator;
1693
- virtual string Name () const { return "OrthoLaplace"; }
1694
- };
1695
-
1696
-
1697
- ///
1698
- template <int D, typename FEL = ScalarFiniteElement<D> >
1699
- class NGS_DLL_HEADER MassIntegrator
1700
- : public T_BDBIntegrator<DiffOpId<D>, DiagDMat<1>, FEL >
1701
- {
1702
- typedef T_BDBIntegrator<DiffOpId<D>, DiagDMat<1>, FEL> BASE;
1703
- public:
1704
- using T_BDBIntegrator<DiffOpId<D>, DiagDMat<1>, FEL>::T_BDBIntegrator;
1705
- virtual string Name () const { return "Mass"; }
1706
- };
1707
-
1708
-
1709
- /// integrator for \f$\int_\Gamma u v \, ds\f$
1710
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
1711
- class NGS_DLL_HEADER RobinIntegrator
1712
- : public T_BDBIntegrator<DiffOpIdBoundary<D>, DiagDMat<1>, FEL>
1713
- {
1714
- typedef T_BDBIntegrator<DiffOpIdBoundary<D>, DiagDMat<1>, FEL> BASE;
1715
- public:
1716
- using T_BDBIntegrator<DiffOpIdBoundary<D>, DiagDMat<1>, FEL>::T_BDBIntegrator;
1717
- // RobinIntegrator (shared_ptr<CoefficientFunction> coeff) : BASE(DiagDMat<1> (coeff)) { ; }
1718
- // nvirtual ~RobinIntegrator () { ; }
1719
- // virtual bool BoundaryForm () const { return 1; }
1720
- virtual string Name () const { return "Robin"; }
1721
- };
1722
-
1723
-
1724
-
1725
-
1726
-
1727
- /*
1728
- template <int D>
1729
- class NormalRobinIntegrator
1730
- : public T_BDBIntegrator<DiffOpIdBoundary<D,D>, NormalDMat<D>, ScalarFiniteElement<D> >
1731
- {
1732
- public:
1733
- NormalRobinIntegrator (CoefficientFunction * coeff)
1734
- : T_BDBIntegrator<DiffOpIdBoundary<D,D>, NormalDMat<D>, ScalarFiniteElement<D> > (NormalDMat<D> (coeff))
1735
- { ; }
1736
-
1737
- static Integrator * Create (Array<CoefficientFunction*> & coeffs)
1738
- {
1739
- return new NormalRobinIntegrator (coeffs[0]);
1740
- }
1741
-
1742
- virtual bool BoundaryForm () const { return 1; }
1743
- virtual string Name () const { return "NormalRobin"; }
1744
- };
1745
- */
1746
-
1747
-
1748
- ///
1749
- template <int D>
1750
- class DiffOpDiv : public DiffOp<DiffOpDiv<D> >
1751
- {
1752
- public:
1753
- enum { DIM = D };
1754
- enum { DIM_SPACE = D };
1755
- enum { DIM_ELEMENT = D };
1756
- enum { DIM_DMAT = 1 };
1757
- enum { DIFFORDER = 1 };
1758
-
1759
- template <typename FEL, typename MIP, typename MAT>
1760
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
1761
- MAT & mat, LocalHeap & lh)
1762
- {
1763
- int nd = fel.GetNDof();
1764
-
1765
- FlatMatrix<> grad (D, nd, lh);
1766
- grad = Trans (mip.GetJacobianInverse ()) *
1767
- Trans (fel.GetDShape(mip.IP(), lh));
1768
-
1769
- mat = 0;
1770
- for (int i = 0; i < nd; i++)
1771
- for (int j = 0; j < DIM; j++)
1772
- mat(0, DIM*i+j) = grad(j, i);
1773
- }
1774
- };
1775
-
1776
-
1777
- template <int D, typename FEL = ScalarFiniteElement<D> >
1778
- class DivDivIntegrator
1779
- : public T_BDBIntegrator<DiffOpDiv<D>, DiagDMat<1>, FEL>
1780
- {
1781
- typedef T_BDBIntegrator<DiffOpDiv<D>, DiagDMat<1>, FEL> BASE;
1782
- public:
1783
- using T_BDBIntegrator<DiffOpDiv<D>, DiagDMat<1>, FEL>::T_BDBIntegrator;
1784
- virtual string Name () const { return "DivDiv"; }
1785
- };
1786
-
1787
-
1788
-
1789
- ///
1790
- class DiffOpCurl : public DiffOp<DiffOpCurl>
1791
- {
1792
- public:
1793
- enum { DIM = 2 };
1794
- enum { DIM_SPACE = 2 };
1795
- enum { DIM_ELEMENT = 2 };
1796
- enum { DIM_DMAT = 1 };
1797
- enum { DIFFORDER = 1 };
1798
-
1799
- template <typename FEL, typename MIP, typename MAT>
1800
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
1801
- MAT & mat, LocalHeap & lh)
1802
- {
1803
- int nd = fel.GetNDof();
1804
-
1805
- FlatMatrix<> grad (2, nd, lh);
1806
- grad = Trans (mip.GetJacobianInverse ()) *
1807
- Trans (fel.GetDShape(mip.IP(), lh));
1808
-
1809
- mat = 0;
1810
- for (int i = 0; i < nd; i++)
1811
- {
1812
- mat(0, DIM*i ) = grad(1, i);
1813
- mat(0, DIM*i+1) = -grad(0, i);
1814
- }
1815
- }
1816
- };
1817
-
1818
-
1819
- template <typename FEL = ScalarFiniteElement<2> >
1820
- class CurlCurlIntegrator
1821
- : public T_BDBIntegrator<DiffOpCurl, DiagDMat<1>, FEL>
1822
- {
1823
- typedef T_BDBIntegrator<DiffOpCurl, DiagDMat<1>, FEL> BASE;
1824
- public:
1825
- using T_BDBIntegrator<DiffOpCurl, DiagDMat<1>, FEL>::T_BDBIntegrator;
1826
- virtual string Name () const { return "CurlCurl"; }
1827
- };
1828
-
1829
-
1830
-
1831
- ///
1832
- class DiffOpCurl3d : public DiffOp<DiffOpCurl3d>
1833
- {
1834
- public:
1835
- enum { DIM = 3 };
1836
- enum { DIM_SPACE = 3 };
1837
- enum { DIM_ELEMENT = 3 };
1838
- enum { DIM_DMAT = 3 };
1839
- enum { DIFFORDER = 1 };
1840
-
1841
- template <typename FEL, typename MIP, typename MAT>
1842
- static void GenerateMatrix (const FEL & fel, const MIP & mip,
1843
- MAT & mat, LocalHeap & lh)
1844
- {
1845
- int nd = fel.GetNDof();
1846
-
1847
- FlatMatrix<> grad (3, nd, lh);
1848
- grad = Trans (mip.GetJacobianInverse ()) *
1849
- Trans (fel.GetDShape(mip.IP(), lh));
1850
-
1851
- mat = 0;
1852
- for (int i = 0; i < nd; i++)
1853
- {
1854
- mat(0, DIM*i+2) = grad(1, i);
1855
- mat(0, DIM*i+1) = -grad(2, i);
1856
- mat(1, DIM*i+0) = grad(2, i);
1857
- mat(1, DIM*i+2) = -grad(0, i);
1858
- mat(2, DIM*i+1) = grad(0, i);
1859
- mat(2, DIM*i+0) = -grad(1, i);
1860
- }
1861
- }
1862
- };
1863
-
1864
-
1865
- template <typename FEL = ScalarFiniteElement<3> >
1866
- class CurlCurl3dIntegrator
1867
- : public T_BDBIntegrator<DiffOpCurl3d, DiagDMat<3>, FEL>
1868
- {
1869
- typedef T_BDBIntegrator<DiffOpCurl3d, DiagDMat<3>, FEL> BASE;
1870
- public:
1871
- using T_BDBIntegrator<DiffOpCurl3d, DiagDMat<3>, FEL>::T_BDBIntegrator;
1872
- virtual string Name () const { return "CurlCurl3d"; }
1873
- };
1874
-
1875
-
1876
-
1877
-
1878
-
1879
-
1880
-
1881
-
1882
-
1883
-
1884
-
1885
-
1886
-
1887
-
1888
-
1889
-
1890
-
1891
-
1892
-
1893
- /* ********************* Vectorial Diffops ******************************** */
1894
-
1895
-
1896
- template <int DIM_SPC, VorB VB = VOL>
1897
- class DiffOpIdVectorH1 : public DiffOp<DiffOpIdVectorH1<DIM_SPC, VB> >
1898
- {
1899
- public:
1900
- enum { DIM = 1 };
1901
- enum { DIM_SPACE = DIM_SPC };
1902
- enum { DIM_ELEMENT = DIM_SPC-VB };
1903
- enum { DIM_DMAT = DIM_SPC };
1904
- enum { DIFFORDER = 0 };
1905
-
1906
- static string Name() { return "Id"; }
1907
- static constexpr bool SUPPORT_PML = true;
1908
- static bool SupportsVB (VorB checkvb) { return true; }
1909
-
1910
- template <typename FEL, typename MIP, typename MAT>
1911
- static void GenerateMatrix (const FEL & bfel, const MIP & mip,
1912
- MAT && mat, LocalHeap & lh)
1913
- {
1914
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
1915
- mat.AddSize(DIM_DMAT, bfel.GetNDof()) = 0.0;
1916
- for (int i = 0; i < DIM_SPC; i++)
1917
- {
1918
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
1919
- feli.CalcShape (mip.IP(), mat.Row(i).Range(fel.GetRange(i)));
1920
- }
1921
- }
1922
-
1923
-
1924
-
1925
- static int DimRef() { return DIM_SPC; }
1926
-
1927
- template <typename IP, typename MAT>
1928
- static void GenerateMatrixRef (const FiniteElement & bfel, const IP & ip,
1929
- MAT && mat, LocalHeap & lh)
1930
- {
1931
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
1932
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
1933
- int ndofi = feli.GetNDof();
1934
- mat.Rows(DIM_SPC).Cols(fel.GetNDof()) = 0.0;
1935
- feli.CalcShape (ip, mat.Row(0).Range(ndofi));
1936
- for (int i = 1; i < DIM_SPC; i++)
1937
- mat.Row(i).Range(i*ndofi, (i+1)*ndofi) = mat.Row(0).Range(ndofi);
1938
- }
1939
-
1940
- template <typename MIP, typename MAT>
1941
- static void CalcTransformationMatrix (const MIP & mip,
1942
- MAT & mat, LocalHeap & lh)
1943
- {
1944
- mat = Identity(DIM_SPC);
1945
- }
1946
-
1947
-
1948
-
1949
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
1950
- const SIMD_BaseMappedIntegrationRule & mir,
1951
- BareSliceMatrix<SIMD<double>> mat)
1952
- {
1953
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
1954
- mat.AddSize(DIM_SPC*bfel.GetNDof(), mir.Size()) = 0.0;
1955
- for (int i = 0; i < DIM_SPC; i++)
1956
- {
1957
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
1958
- feli.CalcShape (mir.IR(), mat.Rows(DIM_SPC*fel.GetRange(i)).RowSlice(i, DIM_SPC));
1959
- }
1960
- }
1961
-
1962
- using DiffOp<DiffOpIdVectorH1<DIM_SPC, VB>>::ApplySIMDIR;
1963
- static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
1964
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
1965
- {
1966
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
1967
- for (int i = 0; i < DIM_SPC; i++)
1968
- {
1969
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
1970
- feli.Evaluate (mir.IR(), x.Range(fel.GetRange(i)), y.Row(i));
1971
- }
1972
- }
1973
-
1974
- using DiffOp<DiffOpIdVectorH1<DIM_SPC, VB>>::AddTransSIMDIR;
1975
- static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
1976
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
1977
- {
1978
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
1979
- for (int i = 0; i < DIM_SPC; i++)
1980
- {
1981
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
1982
- feli.AddTrans (mir.IR(), y.Row(i), x.Range(fel.GetRange(i)));
1983
- }
1984
- }
1985
-
1986
- static shared_ptr<CoefficientFunction>
1987
- DiffShape (shared_ptr<CoefficientFunction> proxy,
1988
- shared_ptr<CoefficientFunction> dir,
1989
- bool Eulerian);
1990
-
1991
- };
1992
-
1993
-
1994
-
1995
-
1996
-
1997
- /// Identity
1998
- template <int DIM_EL, int DIM_SPC>
1999
- class DiffOpIdDual : public DiffOp<DiffOpIdDual<DIM_EL, DIM_SPC> >
2000
- {
2001
- public:
2002
- enum { DIM = 1 };
2003
- enum { DIM_SPACE = DIM_SPC };
2004
- enum { DIM_ELEMENT = DIM_EL };
2005
- enum { DIM_DMAT = 1 };
2006
- enum { DIFFORDER = 0 };
2007
- static IVec<0> GetDimensions() { return IVec<0>(); };
2008
-
2009
- static bool SupportsVB (VorB checkvb) { return true; }
2010
-
2011
- static string Name() { return "IdDual"; }
2012
- // static constexpr bool SUPPORT_PML = true;
2013
-
2014
- static const BaseScalarFiniteElement & Cast (const FiniteElement & fel)
2015
- { return static_cast<const BaseScalarFiniteElement&> (fel); }
2016
-
2017
- template <typename MIP, typename MAT>
2018
- static void GenerateMatrix (const FiniteElement & fel, const MIP & mip,
2019
- MAT && mat, LocalHeap & lh)
2020
- {
2021
- Cast(fel).CalcShape (mip.IP(), mat.Row(0));
2022
- mat.Row(0).Range(fel.GetNDof()) /= mip.GetMeasure();
2023
- }
2024
-
2025
- static int DimRef() { return 1; }
2026
-
2027
- template <typename IP, typename MAT>
2028
- static void GenerateMatrixRef (const FiniteElement & fel, const IP & ip,
2029
- MAT && mat, LocalHeap & lh)
2030
- {
2031
- Cast(fel).CalcShape (ip, mat.Row(0));
2032
- }
2033
-
2034
- template <typename MIP, typename MAT>
2035
- static void CalcTransformationMatrix (const MIP & mip,
2036
- MAT & mat, LocalHeap & lh)
2037
- {
2038
- mat(0,0) = 1.0 / mip.GetMeasure();
2039
- }
2040
-
2041
-
2042
-
2043
- #ifdef UNUSED
2044
- template <typename MAT>
2045
- static void GenerateMatrixIR (const FiniteElement & fel,
2046
- const BaseMappedIntegrationRule & mir,
2047
- MAT & mat, LocalHeap & lh)
2048
- {
2049
- Cast(fel).CalcShape (mir.IR(), Trans(mat));
2050
- for (int i = 0; i < mir.Size(); i++)
2051
- mat.Row(i) /= mir[i].GetMeasure();
2052
- }
2053
- #endif
2054
-
2055
- static void GenerateMatrixSIMDIR (const FiniteElement & fel,
2056
- const SIMD_BaseMappedIntegrationRule & mir,
2057
- BareSliceMatrix<SIMD<double>> mat)
2058
- {
2059
- Cast(fel).CalcShape (mir.IR(), mat);
2060
- for (int i = 0; i < mir.Size(); i++)
2061
- mat.Col(i).Range(0,fel.GetNDof()) /= mir[i].GetMeasure();
2062
- }
2063
-
2064
- #ifdef UNSUED
2065
- template <typename MIP, class TVX, class TVY>
2066
- static void Apply (const FiniteElement & fel, const MIP & mip,
2067
- const TVX & x, TVY & y,
2068
- LocalHeap & lh)
2069
- {
2070
- HeapReset hr(lh);
2071
- y = Trans (Cast(fel).GetShape (mip.IP(), lh)) * x;
2072
- y(0) /= mip.GetMeasure();
2073
- }
2074
-
2075
- static void Apply (const FiniteElement & fel, const MappedIntegrationPoint<D,D> & mip,
2076
- BareSliceVector<double> x, FlatVector<double> y,
2077
- LocalHeap & lh)
2078
- {
2079
- y(0) = Cast(fel).Evaluate(mip.IP(), x);
2080
- y(0) /= mip.GetMeasure();
2081
- }
2082
-
2083
-
2084
- using DiffOp<DiffOpIdDual>::ApplyIR;
2085
- template <class MIR, class TMY>
2086
- static void ApplyIR (const FiniteElement & fel, const MIR & mir,
2087
- BareSliceVector<double> x, TMY y,
2088
- LocalHeap & lh)
2089
- {
2090
- Cast(fel).Evaluate (mir.IR(), x, y.Col(0));
2091
- for (int i = 0; i < mir.Size(); i++)
2092
- y(i,0) /= mir[i].GetMeasure();
2093
- }
2094
- #endif
2095
-
2096
- // using ApplySIMDIR;
2097
- using DiffOp<DiffOpIdDual>::ApplySIMDIR;
2098
- static void ApplySIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
2099
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
2100
- {
2101
- Cast(fel).Evaluate (mir.IR(), x, y.Row(0));
2102
- for (int i = 0; i < mir.Size(); i++)
2103
- y(0,i) /= mir[i].GetMeasure();
2104
-
2105
- }
2106
-
2107
- #ifdef UNSUED
2108
- template <typename MIP, class TVX, class TVY>
2109
- static void ApplyTrans (const FiniteElement & fel, const MIP & mip,
2110
- const TVX & x, TVY & y,
2111
- LocalHeap & lh)
2112
- {
2113
- HeapReset hr(lh);
2114
- y.Range(0,fel.GetNDof()) = (x(0)/mip.GetMeasure()) * Cast(fel).GetShape (mip.IP(), lh);
2115
- }
2116
-
2117
- /*
2118
- // using DiffOp<DiffOpId<D, FEL> >::ApplyTransIR;
2119
- template <class MIR>
2120
- static void ApplyTransIR (const FiniteElement & fel,
2121
- const MIR & mir,
2122
- FlatMatrix<double> x, BareSliceVector<double> y,
2123
- LocalHeap & lh)
2124
- {
2125
- Cast(fel).EvaluateTrans (mir.IR(), FlatVector<> (mir.Size(), &x(0,0)), y);
2126
- }
2127
-
2128
- template <class MIR>
2129
- static void ApplyTransIR (const FiniteElement & fel,
2130
- const MIR & mir,
2131
- FlatMatrix<Complex> x, BareSliceVector<Complex> y,
2132
- LocalHeap & lh)
2133
- {
2134
- DiffOp<DiffOpId<D, FEL> > :: ApplyTransIR (fel, mir, x, y, lh);
2135
- }
2136
-
2137
- using DiffOp<DiffOpId<D, FEL> >::AddTransSIMDIR;
2138
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
2139
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
2140
- {
2141
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
2142
- }
2143
-
2144
- static void AddTransSIMDIR (const FiniteElement & fel, const SIMD_BaseMappedIntegrationRule & mir,
2145
- BareSliceMatrix<SIMD<Complex>> y, BareSliceVector<Complex> x)
2146
- {
2147
- Cast(fel).AddTrans (mir.IR(), y.Row(0), x);
2148
- }
2149
- */
2150
-
2151
-
2152
- /*
2153
- static shared_ptr<CoefficientFunction>
2154
- DiffShape (shared_ptr<CoefficientFunction> proxy,
2155
- shared_ptr<CoefficientFunction> dir);
2156
- */
2157
- #endif
2158
- };
2159
-
2160
-
2161
-
2162
-
2163
-
2164
-
2165
-
2166
- template <int DIM_SPC> class DiffOpGradBoundaryVectorH1;
2167
-
2168
- template <int DIM_SPC>
2169
- class DiffOpGradVectorH1 : public DiffOp<DiffOpGradVectorH1<DIM_SPC> >
2170
- {
2171
- public:
2172
- enum { DIM = 1 };
2173
- enum { DIM_SPACE = DIM_SPC };
2174
- enum { DIM_ELEMENT = DIM_SPC };
2175
- enum { DIM_DMAT = DIM_SPC*DIM_SPC };
2176
- enum { DIFFORDER = 1 };
2177
-
2178
- typedef DiffOpGradBoundaryVectorH1<DIM_SPC> DIFFOP_TRACE;
2179
-
2180
- static string Name() { return "grad"; }
2181
- static constexpr bool SUPPORT_PML = true;
2182
- static IVec<2> GetDimensions() { return { DIM_SPC, DIM_SPC }; }
2183
-
2184
-
2185
- template <typename FEL, typename MIP, typename MAT>
2186
- static void GenerateMatrix (const FEL & bfel, const MIP & mip,
2187
- MAT && mat, LocalHeap & lh)
2188
- {
2189
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2190
- auto & feli = static_cast<const ScalarFiniteElement<DIM_SPC>&> (fel[0]);
2191
-
2192
- HeapReset hr(lh);
2193
- FlatMatrix<> hmat(feli.GetNDof(), DIM_SPC, lh);
2194
- feli.CalcMappedDShape (mip, hmat);
2195
- mat.AddSize(DIM_DMAT, bfel.GetNDof()) = 0.0;
2196
- for (int i = 0; i < DIM_SPC; i++)
2197
- mat.Rows(DIM_SPC*i, DIM_SPC*(i+1)).Cols(fel.GetRange(i)) = Trans(hmat);
2198
- }
2199
-
2200
-
2201
- static int DimRef() { return DIM_SPC*DIM_ELEMENT; }
2202
-
2203
- template <typename IP, typename MAT>
2204
- static void GenerateMatrixRef (const FiniteElement & bfel, const IP & ip,
2205
- MAT && mat, LocalHeap & lh)
2206
- {
2207
- HeapReset hr(lh);
2208
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2209
- auto & feli = static_cast<const ScalarFiniteElement<DIM_SPC>&> (fel[0]);
2210
- FlatMatrix<> hmat(feli.GetNDof(), DIM_ELEMENT, lh);
2211
- feli.CalcDShape(ip, hmat);
2212
- int ndof = feli.GetNDof();
2213
- mat.Rows(DIM_DMAT).Cols(DIM_SPC*ndof) = 0.0;
2214
- for (int i = 0; i < DIM_SPACE; i++)
2215
- mat.Rows(i*DIM_ELEMENT, (i+1)*DIM_ELEMENT).Cols(i*ndof,(i+1)*ndof)
2216
- = Trans(hmat);
2217
- }
2218
-
2219
- template <typename MIP, typename MAT>
2220
- static void CalcTransformationMatrix (const MIP & mip,
2221
- MAT & mat, LocalHeap & lh)
2222
- {
2223
- FlatMatrix<> hmat(DIM_SPC, DIM_SPC, lh);
2224
- hmat = Trans(static_cast<const MappedIntegrationPoint<DIM_SPC,DIM_SPC>&>(mip).GetJacobianInverse());
2225
- mat.Rows(DIM_DMAT).Cols(DIM_DMAT) = 0.0;
2226
- for (int i = 0; i < DIM_SPACE; i++)
2227
- mat.Rows(i*DIM_SPC, (i+1)*DIM_SPC).Cols(i*DIM_SPC, (i+1)*DIM_SPC) = hmat;
2228
- }
2229
-
2230
-
2231
-
2232
-
2233
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
2234
- const SIMD_BaseMappedIntegrationRule & mir,
2235
- BareSliceMatrix<SIMD<double>> bmat)
2236
- {
2237
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2238
- /*
2239
- mat.AddSize(DIM_SPC*DIM_SPC*bfel.GetNDof(), mir.Size()) = 0.0;
2240
- for (int i = 0; i < DIM_SPC; i++)
2241
- {
2242
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
2243
- feli.CalcMappedDShape (mir, mat.Rows(DIM_SPC*DIM_SPC*fel.GetRange(i)).RowSlice(i,DIM_SPC));
2244
- // cout << "grad-mat, i = " << i << ":" << endl << mat.AddSize(DIM_SPC*DIM_SPC*bfel.GetNDof(), mir.Size()) << endl;
2245
- }
2246
- */
2247
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2248
- auto mat = bmat.AddSize(DIM_SPC*DIM_SPC*bfel.GetNDof(), mir.Size());
2249
- mat = 0.0;
2250
- feli.CalcMappedDShape (mir, mat);
2251
- for (int i = 1; i < DIM_SPC; i++)
2252
- {
2253
- auto mati = mat.Rows(DIM_SPC*DIM_SPC*fel.GetRange(i));
2254
- for (int j = 0; j < feli.GetNDof(); j++)
2255
- mati.Rows(j*DIM_SPC*DIM_SPC+i*DIM_SPC, j*DIM_SPC*DIM_SPC+(i+1)*DIM_SPC)
2256
- = mat.Rows(j*DIM_SPC, (j+1)*DIM_SPC);
2257
- }
2258
- for (int j = feli.GetNDof()-1; j >= 0; j--)
2259
- mat.Rows(j*DIM_SPC*DIM_SPC, j*DIM_SPC*DIM_SPC+DIM_SPC) = mat.Rows(j*DIM_SPC, (j+1)*DIM_SPC);
2260
- for (int j = feli.GetNDof()-1; j >= 0; j--)
2261
- mat.Rows(j*DIM_SPC*DIM_SPC+DIM_SPC, (j+1)*DIM_SPC*DIM_SPC) = 0.0;
2262
- // cout << "mat = " << endl << mat << endl;
2263
- }
2264
-
2265
- using DiffOp<DiffOpGradVectorH1<DIM_SPC>>::ApplySIMDIR;
2266
- static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2267
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
2268
- {
2269
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2270
- for (int i = 0; i < DIM_SPC; i++)
2271
- {
2272
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
2273
- feli.EvaluateGrad (mir, x.Range(fel.GetRange(i)), y.Rows(i*DIM_SPC, (i+1)*DIM_SPC));
2274
- }
2275
- }
2276
-
2277
- using DiffOp<DiffOpGradVectorH1<DIM_SPC>>::AddTransSIMDIR;
2278
- static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2279
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
2280
- {
2281
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2282
- for (int i = 0; i < DIM_SPC; i++)
2283
- {
2284
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
2285
- feli.AddGradTrans (mir, y.Rows(i*DIM_SPC, (i+1)*DIM_SPC), x.Range(fel.GetRange(i)));
2286
- }
2287
- }
2288
-
2289
- static shared_ptr<CoefficientFunction>
2290
- DiffShape (shared_ptr<CoefficientFunction> proxy,
2291
- shared_ptr<CoefficientFunction> dir,
2292
- bool Eulerian);
2293
- };
2294
-
2295
-
2296
- template <int DIM_SPC>
2297
- class DiffOpGradBoundaryVectorH1 : public DiffOp<DiffOpGradBoundaryVectorH1<DIM_SPC> >
2298
- {
2299
- public:
2300
- enum { DIM = 1 };
2301
- enum { DIM_SPACE = DIM_SPC };
2302
- enum { DIM_ELEMENT = DIM_SPC-1 };
2303
- enum { DIM_DMAT = DIM_SPC*DIM_SPC };
2304
- enum { DIFFORDER = 1 };
2305
-
2306
- static IVec<2> GetDimensions() { return { DIM_SPC, DIM_SPC }; }
2307
- static constexpr bool SUPPORT_PML = true;
2308
- static string Name() { return "gradbnd"; }
2309
-
2310
- typedef void DIFFOP_TRACE;
2311
-
2312
- template <typename FEL, typename MIP, typename MAT>
2313
- static void GenerateMatrix (const FEL & bfel, const MIP & mip,
2314
- MAT && mat, LocalHeap & lh)
2315
- {
2316
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2317
- auto & feli = static_cast<const ScalarFiniteElement<DIM_ELEMENT>&> (fel[0]);
2318
-
2319
- HeapReset hr(lh);
2320
- FlatMatrix<> hmat(feli.GetNDof(), DIM_SPACE, lh);
2321
- feli.CalcMappedDShape (mip, hmat);
2322
- mat.AddSize(DIM_DMAT, fel.GetNDof()) = 0.0;
2323
- for (int i = 0; i < DIM_SPC; i++)
2324
- mat.Rows(DIM_SPC*i, DIM_SPC*(i+1)).Cols(fel.GetRange(i)) = Trans(hmat);
2325
- }
2326
-
2327
-
2328
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
2329
- const SIMD_BaseMappedIntegrationRule & mir,
2330
- BareSliceMatrix<SIMD<double>> bmat)
2331
- {
2332
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2333
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2334
- auto mat = bmat.AddSize(DIM_SPC*DIM_SPC*bfel.GetNDof(), mir.Size());
2335
- mat = 0.0;
2336
- feli.CalcMappedDShape (mir, mat);
2337
- for (int i = 1; i < DIM_SPC; i++)
2338
- {
2339
- auto mati = mat.Rows(DIM_SPC*DIM_SPC*fel.GetRange(i));
2340
- for (int j = 0; j < feli.GetNDof(); j++)
2341
- mati.Rows(j*DIM_SPC*DIM_SPC+i*DIM_SPC, j*DIM_SPC*DIM_SPC+(i+1)*DIM_SPC)
2342
- = mat.Rows(j*DIM_SPC, (j+1)*DIM_SPC);
2343
- }
2344
- for (int j = feli.GetNDof()-1; j >= 0; j--)
2345
- mat.Rows(j*DIM_SPC*DIM_SPC, j*DIM_SPC*DIM_SPC+DIM_SPC) = mat.Rows(j*DIM_SPC, (j+1)*DIM_SPC);
2346
- for (int j = feli.GetNDof()-1; j >= 0; j--)
2347
- mat.Rows(j*DIM_SPC*DIM_SPC+DIM_SPC, (j+1)*DIM_SPC*DIM_SPC) = 0.0;
2348
- }
2349
-
2350
- using DiffOp<DiffOpGradBoundaryVectorH1<DIM_SPC>>::ApplySIMDIR;
2351
- static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2352
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
2353
- {
2354
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2355
- for (int i = 0; i < DIM_SPC; i++)
2356
- {
2357
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
2358
- feli.EvaluateGrad (mir, x.Range(fel.GetRange(i)), y.Rows(i*DIM_SPC, (i+1)*DIM_SPC));
2359
- }
2360
- }
2361
-
2362
- using DiffOp<DiffOpGradBoundaryVectorH1<DIM_SPC>>::AddTransSIMDIR;
2363
- static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2364
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
2365
- {
2366
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2367
- for (int i = 0; i < DIM_SPC; i++)
2368
- {
2369
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[i]);
2370
- feli.AddGradTrans (mir, y.Rows(i*DIM_SPC, (i+1)*DIM_SPC), x.Range(fel.GetRange(i)));
2371
- }
2372
- }
2373
-
2374
-
2375
- static shared_ptr<CoefficientFunction>
2376
- DiffShape (shared_ptr<CoefficientFunction> proxy,
2377
- shared_ptr<CoefficientFunction> dir,
2378
- bool Eulerian);
2379
- };
2380
-
2381
-
2382
- template <int DIM_SPC> class DiffOpDivBoundaryVectorH1;
2383
-
2384
- template <int DIM_SPC>
2385
- class DiffOpDivVectorH1 : public DiffOp<DiffOpDivVectorH1<DIM_SPC> >
2386
- {
2387
- public:
2388
- enum { DIM = 1 };
2389
- enum { DIM_SPACE = DIM_SPC };
2390
- enum { DIM_ELEMENT = DIM_SPC };
2391
- enum { DIM_DMAT = 1 };
2392
- enum { DIFFORDER = 1 };
2393
-
2394
- typedef DiffOpDivBoundaryVectorH1<DIM_SPC> DIFFOP_TRACE;
2395
- static constexpr bool SUPPORT_PML = true;
2396
- static string Name() { return "div"; }
2397
-
2398
- template <typename FEL, typename MIP, typename MAT>
2399
- static void GenerateMatrix (const FEL & bfel, const MIP & mip,
2400
- MAT && mat, LocalHeap & lh)
2401
- {
2402
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2403
- auto & feli = static_cast<const ScalarFiniteElement<DIM_SPC>&> (fel[0]);
2404
-
2405
- mat.AddSize(1, bfel.GetNDof()) = 0.0;
2406
- size_t n1 = feli.GetNDof();
2407
- HeapReset hr(lh);
2408
- FlatMatrix<> tmp(n1, DIM_SPC, lh);
2409
- feli.CalcMappedDShape (mip, tmp);
2410
-
2411
- for (int i = 0; i < DIM_SPC; i++)
2412
- mat.Row(0).Range(i*n1, (i+1)*n1) = tmp.Col(i);
2413
- }
2414
-
2415
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
2416
- const SIMD_BaseMappedIntegrationRule & mir,
2417
- BareSliceMatrix<SIMD<double>> bmat)
2418
- {
2419
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2420
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2421
-
2422
- auto mat = bmat.AddSize(bfel.GetNDof(), mir.Size());
2423
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*feli.GetNDof()*mir.Size());
2424
- FlatMatrix<SIMD<double>> hmat(DIM_SPC*feli.GetNDof(), mir.Size(), &mem[0]);
2425
- feli.CalcMappedDShape (mir, hmat);
2426
- for (size_t i = 0; i < DIM_SPC; i++)
2427
- for (size_t j = 0; j < feli.GetNDof(); j++)
2428
- mat.Row(i*feli.GetNDof()+j) = hmat.Row(i+j*DIM_SPC);
2429
- }
2430
-
2431
- using DiffOp<DiffOpDivVectorH1<DIM_SPC>>::ApplySIMDIR;
2432
- static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2433
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
2434
- {
2435
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2436
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2437
-
2438
- y.AddSize(1, mir.Size()) = SIMD<double>(0.0);
2439
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*mir.Size());
2440
- FlatMatrix<SIMD<double>> hmat(DIM_SPC, mir.Size(), &mem[0]);
2441
-
2442
- for (int i = 0; i < DIM_SPC; i++)
2443
- {
2444
- feli.EvaluateGrad (mir, x.Range(fel.GetRange(i)), hmat);
2445
- y.Row(0).Range(mir.Size()) += hmat.Row(i);
2446
- }
2447
- }
2448
-
2449
- using DiffOp<DiffOpDivVectorH1<DIM_SPC>>::AddTransSIMDIR;
2450
- static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2451
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
2452
- {
2453
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2454
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2455
-
2456
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*mir.Size());
2457
- FlatMatrix<SIMD<double>> hmat(DIM_SPC,mir.Size(), &mem[0]);
2458
-
2459
- for (int i = 0; i < DIM_SPC; i++)
2460
- {
2461
- hmat = SIMD<double>(0.0);
2462
- hmat.Row(i) = y.Row(0);
2463
- feli.AddGradTrans (mir, hmat, x.Range(i*feli.GetNDof(), (i+1)*feli.GetNDof()));
2464
- }
2465
- }
2466
- };
2467
-
2468
- template <int DIM_SPC>
2469
- class DiffOpDivBoundaryVectorH1 : public DiffOp<DiffOpDivBoundaryVectorH1<DIM_SPC> >
2470
- {
2471
- public:
2472
- enum { DIM = 1 };
2473
- enum { DIM_SPACE = DIM_SPC };
2474
- enum { DIM_ELEMENT = DIM_SPC-1 };
2475
- enum { DIM_DMAT = 1 };
2476
- enum { DIFFORDER = 1 };
2477
-
2478
- static constexpr bool SUPPORT_PML = true;
2479
- static string Name() { return "divbnd"; }
2480
-
2481
- template <typename FEL, typename MIP, typename MAT>
2482
- static void GenerateMatrix (const FEL & bfel, const MIP & mip,
2483
- MAT && mat, LocalHeap & lh)
2484
- {
2485
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2486
- auto & feli = static_cast<const ScalarFiniteElement<DIM_ELEMENT>&> (fel[0]);
2487
-
2488
- mat.AddSize(1, bfel.GetNDof()) = 0.0;
2489
- size_t n1 = feli.GetNDof();
2490
- HeapReset hr(lh);
2491
- FlatMatrix<> tmp(n1, DIM_SPC, lh);
2492
- feli.CalcMappedDShape (mip, tmp);
2493
-
2494
- for (int i = 0; i < DIM_SPC; i++)
2495
- mat.Row(0).Range(i*n1, (i+1)*n1) = tmp.Col(i);
2496
- }
2497
-
2498
- static void GenerateMatrixSIMDIR (const FiniteElement & bfel,
2499
- const SIMD_BaseMappedIntegrationRule & mir,
2500
- BareSliceMatrix<SIMD<double>> bmat)
2501
- {
2502
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2503
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2504
-
2505
- auto mat = bmat.AddSize(bfel.GetNDof(), mir.Size());
2506
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*feli.GetNDof()*mir.Size());
2507
- FlatMatrix<SIMD<double>> hmat(DIM_SPC*feli.GetNDof(), mir.Size(), &mem[0]);
2508
- feli.CalcMappedDShape (mir, hmat);
2509
- for (size_t i = 0; i < DIM_SPC; i++)
2510
- for (size_t j = 0; j < feli.GetNDof(); j++)
2511
- mat.Row(i*feli.GetNDof()+j) = hmat.Row(i+j*DIM_SPC);
2512
- }
2513
-
2514
-
2515
- using DiffOp<DiffOpDivBoundaryVectorH1<DIM_SPC>>::ApplySIMDIR;
2516
- static void ApplySIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2517
- BareSliceVector<double> x, BareSliceMatrix<SIMD<double>> y)
2518
- {
2519
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2520
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2521
-
2522
- y.AddSize(1, mir.Size()) = SIMD<double>(0.0);
2523
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*mir.Size());
2524
- FlatMatrix<SIMD<double>> hmat(DIM_SPC, mir.Size(), &mem[0]);
2525
-
2526
- for (int i = 0; i < DIM_SPC; i++)
2527
- {
2528
- feli.EvaluateGrad (mir, x.Range(fel.GetRange(i)), hmat);
2529
- y.Row(0).Range(mir.Size()) += hmat.Row(i);
2530
- }
2531
- }
2532
-
2533
- using DiffOp<DiffOpDivBoundaryVectorH1<DIM_SPC>>::AddTransSIMDIR;
2534
- static void AddTransSIMDIR (const FiniteElement & bfel, const SIMD_BaseMappedIntegrationRule & mir,
2535
- BareSliceMatrix<SIMD<double>> y, BareSliceVector<double> x)
2536
- {
2537
- auto & fel = static_cast<const VectorFiniteElement&> (bfel);
2538
- auto & feli = static_cast<const BaseScalarFiniteElement&> (fel[0]);
2539
-
2540
- ArrayMem<SIMD<double>,100> mem(DIM_SPC*mir.Size());
2541
- FlatMatrix<SIMD<double>> hmat(DIM_SPC,mir.Size(), &mem[0]);
2542
-
2543
- for (int i = 0; i < DIM_SPC; i++)
2544
- {
2545
- hmat = SIMD<double>(0.0);
2546
- hmat.Row(i) = y.Row(0);
2547
- feli.AddGradTrans (mir, hmat, x.Range(i*feli.GetNDof(), (i+1)*feli.GetNDof()));
2548
- }
2549
- }
2550
- };
2551
-
2552
-
2553
-
2554
- /* ************************** Linearform Integrators ************************* */
2555
-
2556
- /// integrator for \f$\int_\Omega f v \f$
2557
- template <int D, typename FEL = ScalarFiniteElement<D> >
2558
- class NGS_DLL_HEADER SourceIntegrator
2559
- : public T_BIntegrator<DiffOpId<D>, DVec<1>, FEL>
2560
- {
2561
- typedef T_BIntegrator<DiffOpId<D>, DVec<1>, FEL> BASE;
2562
- public:
2563
- using T_BIntegrator<DiffOpId<D>, DVec<1>, FEL>::T_BIntegrator;
2564
- /*
2565
- SourceIntegrator (shared_ptr<CoefficientFunction> coeff)
2566
- : T_BIntegrator<DiffOpId<D>, DVec<1>, FEL> (DVec<1> (coeff))
2567
- { ; }
2568
- */
2569
- virtual ~SourceIntegrator () { ; }
2570
- virtual string Name () const { return "Source"; }
2571
- };
2572
-
2573
-
2574
- ///
2575
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
2576
- class NGS_DLL_HEADER NeumannIntegrator
2577
- : public T_BIntegrator<DiffOpIdBoundary<D>, DVec<1>, FEL>
2578
- {
2579
- typedef T_BIntegrator<DiffOpIdBoundary<D>, DVec<1>, FEL> BASE;
2580
- public:
2581
- using T_BIntegrator<DiffOpIdBoundary<D>, DVec<1>, FEL>::T_BIntegrator;
2582
- /*
2583
- NeumannIntegrator (shared_ptr<CoefficientFunction> coeff)
2584
- : T_BIntegrator<DiffOpIdBoundary<D>, DVec<1>, FEL> (DVec<1> (coeff))
2585
- { ; }
2586
- */
2587
- virtual string Name () const { return "Neumann"; }
2588
- };
2589
-
2590
-
2591
-
2592
-
2593
- /// integrator for \f$\int_\Gamma v_n \, ds\f$
2594
- template <int D, typename FEL = ScalarFiniteElement<D-1> >
2595
- class NormalNeumannIntegrator
2596
- : public T_BIntegrator<DiffOpNormal<D>, DVec<1>, FEL>
2597
- {
2598
- typedef T_BIntegrator<DiffOpNormal<D>, DVec<1>, FEL> BASE;
2599
- public:
2600
- using T_BIntegrator<DiffOpNormal<D>, DVec<1>, FEL>::T_BIntegrator;
2601
- virtual string Name () const { return "NormalNeumann"; }
2602
- };
2603
-
2604
-
2605
-
2606
-
2607
- ///
2608
- template <int D, typename FEL = ScalarFiniteElement<D> >
2609
- class GradSourceIntegrator
2610
- : public T_BIntegrator<DiffOpGradient<D>, DVec<D>, FEL>
2611
- {
2612
- typedef T_BIntegrator<DiffOpGradient<D>, DVec<D>, FEL> BASE;
2613
- public:
2614
- using T_BIntegrator<DiffOpGradient<D>, DVec<D>, FEL>::T_BIntegrator;
2615
- virtual string Name () const { return "GradSource"; }
2616
- };
2617
-
2618
-
2619
-
2620
-
2621
-
2622
-
2623
- #ifdef FILE_BDBEQUATIONS_CPP
2624
- #define BDBEQUATIONS_EXTERN
2625
- #else
2626
- #define BDBEQUATIONS_EXTERN extern
2627
- #endif
2628
-
2629
- /*
2630
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<1>,2,2>;
2631
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<1>,3,3>;
2632
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<1>,1,2>;
2633
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<1>,2,3>;
2634
-
2635
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<2>,2,2>;
2636
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<2>,1,2>;
2637
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<3>,3,3>;
2638
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<3>,2,3>;
2639
-
2640
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<SymDMat<3>,2,2>;
2641
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<SymDMat<3>,3,3>;
2642
- */
2643
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<1>>;
2644
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<2>>;
2645
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<DiagDMat<3>>;
2646
-
2647
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<SymDMat<2>>;
2648
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator_DMat<SymDMat<3>>;
2649
-
2650
-
2651
- BDBEQUATIONS_EXTERN template class MassIntegrator<1>;
2652
- BDBEQUATIONS_EXTERN template class MassIntegrator<2>;
2653
- BDBEQUATIONS_EXTERN template class MassIntegrator<3>;
2654
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpId<1>, DiagDMat<1>, ScalarFiniteElement<1>>;
2655
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpId<2>, DiagDMat<1>, ScalarFiniteElement<2>>;
2656
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpId<3>, DiagDMat<1>, ScalarFiniteElement<3>>;
2657
-
2658
- BDBEQUATIONS_EXTERN template class LaplaceIntegrator<1>;
2659
- BDBEQUATIONS_EXTERN template class LaplaceIntegrator<2>;
2660
- BDBEQUATIONS_EXTERN template class LaplaceIntegrator<3>;
2661
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpGradient<1>, DiagDMat<1>, ScalarFiniteElement<1>>;
2662
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpGradient<2>, DiagDMat<2>, ScalarFiniteElement<2>>;
2663
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpGradient<3>, DiagDMat<3>, ScalarFiniteElement<3>>;
2664
-
2665
- BDBEQUATIONS_EXTERN template class RotSymLaplaceIntegrator<2>;
2666
- BDBEQUATIONS_EXTERN template class RotSymLaplaceIntegrator<3>;
2667
-
2668
- BDBEQUATIONS_EXTERN template class LaplaceBoundaryIntegrator<2>;
2669
- BDBEQUATIONS_EXTERN template class LaplaceBoundaryIntegrator<3>;
2670
-
2671
-
2672
- BDBEQUATIONS_EXTERN template class RobinIntegrator<1>;
2673
- BDBEQUATIONS_EXTERN template class RobinIntegrator<2>;
2674
- BDBEQUATIONS_EXTERN template class RobinIntegrator<3>;
2675
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpIdBoundary<1>, DiagDMat<1>, ScalarFiniteElement<0>>;
2676
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpIdBoundary<2>, DiagDMat<1>, ScalarFiniteElement<1>>;
2677
- BDBEQUATIONS_EXTERN template class T_BDBIntegrator<DiffOpIdBoundary<3>, DiagDMat<1>, ScalarFiniteElement<2>>;
2678
-
2679
- BDBEQUATIONS_EXTERN template class SourceIntegrator<1>;
2680
- BDBEQUATIONS_EXTERN template class SourceIntegrator<2>;
2681
- BDBEQUATIONS_EXTERN template class SourceIntegrator<3>;
2682
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpId<1>, DVec<1>, ScalarFiniteElement<1>>;
2683
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpId<2>, DVec<1>, ScalarFiniteElement<2>>;
2684
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpId<3>, DVec<1>, ScalarFiniteElement<3>>;
2685
-
2686
-
2687
- BDBEQUATIONS_EXTERN template class NeumannIntegrator<1>;
2688
- BDBEQUATIONS_EXTERN template class NeumannIntegrator<2>;
2689
- BDBEQUATIONS_EXTERN template class NeumannIntegrator<3>;
2690
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpIdBoundary<1>, DVec<1>, ScalarFiniteElement<0>>;
2691
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpIdBoundary<2>, DVec<1>, ScalarFiniteElement<1>>;
2692
- BDBEQUATIONS_EXTERN template class T_BIntegrator<DiffOpIdBoundary<3>, DVec<1>, ScalarFiniteElement<2>>;
2693
-
2694
-
2695
- extern template class NGS_DLL_HEADER DiffOpIdDual<1,2>;
2696
- extern template class NGS_DLL_HEADER DiffOpIdDual<2,3>;
2697
- extern template class NGS_DLL_HEADER DiffOpIdDual<1,1>;
2698
- extern template class NGS_DLL_HEADER DiffOpIdDual<2,2>;
2699
- extern template class NGS_DLL_HEADER DiffOpIdDual<3,3>;
2700
-
2701
-
2702
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpId<1> >;
2703
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpId<2> >;
2704
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpId<3> >;
2705
-
2706
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdBoundary<1> >;
2707
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdBoundary<2> >;
2708
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdBoundary<3> >;
2709
-
2710
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<1,VOL> >;
2711
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<2,VOL> >;
2712
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<3,VOL> >;
2713
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<1,BND> >;
2714
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<2,BND> >;
2715
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<3,BND> >;
2716
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpIdVectorH1<3,BBND> >;
2717
-
2718
-
2719
-
2720
-
2721
- extern template class NGS_DLL_HEADER DiffOpGradient<1>;
2722
- extern template class NGS_DLL_HEADER DiffOpGradient<2>;
2723
- extern template class NGS_DLL_HEADER DiffOpGradient<3>;
2724
-
2725
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradient<1> >;
2726
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradient<2> >;
2727
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradient<3> >;
2728
-
2729
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradVectorH1<1> >;
2730
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradVectorH1<2> >;
2731
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradVectorH1<3> >;
2732
-
2733
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradientBoundary<2> >;
2734
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradientBoundary<3> >;
2735
-
2736
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradBoundaryVectorH1<2> >;
2737
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpGradBoundaryVectorH1<3> >;
2738
-
2739
-
2740
-
2741
-
2742
-
2743
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesse<1> >;
2744
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesse<2> >;
2745
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesse<3> >;
2746
-
2747
- // extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesseBoundary<1> >;
2748
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesseBoundary<2> >;
2749
- extern template class NGS_DLL_HEADER T_DifferentialOperator<DiffOpHesseBoundary<3> >;
2750
- }
2751
-
2752
- #endif