ngsolve 6.2.2501.post21.dev1__cp313-cp313-macosx_10_15_universal2.whl → 6.2.2501.post37.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.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/METADATA +2 -2
  3. ngsolve-6.2.2501.post37.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.post21.dev1.data/data/Netgen.icns +0 -0
  251. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngscxx +0 -17
  252. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngsld +0 -13
  253. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngsolve.tcl +0 -648
  254. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngspy +0 -2
  255. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/beam.geo +0 -17
  256. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/beam.vol +0 -240
  257. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/chip.in2d +0 -41
  258. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/chip.vol +0 -614
  259. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coil.geo +0 -12
  260. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coil.vol +0 -2560
  261. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coilshield.geo +0 -24
  262. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coilshield.vol +0 -3179
  263. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/cube.geo +0 -19
  264. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/cube.vol +0 -1832
  265. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -50
  266. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d11_chip_nitsche.pde +0 -40
  267. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d1_square.pde +0 -43
  268. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d2_chip.pde +0 -35
  269. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d3_helmholtz.pde +0 -22
  270. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d4_cube.pde +0 -46
  271. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d5_beam.pde +0 -74
  272. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d6_shaft.pde +0 -73
  273. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d7_coil.pde +0 -50
  274. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d8_coilshield.pde +0 -49
  275. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d9_hybridDG.pde +0 -72
  276. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/doubleglazing.in2d +0 -27
  277. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/doubleglazing.vol +0 -737
  278. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  279. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/shaft.geo +0 -73
  280. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/shaft.vol +0 -4291
  281. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/square.in2d +0 -17
  282. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/square.vol +0 -149
  283. ngsolve-6.2.2501.post21.dev1.dist-info/RECORD +0 -304
  284. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/LICENSE +0 -0
  285. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/WHEEL +0 -0
  286. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/top_level.txt +0 -0
@@ -1,1871 +0,0 @@
1
- #ifndef FILE_HCURLHOFE_IMPL
2
- #define FILE_HCURLHOFE_IMPL
3
-
4
- /*********************************************************************/
5
- /* File: hcurlhofe.hpp */
6
- /* Author: Sabine Zaglmayr, Joachim Schoeber */
7
- /* Date: 20. Maerz 2003 */
8
- /* */
9
- /* AutoCurl - revision: J. Schoeberl, March 2009 */
10
- /*********************************************************************/
11
-
12
- #include "recursive_pol.hpp"
13
- // #include "thdivfe.hpp"
14
- #include "hcurlhofe.hpp"
15
- #include "hcurlfe_utils.hpp"
16
-
17
- namespace ngfem
18
- {
19
-
20
- // declaration of the shapes ...
21
-
22
-
23
-
24
- template <ELEMENT_TYPE ET, template <ELEMENT_TYPE ET2> class TSHAPES, typename BASE>
25
- void HCurlHighOrderFE<ET,TSHAPES,BASE> :: ComputeNDof()
26
- {
27
- ndof = N_EDGE;
28
-
29
- for (int i = 0; i < N_EDGE; i++)
30
- if(order_edge[i] > 0)
31
- ndof += usegrad_edge[i]*order_edge[i];
32
-
33
- for(int i = 0; i < N_FACE; i++)
34
- if (FaceType(i) == ET_TRIG)
35
- {
36
- if (order_face[i][0] > 1)
37
- {
38
- int p = order_face[i][0];
39
- int pg = p - (type1 ? 1 : 0);
40
- ndof += usegrad_face[i]*pg*(pg-1)/2;
41
- ndof += (p+2)*(p-1)/2;
42
- // ndof += ((usegrad_face[i]+1)*order_face[i][0]+2)*(order_face[i][0]-1)/2;
43
- }
44
- }
45
- else
46
- {
47
- if(order_face[i][0]>=0 && order_face[i][1]>=0)
48
- ndof += (usegrad_face[i]+1)*order_face[i][0]*order_face[i][1]
49
- + order_face[i][0] + order_face[i][1];
50
- }
51
-
52
- switch (ET)
53
- {
54
- case ET_TET:
55
- if(order_cell[0] > 2) {
56
- if (type1)
57
- ndof += usegrad_cell*(order_cell[0]-3)*(order_cell[0]-2)*(order_cell[0]-1)/6 + (order_cell[0]-2)*(order_cell[0]-1)*(2*order_cell[0]+3)/6 ;
58
- else
59
- ndof += ((usegrad_cell + 2) * order_cell[0] + 3)
60
- * (order_cell[0]-2) * (order_cell[0]-1) / 6;
61
- }
62
- break;
63
- case ET_PRISM:
64
- if(order_cell[2] > 0 && order_cell[0] > 1)
65
- ndof += ((usegrad_cell+2)*order_cell[2] + 1) * order_cell[0]*(order_cell[0]-1)/2
66
- + (order_cell[0]-1)*order_cell[2];
67
- break;
68
- case ET_PYRAMID:
69
- {
70
- int pc = order_cell[0]; //SZ: no problem to do anisotropic, but for the moment
71
- // is it worth getting crazy :-)
72
- if(order_cell[0]>1)
73
- ndof += usegrad_cell*(pc-1)*pc*(2*pc-1)/6 + pc*(2*pc*pc+3*pc-2)/3;
74
- break;
75
- }
76
- case ET_HEX:
77
- if(order_cell[0] >= 0 && order_cell[1]>= 0 && order_cell[2]>=0)
78
- ndof += (usegrad_cell + 2)* order_cell[0] * order_cell[1] * order_cell[2]
79
- + order_cell[1]*order_cell[2] + order_cell[0]*(order_cell[1] + order_cell[2]);
80
- break;
81
- default:
82
- ;
83
- }
84
-
85
- TORDER horder = 0;
86
- for (int i = 0; i < N_EDGE; i++)
87
- horder = max2 (horder, order_edge[i]);
88
-
89
- for(int i=0; i < N_FACE; i++)
90
- if (ET_trait<ET>::FaceType(i) == ET_TRIG)
91
- horder = max2 (horder, order_face[i][0]);
92
- else
93
- horder = max2 (horder, Max (order_face[i]));
94
-
95
- if (DIM == 3)
96
- horder = max2 (horder, Max(order_cell));
97
-
98
- // for integration order ..
99
- if (ET == ET_PRISM || ET == ET_HEX || ET == ET_PYRAMID || ET == ET_QUAD)
100
- horder++;
101
- else
102
- if (horder==0) horder++;
103
- order = horder;
104
- }
105
-
106
-
107
-
108
-
109
- template <ELEMENT_TYPE ET>
110
- class HCurlHighOrderFE_Shape : public HCurlHighOrderFE<ET>
111
- {
112
- using ET_trait<ET>::DIM;
113
- public:
114
- template<typename Tx, typename TFA>
115
- void T_CalcShape (TIP<DIM,Tx> ip, TFA & shape) const;
116
-
117
- template <typename MIP, typename TFA>
118
- inline void CalcDualShape2 (const MIP & mip, TFA & shape) const
119
- {
120
- throw Exception(string("CalcDualShape missing for HighOrderHCurl element ")+ElementTopology::GetElementName(ET));
121
- }
122
- };
123
-
124
-
125
-
126
-
127
- //------------------------------------------------------------------------
128
- // HCurlHighOrderSegm
129
- //------------------------------------------------------------------------
130
-
131
-
132
- template<> template<typename Tx, typename TFA>
133
- void HCurlHighOrderFE_Shape<ET_SEGM> :: T_CalcShape (TIP<1,Tx> ip, TFA & shape) const
134
- {
135
- Tx x = ip.x;
136
- Tx lam[2] = { x, 1-x };
137
-
138
- IVec<2> e = GetEdgeSort (0, vnums);
139
-
140
- //Nedelec low order edge shape function
141
- shape[0] = uDv_minus_vDu (lam[e[0]], lam[e[1]]);
142
-
143
- int p = order_edge[0]; //order_cell[0];
144
- //HO-Edge shapes (Gradient Fields)
145
- if(p > 0 && usegrad_cell)
146
- {
147
- // LegendrePolynomial::
148
- size_t ii = 1;
149
- EdgeOrthoPol::
150
- EvalScaledMult (p-1,
151
- lam[e[1]]-lam[e[0]], lam[e[0]]+lam[e[1]],
152
- lam[e[0]]*lam[e[1]],
153
- SBLambda ([&](int nr, Tx val)
154
- {
155
- shape[ii++] = Du (val);
156
- }));
157
- }
158
- }
159
-
160
-
161
-
162
-
163
- //------------------------------------------------------------------------
164
- // HCurlHighOrderTrig
165
- //------------------------------------------------------------------------
166
-
167
- template<> template<typename Tx, typename TFA>
168
- INLINE void HCurlHighOrderFE_Shape<ET_TRIG> :: T_CalcShape (TIP<2,Tx> ip, TFA & shape) const
169
- {
170
- Tx x = ip.x, y = ip.y;
171
- Tx lam[3] = { x, y, 1-x-y };
172
-
173
-
174
- int ii = 3;
175
- for (int i = 0; i < 3; i++)
176
- {
177
- IVec<2> e = GetEdgeSort (i, vnums);
178
-
179
- //Nedelec low order edge shape function
180
- shape[i] = uDv_minus_vDu (lam[e[0]], lam[e[1]]);
181
-
182
- int p = order_edge[i];
183
- //HO-Edge shapes (Gradient Fields)
184
- if(p > 0 && usegrad_edge[i])
185
- {
186
- // LegendrePolynomial::
187
- EdgeOrthoPol::
188
- EvalScaledMult (order_edge[i]-1,
189
- lam[e[1]]-lam[e[0]], lam[e[0]]+lam[e[1]],
190
- lam[e[0]]*lam[e[1]],
191
- // adpol1
192
- SBLambda ([&](int nr, Tx val)
193
- {
194
- shape[ii++] = Du (val);
195
- }));
196
- }
197
- }
198
-
199
- //Inner shapes (Face)
200
- int p = order_face[0][0];
201
- if(p > 1)
202
- {
203
- IVec<4> fav = GetFaceSort (0, vnums);
204
-
205
- // Tx xi = lam[fav[2]]-lam[fav[1]];
206
- // Tx eta = lam[fav[0]];
207
- int pg = p - 2 - (type1 ? 1 : 0);
208
-
209
- // gradients:
210
- if (usegrad_face[0] && pg >=0)
211
-
212
- // DubinerBasis
213
- TrigOrthoPolGrad::EvalMult
214
- (pg, lam[fav[0]], lam[fav[1]],
215
- lam[fav[0]]*lam[fav[1]]*lam[fav[2]],
216
- SBLambda
217
- ([&](int nr, Tx val)
218
- {
219
- shape[ii++] = Du (val);
220
- }));
221
-
222
- // now ready: compatibility with tets/prisms ! non-gradient inner shapes, same for type 1 and 2
223
- if (true) // if (type1)
224
- {
225
- DubinerBasis::EvalMult
226
- (p-2, lam[fav[0]], lam[fav[1]],
227
- lam[fav[0]],
228
- SBLambda
229
- ([&](int nr, Tx val)
230
- {
231
- shape[ii++] = wuDv_minus_wvDu (lam[fav[1]], lam[fav[2]], val);
232
- }));
233
-
234
- LegendrePolynomial::EvalMult
235
- (p-2, lam[fav[2]]-lam[fav[1]], lam[fav[2]],
236
- SBLambda
237
- ([&] (int j, Tx val)
238
- {
239
- shape[ii++] = wuDv_minus_wvDu (lam[fav[1]], lam[fav[0]], val);
240
- }));
241
- }
242
- else
243
- {
244
- Tx xi = lam[fav[2]]-lam[fav[1]];
245
- Tx eta = lam[fav[0]];
246
-
247
- ArrayMem<Tx,20> adpol1(order),adpol2(order);
248
- TrigShapesInnerLegendre::CalcSplitted(p+1, xi, eta, adpol1,adpol2);
249
-
250
- // other combination
251
- for (int j = 0; j < p-1; j++)
252
- for (int k = 0; k < p-1-j; k++, ii++)
253
- shape[ii] = uDv_minus_vDu (adpol2[k], adpol1[j]);
254
-
255
- // rec_pol * Nedelec0
256
- for (int j = 0; j < p-1; j++, ii++)
257
- shape[ii] = wuDv_minus_wvDu (lam[fav[1]], lam[fav[2]], adpol2[j]);
258
- }
259
- }
260
- }
261
-
262
-
263
- //------------------------------------------------------------------------
264
- // HCurlHighOrderQuad
265
- //------------------------------------------------------------------------
266
-
267
-
268
- template<> template<typename Tx, typename TFA>
269
- void HCurlHighOrderFE_Shape<ET_QUAD> :: T_CalcShape (TIP<2,Tx> ip, TFA & shape) const
270
- {
271
- Tx x = ip.x, y = ip.y;
272
- Tx hx[2] = { x, y };
273
- Tx lami[4] = {(1-x)*(1-y),x*(1-y),x*y,(1-x)*y};
274
- Tx sigma[4] = {(1-x)+(1-y),x+(1-y),x+y,(1-x)+y};
275
-
276
- int ii = 4;
277
- ArrayMem<Tx, 10> pol_xi(order+2), pol_eta(order+2);
278
-
279
- for (int i = 0; i < 4; i++)
280
- {
281
- // int p = order_edge[i];
282
- IVec<2> e = GetEdgeSort (i, vnums);
283
-
284
- Tx xi = sigma[e[1]]-sigma[e[0]];
285
- Tx lam_e = lami[e[0]]+lami[e[1]];
286
- Tx bub = 0.25 * lam_e * (1 - xi*xi);
287
-
288
- // Nedelec0-shapes
289
- shape[i] = uDv (0.5 * lam_e, xi);
290
-
291
- // High Order edges ... Gradient fields
292
- if(usegrad_edge[i])
293
- {
294
- /*
295
- LegendrePolynomial::
296
- EvalMult (order_edge[i]-1,
297
- xi, bub, pol_xi);
298
-
299
- for (int j = 0; j < p; j++)
300
- shape[ii++] = Du<2> (pol_xi[j]);
301
- */
302
- // LegendrePolynomial::
303
- EdgeOrthoPol::
304
- EvalMult (order_edge[i]-1,
305
- xi, bub, SBLambda ([&](int i, Tx val)
306
- {
307
- shape[ii++] = Du (val);
308
- }));
309
-
310
- }
311
- }
312
-
313
-
314
-
315
-
316
- IVec<2> p = order_face[0]; // (order_cell[0],order_cell[1]);
317
-
318
-
319
- if (usegrad_face[0] && p[0] >= 1 && p[1] >= 1)
320
- {
321
- Vec<2,Tx> xi = ET_trait<ET_QUAD>::XiFace(0, hx, vnums);
322
- Tx bub = 1.0/16 * (1-xi(0)*xi(0))*(1-xi(1)*xi(1));
323
-
324
- QuadOrthoPol::EvalMult1Assign(p[0]-1, xi(0), bub,
325
- SBLambda ([&](int i, Tx val) LAMBDA_INLINE
326
- {
327
- QuadOrthoPol::EvalMult (p[1]-1, xi(1), val,
328
- SBLambda([&](int i2, Tx v2)
329
- {
330
- shape[ii++] = Du (v2);
331
- }));
332
- }));
333
- }
334
-
335
-
336
-
337
-
338
-
339
- int fmax = 0;
340
- for (int j = 1; j < 4; j++)
341
- if (vnums[j] > vnums[fmax])
342
- fmax = j;
343
-
344
- int f1 = (fmax+3)%4;
345
- int f2 = (fmax+1)%4;
346
- if(vnums[f2] > vnums[f1]) swap(f1,f2); // fmax > f2 > f1;
347
-
348
- Tx xi = sigma[fmax]-sigma[f1]; // in [-1,1]
349
- Tx eta = sigma[fmax]-sigma[f2]; // in [-1,1]
350
-
351
- T_ORTHOPOL::Calc(p[0]+1, xi,pol_xi);
352
- T_ORTHOPOL::Calc(p[1]+1,eta,pol_eta);
353
-
354
- /*
355
- //Gradient fields
356
- if(usegrad_face[0])
357
- for (int k = 0; k < p[0]; k++)
358
- for (int j= 0; j < p[1]; j++)
359
- shape[ii++] = Du<2> (pol_xi[k]*pol_eta[j]);
360
- */
361
-
362
- //Rotation of Gradient fields
363
- for (int k = 0; k < p[0]; k++)
364
- for (int j= 0; j < p[1]; j++)
365
- shape[ii++] = uDv_minus_vDu (pol_eta[j], pol_xi[k]);
366
-
367
- //Missing ones
368
- for(int j = 0; j< p[0]; j++)
369
- shape[ii++] = uDv (0.5*pol_xi[j], eta);
370
-
371
- for(int j = 0; j < p[1]; j++)
372
- shape[ii++] = uDv (0.5*pol_eta[j], xi);
373
- }
374
-
375
-
376
-
377
- //------------------------------------------------------------------------
378
- // Tetrahedron
379
- //------------------------------------------------------------------------
380
-
381
-
382
- template<> template<typename Tx, typename TFA>
383
- void HCurlHighOrderFE_Shape<ET_TET> :: T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
384
- {
385
- Tx x = ip.x, y = ip.y, z = ip.z;
386
- Tx lam[4] = { x, y, z, 1-x-y-z };
387
-
388
- ArrayMem<Tx,20> adpol1(order+2),adpol2(order+2),adpol3(order+2);
389
- int ii = 6;
390
-
391
- for (int i = 0; i < N_EDGE; i++)
392
- {
393
- int p = order_edge[i];
394
- IVec<2> e = GetEdgeSort (i, vnums);
395
-
396
- //Nedelec low order edge shape function
397
- shape[i] = uDv_minus_vDu (lam[e[0]], lam[e[1]]);
398
-
399
- //HO-Edge shape functions (Gradient Fields)
400
- if (p > 0 && usegrad_edge[i])
401
- {
402
- // LegendrePolynomial::
403
- EdgeOrthoPol::
404
- EvalScaledMult (p-1,
405
- lam[e[1]]-lam[e[0]], lam[e[0]]+lam[e[1]],
406
- lam[e[0]]*lam[e[1]],
407
- SBLambda ([&](int i, Tx val)
408
- {
409
- shape[ii++] = Du (val);
410
- }));
411
- }
412
- }
413
-
414
- // face shape functions
415
- for(int i = 0; i < N_FACE; i++)
416
- if (order_face[i][0] >= 2)
417
- {
418
- IVec<4> fav = GetFaceSort (i, vnums);
419
-
420
- int vop = 6 - fav[0] - fav[1] - fav[2];
421
- int p = order_face[i][0];
422
- int pg = p - (type1 ? 1 : 0);
423
-
424
- Tx xi = lam[fav[2]]-lam[fav[1]];
425
- Tx eta = lam[fav[0]]; // lo
426
- Tx zeta = lam[vop]; // lz
427
-
428
- TetShapesFaceLegendre::CalcSplitted (p+1, xi, eta, zeta, adpol1, adpol2);
429
-
430
- // gradients
431
- if (usegrad_face[i] && pg >= 2)
432
-
433
- // DubinerBasis
434
- TrigOrthoPolGrad::EvalScaledMult
435
- (pg-2, lam[fav[0]], lam[fav[1]],
436
- 1-lam[vop],
437
- lam[fav[0]]*lam[fav[1]]*lam[fav[2]],
438
- SBLambda
439
- ([&](int nr, Tx val)
440
- {
441
- shape[ii++] = Du (val);
442
- }));
443
-
444
-
445
- // non-gradient face shapes
446
- // if (type1) {
447
- if (true) {
448
-
449
- DubinerBasis::EvalMult
450
- (p-2, lam[fav[0]], lam[fav[1]],
451
- lam[fav[0]],
452
- SBLambda
453
- ([&](int nr, Tx val)
454
- {
455
- shape[ii++] = wuDv_minus_wvDu(lam[fav[1]], lam[fav[2]], val);
456
- }));
457
-
458
- LegendrePolynomial::EvalMult
459
- (p-2, lam[fav[2]]-lam[fav[1]], lam[fav[2]],
460
- SBLambda
461
- ([&] (int j, Tx val)
462
- {
463
- shape[ii++] = wuDv_minus_wvDu(lam[fav[1]], lam[fav[0]], val);
464
- }));
465
- }
466
- else {
467
-
468
- // other combination
469
- for (int j = 0; j <= p-2; j++)
470
- for (int k = 0; k <= p-2-j; k++, ii++)
471
- shape[ii] = uDv_minus_vDu (adpol2[k], adpol1[j]);
472
-
473
- // type 3
474
- for (int j = 0; j <= p-2; j++, ii++)
475
- shape[ii] = wuDv_minus_wvDu (lam[fav[1]], lam[fav[2]], adpol2[j]);
476
- }
477
- }
478
-
479
-
480
- int p = order_cell[0];
481
- int pg = p - (type1 ? 1 : 0);
482
-
483
- // gradient inner shapes
484
-
485
- if (usegrad_cell && pg >= 3)
486
-
487
- DubinerBasis3DOrthoBub::EvalMult
488
- (pg-3, lam[0], lam[1], lam[2], lam[0]*lam[1]*lam[2]*lam[3],
489
- SBLambda
490
- ([&](int nr, Tx val)
491
- {
492
- shape[ii++] = Du(val);
493
- }));
494
-
495
- // non-gradient inner shapes, same for type 1 and type 2 Nedelec:
496
-
497
- if (p >= 3) {
498
-
499
- Tx lam21 = lam[2]*lam[1], lam30 = lam[3]*lam[0];
500
-
501
- DubinerBasis3D::Eval
502
- (p-3, lam[0], lam[1], lam[2],
503
- SBLambda
504
- ([&](int nr, Tx val)
505
- {
506
- shape[ii++] = wuDv_minus_wvDu(lam[3], lam[0], lam21*val);
507
- shape[ii++] = wuDv_minus_wvDu(lam[2], lam[1], lam30*val);
508
- }));
509
-
510
-
511
- DubinerBasis::EvalMult
512
- (p-3, lam[0], lam[1], lam[0]*lam[1],
513
- SBLambda
514
- ([&](int nr, Tx val)
515
- {
516
- shape[ii++] = wuDv_minus_wvDu(lam[3], lam[2], val);
517
- }));
518
- }
519
- }
520
-
521
-
522
-
523
- //------------------------------------------------------------------------
524
- // Prism
525
- //------------------------------------------------------------------------
526
-
527
- template<> template<typename Tx, typename TFA>
528
- void HCurlHighOrderFE_Shape<ET_PRISM> :: T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
529
- {
530
- typedef TrigShapesInnerLegendre T_TRIGFACESHAPES;
531
-
532
- // Tx x = hx[0], y = hx[1], z = hx[2];
533
- Tx x = ip.x, y = ip.y, z = ip.z;
534
-
535
- Tx lam[6] = { x, y, 1-x-y, x, y, 1-x-y };
536
- Tx muz[6] = { 1-z, 1-z, 1-z, z, z, z };
537
-
538
- Tx sigma[6];
539
- for (int i = 0; i < 6; i++) sigma[i] = lam[i] + muz[i];
540
-
541
- ArrayMem<Tx,20> adpolxy1(order+3),adpolxy2(order+3);
542
- ArrayMem<Tx,20> adpolz(order+3);
543
-
544
- int ii = 9;
545
-
546
- // horizontal edge shapes
547
- for (int i = 0; i < 6; i++)
548
- {
549
- int p = order_edge[i];
550
- IVec<2> e = GetEdgeSort (i, vnums);
551
-
552
- //Nedelec0
553
- shape[i] = wuDv_minus_wvDu (lam[e[0]], lam[e[1]], muz[e[1]]);
554
-
555
- //high order \nabla (P_edge(x,y) * muz)
556
- if (p > 0 && usegrad_edge[i])
557
- {
558
- /*
559
- T_ORTHOPOL::CalcTrigExt(p+1, lam[e[1]]-lam[e[0]],
560
- 1-lam[e[0]]-lam[e[1]],adpolxy1);
561
- for(int j = 0; j <= p-1; j++)
562
- shape[ii++] = Du<3> (adpolxy1[j] * muz[e[1]]);
563
- */
564
- Tx xi = lam[e[1]]-lam[e[0]];
565
- Tx eta = lam[e[0]]+lam[e[1]];
566
- Tx bub = lam[e[0]]*lam[e[1]]*muz[e[1]];
567
-
568
- // LegendrePolynomial::
569
- EdgeOrthoPol::
570
- EvalScaledMult (p-1, xi, eta, bub, adpolxy1);
571
- for(int j = 0; j <= p-1; j++)
572
- shape[ii++] = Du (adpolxy1[j]);
573
- }
574
- }
575
-
576
- //Vertical Edge Shapes
577
- for (int i = 6; i < 9; i++)
578
- {
579
- int p = order_edge[i];
580
- IVec<2> e = GetEdgeSort (i, vnums);
581
-
582
- shape[i] = wuDv_minus_wvDu (muz[e[0]], muz[e[1]], lam[e[1]]);
583
-
584
- //high order edges: \nabla (T_ORTHOPOL^{p+1}(2z-1) * lam(x,y))
585
- if(p > 0 && usegrad_edge[i])
586
- {
587
- // T_ORTHOPOL::Calc (p+1, muz[e[1]]-muz[e[0]], adpolz);
588
- // for (int j = 0; j < p; j++)
589
- // shape[ii++] = Du<3> (adpolz[j] * lam[e[1]]);
590
-
591
- // LegendrePolynomial::
592
- EdgeOrthoPol::
593
- EvalMult (p-1,
594
- muz[e[1]]-muz[e[0]],
595
- muz[e[0]]*muz[e[1]]*lam[e[1]], adpolz);
596
-
597
- for (int j = 0; j < p; j++)
598
- shape[ii++] = Du (adpolz[j]);
599
- }
600
- }
601
-
602
-
603
- const FACE * faces = ElementTopology::GetFaces (ET_PRISM);
604
-
605
- // trig face shapes
606
- for (int i = 0; i < 2; i++)
607
- {
608
- int p = order_face[i][0];
609
- if (p < 2) continue;
610
-
611
- IVec<4> fav = GetFaceSort (i, vnums);
612
-
613
- {
614
- // gradients
615
- if (usegrad_face[i])
616
- {
617
- TrigOrthoPolGrad::EvalMult (p-2, lam[fav[0]], lam[fav[1]],
618
- lam[fav[0]]*lam[fav[1]]*lam[fav[2]]*muz[fav[2]],
619
- SBLambda ([&](int nr, Tx val)
620
- {
621
- shape[ii++] = Du (val);
622
- }));
623
- }
624
- }
625
-
626
- // if (type1) {
627
- if (true) {
628
-
629
- DubinerBasis::EvalMult
630
- (p-2, lam[fav[0]], lam[fav[1]],
631
- lam[fav[0]]*muz[fav[2]],
632
- SBLambda
633
- ([&](int nr, Tx val)
634
- {
635
- shape[ii++] = wuDv_minus_wvDu(lam[fav[1]], lam[fav[2]], val);
636
- }));
637
-
638
- LegendrePolynomial::EvalMult
639
- (p-2, lam[fav[2]]-lam[fav[1]], lam[fav[2]]*muz[fav[2]],
640
- SBLambda
641
- ([&] (int j, Tx val)
642
- {
643
- shape[ii++] = wuDv_minus_wvDu(lam[fav[1]], lam[fav[0]], val);
644
- }));
645
- }
646
-
647
- else
648
-
649
- {
650
-
651
- Tx xi = lam[fav[2]]-lam[fav[1]];
652
- Tx eta = lam[fav[0]]; // 1-lam[f2]-lam[f1];
653
-
654
- T_TRIGFACESHAPES::CalcSplitted(p+1,xi,eta,adpolxy1,adpolxy2);
655
- /*
656
- if(usegrad_face[i])
657
- // gradient-fields => \nabla( adpolxy1*adpolxy2*muz )
658
- for (int j = 0; j <= p-2; j++)
659
- for (int k = 0; k <= p-2-j; k++)
660
- shape[ii++] = Du<3> (adpolxy1[j]*adpolxy2[k] * muz[fav[2]]);
661
- */
662
-
663
-
664
- // rotations of grad-fields => grad(uj)*vk*w - uj*grad(vk)*w
665
- for (int j = 0; j <= p-2; j++)
666
- for (int k = 0; k <= p-2-j; k++)
667
- shape[ii++] = wuDv_minus_wvDu (adpolxy2[k], adpolxy1[j], muz[fav[2]]);
668
-
669
- // Ned0*adpolxy2[j]*muz
670
- for (int j = 0; j <= p-2; j++,ii++)
671
- shape[ii] = wuDv_minus_wvDu (lam[fav[1]], lam[fav[2]], adpolxy2[j]*muz[fav[2]]);
672
- }
673
- }
674
-
675
-
676
- // quad faces
677
- for (int i = 2; i < 5; i++)
678
- {
679
- IVec<2> p = order_face[i];
680
- IVec<4> f = GetFaceSort (i, vnums);
681
-
682
- {
683
- Tx xi = sigma[f[0]] - sigma[f[1]];
684
- Tx eta = sigma[f[0]] - sigma[f[3]];
685
-
686
- Tx scalexi(1.0), scaleeta(1.0);
687
- if (f[0] / 3 == f[1] / 3)
688
- scalexi = lam[f[0]]+lam[f[1]]; // xi is horizontal
689
- else
690
- scaleeta = lam[f[0]]+lam[f[3]];
691
-
692
- Tx bub = (1.0/16)*(scaleeta*scaleeta-eta*eta)*(scalexi*scalexi-xi*xi);
693
- QuadOrthoPol::EvalScaled (p[0]-1, xi, scalexi, adpolxy1);
694
- QuadOrthoPol::EvalScaledMult (p[1]-1, eta, scaleeta, bub, adpolz);
695
-
696
-
697
- if(usegrad_face[i])
698
- {
699
- // Gradientfields nabla(polxy*polz)
700
- for (int k = 0; k <= p[0]-1; k++)
701
- for (int j = 0; j <= p[1]-1; j++)
702
- shape[ii++] = Du (adpolxy1[k] * adpolz[j]);
703
- }
704
- }
705
-
706
-
707
- int fmax = 0;
708
- for (int j = 1; j < 4; j++)
709
- if (vnums[faces[i][j]] > vnums[faces[i][fmax]]) fmax = j;
710
-
711
- int fz = 3-fmax;
712
- int ftrig = fmax^1;
713
- Tx xi = lam[faces[i][fmax]]-lam[faces[i][ftrig]];
714
- Tx eta = 1-lam[faces[i][fmax]]-lam[faces[i][ftrig]];
715
- Tx zeta = muz[faces[i][fmax]]-muz[faces[i][fz]];
716
-
717
- int pp = int(max2(p[0],p[1]))+1;
718
- T_ORTHOPOL::CalcTrigExt(pp,xi,eta,adpolxy1);
719
- T_ORTHOPOL::Calc(pp,zeta,adpolz);
720
-
721
-
722
- /*
723
- if(usegrad_face[i])
724
- {
725
- // Gradientfields nabla(polxy*polz)
726
- if (vnums[faces[i][ftrig]] > vnums[faces[i][fz]])
727
- for (int k = 0; k <= p[0]-1; k++)
728
- for (int j = 0; j <= p[1]-1; j++)
729
- shape[ii++] = Du<3> (adpolxy1[k] * adpolz[j]);
730
- else
731
- for (int j = 0; j <= p[0]-1; j++)
732
- for (int k = 0; k <= p[1]-1; k++)
733
- shape[ii++] = Du<3> (adpolxy1[k] * adpolz[j]);
734
- }
735
- */
736
-
737
- // Rotations of GradFields => nabla(polxy)*polz - polxy*nabla(polz)
738
- if (vnums[faces[i][ftrig]] > vnums[faces[i][fz]])
739
- for (int k = 0; k <= p[0]-1; k++)
740
- for (int j = 0; j <= p[1]-1; j++)
741
- shape[ii++] = uDv_minus_vDu (adpolz[j], adpolxy1[k]);
742
- else
743
- for (int j = 0; j <= p[0]-1; j++)
744
- for (int k = 0; k <= p[1]-1; k++)
745
- shape[ii++] = uDv_minus_vDu (adpolxy1[k], adpolz[j]);
746
-
747
- // Type 3
748
- // (ned0_trig)*polz, (ned0_quad)* polxy
749
-
750
- if(vnums[faces[i][ftrig]] > vnums[faces[i][fz]]) // p = (p_trig,p_z)
751
- {
752
- for(int j=0;j<=p[0]-1;j++)
753
- shape[ii++] = wuDv_minus_wvDu (muz[faces[i][fz]], muz[faces[i][fmax]], adpolxy1[j]);
754
- for(int j=0;j<=p[1]-1;j++)
755
- shape[ii++] = wuDv_minus_wvDu (lam[faces[i][ftrig]], lam[faces[i][fmax]], adpolz[j]);
756
- }
757
- else
758
- {
759
- for(int j=0;j<=p[0]-1;j++)
760
- shape[ii++] = wuDv_minus_wvDu (lam[faces[i][ftrig]], lam[faces[i][fmax]], adpolz[j]);
761
- for(int j=0;j<=p[1]-1;j++)
762
- shape[ii++] = wuDv_minus_wvDu (muz[faces[i][fz]], muz[faces[i][fmax]], adpolxy1[j]);
763
- }
764
- }
765
-
766
- if(order_cell[0] > 1 && order_cell[2] > 0)
767
- {
768
- IVec<3> p = order_cell[0];
769
- if (usegrad_cell && p[0] > 1 && p[2] > 0)
770
- {
771
- // gradientfields
772
- int nf = (p[0]-0)*(p[0]-1)/2;
773
- ArrayMem<Tx,20> pol_trig(nf);
774
-
775
- DubinerBasis::EvalMult (p[0]-2, x, y, x*y*(1-x-y),pol_trig);
776
- LegendrePolynomial::EvalMult (p[2]-1, 2*z-1, z*(1-z), adpolz);
777
-
778
- for (int i = 0; i < nf; i++)
779
- for (int k = 0; k <= p[2]-1; k++)
780
- shape[ii++] = Du (pol_trig[i] * adpolz[k]);
781
- }
782
-
783
-
784
- T_TRIGFACESHAPES::CalcSplitted(order_cell[0]+1,x-y,1-x-y,adpolxy1,adpolxy2);
785
- T_ORTHOPOL::Calc(order_cell[2]+1,2*z-1,adpolz);
786
-
787
- /*
788
- // gradientfields
789
- if(usegrad_cell)
790
- for(int i=0;i<=order_cell[0]-2;i++)
791
- for(int j=0;j<=order_cell[0]-2-i;j++)
792
- for(int k=0;k<=order_cell[2]-1;k++)
793
- shape[ii++] = Du<3> (adpolxy1[i]*adpolxy2[j]*adpolz[k]);
794
- */
795
-
796
- // Rotations of gradientfields
797
- for(int i=0;i<=order_cell[0]-2;i++)
798
- for(int j=0;j<=order_cell[0]-2-i;j++)
799
- for(int k=0;k<=order_cell[2]-1;k++)
800
- {
801
- shape[ii++] = wuDv_minus_wvDu (adpolxy1[i],adpolxy2[j],adpolz[k]);
802
- shape[ii++] = uDv_minus_vDu (adpolxy1[i],adpolxy2[j]*adpolz[k]);
803
- }
804
-
805
- // Type 3
806
- // ned0(trig) * polxy2[j]*polz
807
- // z.DValue(0) * polxy1[i] * polxy2[j]
808
- // double ned_trig[2] = {y.Value(),-x.Value()};
809
- for(int j=0;j<=order_cell[0]-2;j++)
810
- for (int k=0;k<=order_cell[2]-1;k++)
811
- shape[ii++] = wuDv_minus_wvDu (x,y, adpolxy2[j]*adpolz[k]);
812
-
813
- for(int i = 0; i <= order_cell[0]-2; i++)
814
- for(int j = 0; j <= order_cell[0]-2-i; j++)
815
- shape[ii++] = wuDv_minus_wvDu (z,1-z, adpolxy1[i]*adpolxy2[j]);
816
- }
817
- }
818
-
819
-
820
-
821
- //------------------------------------------------------------------------
822
- // HCurlHighOrderHex
823
- //------------------------------------------------------------------------
824
-
825
-
826
- template<> template<typename Tx, typename TFA>
827
- void HCurlHighOrderFE_Shape<ET_HEX> :: T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
828
- {
829
- // Tx x = hx[0], y = hx[1], z = hx[2];
830
- Tx x = ip.x, y = ip.y, z = ip.z;
831
-
832
- Tx lami[8]={(1-x)*(1-y)*(1-z),x*(1-y)*(1-z),x*y*(1-z),(1-x)*y*(1-z),
833
- (1-x)*(1-y)*z,x*(1-y)*z,x*y*z,(1-x)*y*z};
834
- Tx sigma[8]={(1-x)+(1-y)+(1-z),x+(1-y)+(1-z),x+y+(1-z),(1-x)+y+(1-z),
835
- (1-x)+(1-y)+z,x+(1-y)+z,x+y+z,(1-x)+y+z};
836
-
837
- int ii = 12;
838
- ArrayMem<Tx, 20> pol_xi(order+2),pol_eta(order+2),pol_zeta(order+2);
839
-
840
- // edges
841
- for (int i = 0; i < 12; i++)
842
- {
843
- int p = order_edge[i];
844
- IVec<2> e = GetEdgeSort (i, vnums);
845
-
846
- Tx xi = sigma[e[1]]-sigma[e[0]];
847
- Tx lam_e = lami[e[0]]+lami[e[1]];
848
- Tx bub = 0.25 * lam_e * (1 - xi*xi);
849
-
850
- // Nedelec0-shapes
851
- shape[i] = uDv (0.5 * lam_e, xi);
852
-
853
- // High Order edges ... Gradient fields
854
- if(p > 0 && usegrad_edge[i])
855
- {
856
- //LegendrePolynomial::
857
- EdgeOrthoPol::
858
- EvalMult (p-1,
859
- xi, bub, pol_xi);
860
-
861
- for (int j = 0; j < p; j++)
862
- shape[ii++] = Du (pol_xi[j]);
863
- }
864
- }
865
-
866
- //Faces
867
- const FACE * faces = ElementTopology::GetFaces (ET_HEX);
868
- for (int i = 0; i<6; i++)
869
- {
870
- IVec<2> p = order_face[i];
871
-
872
- Tx lam_f(0);
873
- for (int j = 0; j < 4; j++)
874
- lam_f += lami[faces[i][j]];
875
-
876
- {
877
- IVec<4> f = GetFaceSort (i, vnums);
878
- Tx xi = sigma[f[0]] - sigma[f[1]];
879
- Tx eta = sigma[f[0]] - sigma[f[3]];
880
-
881
- Tx bub = lam_f*(1.0/16)*(1.0-eta*eta)*(1.0-xi*xi);
882
- QuadOrthoPol::Eval (p[0]-1, xi, pol_xi);
883
- QuadOrthoPol::EvalMult (p[1]-1, eta, bub, pol_eta);
884
-
885
- if(usegrad_face[i])
886
- {
887
- // Gradientfields nabla(polxy*polz)
888
- for (int k = 0; k <= p[0]-1; k++)
889
- for (int j = 0; j <= p[1]-1; j++)
890
- shape[ii++] = Du (pol_xi[k] * pol_eta[j]);
891
- }
892
- }
893
-
894
-
895
-
896
- int qmax = 0;
897
- for (int j = 1; j < 4; j++)
898
- if (vnums[faces[i][j]] > vnums[faces[i][qmax]])
899
- qmax = j;
900
-
901
- int q1 = (qmax+3)%4;
902
- int q2 = (qmax+1)%4;
903
-
904
- if(vnums[faces[i][q2]] > vnums[faces[i][q1]])
905
- swap(q1,q2); // fmax > f1 > f2
906
-
907
- int fmax = faces[i][qmax];
908
- int f1 = faces[i][q1];
909
- int f2 = faces[i][q2];
910
-
911
- Tx xi = sigma[fmax]-sigma[f1];
912
- Tx eta = sigma[fmax]-sigma[f2];
913
-
914
- T_ORTHOPOL::Calc(p[0]+1, xi,pol_xi);
915
- T_ORTHOPOL::Calc(p[1]+1,eta,pol_eta);
916
-
917
- /*
918
- //Gradient fields
919
- if(usegrad_face[i])
920
- for (int k = 0; k < p[0]; k++)
921
- for (int j= 0; j < p[1]; j++)
922
- shape[ii++] = Du<3> (lam_f * pol_xi[k] * pol_eta[j]);
923
- */
924
-
925
- //Rotation of Gradient fields
926
- for (int k = 0; k < p[0]; k++)
927
- for (int j= 0; j < p[1]; j++)
928
- shape[ii++] = uDv_minus_vDu (pol_eta[j], lam_f * pol_xi[k]);
929
-
930
- // Missing ones
931
- for(int j = 0; j < p[0];j++)
932
- shape[ii++] = wuDv_minus_wvDu (Tx(0.5), eta, pol_xi[j]*lam_f);
933
-
934
- for(int j = 0; j < p[1];j++)
935
- shape[ii++] = wuDv_minus_wvDu (Tx(0.5), xi, pol_eta[j]*lam_f);
936
- }
937
-
938
-
939
-
940
- {
941
- IVec<3> p = order_cell[0];
942
- if(usegrad_cell)
943
- if (p[0] >= 1 && p[1] >= 1 && p[2] >= 1)
944
- {
945
- QuadOrthoPol::EvalMult (p[0]-1, 2*x-1, x*(1-x), pol_xi);
946
- QuadOrthoPol::EvalMult (p[1]-1, 2*y-1, y*(1-y), pol_eta);
947
- QuadOrthoPol::EvalMult (p[2]-1, 2*z-1, z*(1-z), pol_zeta);
948
-
949
- for (int i = 0; i < p[0]; i++)
950
- for (int j = 0; j < p[1]; j++)
951
- {
952
- Tx pxy = pol_xi[i] * pol_eta[j];
953
- for (int k = 0; k < p[2]; k++)
954
- shape[ii++] = Du (pxy * pol_zeta[k]);
955
- }
956
- }
957
- }
958
-
959
-
960
- // Element-based shapes
961
- T_ORTHOPOL::Calc(order_cell[0]+1,2*x-1,pol_xi);
962
- T_ORTHOPOL::Calc(order_cell[1]+1,2*y-1,pol_eta);
963
- T_ORTHOPOL::Calc(order_cell[2]+1,2*z-1,pol_zeta);
964
-
965
- /*
966
- //Gradient fields
967
- if(usegrad_cell)
968
- for (int i=0; i<order_cell[0]; i++)
969
- for(int j=0; j<order_cell[1]; j++)
970
- for(int k=0; k<order_cell[2]; k++)
971
- shape[ii++] = Du<3> (pol_xi[i] * pol_eta[j] * pol_zeta[k]);
972
- */
973
-
974
- //Rotations of gradient fields
975
- for (int i=0; i<order_cell[0]; i++)
976
- for(int j=0; j<order_cell[1]; j++)
977
- for(int k=0; k<order_cell[2]; k++)
978
- {
979
- shape[ii++] = uDv_minus_vDu (pol_xi[i] * pol_eta[j], pol_zeta[k]);
980
- shape[ii++] = uDv_minus_vDu (pol_xi[i], pol_eta[j] * pol_zeta[k]);
981
- }
982
-
983
- for(int i = 0; i < order_cell[0]; i++)
984
- for(int j = 0; j < order_cell[1]; j++)
985
- shape[ii++] = wuDv_minus_wvDu (z,1-z,pol_xi[i] * pol_eta[j]);
986
-
987
- for(int i = 0; i < order_cell[0]; i++)
988
- for(int k = 0; k < order_cell[2]; k++)
989
- shape[ii++] = wuDv_minus_wvDu (y,1-y,pol_xi[i] * pol_zeta[k]);
990
-
991
- for(int j = 0; j < order_cell[1]; j++)
992
- for(int k = 0; k < order_cell[2]; k++)
993
- shape[ii++] = wuDv_minus_wvDu (x,1-x,pol_eta[j] * pol_zeta[k]);
994
- }
995
-
996
-
997
-
998
- template<> template <typename MIP, typename TFA>
999
- inline void HCurlHighOrderFE_Shape<ET_HEX> ::
1000
- CalcDualShape2 (const MIP & mip, TFA & shape) const
1001
- {
1002
- typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
1003
- auto & ip = mip.IP();
1004
- T x = ip(0), y = ip(1), z = ip(2);
1005
- // T lam[4] = { x, y, z, 1-x-y-z };
1006
- // Vec<3> pnts[4] = { { 1, 0, 0 }, { 0, 1, 0 } , { 0, 0, 1 }, { 0, 0, 0 } };
1007
- // T lam[8]={(1-x)*(1-y)*(1-z),x*(1-y)*(1-z),x*y*(1-z),(1-x)*y*(1-z),
1008
- // (1-x)*(1-y)*z,x*(1-y)*z,x*y*z,(1-x)*y*z};
1009
- T sigma[8]={(1-x)+(1-y)+(1-z),x+(1-y)+(1-z),x+y+(1-z),(1-x)+y+(1-z),
1010
- (1-x)+(1-y)+z,x+(1-y)+z,x+y+z,(1-x)+y+z};
1011
- Vec<3> pnts[8] =
1012
- {
1013
- { 0, 0, 0 },
1014
- { 1, 0, 0 },
1015
- { 1, 1, 0 },
1016
- { 0, 1, 0 },
1017
- { 0, 0, 1 },
1018
- { 1, 0, 1 },
1019
- { 1, 1, 1 },
1020
- { 0, 1, 1 }
1021
- };
1022
-
1023
-
1024
- int facetnr = ip.FacetNr();
1025
- int ii = 12;
1026
-
1027
- if (ip.VB() == BBND)
1028
- { // edge shapes
1029
- for (int i = 0; i < 12; i++)
1030
- {
1031
- int p = order_edge[i];
1032
- if (i == facetnr)
1033
- {
1034
- IVec<2> e = GetEdgeSort (i, vnums);
1035
- T xi = sigma[e[1]]-sigma[e[0]];
1036
- Vec<3> tauref = pnts[e[1]] - pnts[e[0]];
1037
- Vec<3,T> tau = mip.GetJacobian()*tauref;
1038
- tau /= mip.GetMeasure();
1039
- LegendrePolynomial::Eval
1040
- (p, xi,
1041
- SBLambda([&] (size_t nr, T val)
1042
- {
1043
- Vec<3,T> vshape = val * tau;
1044
- if (nr==0)
1045
- shape[i] = vshape;
1046
- else
1047
- shape[ii+nr-1] = vshape;
1048
- }));
1049
- }
1050
- ii += p;
1051
- }
1052
- }
1053
- else
1054
- {
1055
- throw Exception ("H(curl)-hex: dual shapes supported only on edges");
1056
- for (int i = 0; i < 12; i++)
1057
- ii += order_edge[i];
1058
- }
1059
-
1060
- /*
1061
- // just copied from tet, needs adaption ...
1062
- if (ip.VB() == BND)
1063
- {
1064
- //AutoDiff<3,T> xa(ip(0), 0), ya(ip(1),1), za(ip(2),2);
1065
- //AutoDiff<3,T> lami[4] = { xa, ya, za, (T)(1.0) };
1066
-
1067
- for (int f = 0; f < 4; f++)
1068
- {
1069
- int p = order_face[f][0];
1070
- if (f == facetnr)
1071
- {
1072
- IVec<4> fav = GetFaceSort (facetnr, vnums);
1073
- //AutoDiff<3,T> adxi = lami[fav[0]]-lami[fav[2]];
1074
- //AutoDiff<3,T> adeta = lami[fav[1]]-lami[fav[2]];
1075
- Vec<3> adxi = pnts[fav[0]] - pnts[fav[2]];
1076
- Vec<3> adeta = pnts[fav[1]] - pnts[fav[2]];
1077
- T xi = lam[fav[0]];
1078
- T eta = lam[fav[1]];
1079
-
1080
- Matrix<> F(3,2);
1081
- F.Cols(0,1) = adxi;//Vec<3,T>(adxi.DValue(0),adxi.DValue(1),adxi.DValue(2));
1082
- F.Cols(1,2) = adeta;//Vec<3,T>(adeta.DValue(0),adeta.DValue(1),adeta.DValue(2));
1083
-
1084
- Matrix<> Ftmp(2,2);
1085
- Ftmp = Trans(F)*F;
1086
- auto det = sqrt(Ftmp(0,0)*Ftmp(1,1)-Ftmp(1,0)*Ftmp(0,1));
1087
-
1088
- DubinerBasis::Eval(order-2, xi, eta,
1089
- SBLambda([&] (size_t nr, auto val)
1090
- {
1091
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T> (val, 0));
1092
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T> (val*xi, val*eta));
1093
- }));
1094
- LegendrePolynomial::Eval(order-2,xi,
1095
- SBLambda([&] (size_t nr, auto val)
1096
- {
1097
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T>(0, val));
1098
- }));
1099
- }
1100
- else
1101
- ii += (p+1)*(p-1);
1102
- }
1103
- }
1104
- else
1105
- {
1106
- for (int i = 0; i < 4; i++)
1107
- {
1108
- int p = order_face[i][0];
1109
- ii += (p+1)*(p-1);
1110
- }
1111
- }
1112
- if (ip.VB() == VOL)
1113
- {
1114
- // auto xphys = mip.GetPoint()(0);
1115
- // auto yphys = mip.GetPoint()(1);
1116
- // auto zphys = mip.GetPoint()(2);
1117
-
1118
- LegendrePolynomial leg;
1119
- JacobiPolynomialAlpha jac1(1);
1120
- leg.EvalScaled1Assign
1121
- (order-3, lam[2]-lam[3], lam[2]+lam[3],
1122
- SBLambda ([&](size_t k, T polz) LAMBDA_INLINE
1123
- {
1124
- // JacobiPolynomialAlpha jac(2*k+1);
1125
- JacobiPolynomialAlpha jac2(2*k+2);
1126
-
1127
- jac1.EvalScaledMult1Assign
1128
- (order-3-k, lam[1]-lam[2]-lam[3], 1-lam[0], polz,
1129
- SBLambda ([&] (size_t j, T polsy) LAMBDA_INLINE
1130
- {
1131
- // JacobiPolynomialAlpha jac(2*(j+k)+2);
1132
- jac2.EvalMult(order-3 - k - j, 2 * lam[0] - 1, polsy,
1133
- SBLambda([&](size_t j, T val) LAMBDA_INLINE
1134
- {
1135
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<3,T>(val*x, val*y, val*z);
1136
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<3,T>(val, 0, 0);
1137
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<3,T>(0, val, 0);
1138
- }));
1139
- jac2.IncAlpha2();
1140
- }));
1141
- jac1.IncAlpha2();
1142
- }));
1143
-
1144
-
1145
- DubinerBasis::Eval(order-3, x, y,
1146
- SBLambda([&] (size_t nr, auto val)
1147
- {
1148
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<3,T> (0, 0, val);
1149
- }));
1150
- }
1151
- */
1152
- }
1153
-
1154
-
1155
-
1156
-
1157
-
1158
-
1159
-
1160
-
1161
-
1162
-
1163
- //------------------------------------------------------------------------
1164
- // Pyramid
1165
- //------------------------------------------------------------------------
1166
-
1167
-
1168
- template<> template<typename Tx, typename TFA>
1169
- void HCurlHighOrderFE_Shape<ET_PYRAMID> :: T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
1170
- {
1171
- typedef TrigShapesInnerLegendre T_TRIGFACESHAPES;
1172
-
1173
- // Tx x = hx[0], y = hx[1], z = hx[2];
1174
- Tx x = ip.x, y = ip.y, z = ip.z;
1175
-
1176
- //if(z.Value()==1.) z.Value() -=1.e-8;
1177
- z.Value() = z.Value()*(1-1e-12);
1178
-
1179
- Tx xt = x/(1-z);
1180
- Tx yt = y/(1-z);
1181
- Tx sigma[5] = {(1-xt)+(1-yt)+(1-z),xt+(1-yt)+(1-z), xt + yt + (1-z),
1182
- (1-xt)+yt+(1-z),z};
1183
-
1184
- Tx lami[5] = {(1-xt)*(1-yt)*(1-z),xt*(1-yt)*(1-z), xt * yt * (1-z),
1185
- (1-xt)*yt*(1-z),z};
1186
-
1187
- Tx lambda[5] = {(1-xt)*(1-yt),xt*(1-yt), xt * yt,
1188
- (1-xt)*yt,z};
1189
-
1190
-
1191
- ArrayMem<Tx, 20> pol_xi(order+2), pol_eta(order+2), pol_zeta(order+2);
1192
-
1193
- int ii =8;
1194
-
1195
- // horizontal edges incl. Nedelec 0
1196
- for (int i = 0; i < 4; i++)
1197
- {
1198
- int p = order_edge[i];
1199
- IVec<2> e = GetEdgeSort (i, vnums);
1200
-
1201
- Tx xi = sigma[e[1]] - sigma[e[0]];
1202
- Tx lam_t = lambda[e[1]] + lambda[e[0]];
1203
-
1204
- shape[i] = uDv (0.5 * (1-z)*(1-z)*lam_t, xi);
1205
-
1206
- if(p > 0 && usegrad_edge[i])
1207
- {
1208
- Tx bub = 0.25*(1-xi*xi)*(1-z)*(1-z)*lam_t;
1209
- // LegendrePolynomial::
1210
- EdgeOrthoPol::
1211
- EvalScaledMult (p-1,
1212
- xi*(1-z), 1-z, bub,
1213
- SBLambda ([&](int i, Tx val)
1214
- {
1215
- shape[ii++] = Du(val);
1216
- }));
1217
- }
1218
- }
1219
-
1220
- // vertical edges incl. Nedelec 0
1221
- for(int i = 4; i < 8; i++)
1222
- {
1223
- int p = order_edge[i];
1224
- IVec<2> e = GetEdgeSort (i, vnums);
1225
-
1226
- shape[i] = uDv_minus_vDu (lami[e[0]], lami[e[1]]);
1227
-
1228
- if (p > 0 && usegrad_edge[i])
1229
- {
1230
- Tx xi = lami[e[1]]-lami[e[0]];
1231
- Tx lam_e = lami[e[0]]+lami[e[1]];
1232
- Tx bub = 0.25 * (lam_e*lam_e-xi*xi);
1233
-
1234
- // LegendrePolynomial::
1235
- EdgeOrthoPol::
1236
- EvalScaledMult (p-1,
1237
- xi, lam_e, bub,
1238
- SBLambda ([&](int i, Tx val)
1239
- {
1240
- shape[ii++] = Du(val);
1241
- }));
1242
- }
1243
- }
1244
-
1245
- const FACE * faces = ElementTopology::GetFaces (ET_PYRAMID);
1246
-
1247
- // trig face dofs
1248
- for (int i = 0; i < 4; i++)
1249
- if (order_face[i][0] >= 2)
1250
- {
1251
- int p = order_face[i][0];
1252
- Tx lam_face = lambda[faces[i][0]] + lambda[faces[i][1]];
1253
- Tx bary[3] =
1254
- {(sigma[faces[i][0]]-(1-z)-lam_face)*(1-z),
1255
- (sigma[faces[i][1]]-(1-z)-lam_face)*(1-z), z};
1256
-
1257
- int fav[3] = {0, 1, 2};
1258
- if(vnums[faces[i][fav[0]]] > vnums[faces[i][fav[1]]]) swap(fav[0],fav[1]);
1259
- if(vnums[faces[i][fav[1]]] > vnums[faces[i][fav[2]]]) swap(fav[1],fav[2]);
1260
- if(vnums[faces[i][fav[0]]] > vnums[faces[i][fav[1]]]) swap(fav[0],fav[1]);
1261
-
1262
- if(usegrad_face[i])
1263
- {
1264
- Tx bub = lam_face * bary[fav[0]]*bary[fav[1]]*bary[fav[2]];
1265
- TrigOrthoPolGrad::
1266
- EvalMult (p-2, bary[fav[0]], bary[fav[1]], bub,
1267
- SBLambda ([&](int nr, Tx val)
1268
- {
1269
- shape[ii++] = Du (val);
1270
- }));
1271
- }
1272
-
1273
- /*
1274
- // phi = pol_xi * pol_eta * lam_face;
1275
- // Type 1: Gradient Functions
1276
- if(usegrad_face[i])
1277
- for(int j=0;j<= p-2; j++)
1278
- for(int k=0;k<=p-2-j; k++)
1279
- shape[ii++] = Du<3> (pol_xi[j] * pol_eta[k]);
1280
- */
1281
-
1282
- // if (type1) {
1283
- if (true) {
1284
-
1285
- DubinerBasis::EvalMult
1286
- (p-2, bary[fav[0]], bary[fav[1]],
1287
- bary[fav[0]]*lam_face,
1288
- SBLambda
1289
- ([&](int nr, Tx val)
1290
- {
1291
- shape[ii++] = wuDv_minus_wvDu(bary[fav[1]], bary[fav[2]], val);
1292
- }));
1293
-
1294
- LegendrePolynomial::EvalMult
1295
- (p-2, bary[fav[2]]-bary[fav[1]], bary[fav[2]]*lam_face,
1296
- SBLambda
1297
- ([&] (int j, Tx val)
1298
- {
1299
- shape[ii++] = wuDv_minus_wvDu(bary[fav[1]], bary[fav[0]], val);
1300
- }));
1301
- }
1302
-
1303
- else {
1304
- T_TRIGFACESHAPES::CalcSplitted(p+1, bary[fav[2]]-bary[fav[1]],
1305
- bary[fav[0]],pol_xi,pol_eta);
1306
-
1307
- for(int j=0;j<=p-2;j++) pol_eta[j] *= lam_face;
1308
-
1309
- // Type 2:
1310
- for(int j=0;j<= p-2; j++)
1311
- for(int k=0;k<=p-2-j; k++)
1312
- shape[ii++] = uDv_minus_vDu (pol_eta[k], pol_xi[j]);
1313
-
1314
- // Type 3: Nedelec-based ones (Ned_0*v_j)
1315
- for(int j=0;j<=p-2;j++)
1316
- shape[ii++] = wuDv_minus_wvDu (bary[fav[1]], bary[fav[2]], pol_eta[j]);
1317
- }
1318
- }
1319
-
1320
-
1321
- // quad face
1322
- if (order_face[4][0] >= 1)
1323
- {
1324
- int px = order_face[4][0];
1325
- int py = order_face[4][0]; // SZ-Attentione
1326
- int p = max2(px, py);
1327
-
1328
- Tx fac(1.0);
1329
- for (int k = 1; k <= p+1; k++) fac *= (1-z);
1330
-
1331
- IVec<4> f = GetFaceSort (4, vnums);
1332
- Tx xi = sigma[f[0]] - sigma[f[1]];
1333
- Tx eta = sigma[f[0]] - sigma[f[3]];
1334
-
1335
- if (usegrad_face[4])
1336
- {
1337
- // Type 1: Gradient-fields
1338
-
1339
- QuadOrthoPol::
1340
- EvalMult (px-1, xi, fac*0.25*(1-xi*xi), pol_xi);
1341
- QuadOrthoPol::
1342
- EvalMult (py-1, eta, 0.25*(1-eta*eta), pol_eta);
1343
-
1344
- for (int k = 0; k <= px-1; k++)
1345
- for (int j = 0; j <= py-1; j++, ii++)
1346
- shape[ii] = Du (pol_xi[k] * pol_eta[j]);
1347
- }
1348
-
1349
- int fmax = 0;
1350
- for (int l=1; l<4; l++)
1351
- if (vnums[l] > vnums[fmax]) fmax = l;
1352
-
1353
- int f1 = (fmax+3)%4;
1354
- int f2 = (fmax+1)%4;
1355
- if(vnums[f1]>vnums[f2]) swap(f1,f2); // fmax > f2 > f1
1356
-
1357
- xi = sigma[fmax] - sigma[f2];
1358
- eta = sigma[fmax] - sigma[f1];
1359
-
1360
- T_ORTHOPOL::Calc (px+1, xi, pol_xi);
1361
- T_ORTHOPOL::Calc (py+1, eta, pol_eta);
1362
-
1363
- for(int k = 0; k < py; k++) pol_eta[k] *= fac;
1364
-
1365
- // Type 2:
1366
- for (int k = 0; k < px; k++)
1367
- for (int j = 0; j < py; j++)
1368
- shape[ii++] = uDv_minus_vDu (pol_eta[j], pol_xi[k]);
1369
-
1370
- // Type 3:
1371
- for (int k = 0; k < px; k++)
1372
- shape[ii++] = uDv (0.5*pol_xi[k]*fac, eta);
1373
-
1374
- for (int k = 0; k < py; k++)
1375
- shape[ii++] = uDv (0.5*pol_eta[k] /* *fac */, xi);
1376
- }
1377
-
1378
- if (order_cell[0] >= 2)
1379
- {
1380
- int pp = order_cell[0];
1381
- // According H^1 terms:
1382
- // u_i = L_i+2(2xt-1)
1383
- // v_j = L_j+2(2yt-1)
1384
- // w_k = z * (1-z)^(k+2) with 0 <= i,j <= k, 0<= k <= p-2
1385
-
1386
- LegendrePolynomial::EvalMult (pp-1, 2*xt-1, xt*(1-xt), pol_xi);
1387
- LegendrePolynomial::EvalMult (pp-1, 2*yt-1, yt*(1-yt), pol_eta);
1388
- // T_ORTHOPOL::Calc (pp+3, 2*xt-1, pol_xi);
1389
- // T_ORTHOPOL::Calc (pp+3, 2*yt-1, pol_eta);
1390
-
1391
- pol_zeta[0] = z*(1-z)*(1-z);
1392
- for (int k=1;k<=pp-2;k++)
1393
- pol_zeta[k] = (1-z)*pol_zeta[k-1];
1394
-
1395
- if(usegrad_cell)
1396
- {
1397
- for(int k=0;k<= pp-2;k++)
1398
- {
1399
- for(int i=0;i<=k;i++)
1400
- for(int j=0;j<=k;j++)
1401
- shape[ii++] = Du (pol_xi[i]*pol_eta[j]*pol_zeta[k]);
1402
- }
1403
- }
1404
-
1405
- // Type 2a: l.i. combinations of grad-terms
1406
- // shape = u_i \nabla(v_j) w_k
1407
- // shape = u_i v_j \nabla(w_k)
1408
- for(int k=0;k<= pp-2;k++)
1409
- for(int i=0;i<=k;i++)
1410
- for(int j=0;j<=k;j++,ii++)
1411
- shape[ii] = uDv (pol_xi[i]*pol_zeta[k], pol_eta[j]);
1412
-
1413
- // Type 2b: shape = v_j w_k \nabla (xt)
1414
- // shape = u_i w_k \nabla (yt)
1415
- for(int k = 0;k<= pp-2;k++)
1416
- for(int j=0;j<=k;j++)
1417
- shape[ii++] = uDv (pol_eta[j]*pol_zeta[k], xt);
1418
-
1419
- for(int k = 0;k<= pp-2;k++)
1420
- for (int i=0;i<=k;i++)
1421
- shape[ii++] = uDv (pol_xi[i]*pol_zeta[k], yt);
1422
-
1423
- // 3rd component spans xi^i eta^j zeta^(k-1), i,j <= k
1424
- // pol_zeta starts linear in zeta
1425
- // pol_xi and pol_eta quadratic in xi resp. eta
1426
- pol_zeta[0] = (1-z);
1427
- for (int k=1;k<=pp;k++)
1428
- pol_zeta[k] = (1-z)*pol_zeta[k-1];
1429
-
1430
- for(int k=0;k<= pp-1;k++)
1431
- for(int i=0;i<=k;i++)
1432
- for(int j=0;j<=k;j++,ii++)
1433
- shape[ii] = uDv (pol_eta[j] * pol_xi[i] * pol_zeta[k], z);
1434
- }
1435
- }
1436
-
1437
-
1438
-
1439
-
1440
- // dual shapes
1441
-
1442
- template<> template <typename MIP, typename TFA>
1443
- inline void HCurlHighOrderFE_Shape<ET_TRIG> ::
1444
- CalcDualShape2 (const MIP & mip, TFA & shape) const
1445
- {
1446
- // shape = 0;
1447
- auto & ip = mip.IP();
1448
- typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
1449
- T x = ip(0), y = ip(1);
1450
- T lam[3] = { x, y, 1-x-y };
1451
- Vec<2,T> pnts[3] = { { 1, 0 }, { 0, 1 } , { 0, 0 } };
1452
- int facetnr = ip.FacetNr();
1453
-
1454
- if (ip.VB() == BND)
1455
- { // facet shapes
1456
- int ii = 3;
1457
- for (int i = 0; i < 3; i++)
1458
- {
1459
- int p = order_edge[i];
1460
- if (i == facetnr)
1461
- {
1462
- IVec<2> e = GetEdgeSort (i, vnums);
1463
- T xi = lam[e[1]]-lam[e[0]];
1464
- Vec<2,T> tauref = pnts[e[1]] - pnts[e[0]];
1465
- auto tau = mip.GetJacobian()*tauref;
1466
- tau /= mip.GetMeasure();
1467
-
1468
- LegendrePolynomial::Eval
1469
- (p, xi,
1470
- SBLambda([&] (size_t nr, T val)
1471
- {
1472
- auto vshape = val * tau;
1473
- if (nr==0)
1474
- shape[i] = vshape;
1475
- else
1476
- shape[ii+nr-1] = vshape;
1477
- }));
1478
- }
1479
- ii += p;
1480
- }
1481
- }
1482
- if (ip.VB() == VOL)
1483
- { // inner shapes
1484
- int ii = 3;
1485
- for (int i = 0; i < 3; i++)
1486
- ii += order_edge[i];
1487
-
1488
-
1489
- auto trafo = 1/mip.GetMeasure()*mip.GetJacobian();
1490
- DubinerBasis::Eval(order-2, x, y,
1491
- SBLambda([&] (size_t nr, auto val)
1492
- {
1493
- shape[ii++] = trafo * Vec<2,T> (val, 0);
1494
- if (type1)
1495
- shape[ii++] = trafo * Vec<2,T> (0, val);
1496
- else
1497
- shape[ii++] = trafo * Vec<2,T> (val*x, val*y);
1498
- }));
1499
- if (!type1)
1500
- LegendrePolynomial::Eval(order-2,x,
1501
- SBLambda([&] (size_t nr, auto val)
1502
- {
1503
- shape[ii++] = trafo * Vec<2,T>(0,val);
1504
- }));
1505
- }
1506
- }
1507
-
1508
- template<> template <typename MIP, typename TFA>
1509
- inline void HCurlHighOrderFE_Shape<ET_QUAD> ::
1510
- CalcDualShape2 (const MIP & mip, TFA & shape) const
1511
- {
1512
- auto & ip = mip.IP();
1513
- typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
1514
- T x = ip(0), y = ip(1);
1515
- Vec<2,T> pnts[4] = { { 0, 0 },
1516
- { 1, 0 },
1517
- { 1, 1 },
1518
- { 0, 1 } };
1519
- T sigma[4] = {(1-x)+(1-y),x+(1-y),x+y,(1-x)+y};
1520
- int facetnr = ip.FacetNr();
1521
-
1522
- if (ip.VB() == BND)
1523
- { // facet shapes
1524
- int ii = 4;
1525
- for (int i = 0; i < 4; i++)
1526
- {
1527
- int p = order_edge[i];
1528
- if (i == facetnr)
1529
- {
1530
- IVec<2> e = GetEdgeSort (i, vnums);
1531
- T xi = sigma[e[1]]-sigma[e[0]];
1532
- Vec<2,T> tauref = pnts[e[1]] - pnts[e[0]];
1533
- auto tau = mip.GetJacobian()*tauref;
1534
- tau /= mip.GetMeasure();
1535
-
1536
- LegendrePolynomial::Eval
1537
- (p, xi,
1538
- SBLambda([&] (size_t nr, T val)
1539
- {
1540
- auto vshape = val * tau;
1541
- if (nr==0)
1542
- shape[i] = vshape;
1543
- else
1544
- shape[ii+nr-1] = vshape;
1545
- }));
1546
- }
1547
- ii += p;
1548
- }
1549
- }
1550
- if (ip.VB() == VOL)
1551
- { // inner shapes
1552
- int ii = 4;
1553
- for (int i = 0; i < 4; i++)
1554
- ii += order_edge[i];
1555
-
1556
- //do not sort face!
1557
- //IVec<4> f = GetFaceSort (0, vnums);
1558
- //T xi = sigma[f[0]]-sigma[f[1]];
1559
- //T eta = sigma[f[0]]-sigma[f[3]];
1560
- T xi = sigma[0]-sigma[1];
1561
- T eta = sigma[0]-sigma[3];
1562
- ArrayMem<T, 20> polx(order+2), poly(order+2);
1563
- LegendrePolynomial (order, xi, polx);
1564
- LegendrePolynomial (order, eta, poly);
1565
-
1566
- int p = order_face[0][0];
1567
-
1568
- for (int i = 0; i < p+1; i++)
1569
- for (int j = 0; j < p; j++)
1570
- {
1571
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<2,T>(polx[i] * poly[j],0);
1572
- shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*Vec<2,T>(0,polx[j] * poly[i]);
1573
- }
1574
- }
1575
- }
1576
-
1577
-
1578
-
1579
- template<> template <typename MIP, typename TFA>
1580
- inline void HCurlHighOrderFE_Shape<ET_TET> ::
1581
- CalcDualShape2 (const MIP & mip, TFA & shape) const
1582
- {
1583
- // shape = 0;
1584
- typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
1585
- auto & ip = mip.IP();
1586
- T x = ip(0), y = ip(1), z = ip(2);
1587
- T lam[4] = { x, y, z, 1-x-y-z };
1588
- Vec<3> pnts[4] = { { 1, 0, 0 }, { 0, 1, 0 } , { 0, 0, 1 }, { 0, 0, 0 } };
1589
- int facetnr = ip.FacetNr();
1590
- int ii = 6;
1591
-
1592
- if (ip.VB() == BBND)
1593
- { // edge shapes
1594
- for (int i = 0; i < 6; i++)
1595
- {
1596
- int p = order_edge[i] * usegrad_edge[i];
1597
- if (i == facetnr)
1598
- {
1599
- IVec<2> e = GetEdgeSort (i, vnums);
1600
- T xi = lam[e[1]]-lam[e[0]];
1601
- Vec<3> tauref = pnts[e[1]] - pnts[e[0]];
1602
- Vec<3,T> tau = mip.GetJacobian()*tauref;
1603
- tau /= mip.GetMeasure();
1604
- LegendrePolynomial::Eval
1605
- (p, xi,
1606
- SBLambda([&] (size_t nr, T val)
1607
- {
1608
- Vec<3,T> vshape = val * tau;
1609
- if (nr==0)
1610
- shape[i] = vshape;
1611
- else
1612
- shape[ii+nr-1] = vshape;
1613
- }));
1614
- }
1615
- ii += p;
1616
- }
1617
- }
1618
- else
1619
- {
1620
- for (int i = 0; i < 6; i++)
1621
- ii += order_edge[i] * usegrad_edge[i];
1622
- }
1623
- if (ip.VB() == BND)
1624
- {
1625
- //AutoDiff<3,T> xa(ip(0), 0), ya(ip(1),1), za(ip(2),2);
1626
- //AutoDiff<3,T> lami[4] = { xa, ya, za, (T)(1.0) };
1627
-
1628
- for (int f = 0; f < 4; f++)
1629
- {
1630
- int p = order_face[f][0];
1631
- if (f == facetnr)
1632
- {
1633
- IVec<4> fav = GetFaceSort (facetnr, vnums);
1634
- //AutoDiff<3,T> adxi = lami[fav[0]]-lami[fav[2]];
1635
- //AutoDiff<3,T> adeta = lami[fav[1]]-lami[fav[2]];
1636
- Vec<3> adxi = pnts[fav[0]] - pnts[fav[2]];
1637
- Vec<3> adeta = pnts[fav[1]] - pnts[fav[2]];
1638
- T xi = lam[fav[0]];
1639
- T eta = lam[fav[1]];
1640
-
1641
- Matrix<> F(3,2);
1642
- F.Col(0) = adxi;//Vec<3,T>(adxi.DValue(0),adxi.DValue(1),adxi.DValue(2));
1643
- F.Col(1) = adeta;//Vec<3,T>(adeta.DValue(0),adeta.DValue(1),adeta.DValue(2));
1644
-
1645
- Matrix<> Ftmp(2,2);
1646
- Ftmp = Trans(F)*F;
1647
- auto det = sqrt(Ftmp(0,0)*Ftmp(1,1)-Ftmp(1,0)*Ftmp(0,1));
1648
-
1649
- DubinerBasis::Eval(order-2, xi, eta,
1650
- SBLambda([&] (size_t nr, auto val)
1651
- {
1652
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T> (val, 0));
1653
- if (type1)
1654
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T>(0, val));
1655
- else
1656
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T> (val*xi, val*eta));
1657
- }));
1658
- if (!type1)
1659
- LegendrePolynomial::Eval(order-2,xi,
1660
- SBLambda([&] (size_t nr, auto val)
1661
- {
1662
- shape[ii++] = 1/(det*mip.GetMeasure())*mip.GetJacobian()*(F*Vec<2,T>(0, val));
1663
- }));
1664
- }
1665
- else
1666
- ii += (p+!type1)*(p-1);
1667
-
1668
- }
1669
- }
1670
- else
1671
- {
1672
- for (int i = 0; i < 4; i++)
1673
- {
1674
- int p = order_face[i][0];
1675
- ii += (p+!type1)*(p-1);
1676
- }
1677
- }
1678
- if (ip.VB() == VOL)
1679
- {
1680
- // auto xphys = mip.GetPoint()(0);
1681
- // auto yphys = mip.GetPoint()(1);
1682
- // auto zphys = mip.GetPoint()(2);
1683
-
1684
- auto trafo = 1/mip.GetMeasure()*mip.GetJacobian();
1685
-
1686
- DubinerBasis3D::Eval (order-3, lam[0], lam[1], lam[2],
1687
- SBLambda([&](size_t j, T val) LAMBDA_INLINE
1688
- {
1689
- if (type1)
1690
- shape[ii++] = trafo*Vec<3,T> (0, 0, val);
1691
- else
1692
- shape[ii++] = trafo*Vec<3,T>(val*x, val*y, val*z);
1693
- shape[ii++] = trafo*Vec<3,T>(val, 0, 0);
1694
- shape[ii++] = trafo*Vec<3,T>(0, val, 0);
1695
- }));
1696
-
1697
- if (!type1)
1698
- DubinerBasis::Eval(order-3, x, y,
1699
- SBLambda([&] (size_t nr, auto val)
1700
- {
1701
- shape[ii++] = trafo*Vec<3,T> (0, 0, val);
1702
- }));
1703
- }
1704
- }
1705
-
1706
- template<> template <typename MIP, typename TFA>
1707
- inline void HCurlHighOrderFE_Shape<ET_PRISM> ::
1708
- CalcDualShape2 (const MIP & mip, TFA & shape) const
1709
- {
1710
- // shape = 0;
1711
- typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
1712
- auto & ip = mip.IP();
1713
- T x = ip(0), y = ip(1), z = ip(2);
1714
- T lam[6] = { x, y, 1-x-y, x, y, 1-x-y };
1715
- T muz[6] = { 1-z, 1-z, 1-z, z, z, z };
1716
-
1717
- T sigma[6];
1718
- for (int i = 0; i < 6; i++) sigma[i] = lam[i] + muz[i];
1719
-
1720
- Vec<3> pnts[6] = { { 1, 0, 0 }, { 0, 1, 0 } , { 0, 0, 0 },
1721
- { 1, 0, 1 }, { 0, 1, 1 }, { 0, 0, 1 }};
1722
- int facetnr = ip.FacetNr();
1723
- int ii = 9;
1724
-
1725
- if (ip.VB() == BBND)
1726
- {
1727
- for (int i = 0; i < 9; i++)
1728
- {
1729
- if(order_edge[i] > 1) throw Exception("Dual shapes for prisms for order > 1 not implemented!");
1730
- int p = order_edge[i] * usegrad_edge[i];
1731
- if (i == facetnr)
1732
- {
1733
- IVec<2> e = GetEdgeSort (i, vnums);
1734
- T xi = sigma[e[1]] - sigma[e[0]];
1735
- Vec<3> tauref = pnts[e[1]] - pnts[e[0]];
1736
- Vec<3,T> tau = mip.GetJacobian()*tauref;
1737
- tau /= mip.GetMeasure();
1738
- LegendrePolynomial::Eval
1739
- (p, xi,
1740
- SBLambda([&] (size_t nr, T val)
1741
- {
1742
- Vec<3,T> vshape = val * tau;
1743
- if (nr==0)
1744
- shape[i] = vshape;
1745
- else
1746
- shape[ii+nr-1] = vshape;
1747
- }));
1748
- }
1749
- ii += p;
1750
- }
1751
- }
1752
- else
1753
- {
1754
- for (int i = 0; i < 9; i++)
1755
- ii += order_edge[i] * usegrad_edge[i];
1756
- }
1757
- if (ip.VB() == BND)
1758
- {
1759
- // TODO
1760
- }
1761
- else
1762
- {
1763
- for (int i = 0; i < 4; i++)
1764
- {
1765
- int p = order_face[i][0];
1766
- ii += (p+1)*(p-1);
1767
- }
1768
- }
1769
- if (ip.VB() == VOL)
1770
- {
1771
- // TODO
1772
- }
1773
- }
1774
-
1775
- template <ELEMENT_TYPE ET,
1776
- template <ELEMENT_TYPE ET2> class TSHAPES,
1777
- typename BASE>
1778
- void HCurlHighOrderFE<ET,TSHAPES,BASE> ::
1779
- CalcDualShape (const BaseMappedIntegrationPoint & bmip, BareSliceMatrix<> shape) const
1780
- {
1781
- shape.AddSize(ndof, bmip.DimSpace()) = 0.0;
1782
- Switch<4-DIM>
1783
- (bmip.DimSpace()-DIM,[this,&bmip,shape](auto CODIM)
1784
- {
1785
- auto & mip = static_cast<const MappedIntegrationPoint<DIM,DIM+CODIM.value>&> (bmip);
1786
- static_cast<const HCurlHighOrderFE_Shape<ET>*> (this)
1787
- -> CalcDualShape2 (mip, SBLambda([shape] (size_t i, auto val)
1788
- {
1789
- shape.Row(i) = val;
1790
- }));
1791
- });
1792
- }
1793
-
1794
-
1795
- template <ELEMENT_TYPE ET,
1796
- template <ELEMENT_TYPE ET2> class TSHAPES,
1797
- typename BASE>
1798
- void HCurlHighOrderFE<ET,TSHAPES,BASE> ::
1799
- CalcDualShape (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceMatrix<SIMD<double>> shapes) const
1800
- {
1801
-
1802
- Switch<4-DIM>
1803
- (bmir.DimSpace()-DIM,[this,&bmir,shapes](auto CODIM)
1804
- {
1805
- constexpr int DIMSPACE = DIM+CODIM.value;
1806
- auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
1807
- shapes.AddSize(ndof*DIMSPACE, mir.Size()) = 0.0;
1808
- for (size_t i = 0; i < mir.Size(); i++)
1809
- static_cast<const HCurlHighOrderFE_Shape<ET>*> (this)
1810
- -> CalcDualShape2 (mir[i], SBLambda([shapes,i,DIMSPACE] (size_t j, auto val)
1811
- {
1812
- for (size_t k = 0; k < DIMSPACE; k++)
1813
- shapes(j*DIMSPACE+k, i) = val(k);
1814
- }));
1815
- });
1816
- }
1817
-
1818
- template <ELEMENT_TYPE ET,
1819
- template <ELEMENT_TYPE ET2> class TSHAPES,
1820
- typename BASE>
1821
- void HCurlHighOrderFE<ET,TSHAPES,BASE> ::
1822
- EvaluateDual (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceVector<> coefs, BareSliceMatrix<SIMD<double>> values) const
1823
- {
1824
- Switch<4-DIM>
1825
- (bmir.DimSpace()-DIM,[this,&bmir,coefs,values](auto CODIM)
1826
- {
1827
- constexpr int DIMSPACE = DIM+CODIM.value;
1828
- auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
1829
- for (size_t i = 0; i < mir.Size(); i++)
1830
- {
1831
- Vec<DIMSPACE,SIMD<double>> sum (SIMD<double>(0.0));
1832
- static_cast<const HCurlHighOrderFE_Shape<ET>*> (this)
1833
- -> CalcDualShape2 (mir[i], SBLambda([&sum, coefs] (size_t j, auto val)
1834
- {
1835
- sum += coefs(j) * val;
1836
- }));
1837
- for (size_t k = 0; k < DIMSPACE; k++)
1838
- values(k, i) = sum(k);
1839
- }
1840
- });
1841
- }
1842
-
1843
- template <ELEMENT_TYPE ET,
1844
- template <ELEMENT_TYPE ET2> class TSHAPES,
1845
- typename BASE>
1846
- void HCurlHighOrderFE<ET,TSHAPES,BASE> ::
1847
- AddDualTrans (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceMatrix<SIMD<double>> values,
1848
- BareSliceVector<double> coefs) const
1849
- {
1850
- Switch<4-DIM>
1851
- (bmir.DimSpace()-DIM,[this,&bmir,coefs,values](auto CODIM)
1852
- {
1853
- constexpr int DIMSPACE = DIM+CODIM.value;
1854
- auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
1855
- for (size_t i = 0; i < mir.Size(); i++)
1856
- {
1857
- Vec<DIMSPACE,SIMD<double>> value = values.Col(i);
1858
- // for (size_t k = 0; k < DIMSPACE; k++)
1859
- // value(k) = values(k, i);
1860
-
1861
- static_cast<const HCurlHighOrderFE_Shape<ET>*> (this)
1862
- -> CalcDualShape2 (mir[i], SBLambda([value, coefs] (size_t j, auto val)
1863
- {
1864
- coefs(j) += HSum(InnerProduct(value,val));
1865
- }));
1866
- }
1867
- });
1868
- }
1869
- }
1870
-
1871
- #endif