ngsolve 6.2.2506.post216.dev0__cp314-cp314-manylinux_2_28_x86_64.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.
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvcc +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvlink +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngscxx +15 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsld +11 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsolve.tcl +648 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngspy +2 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/analytic_integrals.hpp +10 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/arnoldi.hpp +55 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bandmatrix.hpp +334 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basematrix.hpp +963 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basevector.hpp +1268 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbequations.hpp +2807 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbintegrator.hpp +1660 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bem_diffops.hpp +475 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bessel.hpp +1064 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bilinearform.hpp +966 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bla.hpp +29 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockalloc.hpp +95 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockjacobi.hpp +328 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bspline.hpp +116 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/calcinverse.hpp +141 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cg.hpp +368 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/chebyshev.hpp +44 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cholesky.hpp +720 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/clapack.h +7254 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/code_generation.hpp +296 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient.hpp +2033 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_impl.hpp +19 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_stdmath.hpp +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/commutingAMG.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/comp.hpp +79 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compatibility.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/complex_wrapper.hpp +101 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compressedfespace.hpp +110 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/contact.hpp +239 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_core.hpp +216 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_linalg.hpp +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngbla.hpp +317 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngstd.hpp +414 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_profiler.hpp +240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diagonalmatrix.hpp +160 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/differentialoperator.hpp +276 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop.hpp +1286 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop_impl.hpp +328 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffopwithfactor.hpp +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/discontinuous.hpp +84 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/dump.hpp +949 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ectypes.hpp +121 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigen.hpp +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigensystem.hpp +18 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elasticity_equations.hpp +595 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementbyelement.hpp +201 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtopology.hpp +1760 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtransformation.hpp +339 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/evalfunc.hpp +405 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/expr.hpp +1693 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfe.hpp +175 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfespace.hpp +180 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facethofe.hpp +111 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetsurffespace.hpp +112 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fe_interfaces.hpp +32 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fem.hpp +87 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fesconvert.hpp +14 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fespace.hpp +1454 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/finiteelement.hpp +286 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalinterfacespace.hpp +77 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalspace.hpp +115 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/gridfunction.hpp +525 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1amg.hpp +124 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe.hpp +188 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe_impl.hpp +1262 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo.hpp +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo_impl.hpp +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofespace.hpp +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lofe.hpp +1240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lumping.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurl_equations.hpp +1381 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfe.hpp +2241 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfespace.hpp +78 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe.hpp +259 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe_utils.hpp +107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdiv_dshape.hpp +857 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdivfes.hpp +308 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe.hpp +175 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe_impl.hpp +1871 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofespace.hpp +193 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurllofe.hpp +1146 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdiv_equations.hpp +880 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivfe.hpp +2923 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivsurfacespace.hpp +76 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe.hpp +206 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe_utils.hpp +717 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfes.hpp +75 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe.hpp +447 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe_impl.hpp +1107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofefo.hpp +229 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofespace.hpp +177 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhosurfacefespace.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivlofe.hpp +773 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hidden.hpp +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/householder.hpp +181 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_ams_precond.hpp +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_precond.hpp +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integrator.hpp +2012 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integratorcf.hpp +253 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/interpolate.hpp +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrule.hpp +2542 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrules_SauterSchwab.hpp +25 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/irspace.hpp +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/jacobi.hpp +153 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/kernels.hpp +724 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe.hpp +194 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe_impl.hpp +564 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofefo.hpp +542 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofespace.hpp +344 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/la.hpp +38 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linalg_kernels.hpp +70 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linearform.hpp +266 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/matrix.hpp +2145 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/memusage.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/meshaccess.hpp +1359 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mgpre.hpp +204 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mp_coefficient.hpp +145 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mptools.hpp +2281 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multigrid.hpp +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multivector.hpp +447 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mumpsinverse.hpp +187 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mycomplex.hpp +361 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ng_lapack.hpp +1661 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngblas.hpp +1232 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_defines.hpp +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_stdcpp_include.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_utils.hpp +121 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsobject.hpp +1019 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsstream.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngstd.hpp +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe.hpp +96 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe_impl.hpp +141 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfe.hpp +223 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfespace.hpp +98 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetsurfacefespace.hpp +84 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/order.hpp +251 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallel_matrices.hpp +222 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/paralleldofs.hpp +340 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelngs.hpp +23 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelvector.hpp +269 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pardisoinverse.hpp +200 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/periodic.hpp +129 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/plateaufespace.hpp +25 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pml.hpp +275 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pmltrafo.hpp +631 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/postproc.hpp +142 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/potentialtools.hpp +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/precomp.hpp +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/preconditioner.hpp +602 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/prolongation.hpp +380 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_comp.hpp +107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_fem.hpp +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_linalg.hpp +58 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_ngstd.hpp +386 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol.hpp +4896 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_tet.hpp +395 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_trig.hpp +492 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/reorderedfespace.hpp +81 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sample_sort.hpp +105 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/scalarfe.hpp +335 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/shapefunction_utils.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/simd_complex.hpp +329 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/smoother.hpp +253 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/solve.hpp +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsecholesky.hpp +317 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsefactorization_interface.hpp +159 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix.hpp +1052 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_dyn.hpp +90 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_impl.hpp +1055 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/special_matrix.hpp +463 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/specialelement.hpp +125 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/statushandler.hpp +33 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/stringops.hpp +12 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/superluinverse.hpp +136 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symbolicintegrator.hpp +850 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symmetricmatrix.hpp +144 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfe.hpp +224 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfespace.hpp +91 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensor.hpp +522 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorcoefficient.hpp +446 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorproductintegrator.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe.hpp +128 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe_impl.hpp +380 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe.hpp +80 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe_impl.hpp +492 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpdiffop.hpp +461 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpfes.hpp +133 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpintrule.hpp +224 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/triangular.hpp +465 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe.hpp +245 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe_impl.hpp +1029 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/umfpackinverse.hpp +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/unifiedvector.hpp +103 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vector.hpp +1452 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/voxelcoefficientfunction.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vtkoutput.hpp +198 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vvector.hpp +208 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/webgui.hpp +92 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/NGSolveConfig.cmake +102 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets-release.cmake +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets.cmake +180 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngbla.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngcomp.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngfem.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngla.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsbem.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngscudalib.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsolve.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngstd.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/TensorProductTools.py +210 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__console.py +94 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__expr.py +181 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__init__.py +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/_scikit_build_core_dependencies.py +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/bvp.py +78 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__init__.py +1 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__main__.py +4 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/config.py +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hhj.py +44 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hybrid_dg.py +53 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/mixed.py +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/nonlin.py +29 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pickling.py +26 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pml.py +31 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/taskmanager.py +20 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/tdnns.py +47 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG-skeleton.py +45 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG.py +38 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGlap.py +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGwave.py +61 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/adaptive.py +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/cmagnet.py +59 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/elasticity.py +76 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/navierstokes.py +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.ipynb +170 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.py +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_poisson.py +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_timeDG.py +82 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/directsolvers.py +14 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/eigenvalues.py +364 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/internal.py +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/krylovspace.py +1182 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/meshes.py +748 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngs2petsc.py +310 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscuda.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscxx.py +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngslib.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/nonlinearsolvers.py +203 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/preconditioners.py +11 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solve_implementation.py +168 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/__init__.py +7 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/cudss.py +112 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timestepping.py +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timing.py +108 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/utils.py +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/webgui.py +671 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.geo +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.vol +240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.in2d +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.vol +614 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.geo +12 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.vol +2560 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.geo +24 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.vol +3179 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.geo +19 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.vol +1832 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d10_DGdoubleglazing.pde +50 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d11_chip_nitsche.pde +40 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d1_square.pde +43 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d2_chip.pde +35 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d3_helmholtz.pde +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d4_cube.pde +46 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d5_beam.pde +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d6_shaft.pde +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d7_coil.pde +50 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d8_coilshield.pde +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d9_hybridDG.pde +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.in2d +27 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.vol +737 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.geo +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.vol +4291 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.in2d +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.vol +149 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/METADATA +14 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/RECORD +306 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/WHEEL +5 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/licenses/LICENSE +504 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2241 @@
|
|
|
1
|
+
#ifndef FILE_HCURLCURLFE
|
|
2
|
+
#define FILE_HCURLCURLFE
|
|
3
|
+
|
|
4
|
+
/*********************************************************************/
|
|
5
|
+
/* File: hcurlcurlfe.hpp */
|
|
6
|
+
/* Author: Michael Neunteufel */
|
|
7
|
+
/* Date: June 2018 */
|
|
8
|
+
/*********************************************************************/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
#include "finiteelement.hpp"
|
|
12
|
+
#include "fe_interfaces.hpp"
|
|
13
|
+
#include "hcurlfe.hpp"
|
|
14
|
+
#include "hcurlfe_utils.hpp"
|
|
15
|
+
#include "recursive_pol.hpp"
|
|
16
|
+
#include "recursive_pol_trig.hpp"
|
|
17
|
+
#include "recursive_pol_tet.hpp"
|
|
18
|
+
|
|
19
|
+
namespace ngfem
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
template <typename T>
|
|
23
|
+
Mat<3,3,T> TensorCrossProduct(Mat<3,3,T> A, Mat<3,3,T> B)
|
|
24
|
+
{
|
|
25
|
+
// return 0.5 * ( Cof(A+B) - Cof(A-B) ); // more cancelation
|
|
26
|
+
|
|
27
|
+
Mat<3,3,T> prod;
|
|
28
|
+
prod.Col(0) = Cross(A.Col(1), B.Col(2)) - Cross(A.Col(2), B.Col(1));
|
|
29
|
+
prod.Col(1) = Cross(A.Col(2), B.Col(0)) - Cross(A.Col(0), B.Col(2));
|
|
30
|
+
prod.Col(2) = Cross(A.Col(0), B.Col(1)) - Cross(A.Col(1), B.Col(0));
|
|
31
|
+
return prod;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
template <typename T>
|
|
35
|
+
Mat<3,3,T> TensorCrossProduct(Vec<3,T> v, Mat<3,3,T> A)
|
|
36
|
+
{
|
|
37
|
+
Mat<3,3,T> result;
|
|
38
|
+
for (int j = 0; j < 3; j++)
|
|
39
|
+
result.Col(j) = Cross(v, A.Col(j));
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
template <typename T>
|
|
44
|
+
Mat<3,3,T> TensorCrossProduct(Mat<3,3,T> A, Vec<3,T> v)
|
|
45
|
+
{
|
|
46
|
+
Mat<3,3,T> result;
|
|
47
|
+
for (int j = 0; j < 3; j++)
|
|
48
|
+
result.Row(j) = Cross(A.Row(j), v);
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
template <int DIM>
|
|
55
|
+
class HCurlCurlFiniteElement : public FiniteElement
|
|
56
|
+
{
|
|
57
|
+
public:
|
|
58
|
+
using FiniteElement::FiniteElement;
|
|
59
|
+
using FiniteElement::ndof;
|
|
60
|
+
using FiniteElement::order;
|
|
61
|
+
|
|
62
|
+
virtual void CalcMappedShape (const BaseMappedIntegrationPoint & bmip,
|
|
63
|
+
BareSliceMatrix<double> shape) const = 0;
|
|
64
|
+
|
|
65
|
+
virtual void EvaluateMappedShape (const BaseMappedIntegrationPoint & bmip,
|
|
66
|
+
BareSliceVector<double> coefs,
|
|
67
|
+
BareSliceMatrix<double> shape) const = 0;
|
|
68
|
+
|
|
69
|
+
virtual void CalcMappedCurlShape (const BaseMappedIntegrationPoint & bmip,
|
|
70
|
+
BareSliceMatrix<double> shape) const = 0;
|
|
71
|
+
|
|
72
|
+
virtual void CalcMappedIncShape (const BaseMappedIntegrationPoint & bmip,
|
|
73
|
+
BareSliceMatrix<double> shape) const = 0;
|
|
74
|
+
|
|
75
|
+
virtual void EvaluateMappedIncShape (const BaseMappedIntegrationPoint & bmip,
|
|
76
|
+
BareSliceVector<double> coefs,
|
|
77
|
+
BareSliceVector<double> inc) const = 0;
|
|
78
|
+
|
|
79
|
+
virtual void CalcMappedIncShape (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
80
|
+
BareSliceMatrix<SIMD<double>> shape) const = 0;
|
|
81
|
+
|
|
82
|
+
virtual void EvaluateIncShape (const SIMD_BaseMappedIntegrationRule & ir,
|
|
83
|
+
BareSliceVector<> coefs,
|
|
84
|
+
BareSliceMatrix<SIMD<double>> values) const = 0;
|
|
85
|
+
|
|
86
|
+
virtual void AddTransIncShape (const SIMD_BaseMappedIntegrationRule & ir,
|
|
87
|
+
BareSliceMatrix<SIMD<double>> values,
|
|
88
|
+
BareSliceVector<> coefs) const = 0;
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
virtual void CalcMappedShape (const SIMD<BaseMappedIntegrationPoint> & bmip,
|
|
92
|
+
BareSliceMatrix<SIMD<double>> shapes) const = 0;
|
|
93
|
+
|
|
94
|
+
virtual void CalcMappedShape (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
95
|
+
BareSliceMatrix<SIMD<double>> shapes) const = 0;
|
|
96
|
+
|
|
97
|
+
virtual void Evaluate (const SIMD_BaseMappedIntegrationRule & ir,
|
|
98
|
+
BareSliceVector<> coefs,
|
|
99
|
+
BareSliceMatrix<SIMD<double>> values) const = 0;
|
|
100
|
+
|
|
101
|
+
virtual void AddTrans (const SIMD_BaseMappedIntegrationRule & ir,
|
|
102
|
+
BareSliceMatrix<SIMD<double>> values,
|
|
103
|
+
BareSliceVector<> coefs) const = 0;
|
|
104
|
+
|
|
105
|
+
virtual void CalcDualShape (const BaseMappedIntegrationPoint & bmip, BareSliceMatrix<> shape) const = 0;
|
|
106
|
+
virtual void CalcDualShape (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceMatrix<SIMD<double>> shape) const = 0;
|
|
107
|
+
virtual void EvaluateDual (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceVector<> coefs, BareSliceMatrix<SIMD<double>> values) const = 0;
|
|
108
|
+
virtual void AddDualTrans (const SIMD_BaseMappedIntegrationRule& bmir, BareSliceMatrix<SIMD<double>> values, BareSliceVector<double> coefs) const = 0;
|
|
109
|
+
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
template <int D,typename VEC,typename MAT>
|
|
113
|
+
void VecToSymMat(const VEC & vec, MAT & mat)
|
|
114
|
+
{
|
|
115
|
+
switch(D)
|
|
116
|
+
{
|
|
117
|
+
case 1:
|
|
118
|
+
mat(0) = vec(0);
|
|
119
|
+
break;
|
|
120
|
+
case 2:
|
|
121
|
+
mat(0) = vec(0);
|
|
122
|
+
mat(3) = vec(1);
|
|
123
|
+
mat(1) = mat(2) = vec(2);
|
|
124
|
+
break;
|
|
125
|
+
case 3:
|
|
126
|
+
mat(0) = vec(0);
|
|
127
|
+
mat(4) = vec(1);
|
|
128
|
+
mat(8) = vec(2);
|
|
129
|
+
mat(1) = mat(3) = vec(5);
|
|
130
|
+
mat(2) = mat(6) = vec(4);
|
|
131
|
+
mat(5) = mat(7) = vec(3);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
template <int H, int W, typename T>
|
|
137
|
+
Mat<H,W,T> DyadProd(Vec<H,T> a, Vec<W,T> b)
|
|
138
|
+
{
|
|
139
|
+
Mat<H,W,T> m;
|
|
140
|
+
for (int i = 0; i < H; i++)
|
|
141
|
+
for (int j = 0; j < W; j++)
|
|
142
|
+
m(i,j) = a(i)*b(j);
|
|
143
|
+
return m;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
template <int S, typename T>
|
|
147
|
+
Mat<S,S,T> SymDyadProd(Vec<S,T> a, Vec<S,T> b)
|
|
148
|
+
{
|
|
149
|
+
Mat<S,S,T> m;
|
|
150
|
+
for (int i = 0; i < S; i++)
|
|
151
|
+
for (int j = 0; j < S; j++)
|
|
152
|
+
m(i,j) = a(i)*b(j)+a(j)*b(i);
|
|
153
|
+
return m;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
template <typename T>
|
|
158
|
+
Vec<6, AutoDiff<3,T>> SymDyadProd(AutoDiff<3,T> a, AutoDiff<3,T> b)
|
|
159
|
+
{
|
|
160
|
+
return Vec<6, AutoDiff<3,T>>(2*a.DValue(0)*b.DValue(0),2*a.DValue(1)*b.DValue(1),2*a.DValue(2)*b.DValue(2), a.DValue(1)*b.DValue(2)+a.DValue(2)*b.DValue(1), a.DValue(0)*b.DValue(2)+a.DValue(2)*b.DValue(0),a.DValue(1)*b.DValue(0)+a.DValue(0)*b.DValue(1));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
template <typename T>
|
|
164
|
+
Vec<6, AutoDiff<3,T>> SymDyadProdAD(Vec<3,T> a, Vec<3,T> b)
|
|
165
|
+
{
|
|
166
|
+
return Vec<6, AutoDiff<3,T>>(2*a(0)*b(0),2*a(1)*b(1),2*a(2)*b(2), a(1)*b(2)+a(2)*b(1), a(0)*b(2)+a(2)*b(0),a(1)*b(0)+a(0)*b(1));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
template <typename T>
|
|
170
|
+
Vec<3,AutoDiff<2,T>> SymDyadProd(AutoDiff<2,T> a, AutoDiff<2,T> b)
|
|
171
|
+
{
|
|
172
|
+
return Vec<3,AutoDiff<2,T>>(2*a.DValue(0)*b.DValue(0),2*a.DValue(1)*b.DValue(1),a.DValue(1)*b.DValue(0)+a.DValue(0)*b.DValue(1));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
template <typename T>
|
|
176
|
+
Vec<3,AutoDiff<2,T>> SymDyadProdAD(Vec<2,T> a, Vec<2,T> b)
|
|
177
|
+
{
|
|
178
|
+
return Vec<3,AutoDiff<2,T>>(2*a(0)*b(0),2*a(1)*b(1),a(1)*b(0)+a(0)*b(1));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
template <typename T>
|
|
182
|
+
AutoDiff<1,T> SymDyadProd(AutoDiff<1,T> a, AutoDiff<1,T> b)
|
|
183
|
+
{
|
|
184
|
+
return a.DValue(0)*b.DValue(0);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
//------------------REGGE_SHAPE---------------------
|
|
189
|
+
template <int D, typename T> class T_REGGE_Shape;
|
|
190
|
+
template <typename T> class T_REGGE_Shape<1,T>
|
|
191
|
+
{
|
|
192
|
+
AutoDiff<1,T> u;
|
|
193
|
+
public:
|
|
194
|
+
T_REGGE_Shape (AutoDiff<1,T> au) : u(au) { ; }
|
|
195
|
+
Vec<1,T> Shape() { return u.Value(); }
|
|
196
|
+
/*0 2
|
|
197
|
+
2 1*/
|
|
198
|
+
Vec<1,T> CurlShape() { return 0.0; }
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
template <typename T> class T_REGGE_Shape<2,T>
|
|
202
|
+
{
|
|
203
|
+
Vec<3,AutoDiff<2,T>> u;
|
|
204
|
+
public:
|
|
205
|
+
T_REGGE_Shape (Vec<3,AutoDiff<2,T>> au) : u(au) { ; }
|
|
206
|
+
Vec<3,T> Shape() { return Vec<3,T> (u(0).Value(), u(1).Value(), u(2).Value()); }
|
|
207
|
+
/*0 2
|
|
208
|
+
2 1*/
|
|
209
|
+
Vec<2,T> CurlShape() { return Vec<2,T> (u(2).DValue(0)-u(0).DValue(1), u(1).DValue(0)-u(2).DValue(1)); }
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
template <typename T> class T_REGGE_Shape<3,T>
|
|
213
|
+
{
|
|
214
|
+
Vec<6,AutoDiff<3,T>> u;
|
|
215
|
+
public:
|
|
216
|
+
T_REGGE_Shape (Vec<6,AutoDiff<3,T>> au) : u(au) { ; }
|
|
217
|
+
Vec<6,T> Shape() { return Vec<6,T> (u(0).Value(), u(1).Value(), u(2).Value(), u(3).Value(), u(4).Value(), u(5).Value()); }
|
|
218
|
+
/*0 5 4
|
|
219
|
+
5 1 3
|
|
220
|
+
4 3 2*/
|
|
221
|
+
Vec<9,T> CurlShape() { return Vec<9,T> (u(4).DValue(1)-u(5).DValue(2), -u(4).DValue(0)+u(0).DValue(2), u(5).DValue(0)-u(0).DValue(1),
|
|
222
|
+
u(3).DValue(1)-u(1).DValue(2), -u(3).DValue(0)+u(5).DValue(2), u(1).DValue(0)-u(5).DValue(1),
|
|
223
|
+
u(2).DValue(1)-u(3).DValue(2), -u(2).DValue(0)+u(4).DValue(2), u(3).DValue(0)-u(4).DValue(1)); }
|
|
224
|
+
};
|
|
225
|
+
//---------------------------------------------------
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
// ***************** EpsGrad ****************************** */
|
|
229
|
+
// eps (nabla u)
|
|
230
|
+
|
|
231
|
+
template <int D, typename T> class T_EpsGrad;
|
|
232
|
+
template <typename T> class T_EpsGrad<2,T>
|
|
233
|
+
{
|
|
234
|
+
AutoDiffDiff<2,T> u;
|
|
235
|
+
public:
|
|
236
|
+
T_EpsGrad (AutoDiffDiff<2,T> au) : u(au) { ; }
|
|
237
|
+
Vec<3,T> Shape()
|
|
238
|
+
{
|
|
239
|
+
return Vec<3,T> (u.DDValue(0,0), u.DDValue(1,1), u.DDValue(0,1));
|
|
240
|
+
}
|
|
241
|
+
Vec<2,T> CurlShape() { return Vec<2,T> (0.0, 0.0); }
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
template <int D, typename T>
|
|
245
|
+
auto EpsGrad (AutoDiffDiff<D,T> au) { return T_EpsGrad<D,T>(au); }
|
|
246
|
+
|
|
247
|
+
// ***************** wEpsGrad ****************************** */
|
|
248
|
+
// w*eps (nabla u)
|
|
249
|
+
|
|
250
|
+
template <int D, typename T> class T_wEpsGrad;
|
|
251
|
+
template <typename T> class T_wEpsGrad<2,T>
|
|
252
|
+
{
|
|
253
|
+
AutoDiffDiff<2,T> u;
|
|
254
|
+
AutoDiff<1,T> w;
|
|
255
|
+
public:
|
|
256
|
+
T_wEpsGrad (AutoDiffDiff<2,T> au, AutoDiff<1,T> aw) : u(au), w(aw) { ; }
|
|
257
|
+
Vec<6,T> Shape()
|
|
258
|
+
{
|
|
259
|
+
return w.Value()*Vec<6,T> (u.DDValue(0,0), u.DDValue(1,1), u.DDValue(2,2), u.DDValue(1,2), u.DDValue(0,2), u.DDValue(0,1));
|
|
260
|
+
}
|
|
261
|
+
Vec<9,T> CurlShape() { return Vec<9,T> (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); }
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
template <int D, typename T>
|
|
265
|
+
auto wEpsGrad (AutoDiffDiff<D,T> au, AutoDiff<1,T> aw) { return T_wEpsGrad<D,T>(au, aw); }
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
// ***************** Eps_u_Gradv ****************************** */
|
|
269
|
+
// eps (u nabla v)
|
|
270
|
+
|
|
271
|
+
template <int D, typename T> class T_Eps_u_Gradv;
|
|
272
|
+
template <typename T> class T_Eps_u_Gradv<2,T>
|
|
273
|
+
{
|
|
274
|
+
AutoDiffDiff<2,T> u, v;
|
|
275
|
+
public:
|
|
276
|
+
T_Eps_u_Gradv (AutoDiffDiff<2,T> au, AutoDiffDiff<2,T> av) : u(au), v(av) { ; }
|
|
277
|
+
Vec<3,T> Shape() { return Vec<3,T> ((u.Value()*v.DDValue(0,0) + u.DValue(0)*v.DValue(0)),
|
|
278
|
+
(u.Value()*v.DDValue(1,1) + u.DValue(1)*v.DValue(1)),
|
|
279
|
+
u.Value()*v.DDValue(0,1) + 0.5 * (u.DValue(0)*v.DValue(1)+u.DValue(1)*v.DValue(0))); }
|
|
280
|
+
Vec<2,T> CurlShape()
|
|
281
|
+
{
|
|
282
|
+
T uxx = u.DDValue(0,0), uyy = u.DDValue(1,1), uxy = u.DDValue(0,1);
|
|
283
|
+
T ux = u.DValue(0), uy = u.DValue(1);
|
|
284
|
+
T vxx = v.DDValue(0,0), vyy = v.DDValue(1,1), vxy = v.DDValue(0,1);
|
|
285
|
+
T vx = v.DValue(0), vy = v.DValue(1);
|
|
286
|
+
|
|
287
|
+
/*return -0.5 * Vec<2,T> (uyy*vx - uxy*vy + uy*vxy - ux*vyy,
|
|
288
|
+
-uxy*vx + uxx*vy - uy*vxx + ux*vxy);*/
|
|
289
|
+
return 0.5 * Vec<2,T>(ux*vxy - uy*vxx - uxy*vx + uxx*vy,
|
|
290
|
+
ux*vyy + uxy*vy - uyy*vx - uy*vxy);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
template <int D, typename T>
|
|
295
|
+
auto Eps_u_Gradv (AutoDiffDiff<D,T> au, AutoDiffDiff<D,T> av) { return T_Eps_u_Gradv<D,T>(au, av); }
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
template <int D, typename T> class T_vEpsGradu;
|
|
299
|
+
template <typename T> class T_vEpsGradu<2,T>
|
|
300
|
+
{
|
|
301
|
+
AutoDiffDiff<2,T> u,v;
|
|
302
|
+
public:
|
|
303
|
+
T_vEpsGradu (AutoDiffDiff<2,T> au, AutoDiffDiff<2,T> av) : u(au), v(av) { ; }
|
|
304
|
+
Vec<3,T> Shape() { return Vec<3,T> (u.DDValue(0,0)*v.Value(),
|
|
305
|
+
u.DDValue(1,1)*v.Value(), (u.DDValue(1,0)*v.Value()));}
|
|
306
|
+
Vec<2,T> CurlShape()
|
|
307
|
+
{
|
|
308
|
+
T uxx = u.DDValue(0,0), uyy = u.DDValue(1,1), uxy = u.DDValue(0,1);
|
|
309
|
+
T vx = v.DValue(0), vy = v.DValue(1);
|
|
310
|
+
|
|
311
|
+
//return Vec<2,T> (uyy*vx- uxy*vy, uxx*vy- uxy*vx);
|
|
312
|
+
return Vec<2,T> (uxy*vx - vy*uxx, uyy*vx - uxy*vy);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
template <int D, typename T>
|
|
317
|
+
auto vEpsGradu (AutoDiffDiff<D,T> au, AutoDiffDiff<D,T> av) { return T_vEpsGradu<D,T>(au, av); }
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
template <int D, typename T>
|
|
321
|
+
class ReggeAD
|
|
322
|
+
{
|
|
323
|
+
Mat<D,D,T> value;
|
|
324
|
+
|
|
325
|
+
public:
|
|
326
|
+
ReggeAD ()
|
|
327
|
+
{
|
|
328
|
+
value = T(0);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
ReggeAD (AutoDiff<D,T> a, AutoDiff<D,T> b)
|
|
332
|
+
{
|
|
333
|
+
Vec<D,T> Da, Db;
|
|
334
|
+
for(int i=0; i<D; i++)
|
|
335
|
+
{
|
|
336
|
+
Da(i) = a.DValue(i);
|
|
337
|
+
Db(i) = b.DValue(i);
|
|
338
|
+
}
|
|
339
|
+
value = SymDyadProd(Da,Db);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
auto Value() const { return value; }
|
|
343
|
+
|
|
344
|
+
Mat<D,D,T> & Value() { return value; }
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
template <int D, typename T>
|
|
348
|
+
auto MakeReggeAD(AutoDiff<D,T> a, AutoDiff<D,T> b)
|
|
349
|
+
{
|
|
350
|
+
return ReggeAD<D,T>(a, b);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
template <int D, typename T>
|
|
356
|
+
ReggeAD<D,T> operator* (AutoDiff<D,T> s, ReggeAD<D,T> A)
|
|
357
|
+
{
|
|
358
|
+
ReggeAD<D,T> result;
|
|
359
|
+
result.Value() = s.Value()*A.Value();
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
template <int D, typename T>
|
|
365
|
+
ReggeAD<D,T> operator* (T s, ReggeAD<D,T> A)
|
|
366
|
+
{
|
|
367
|
+
ReggeAD<D,T> result = A;
|
|
368
|
+
result.Value() *= s;
|
|
369
|
+
return result;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
template <int D, typename T>
|
|
373
|
+
ReggeAD<D,T> operator+ (ReggeAD<D,T> A, ReggeAD<D,T> B)
|
|
374
|
+
{
|
|
375
|
+
ReggeAD<D,T> result = A;
|
|
376
|
+
result.Value() += B.Value();
|
|
377
|
+
return result;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
template <int D, typename T>
|
|
381
|
+
ReggeAD<D,T> operator- (ReggeAD<D,T> A, ReggeAD<D,T> B)
|
|
382
|
+
{
|
|
383
|
+
ReggeAD<D,T> result = A;
|
|
384
|
+
result.Value() -= B.Value();
|
|
385
|
+
return result;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
template <int D, typename T> class ReggeADD;
|
|
389
|
+
|
|
390
|
+
template <typename T>
|
|
391
|
+
class ReggeADD<3,T>
|
|
392
|
+
{
|
|
393
|
+
Mat<3,3,T> value;
|
|
394
|
+
Mat<3,3,T> curl;
|
|
395
|
+
Mat<3,3,T> inc;
|
|
396
|
+
|
|
397
|
+
public:
|
|
398
|
+
ReggeADD ()
|
|
399
|
+
{
|
|
400
|
+
value = T(0);
|
|
401
|
+
curl = T(0);
|
|
402
|
+
inc = T(0);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
ReggeADD (AutoDiffDiff<3,T> a, AutoDiffDiff<3,T> b)
|
|
406
|
+
{
|
|
407
|
+
auto Da = Vec<3,T>(a.DValue(0),a.DValue(1),a.DValue(2));
|
|
408
|
+
auto Db = Vec<3,T>(b.DValue(0),b.DValue(1),b.DValue(2));
|
|
409
|
+
value = SymDyadProd(Da,Db);
|
|
410
|
+
// curl(s*v) = nabla s x v + s curl(v) in 3D
|
|
411
|
+
// | nabla a_1 x b + a_1 curl(b) |
|
|
412
|
+
// curl(a \otimes b) = | nabla a_2 x b + a_2 curl(b) |
|
|
413
|
+
// | nabla a_3 x b + a_3 curl(b) |
|
|
414
|
+
|
|
415
|
+
// curl( nabla s ) = 0
|
|
416
|
+
// | nabla d_x a x nabla b |
|
|
417
|
+
// -> curl( nabla a \otimes nabla b) = | nabla d_y a x nabla b |
|
|
418
|
+
// | nabla d_z a x nabla b |
|
|
419
|
+
|
|
420
|
+
Vec<3,T> Ddai [3] = { Vec<3,T>(a.DDValue(0,0), a.DDValue(0,1), a.DDValue(0,2)), Vec<3,T>(a.DDValue(1,0), a.DDValue(1,1), a.DDValue(1,2)), Vec<3,T>(a.DDValue(2,0), a.DDValue(2,1), a.DDValue(2,2)) };
|
|
421
|
+
Vec<3,T> Ddbi [3] = { Vec<3,T>(b.DDValue(0,0), b.DDValue(0,1), b.DDValue(0,2)), Vec<3,T>(b.DDValue(1,0), b.DDValue(1,1), b.DDValue(1,2)), Vec<3,T>(b.DDValue(2,0), b.DDValue(2,1), b.DDValue(2,2)) };
|
|
422
|
+
|
|
423
|
+
for (int i = 0; i < 3; i++)
|
|
424
|
+
curl.Row(i) = Cross(Ddai[i], Db) + Cross(Ddbi[i], Da);
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
// | nabla d_x a x nabla b |
|
|
428
|
+
// curl( nabla a \otimes nabla b) = | nabla d_y a x nabla b |
|
|
429
|
+
// | nabla d_z a x nabla b |
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
// curl T curl ( nabla a \otimes nabla b):
|
|
433
|
+
//11: d_yd_z(a) d_yd_z(b) - d^2_z(a) d^2_y(b) - d_y^2(a) d^2_z(b) + d_yd_z(a)d_yd_z(b)
|
|
434
|
+
//12: d_xd_y(a) d_z^2(b) - d_xd_z(a) d_yd_z(b) - d_yd_z(a) d_xd_z(b) + d_z^2(a)d_xd_y(b)
|
|
435
|
+
//13: d^2_y(a) d_xd_z(b) - d_yd_z(a) d_xd_y(b) - d_xd_y(a) d_yd_z(b) + d_xd_z(a)d^2_y(b)
|
|
436
|
+
//22: d_xd_z(a) d_xd_z(b) - d^2_x(a) d^2_z(b) - d^2_z(a) d^2_x(b) + d_xd_z(a)d_xd_z(b)
|
|
437
|
+
//23: d_yd_z(a) d^2_x(b) - d_xd_y(a) d_xd_z(b) - d_xd_z(a) d_xd_y(b) + d^2_x(a)d_yd_z(b)
|
|
438
|
+
//33: d^2_x(a) d^2_y(b) - d_xd_y(a) d_xd_y(b) - d_xd_y(a) d_xd_y(b) + d^2_y(a)d^2_x(b)
|
|
439
|
+
|
|
440
|
+
// = - hesse(a) x hesse(b) = -eps_imn eps_jlk d_md_l(a) d_nd_k b ??
|
|
441
|
+
|
|
442
|
+
/*inc(0,0) = a.DDValue(1,2)*b.DDValue(1,2) - a.DDValue(2,2)*b.DDValue(1,1) - a.DDValue(1,1)*b.DDValue(2,2) + a.DDValue(1,2)*b.DDValue(1,2);
|
|
443
|
+
inc(0,1) = a.DDValue(0,1)*b.DDValue(2,2) - a.DDValue(0,2)*b.DDValue(1,2) - a.DDValue(1,2)*b.DDValue(0,2) + a.DDValue(2,2)*b.DDValue(0,1);
|
|
444
|
+
inc(0,2) = a.DDValue(1,1)*b.DDValue(0,2) - a.DDValue(1,2)*b.DDValue(0,1) - a.DDValue(0,1)*b.DDValue(1,2) + a.DDValue(0,2)*b.DDValue(1,1);
|
|
445
|
+
inc(1,1) = a.DDValue(0,2)*b.DDValue(0,2) - a.DDValue(0,0)*b.DDValue(2,2) - a.DDValue(2,2)*b.DDValue(0,0) + a.DDValue(0,2)*b.DDValue(0,2);
|
|
446
|
+
inc(1,2) = a.DDValue(1,2)*b.DDValue(0,0) - a.DDValue(0,1)*b.DDValue(0,2) - a.DDValue(0,2)*b.DDValue(0,1) + a.DDValue(0,0)*b.DDValue(1,2);
|
|
447
|
+
inc(2,2) = a.DDValue(0,0)*b.DDValue(1,1) - a.DDValue(0,1)*b.DDValue(0,1) - a.DDValue(0,1)*b.DDValue(0,1) + a.DDValue(1,1)*b.DDValue(0,0);
|
|
448
|
+
// curl T curl ( nabla b \otimes nabla a):
|
|
449
|
+
inc(0,0) += b.DDValue(1,2)*a.DDValue(1,2) - b.DDValue(2,2)*a.DDValue(1,1) - b.DDValue(1,1)*a.DDValue(2,2) + b.DDValue(1,2)*a.DDValue(1,2);
|
|
450
|
+
inc(0,1) += b.DDValue(0,1)*a.DDValue(2,2) - b.DDValue(0,2)*a.DDValue(1,2) - b.DDValue(1,2)*a.DDValue(0,2) + b.DDValue(2,2)*a.DDValue(0,1);
|
|
451
|
+
inc(0,2) += b.DDValue(1,1)*a.DDValue(0,2) - b.DDValue(1,2)*a.DDValue(0,1) - b.DDValue(0,1)*a.DDValue(1,2) + b.DDValue(0,2)*a.DDValue(1,1);
|
|
452
|
+
inc(1,1) += b.DDValue(0,2)*a.DDValue(0,2) - b.DDValue(0,0)*a.DDValue(2,2) - b.DDValue(2,2)*a.DDValue(0,0) + b.DDValue(0,2)*a.DDValue(0,2);
|
|
453
|
+
inc(1,2) += b.DDValue(1,2)*a.DDValue(0,0) - b.DDValue(0,1)*a.DDValue(0,2) - b.DDValue(0,2)*a.DDValue(0,1) + b.DDValue(0,0)*a.DDValue(1,2);
|
|
454
|
+
inc(2,2) += b.DDValue(0,0)*a.DDValue(1,1) - b.DDValue(0,1)*a.DDValue(0,1) - b.DDValue(0,1)*a.DDValue(0,1) + b.DDValue(1,1)*a.DDValue(0,0);
|
|
455
|
+
// symmetry
|
|
456
|
+
inc(1,0) = inc(0,1);
|
|
457
|
+
inc(2,0) = inc(0,2);
|
|
458
|
+
inc(2,1) = inc(1,2);*/
|
|
459
|
+
|
|
460
|
+
Mat<3,3,T> hesse1, hesse2;
|
|
461
|
+
a.StoreHessian(hesse1.Data());
|
|
462
|
+
b.StoreHessian(hesse2.Data());
|
|
463
|
+
inc = -2*TensorCrossProduct(hesse1,hesse2);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
auto Value() const { return value; }
|
|
467
|
+
auto Curl() const { return curl; }
|
|
468
|
+
auto Inc() const { return inc; }
|
|
469
|
+
|
|
470
|
+
Mat<3,3,T> & Value() { return value; }
|
|
471
|
+
Mat<3,3,T> & Curl() { return curl; }
|
|
472
|
+
Mat<3,3,T> & Inc() { return inc; }
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
template <typename T>
|
|
477
|
+
class ReggeADD<2,T>
|
|
478
|
+
{
|
|
479
|
+
Mat<2,2,T> value;
|
|
480
|
+
Vec<2,T> curl;
|
|
481
|
+
T inc;
|
|
482
|
+
|
|
483
|
+
public:
|
|
484
|
+
ReggeADD ()
|
|
485
|
+
{
|
|
486
|
+
value = T(0);
|
|
487
|
+
curl = T(0);
|
|
488
|
+
inc = T(0);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
ReggeADD (AutoDiffDiff<2,T> a, AutoDiffDiff<2,T> b)
|
|
492
|
+
{
|
|
493
|
+
auto Da = Vec<2,T>(a.DValue(0),a.DValue(1));
|
|
494
|
+
auto Db = Vec<2,T>(b.DValue(0),b.DValue(1));
|
|
495
|
+
value = SymDyadProd(Da,Db);
|
|
496
|
+
// curl(s*v) = v* nabla s^perp + s curl(v) in 2D
|
|
497
|
+
// | b * nabla a_1^perp + a_1 curl(b) |
|
|
498
|
+
// curl(a \otimes b) = | b * nabla a_2^perp + a_2 curl(b) |
|
|
499
|
+
|
|
500
|
+
// curl( nabla s ) = 0
|
|
501
|
+
// | Db * nabla d_x a^perp |
|
|
502
|
+
// -> curl( nabla a \otimes nabla b) = | Db * nabla d_y a^perp |
|
|
503
|
+
|
|
504
|
+
Vec<2,T> Ddai_p [2] = { Vec<2,T>(-a.DDValue(0,1), a.DDValue(0,0)), Vec<2,T>(-a.DDValue(1,1), a.DDValue(1,0)) };
|
|
505
|
+
Vec<2,T> Ddbi_p [2] = { Vec<2,T>(-b.DDValue(0,1), b.DDValue(0,0)), Vec<2,T>(-b.DDValue(1,1), b.DDValue(1,0)) };
|
|
506
|
+
|
|
507
|
+
for (int i=0; i<2; i++)
|
|
508
|
+
curl(i) = InnerProduct(Db,Ddai_p[i]) + InnerProduct(Da,Ddbi_p[i]);
|
|
509
|
+
|
|
510
|
+
// | Db * nabla d_x a^perp |
|
|
511
|
+
// curl( nabla a \otimes nabla b) = | Db * nabla d_y a^perp |
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
// curl T curl ( nabla a \otimes nabla b) = d_x(Db * nabla d_y a^perp) - d_y(Db * nabla d_x a^perp)
|
|
515
|
+
// = (d_x Db) * nabla(d_y a)^perp - (d_y Db) * nabla(d_x a)^perp
|
|
516
|
+
|
|
517
|
+
inc = InnerProduct(Vec<2,T>(b.DDValue(0,0), b.DDValue(0,1)),Ddai_p[1]) - InnerProduct(Vec<2,T>(b.DDValue(1,0), b.DDValue(1,1)),Ddai_p[0]) + InnerProduct(Vec<2,T>(a.DDValue(0,0), a.DDValue(0,1)),Ddbi_p[1]) - InnerProduct(Vec<2,T>(a.DDValue(1,0), a.DDValue(1,1)),Ddbi_p[0]);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
auto Value() const { return value; }
|
|
521
|
+
auto Curl() const { return curl; }
|
|
522
|
+
auto Inc() const { return inc; }
|
|
523
|
+
|
|
524
|
+
Mat<2,2,T> & Value() { return value; }
|
|
525
|
+
Vec<2,T> & Curl() { return curl; }
|
|
526
|
+
T & Inc() { return inc; }
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
template <int D, typename T>
|
|
530
|
+
auto MakeReggeAD(AutoDiffDiff<D,T> a, AutoDiffDiff<D,T> b)
|
|
531
|
+
{
|
|
532
|
+
return ReggeADD<D,T>(a, b);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
template <typename T>
|
|
536
|
+
ReggeADD<3,T> operator* (AutoDiffDiff<3,T> s, ReggeADD<3,T> A)
|
|
537
|
+
{
|
|
538
|
+
ReggeADD<3,T> result;
|
|
539
|
+
result.Value() = s.Value()*A.Value();
|
|
540
|
+
|
|
541
|
+
// s scalar, v vector
|
|
542
|
+
// curl(s*v) = nabla s x v + s curl(v) in 3D
|
|
543
|
+
Vec<3,T> gradient;
|
|
544
|
+
s.StoreGradient(gradient.Data());
|
|
545
|
+
|
|
546
|
+
result.Curl() = s.Value()*A.Curl();
|
|
547
|
+
for (int i = 0; i < 3; i++)
|
|
548
|
+
result.Curl().Row(i) += Cross(gradient, Vec<3,T>(A.Value().Row(i)));
|
|
549
|
+
|
|
550
|
+
// inc(s A) = s inc(A) + 2sym(grad(s) x curl A) + hesse(s) x A, x...Tensor-Cross-Product
|
|
551
|
+
Mat<3,3,T> hesse;
|
|
552
|
+
s.StoreHessian(hesse.Data());
|
|
553
|
+
|
|
554
|
+
result.Inc() = s.Value()*A.Inc() + TensorCrossProduct(gradient,A.Curl()) + Trans(TensorCrossProduct(gradient,A.Curl())) + TensorCrossProduct(hesse,A.Value());
|
|
555
|
+
|
|
556
|
+
return result;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
template <int D, typename T>
|
|
561
|
+
ReggeADD<D,T> operator* (T s, ReggeADD<D,T> A)
|
|
562
|
+
{
|
|
563
|
+
ReggeADD<D,T> result = A;
|
|
564
|
+
result.Value() *= s;
|
|
565
|
+
result.Curl() *= s;
|
|
566
|
+
result.Inc() *= s;
|
|
567
|
+
return result;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
template <int D, typename T>
|
|
571
|
+
ReggeADD<D,T> operator+ (ReggeADD<D,T> A, ReggeADD<D,T> B)
|
|
572
|
+
{
|
|
573
|
+
ReggeADD<D,T> result = A;
|
|
574
|
+
result.Value() += B.Value();
|
|
575
|
+
result.Curl() += B.Curl();
|
|
576
|
+
result.Inc() += B.Inc();
|
|
577
|
+
return result;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
template <int D, typename T>
|
|
581
|
+
ReggeADD<D,T> operator- (ReggeADD<D,T> A, ReggeADD<D,T> B)
|
|
582
|
+
{
|
|
583
|
+
ReggeADD<D,T> result = A;
|
|
584
|
+
result.Value() -= B.Value();
|
|
585
|
+
result.Curl() -= B.Curl();
|
|
586
|
+
result.Inc() -= B.Inc();
|
|
587
|
+
return result;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
template <typename T>
|
|
592
|
+
ReggeADD<2,T> operator* (AutoDiffDiff<2,T> s, ReggeADD<2,T> A)
|
|
593
|
+
{
|
|
594
|
+
ReggeADD<2,T> result;
|
|
595
|
+
result.Value() = s.Value()*A.Value();
|
|
596
|
+
|
|
597
|
+
// s scalar, v vector
|
|
598
|
+
// curl(s*v) = v* nabla s^perp + s curl(v) in 2D
|
|
599
|
+
result.Curl() = A.Value()*Vec<2,T>(-s.DValue(1),s.DValue(0)) + s.Value()*A.Curl();
|
|
600
|
+
|
|
601
|
+
// inc(sA) = A:( dydy s & -dxdy s \\ -dxdy s & dxdx s) + 2*nabla s^\perp*curl(A) + s*inc(A)
|
|
602
|
+
Mat<2,2,T> hesse;
|
|
603
|
+
hesse(0,0) = s.DDValue(1,1);
|
|
604
|
+
hesse(1,0) = -s.DDValue(1,0);
|
|
605
|
+
hesse(0,1) = -s.DDValue(0,1);
|
|
606
|
+
hesse(1,1) = s.DDValue(0,0);
|
|
607
|
+
|
|
608
|
+
result.Inc() = s.Value()*A.Inc() + InnerProduct(hesse,A.Value()) + 2*InnerProduct(Vec<2,T>(-s.DValue(1),s.DValue(0)),A.Curl());
|
|
609
|
+
|
|
610
|
+
return result;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
template <ELEMENT_TYPE ET> class HCurlCurlFE;
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
template <ELEMENT_TYPE ET>
|
|
620
|
+
class T_HCurlCurlFE : public HCurlCurlFiniteElement<ET_trait<ET>::DIM>,
|
|
621
|
+
public VertexOrientedFE<ET>
|
|
622
|
+
{
|
|
623
|
+
protected:
|
|
624
|
+
static constexpr int DIM = ET_trait<ET>::DIM;
|
|
625
|
+
enum { DIM_STRESS = (DIM*(DIM+1))/2 };
|
|
626
|
+
// enum { DIM_DMAT = 7*DIM-12 };
|
|
627
|
+
// enum { DIM_DDMAT = 8*DIM-15 };
|
|
628
|
+
enum { DIM_DMAT = (5*DIM*DIM-11*DIM+6)/2 };
|
|
629
|
+
enum { DIM_DDMAT = (7*DIM*DIM-19*DIM+12)/2 };
|
|
630
|
+
|
|
631
|
+
using VertexOrientedFE<ET>::vnums;
|
|
632
|
+
using HCurlCurlFiniteElement<ET_trait<ET>::DIM>::ndof;
|
|
633
|
+
using HCurlCurlFiniteElement<ET_trait<ET>::DIM>::order;
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
int order_edge[ET_trait<ET>::N_EDGE];
|
|
637
|
+
IVec<DIM-1> order_facet[ET_trait<ET>::N_FACET];
|
|
638
|
+
IVec<DIM> order_inner;
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
public:
|
|
642
|
+
using VertexOrientedFE<ET>::SetVertexNumbers;
|
|
643
|
+
|
|
644
|
+
T_HCurlCurlFE (int aorder)
|
|
645
|
+
{
|
|
646
|
+
order = aorder;
|
|
647
|
+
for (auto & of : order_facet) of = aorder;
|
|
648
|
+
order_inner = aorder;
|
|
649
|
+
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
virtual ELEMENT_TYPE ElementType() const override { return ET; }
|
|
653
|
+
const HCurlCurlFE<ET> * Cast() const { return static_cast<const HCurlCurlFE<ET>*> (this); }
|
|
654
|
+
|
|
655
|
+
INLINE void SetOrderFacet (int nr, IVec<DIM-1,int> order) { order_facet[nr] = order; }
|
|
656
|
+
INLINE void SetOrderEdge (int nr, int order) { order_edge[nr] = order; }
|
|
657
|
+
INLINE void SetOrderInner (IVec<DIM,int> order) { order_inner = order; }
|
|
658
|
+
|
|
659
|
+
virtual void ComputeNDof()
|
|
660
|
+
{
|
|
661
|
+
cout << "Error, T_HCurlCurlFE<ET>:: ComputeNDof not available, only for ET == TRIG" << endl;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
virtual void CalcMappedShape (const BaseMappedIntegrationPoint & bmip,
|
|
666
|
+
BareSliceMatrix<double> shapes) const override
|
|
667
|
+
{
|
|
668
|
+
Switch<4-DIM>
|
|
669
|
+
(bmip.DimSpace()-DIM,[this, &bmip, shapes](auto CODIM)
|
|
670
|
+
{
|
|
671
|
+
constexpr auto DIMSPACE = DIM+CODIM.value;
|
|
672
|
+
auto & mip = static_cast<const MappedIntegrationPoint<DIM, DIM+CODIM.value>&> (bmip);
|
|
673
|
+
|
|
674
|
+
Cast() -> T_CalcShape (GetTIP(mip),SBLambda([shapes,DIMSPACE](int nr,auto val)
|
|
675
|
+
{
|
|
676
|
+
shapes.Row(nr).Range(DIMSPACE*DIMSPACE) = val.Value().AsVector();
|
|
677
|
+
}));
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
virtual void EvaluateMappedShape (const BaseMappedIntegrationPoint & bmip,
|
|
684
|
+
BareSliceVector<double> coefs,
|
|
685
|
+
BareSliceMatrix<double> shape) const override
|
|
686
|
+
{
|
|
687
|
+
Switch<4-DIM>
|
|
688
|
+
(bmip.DimSpace()-DIM,[this, &bmip, coefs, shape](auto CODIM)
|
|
689
|
+
{
|
|
690
|
+
auto & mip = static_cast<const MappedIntegrationPoint<DIM,DIM+CODIM.value>&> (bmip);
|
|
691
|
+
|
|
692
|
+
Mat<DIM+CODIM.value,DIM+CODIM.value> summat(0);
|
|
693
|
+
Cast() -> T_CalcShape (GetTIP(mip), SBLambda ([&summat,coefs] (int nr, auto val)
|
|
694
|
+
{
|
|
695
|
+
summat += coefs(nr) * val.Value();
|
|
696
|
+
|
|
697
|
+
}));
|
|
698
|
+
for (int k = 0; k < sqr(DIM+CODIM.value); k++)
|
|
699
|
+
shape(k) = summat(k);
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
virtual void CalcMappedIncShape (const BaseMappedIntegrationPoint & bmip,
|
|
705
|
+
BareSliceMatrix<double> shapes) const override
|
|
706
|
+
{
|
|
707
|
+
auto & mip = static_cast<const MappedIntegrationPoint<DIM,DIM>&> (bmip);
|
|
708
|
+
if constexpr (ET == ET_TET || ET == ET_TRIG || ET == ET_QUAD)
|
|
709
|
+
Cast() -> T_CalcShape (GetTIPHesse(mip),SBLambda([shapes](int nr,auto val)
|
|
710
|
+
{
|
|
711
|
+
if constexpr (DIM==3)
|
|
712
|
+
shapes.Row(nr).Range(DIM_DDMAT) = val.Inc().AsVector();
|
|
713
|
+
else
|
|
714
|
+
shapes.Row(nr).Range(DIM_DDMAT) = val.Inc();
|
|
715
|
+
}));
|
|
716
|
+
else
|
|
717
|
+
throw Exception("HCurlCurl::CalcMappedIncShape implemented only for TRIG and TET");
|
|
718
|
+
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
virtual void EvaluateMappedIncShape (const BaseMappedIntegrationPoint & bmip,
|
|
722
|
+
BareSliceVector<double> coefs,
|
|
723
|
+
BareSliceVector<double> inc) const override
|
|
724
|
+
{
|
|
725
|
+
auto & mip = static_cast<const MappedIntegrationPoint<DIM,DIM>&> (bmip);
|
|
726
|
+
|
|
727
|
+
Mat<DIM*(DIM-1)/2,DIM*(DIM-1)/2> sum = 0.0;
|
|
728
|
+
if constexpr (ET == ET_TET || ET == ET_TRIG || ET == ET_QUAD)
|
|
729
|
+
Cast() -> T_CalcShape (GetTIPHesse(mip),SBLambda([coefs, &sum](int nr,auto val)
|
|
730
|
+
{
|
|
731
|
+
sum += coefs(nr) * Mat<DIM*(DIM-1)/2,DIM*(DIM-1)/2>(val.Inc());
|
|
732
|
+
}));
|
|
733
|
+
else
|
|
734
|
+
throw Exception("HCurlCurl::EvaluateMappedIncShape implemented only for TRIG and TET");
|
|
735
|
+
|
|
736
|
+
inc.Range(0,DIM_DDMAT) = sum.AsVector();
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
virtual void CalcMappedIncShape (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
740
|
+
BareSliceMatrix<SIMD<double>> shapes) const override
|
|
741
|
+
{
|
|
742
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM>&> (bmir);
|
|
743
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
744
|
+
{
|
|
745
|
+
if constexpr (ET == ET_TET || ET == ET_TRIG || ET == ET_QUAD)
|
|
746
|
+
{
|
|
747
|
+
Cast() -> T_CalcShape (GetTIPHesse(mir[i]),SBLambda([shapes,i](int j,auto val)
|
|
748
|
+
{
|
|
749
|
+
if constexpr (DIM==3)
|
|
750
|
+
shapes.Rows(j*sqr(DIM), (j+1)*sqr(DIM)).Col(i).Range(0,DIM_DDMAT) = val.Inc().AsVector();
|
|
751
|
+
else
|
|
752
|
+
shapes.Rows(j,j+1).Col(i).Range(0,DIM_DDMAT) = val.Inc();
|
|
753
|
+
}));
|
|
754
|
+
}
|
|
755
|
+
else
|
|
756
|
+
throw Exception("HCurlCurl::CalcMappedIncShape implemented only for TRIG and TET");
|
|
757
|
+
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
void EvaluateIncShape (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
762
|
+
BareSliceVector<> coefs,
|
|
763
|
+
BareSliceMatrix<SIMD<double>> values) const override
|
|
764
|
+
{
|
|
765
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM>&> (bmir);
|
|
766
|
+
for (size_t i = 0; i < bmir.Size(); i++)
|
|
767
|
+
{
|
|
768
|
+
double *pcoefs = &coefs(0);
|
|
769
|
+
const size_t dist = coefs.Dist();
|
|
770
|
+
if constexpr (ET == ET_TET && DIM == 3)
|
|
771
|
+
{
|
|
772
|
+
Mat<DIM,DIM,SIMD<double>> summat(0);
|
|
773
|
+
Cast() -> T_CalcShape (GetTIPHesse(mir[i]),
|
|
774
|
+
SBLambda ([&summat,&pcoefs,dist] (size_t j, auto val)
|
|
775
|
+
{
|
|
776
|
+
summat += (*pcoefs)*val.Inc();
|
|
777
|
+
pcoefs += dist;
|
|
778
|
+
}));
|
|
779
|
+
for (size_t k = 0; k < sqr(DIM); k++)
|
|
780
|
+
values(k,i) = summat(k);
|
|
781
|
+
}
|
|
782
|
+
if constexpr ((ET == ET_TRIG || ET == ET_QUAD) && DIM == 2)
|
|
783
|
+
{
|
|
784
|
+
SIMD<double> summat(0);
|
|
785
|
+
Cast() -> T_CalcShape (GetTIPHesse(mir[i]),
|
|
786
|
+
SBLambda ([&summat,&pcoefs,dist] (size_t j, auto val)
|
|
787
|
+
{
|
|
788
|
+
summat += (*pcoefs)*val.Inc();
|
|
789
|
+
pcoefs += dist;
|
|
790
|
+
}));
|
|
791
|
+
values(0,i) = summat;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/*if constexpr (ET == ET_TET || ET == ET_TRIG)
|
|
796
|
+
{
|
|
797
|
+
Switch<1>
|
|
798
|
+
(bmir.DimSpace()-DIM,[values,&bmir,coefs,this](auto CODIM)
|
|
799
|
+
{
|
|
800
|
+
constexpr auto DIMSPACE = DIM+CODIM.value;
|
|
801
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
|
|
802
|
+
for (size_t i = 0; i < bmir.Size(); i++)
|
|
803
|
+
{
|
|
804
|
+
double *pcoefs = &coefs(0);
|
|
805
|
+
const size_t dist = coefs.Dist();
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
if constexpr (DIMSPACE==3)
|
|
809
|
+
{
|
|
810
|
+
Mat<DIMSPACE,DIMSPACE,SIMD<double>> summat(0);
|
|
811
|
+
Cast() -> T_CalcShape (GetTIPHesse(mir[i]),
|
|
812
|
+
SBLambda ([&summat,&pcoefs,dist] (size_t j, auto val)
|
|
813
|
+
{
|
|
814
|
+
summat += (*pcoefs)*val.Inc();
|
|
815
|
+
pcoefs += dist;
|
|
816
|
+
}));
|
|
817
|
+
for (size_t k = 0; k < sqr(DIMSPACE); k++)
|
|
818
|
+
values(k,i) = summat(k);
|
|
819
|
+
}
|
|
820
|
+
if constexpr (DIMSPACE==2)
|
|
821
|
+
{
|
|
822
|
+
SIMD<double> summat(0);
|
|
823
|
+
Cast() -> T_CalcShape (GetTIPHesse(mir[i]),
|
|
824
|
+
SBLambda ([&summat,&pcoefs,dist] (size_t j, auto val)
|
|
825
|
+
{
|
|
826
|
+
summat += (*pcoefs)*val.Inc();
|
|
827
|
+
pcoefs += dist;
|
|
828
|
+
}));
|
|
829
|
+
values(0,i) = summat;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
}*/
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
void AddTransIncShape (const SIMD_BaseMappedIntegrationRule & ir,
|
|
838
|
+
BareSliceMatrix<SIMD<double>> values,
|
|
839
|
+
BareSliceVector<> coefs) const override
|
|
840
|
+
{
|
|
841
|
+
throw ExceptionNOSIMD("HCurlCurl::AddTransIncShape not implemented yet");
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
virtual void CalcDualShape (const BaseMappedIntegrationPoint & bmip, BareSliceMatrix<> shape) const override
|
|
847
|
+
{
|
|
848
|
+
shape.AddSize(ndof, sqr(bmip.DimSpace())) = 0.0;
|
|
849
|
+
Switch<4-DIM>
|
|
850
|
+
(bmip.DimSpace()-DIM,[this, &bmip, shape](auto CODIM)
|
|
851
|
+
{
|
|
852
|
+
auto & mip = static_cast<const MappedIntegrationPoint<DIM,DIM+CODIM.value>&> (bmip);
|
|
853
|
+
|
|
854
|
+
Cast() -> CalcDualShape2 (mip, SBLambda([shape] (size_t nr, auto val)
|
|
855
|
+
{
|
|
856
|
+
shape.Row(nr) = val.AsVector();
|
|
857
|
+
}));
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
virtual void CalcDualShape (const SIMD_BaseMappedIntegrationRule& bmir, BareSliceMatrix<SIMD<double>> shapes) const override
|
|
862
|
+
{
|
|
863
|
+
Switch<4-DIM>
|
|
864
|
+
(bmir.DimSpace()-DIM,[this, &bmir, shapes](auto CODIM)
|
|
865
|
+
{
|
|
866
|
+
constexpr int DIMSPACE = DIM+CODIM.value;
|
|
867
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM+CODIM.value>&> (bmir);
|
|
868
|
+
|
|
869
|
+
shapes.AddSize(ndof*sqr(DIMSPACE), mir.Size()) = 0.0;
|
|
870
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
871
|
+
{
|
|
872
|
+
Cast() -> CalcDualShape2 (mir[i], SBLambda([shapes,i,DIMSPACE] (size_t j, auto val)
|
|
873
|
+
{
|
|
874
|
+
shapes.Rows(j*sqr(DIMSPACE), (j+1)*sqr(DIMSPACE)).Col(i).Range(0,sqr(DIMSPACE)) = val.AsVector();
|
|
875
|
+
}));
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
virtual void EvaluateDual (const SIMD_BaseMappedIntegrationRule & bmir, BareSliceVector<> coefs, BareSliceMatrix<SIMD<double>> values) const override
|
|
881
|
+
{
|
|
882
|
+
Switch<4-DIM>
|
|
883
|
+
(bmir.DimSpace()-DIM,[this,&bmir,coefs,values](auto CODIM)
|
|
884
|
+
{
|
|
885
|
+
constexpr int DIMSPACE = DIM+CODIM.value;
|
|
886
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM+CODIM.value>&> (bmir);
|
|
887
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
888
|
+
{
|
|
889
|
+
Mat<DIMSPACE,DIMSPACE,SIMD<double>> sum (SIMD<double>(0.0));
|
|
890
|
+
Cast() -> CalcDualShape2 (mir[i], SBLambda([&sum, coefs] (size_t j, auto val)
|
|
891
|
+
{
|
|
892
|
+
sum += coefs(j) * val;
|
|
893
|
+
}));
|
|
894
|
+
for (size_t k = 0; k < sqr(DIMSPACE); k++)
|
|
895
|
+
values(k, i) = sum(k);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
virtual void AddDualTrans (const SIMD_BaseMappedIntegrationRule& bmir, BareSliceMatrix<SIMD<double>> values, BareSliceVector<double> coefs) const override
|
|
901
|
+
{
|
|
902
|
+
Switch<4-DIM>
|
|
903
|
+
(bmir.DimSpace()-DIM,[this,&bmir,coefs,values](auto CODIM)
|
|
904
|
+
{
|
|
905
|
+
constexpr int DIMSPACE = DIM+CODIM.value;
|
|
906
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM+CODIM.value>&> (bmir);
|
|
907
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
908
|
+
{
|
|
909
|
+
Mat<DIMSPACE,DIMSPACE,SIMD<double>> value;
|
|
910
|
+
for (size_t k = 0; k < sqr(DIMSPACE); k++)
|
|
911
|
+
value(k) = values(k, i);
|
|
912
|
+
|
|
913
|
+
Cast()-> CalcDualShape2 (mir[i], SBLambda([value, coefs] (size_t j, auto val)
|
|
914
|
+
{
|
|
915
|
+
coefs(j) += HSum(InnerProduct(val,value));
|
|
916
|
+
}));
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
virtual void CalcMappedCurlShape (const BaseMappedIntegrationPoint & bmip,
|
|
922
|
+
BareSliceMatrix<double> shape) const override
|
|
923
|
+
{
|
|
924
|
+
auto mip = static_cast<const MappedIntegrationPoint<DIM,DIM> &>(bmip);
|
|
925
|
+
|
|
926
|
+
if constexpr (ET == ET_TET || ET == ET_TRIG)
|
|
927
|
+
Cast() -> T_CalcShape (GetTIPHesse(mip),SBLambda([shape](int nr,auto val)
|
|
928
|
+
{
|
|
929
|
+
if constexpr (DIM==3)
|
|
930
|
+
shape.Row(nr).Range(DIM_DMAT) = val.Curl().AsVector();
|
|
931
|
+
else
|
|
932
|
+
shape.Row(nr).Range(DIM_DMAT) = val.Curl();
|
|
933
|
+
}));
|
|
934
|
+
else
|
|
935
|
+
throw Exception("HCurlCurl::CalcMappedCurlShape implemented only for TRIG and TET");
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
virtual void CalcMappedShape (const SIMD<BaseMappedIntegrationPoint> & bmip,
|
|
940
|
+
BareSliceMatrix<SIMD<double>> shape) const override
|
|
941
|
+
{
|
|
942
|
+
Switch<4-DIM>
|
|
943
|
+
(bmip.DimSpace()-DIM,[this, &bmip, shape](auto CODIM)
|
|
944
|
+
{
|
|
945
|
+
constexpr auto DIMSPACE = DIM+CODIM.value;
|
|
946
|
+
auto & mip = static_cast<const SIMD<MappedIntegrationPoint<DIM,DIM+CODIM.value>>&> (bmip);
|
|
947
|
+
this->Cast() -> T_CalcShape (GetTIP(mip),
|
|
948
|
+
SBLambda ([shape,DIMSPACE] (size_t j, auto val)
|
|
949
|
+
{
|
|
950
|
+
shape.Rows(j*sqr(DIMSPACE), (j+1)*sqr(DIMSPACE)).Col(0).Range(0,sqr(DIMSPACE)) = val.Value().AsVector();
|
|
951
|
+
}));
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
virtual void CalcMappedShape (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
956
|
+
BareSliceMatrix<SIMD<double>> shapes) const override
|
|
957
|
+
{
|
|
958
|
+
Switch<4-DIM>
|
|
959
|
+
(bmir.DimSpace()-DIM,[this, &bmir, shapes](auto CODIM)
|
|
960
|
+
{
|
|
961
|
+
constexpr auto DIMSPACE = DIM+CODIM.value;
|
|
962
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIM+CODIM.value>&> (bmir);
|
|
963
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
964
|
+
{
|
|
965
|
+
this->Cast() -> T_CalcShape (GetTIP(mir[i]),
|
|
966
|
+
SBLambda ([i,shapes,DIMSPACE] (size_t j, auto val)
|
|
967
|
+
{
|
|
968
|
+
shapes.Rows(j*sqr(DIMSPACE), (j+1)*sqr(DIMSPACE)).Col(i).Range(0,sqr(DIMSPACE)) = val.Value().AsVector();
|
|
969
|
+
}));
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
virtual void Evaluate (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
976
|
+
BareSliceVector<> coefs,
|
|
977
|
+
BareSliceMatrix<SIMD<double>> values) const override
|
|
978
|
+
{
|
|
979
|
+
Switch<4-DIM>
|
|
980
|
+
(bmir.DimSpace()-DIM,[values,&bmir, coefs,this](auto CODIM)
|
|
981
|
+
{
|
|
982
|
+
constexpr auto DIMSPACE = DIM+CODIM.value;
|
|
983
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
|
|
984
|
+
for (size_t i = 0; i < bmir.Size(); i++)
|
|
985
|
+
{
|
|
986
|
+
double *pcoefs = &coefs(0);
|
|
987
|
+
const size_t dist = coefs.Dist();
|
|
988
|
+
|
|
989
|
+
Mat<DIMSPACE,DIMSPACE,SIMD<double>> summat(0);
|
|
990
|
+
Cast() -> T_CalcShape (GetTIP(mir[i]),
|
|
991
|
+
SBLambda ([&summat,&pcoefs,dist] (size_t j, auto val)
|
|
992
|
+
{
|
|
993
|
+
summat += (*pcoefs)*val.Value();
|
|
994
|
+
pcoefs += dist;
|
|
995
|
+
}));
|
|
996
|
+
for (size_t k = 0; k < sqr(DIMSPACE); k++)
|
|
997
|
+
values(k,i) = summat(k);
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
virtual void AddTrans (const SIMD_BaseMappedIntegrationRule & bmir,
|
|
1003
|
+
BareSliceMatrix<SIMD<double>> values,
|
|
1004
|
+
BareSliceVector<> coefs) const override
|
|
1005
|
+
{
|
|
1006
|
+
Switch<4-DIM>
|
|
1007
|
+
(bmir.DimSpace()-DIM,[this,&bmir,coefs,values](auto CODIM)
|
|
1008
|
+
{
|
|
1009
|
+
constexpr int DIMSPACE = DIM+CODIM.value;
|
|
1010
|
+
auto & mir = static_cast<const SIMD_MappedIntegrationRule<DIM,DIMSPACE>&> (bmir);
|
|
1011
|
+
for (size_t i = 0; i < mir.Size(); i++)
|
|
1012
|
+
{
|
|
1013
|
+
Mat<DIMSPACE,DIMSPACE,SIMD<double>> vali;
|
|
1014
|
+
vali.AsVector()= values.Col(i);
|
|
1015
|
+
|
|
1016
|
+
double *pcoefs = &coefs(0);
|
|
1017
|
+
const size_t dist = coefs.Dist();
|
|
1018
|
+
Cast()->T_CalcShape (GetTIP(mir[i]),
|
|
1019
|
+
SBLambda ([vali,&pcoefs,dist] (size_t j, auto s)
|
|
1020
|
+
{
|
|
1021
|
+
*pcoefs += HSum(InnerProduct(s.Value(), vali));
|
|
1022
|
+
pcoefs += dist;
|
|
1023
|
+
}));
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
#ifdef FILE_HCURLCURLFE_CPP
|
|
1035
|
+
#define HCURLCURLFE_EXTERN
|
|
1036
|
+
#else
|
|
1037
|
+
#define HCURLCURLFE_EXTERN extern
|
|
1038
|
+
#endif
|
|
1039
|
+
|
|
1040
|
+
HCURLCURLFE_EXTERN template class HCurlCurlFiniteElement<2>;
|
|
1041
|
+
HCURLCURLFE_EXTERN template class HCurlCurlFiniteElement<3>;
|
|
1042
|
+
|
|
1043
|
+
template <> class HCurlCurlFE<ET_SEGM> : public T_HCurlCurlFE<ET_SEGM>
|
|
1044
|
+
{
|
|
1045
|
+
|
|
1046
|
+
public:
|
|
1047
|
+
using T_HCurlCurlFE<ET_SEGM> :: T_HCurlCurlFE;
|
|
1048
|
+
|
|
1049
|
+
virtual void ComputeNDof()
|
|
1050
|
+
{
|
|
1051
|
+
order = 0;
|
|
1052
|
+
ndof = 0;
|
|
1053
|
+
ndof += order_inner[0]+1;
|
|
1054
|
+
order = max2(order,order_inner[0]);
|
|
1055
|
+
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
template <typename Tx, typename TFA>
|
|
1059
|
+
void T_CalcShape (TIP<1,Tx> ip, TFA & shape) const
|
|
1060
|
+
{
|
|
1061
|
+
Tx x = ip.x;
|
|
1062
|
+
Tx lami[2] ={ x, 1-x };
|
|
1063
|
+
int ii = 0;
|
|
1064
|
+
|
|
1065
|
+
IVec<2> e = ET_trait<ET_SEGM>::GetEdgeSort (0, vnums);
|
|
1066
|
+
Tx ls = lami[e[0]], le = lami[e[1]];
|
|
1067
|
+
|
|
1068
|
+
auto symdyadic = MakeReggeAD(ls, le);
|
|
1069
|
+
|
|
1070
|
+
LegendrePolynomial::Eval(order_inner[0], ls-le, SBLambda([symdyadic, &ii, shape] (size_t nr, auto val)
|
|
1071
|
+
{
|
|
1072
|
+
shape[ii++] = 0.5*val*symdyadic;
|
|
1073
|
+
}));
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
template <typename MIP, typename TFA>
|
|
1077
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
1078
|
+
{
|
|
1079
|
+
auto & ip = mip.IP();
|
|
1080
|
+
typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
|
|
1081
|
+
T x = ip(0);
|
|
1082
|
+
T lam[2] = { x, 1-x };
|
|
1083
|
+
|
|
1084
|
+
int ii = 0;
|
|
1085
|
+
|
|
1086
|
+
IVec<2> e = ET_trait<ET_SEGM>::GetEdgeSort (0, vnums);
|
|
1087
|
+
T xi = lam[e[0]]-lam[e[1]];
|
|
1088
|
+
|
|
1089
|
+
auto tv = mip.GetJacobian()*Vec<1,T>(1);
|
|
1090
|
+
auto tt = DyadProd(tv,tv);
|
|
1091
|
+
|
|
1092
|
+
LegendrePolynomial::Eval(order_inner[0], xi, SBLambda([shape,mip,tt,&ii] (size_t nr, T val)
|
|
1093
|
+
{
|
|
1094
|
+
shape[ii++] = 1/mip.GetMeasure()*val*tt;
|
|
1095
|
+
}));
|
|
1096
|
+
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
template <> class HCurlCurlFE<ET_TRIG> : public T_HCurlCurlFE<ET_TRIG>
|
|
1102
|
+
{
|
|
1103
|
+
|
|
1104
|
+
public:
|
|
1105
|
+
using T_HCurlCurlFE<ET_TRIG> :: T_HCurlCurlFE;
|
|
1106
|
+
|
|
1107
|
+
virtual void ComputeNDof()
|
|
1108
|
+
{
|
|
1109
|
+
order = 0;
|
|
1110
|
+
ndof = 0;
|
|
1111
|
+
for (int i=0; i<3; i++)
|
|
1112
|
+
{
|
|
1113
|
+
ndof += order_facet[i][0]+1;
|
|
1114
|
+
order = max2(order, order_facet[i][0]);
|
|
1115
|
+
}
|
|
1116
|
+
int ninner = 3*order_inner[0]*(order_inner[0]+1)/2 ;
|
|
1117
|
+
order = max2(order, order_inner[0]);
|
|
1118
|
+
|
|
1119
|
+
ndof += ninner;
|
|
1120
|
+
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
template <typename Tx, typename TFA>
|
|
1125
|
+
void T_CalcShape (TIP<2,Tx> ip, TFA & shape) const
|
|
1126
|
+
{
|
|
1127
|
+
Tx x = ip.x, y = ip.y;
|
|
1128
|
+
Tx lami[3] ={ x, y, 1-x-y };
|
|
1129
|
+
int ii = 0;
|
|
1130
|
+
|
|
1131
|
+
// /*int maxorder_facet =
|
|
1132
|
+
// max2(order_facet[0][0],max2(order_facet[1][0],order_facet[2][0]));
|
|
1133
|
+
// ArrayMem<Tx,20> ha(maxorder_facet+1);
|
|
1134
|
+
// ArrayMem<Tx,20> u(order_inner[0]+2), v(order_inner[0]+2);
|
|
1135
|
+
|
|
1136
|
+
// for (int i = 0; i < 3; i++)
|
|
1137
|
+
// {
|
|
1138
|
+
// IVec<2> e = ET_trait<ET_TRIG>::GetEdgeSort(i,vnums);
|
|
1139
|
+
// Tx ls = llami[e[0]], le = llami[e[1]];
|
|
1140
|
+
|
|
1141
|
+
// // edge functions are all curl-free!
|
|
1142
|
+
// IntegratedLegendreMonomialExt::CalcTrigExt(maxorder_facet+2,
|
|
1143
|
+
// le-ls, 1-le-ls, ha);
|
|
1144
|
+
|
|
1145
|
+
// for (int l = 0; l <= order_facet[i][0]; l++)
|
|
1146
|
+
// shape[ii++] = EpsGrad (ha[l]);
|
|
1147
|
+
// }*/
|
|
1148
|
+
|
|
1149
|
+
for (int i = 0; i < 3; i++)
|
|
1150
|
+
{
|
|
1151
|
+
IVec<2> e = ET_trait<ET_TRIG>::GetEdgeSort (i, vnums);
|
|
1152
|
+
Tx ls = lami[e[1]], le = lami[e[0]];
|
|
1153
|
+
|
|
1154
|
+
auto symdyadic = MakeReggeAD(ls, le);
|
|
1155
|
+
|
|
1156
|
+
LegendrePolynomial::EvalScaled(order_facet[i][0], ls-le,ls+le, SBLambda([symdyadic, &ii, shape] (size_t nr, auto val)
|
|
1157
|
+
{
|
|
1158
|
+
shape[ii++] = -val*symdyadic;
|
|
1159
|
+
}));
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
if (order_inner[0] > 0)
|
|
1164
|
+
{
|
|
1165
|
+
IVec<4> f = ET_trait<ET_TRIG>::GetFaceSort(0, vnums);
|
|
1166
|
+
Tx ls = lami[f[0]], le = lami[f[1]], lt = lami[f[2]];
|
|
1167
|
+
|
|
1168
|
+
auto symdyadic1 = lt*MakeReggeAD(ls, le);
|
|
1169
|
+
auto symdyadic2 = ls*MakeReggeAD(lt, le);
|
|
1170
|
+
auto symdyadic3 = le*MakeReggeAD(ls, lt);
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
DubinerBasis::Eval(order_inner[0]-1, ls,le,
|
|
1174
|
+
SBLambda([symdyadic1,symdyadic2,symdyadic3, &ii, shape] (size_t nr, auto val)
|
|
1175
|
+
{
|
|
1176
|
+
shape[ii++] = 2*val*symdyadic1;
|
|
1177
|
+
shape[ii++] = 2*val*symdyadic2;
|
|
1178
|
+
shape[ii++] = 2*val*symdyadic3;
|
|
1179
|
+
}));
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
template <typename MIP, typename TFA>
|
|
1185
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
1186
|
+
{
|
|
1187
|
+
auto & ip = mip.IP();
|
|
1188
|
+
typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
|
|
1189
|
+
T x = ip(0), y = ip(1);
|
|
1190
|
+
T lam[3] = { x, y, 1-x-y };
|
|
1191
|
+
Vec<2,T> pnts[3] = { { 1, 0 }, { 0, 1 } , { 0, 0 } };
|
|
1192
|
+
int facetnr = ip.FacetNr();
|
|
1193
|
+
|
|
1194
|
+
int ii = 0;
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
if (ip.VB() == BND)
|
|
1198
|
+
{ // facet shapes
|
|
1199
|
+
for (int i = 0; i < 3; i++)
|
|
1200
|
+
{
|
|
1201
|
+
int p = order_facet[i][0];
|
|
1202
|
+
|
|
1203
|
+
if (i == facetnr)
|
|
1204
|
+
{
|
|
1205
|
+
IVec<2> e = ET_trait<ET_TRIG>::GetEdgeSort (i, vnums);
|
|
1206
|
+
|
|
1207
|
+
T xi = lam[e[0]]-lam[e[1]];
|
|
1208
|
+
Vec<2,T> tauref = pnts[e[0]] - pnts[e[1]];
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
auto tv = mip.GetJacobian()*tauref;
|
|
1212
|
+
|
|
1213
|
+
auto tt = DyadProd(tv,tv);
|
|
1214
|
+
LegendrePolynomial::Eval
|
|
1215
|
+
(p, xi,
|
|
1216
|
+
SBLambda([&] (size_t nr, T val)
|
|
1217
|
+
{
|
|
1218
|
+
shape[nr+ii] = 1/mip.GetMeasure()*val*tt;
|
|
1219
|
+
}));
|
|
1220
|
+
}
|
|
1221
|
+
ii += (p+1);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
else
|
|
1225
|
+
{
|
|
1226
|
+
for (int i = 0; i < 3; i++)
|
|
1227
|
+
ii += order_facet[i][0]+1;
|
|
1228
|
+
}
|
|
1229
|
+
if (ip.VB() == VOL)
|
|
1230
|
+
{
|
|
1231
|
+
auto p = order_inner[0]-1;
|
|
1232
|
+
if( p >= 0 )
|
|
1233
|
+
{
|
|
1234
|
+
IVec<4> f = ET_trait<ET_TRIG>::GetFaceSort(0, vnums);
|
|
1235
|
+
|
|
1236
|
+
DubinerBasis::Eval (p, lam[f[0]], lam[f[1]],
|
|
1237
|
+
SBLambda([&] (size_t nr, T val)
|
|
1238
|
+
{
|
|
1239
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<2,2>({{1,0},{0,0}})*Trans(mip.GetJacobian());
|
|
1240
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<2,2>({{0,0},{0,1}})*Trans(mip.GetJacobian());
|
|
1241
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<2,2>({{0,1},{1,0}})*Trans(mip.GetJacobian());
|
|
1242
|
+
}));
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
template <> class HCurlCurlFE<ET_QUAD> : public T_HCurlCurlFE<ET_QUAD>
|
|
1251
|
+
{
|
|
1252
|
+
|
|
1253
|
+
public:
|
|
1254
|
+
using T_HCurlCurlFE<ET_QUAD> :: T_HCurlCurlFE;
|
|
1255
|
+
|
|
1256
|
+
virtual void ComputeNDof()
|
|
1257
|
+
{
|
|
1258
|
+
order = 0;
|
|
1259
|
+
ndof = 0;
|
|
1260
|
+
for (int i=0; i<4; i++)
|
|
1261
|
+
{
|
|
1262
|
+
ndof += order_facet[i][0]+1;
|
|
1263
|
+
order = max2(order, order_facet[i][0]);
|
|
1264
|
+
}
|
|
1265
|
+
int ninner = order_inner[0]*order_inner[0] + (order_inner[0]+2)*order_inner[0]*2 +1;//+ 2*order_inner[0];
|
|
1266
|
+
order = max2(order, order_inner[0]);
|
|
1267
|
+
order += 1;
|
|
1268
|
+
ndof += ninner;
|
|
1269
|
+
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
template <typename Tx, typename TFA>
|
|
1275
|
+
void T_CalcShape (TIP<2,Tx> ip, TFA & shape) const
|
|
1276
|
+
{
|
|
1277
|
+
Tx x = ip.x, y = ip.y;
|
|
1278
|
+
Tx lx[4] ={ 1-x, x, x, 1-x };
|
|
1279
|
+
Tx ly[4] ={ 1-y, 1-y, y, y };
|
|
1280
|
+
Tx lami[4] = {(1-x)*(1-y),x*(1-y),x*y,(1-x)*y};
|
|
1281
|
+
Tx sigma[4] = {(1-x)+(1-y),x+(1-y),x+y,(1-x)+y};
|
|
1282
|
+
int ii = 0;
|
|
1283
|
+
|
|
1284
|
+
ArrayMem<Tx,20> v(order+2), u(order+2);
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
for (int i = 0; i < 4; i++)
|
|
1288
|
+
{
|
|
1289
|
+
IVec<2> e = ET_trait<ET_QUAD>::GetEdgeSort (i, vnums);
|
|
1290
|
+
Tx xi = sigma[e[1]]-sigma[e[0]];
|
|
1291
|
+
Tx lam_e = lami[e[0]]+lami[e[1]];
|
|
1292
|
+
auto symdyadic = MakeReggeAD(xi, xi);
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
//IntLegNoBubble::
|
|
1296
|
+
LegendrePolynomial::
|
|
1297
|
+
EvalMult (order_facet[i][0],
|
|
1298
|
+
xi, 0.25*lam_e, SBLambda ([&](int i, auto val)
|
|
1299
|
+
{
|
|
1300
|
+
shape[ii++] = val*symdyadic;
|
|
1301
|
+
}));
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
int oi = order_inner[0];
|
|
1307
|
+
|
|
1308
|
+
auto symdyadic = MakeReggeAD(0.5*x,0.5*y); //(0,0.5, 0.5,0) * P(y) * P(x)
|
|
1309
|
+
|
|
1310
|
+
Tx eta = ly[2]-ly[1];
|
|
1311
|
+
Tx xi = lx[1]-lx[0];
|
|
1312
|
+
LegendrePolynomial (oi, eta, v);
|
|
1313
|
+
LegendrePolynomial (oi, xi, u);
|
|
1314
|
+
|
|
1315
|
+
for (int i = 0; i <= oi; i++)
|
|
1316
|
+
for (int j = 0; j <= oi; j++)
|
|
1317
|
+
{
|
|
1318
|
+
shape[ii++] = u[i]*v[j]*symdyadic;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
auto symdyad = lx[1]*lx[0]*MakeReggeAD(y,y);//x*(1-x)*(0,0, 0,1) * P(y) * P(x)
|
|
1323
|
+
for (int i = 0; i < oi; i++)
|
|
1324
|
+
for (int j = 0; j <= oi; j++)
|
|
1325
|
+
{
|
|
1326
|
+
shape[ii++] = u[i]*v[j]*symdyad;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
symdyad = ly[2]*ly[1]*MakeReggeAD(x,x); //y*(1-y)*(1,0, 0,0) * P(x) * P(y)
|
|
1330
|
+
|
|
1331
|
+
for (int j = 0; j < oi; j++)
|
|
1332
|
+
for (int i = 0; i <= oi; i++)
|
|
1333
|
+
{
|
|
1334
|
+
shape[ii++] = u[i]*v[j]*symdyad;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
//old version
|
|
1338
|
+
//ArrayMem<Tx,20> u(order+2);
|
|
1339
|
+
/*for (int i = 0; i < 4; i++)
|
|
1340
|
+
{
|
|
1341
|
+
IVec<2> e = ET_trait<ET_QUAD>::GetEdgeSort (i, vnums);
|
|
1342
|
+
Tx xi = llx[e[1]]+lly[e[1]]-llx[e[0]]-lly[e[0]];
|
|
1343
|
+
Tx eta = llx[e[0]]*lly[e[0]]+llx[e[1]]*lly[e[1]];
|
|
1344
|
+
|
|
1345
|
+
IntegratedLegendreMonomialExt::Calc(order_facet[i][0]+2,xi,u);
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
for (int l = 0; l <= order_facet[i][0]; l++)
|
|
1349
|
+
shape[ii++] = Eps_u_Gradv (eta, u[l]);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
IntegratedLegendreMonomialExt::Calc(oi+3,llx[0]-llx[1],u);
|
|
1353
|
+
IntegratedLegendreMonomialExt::Calc(oi+3,lly[0]-lly[2],v);
|
|
1354
|
+
|
|
1355
|
+
for(int i = 0; i <= oi-1; i++)
|
|
1356
|
+
for(int j = 0; j <= oi-1; j++)
|
|
1357
|
+
shape[ii++] = EpsGrad(u[i]*v[j]);
|
|
1358
|
+
|
|
1359
|
+
for(int i = 0; i <= oi+1; i++)
|
|
1360
|
+
for(int j = 0; j <= oi-1; j++)
|
|
1361
|
+
{
|
|
1362
|
+
shape[ii++] = vEpsGradu(u[i],v[j]);
|
|
1363
|
+
shape[ii++] = vEpsGradu(v[i],u[j]);
|
|
1364
|
+
}
|
|
1365
|
+
shape[ii++] = Eps_u_Gradv(lx[0], ly[0]);
|
|
1366
|
+
|
|
1367
|
+
for(int i = 0; i <= oi-1; i++)
|
|
1368
|
+
{
|
|
1369
|
+
shape[ii++] = Eps_u_Gradv(u[i], ly[0]);
|
|
1370
|
+
shape[ii++] = Eps_u_Gradv(v[i], lx[0]);
|
|
1371
|
+
}*/
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
template <typename MIP, typename TFA>
|
|
1378
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
1379
|
+
{
|
|
1380
|
+
auto & ip = mip.IP();
|
|
1381
|
+
typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
|
|
1382
|
+
|
|
1383
|
+
T x = ip(0), y = ip(1);
|
|
1384
|
+
T lx[4] = { 1-x, x, x, 1-x };
|
|
1385
|
+
T ly[4] = { 1-y, 1-y, y, y };
|
|
1386
|
+
T sigma[4] = {(1-x)+(1-y),x+(1-y),x+y,(1-x)+y};
|
|
1387
|
+
|
|
1388
|
+
Vec<2,T> pnts[4] = { { 0, 0 }, { 1, 0 }, { 1, 1 }, { 0, 1 } };
|
|
1389
|
+
int facetnr = ip.FacetNr();
|
|
1390
|
+
|
|
1391
|
+
int ii = 0;
|
|
1392
|
+
|
|
1393
|
+
ArrayMem<T,20> v(order+2), u(order+2);
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
if (mip.IP().VB() == BND)
|
|
1397
|
+
{ // facet shapes
|
|
1398
|
+
for (int i = 0; i < 4; i++)
|
|
1399
|
+
{
|
|
1400
|
+
int p = order_facet[i][0];
|
|
1401
|
+
|
|
1402
|
+
if (i == facetnr)
|
|
1403
|
+
{
|
|
1404
|
+
IVec<2> e = ET_trait<ET_QUAD>::GetEdgeSort (i, vnums);
|
|
1405
|
+
|
|
1406
|
+
//T xi = lam[e[0]]-lam[e[1]];
|
|
1407
|
+
T xi = sigma[e[1]]-sigma[e[0]];
|
|
1408
|
+
Vec<2,T> tauref = pnts[e[0]] - pnts[e[1]];
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
auto tv = mip.GetJacobian()*tauref;
|
|
1412
|
+
|
|
1413
|
+
auto tt = DyadProd(tv,tv);
|
|
1414
|
+
LegendrePolynomial::Eval
|
|
1415
|
+
(p, xi,
|
|
1416
|
+
SBLambda([&] (size_t nr, T val)
|
|
1417
|
+
{
|
|
1418
|
+
shape[nr+ii] = 1/mip.GetMeasure()*val*tt;
|
|
1419
|
+
}));
|
|
1420
|
+
/*IVec<2> e = ET_trait<ET_QUAD>::GetEdgeSort (i, vnums);
|
|
1421
|
+
AutoDiff<2,T> xi = sigma[e[1]]-sigma[e[0]];
|
|
1422
|
+
AutoDiff<2,T> lam_e = lami[e[0]]+lami[e[1]];
|
|
1423
|
+
Vec<3, AutoDiff<2,T>> symdyadic = SymDyadProd(xi,xi);
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
IntLegNoBubble::
|
|
1427
|
+
EvalMult (order_edge[i],
|
|
1428
|
+
xi, lam_e, SBLambda ([&](int nr, auto val)
|
|
1429
|
+
{
|
|
1430
|
+
VecToSymMat<2>(T_REGGE_Shape<2,T>(val*symdyadic).Shape(),tmp);
|
|
1431
|
+
shape[nr + ii] = mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1432
|
+
}));*/
|
|
1433
|
+
/*AutoDiff<2,T> xi = sigma[e[1]]-sigma[e[0]];
|
|
1434
|
+
AutoDiff<2,T> lam_e = lami[e[0]]+lami[e[1]];
|
|
1435
|
+
Vec<3, AutoDiff<2,T>> symdyadic = SymDyadProd(xi,xi);
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
IntLegNoBubble::
|
|
1439
|
+
EvalMult (p,xi, lam_e, SBLambda ([&](int nr, auto val)
|
|
1440
|
+
{
|
|
1441
|
+
VecToSymMat<2>(T_REGGE_Shape<2,T>(val*symdyadic).Shape(),tmp);
|
|
1442
|
+
shape[nr + ii] = 1/mip.GetMeasure()*tmp;
|
|
1443
|
+
}));*/
|
|
1444
|
+
}
|
|
1445
|
+
ii += (p+1);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
else
|
|
1449
|
+
{
|
|
1450
|
+
for (int i = 0; i < 4; i++)
|
|
1451
|
+
ii += order_facet[i][0]+1;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
if (mip.IP().VB() == VOL)
|
|
1455
|
+
{
|
|
1456
|
+
auto p = order_inner[0];
|
|
1457
|
+
|
|
1458
|
+
T eta = ly[2]-ly[1];
|
|
1459
|
+
T xi = lx[1]-lx[0];
|
|
1460
|
+
LegendrePolynomial (p, eta, v);
|
|
1461
|
+
LegendrePolynomial (p, xi, u);
|
|
1462
|
+
|
|
1463
|
+
for (int i = 0; i <= p; i++)
|
|
1464
|
+
for (int j = 0; j <= p; j++)
|
|
1465
|
+
{
|
|
1466
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{0,1},{1,0}}))*Trans(mip.GetJacobian());
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
//auto symdyad = lx[1]*lx[0]*SymDyadProd(Vec<2,T>(0,1),Vec<2,T>(0,1));//x*(1-x)*(0,0, 0,1) * P(y) * P(x)
|
|
1471
|
+
for (int i = 0; i < p; i++)
|
|
1472
|
+
for (int j = 0; j <= p; j++)
|
|
1473
|
+
{
|
|
1474
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{0,0},{0,1}}))*Trans(mip.GetJacobian());
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
//symdyad = ly[2]*ly[1]*SymDyadProd(Vec<2,T>(1,0),Vec<2,T>(1,0)); //y*(1-y)*(1,0, 0,0) * P(x) * P(y)
|
|
1478
|
+
|
|
1479
|
+
for (int j = 0; j < p; j++)
|
|
1480
|
+
for (int i = 0; i <= p; i++)
|
|
1481
|
+
{
|
|
1482
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{1,0},{0,0}}))*Trans(mip.GetJacobian());
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
//IVec<4> f = ET_trait<ET_QUAD>::GetFaceSort(0, vnums);
|
|
1486
|
+
|
|
1487
|
+
/*IntegratedLegendreMonomialExt::Calc(p+3,lx[0]-lx[1],u);
|
|
1488
|
+
IntegratedLegendreMonomialExt::Calc(p+3,ly[0]-ly[2],v);
|
|
1489
|
+
|
|
1490
|
+
Mat<2,2,T> tmp;
|
|
1491
|
+
|
|
1492
|
+
for(int i = 0; i <= p-1; i++)
|
|
1493
|
+
for(int j = 0; j <= p-1; j++)
|
|
1494
|
+
{
|
|
1495
|
+
VecToSymMat<2>(EpsGrad(u[i]*v[j]).Shape(),tmp);
|
|
1496
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
for(int i = 0; i <= p+1; i++)
|
|
1500
|
+
for(int j = 0; j <= p-1; j++)
|
|
1501
|
+
{
|
|
1502
|
+
VecToSymMat<2>(vEpsGradu(u[i],v[j]).Shape(),tmp);
|
|
1503
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1504
|
+
VecToSymMat<2>(vEpsGradu(v[i],u[j]).Shape(),tmp);
|
|
1505
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
VecToSymMat<2>(Eps_u_Gradv(lx[0], ly[0]).Shape(),tmp);
|
|
1509
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1510
|
+
|
|
1511
|
+
for(int i = 0; i <= p-1; i++)
|
|
1512
|
+
{
|
|
1513
|
+
VecToSymMat<2>(Eps_u_Gradv(u[i], ly[0]).Shape(),tmp);
|
|
1514
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1515
|
+
VecToSymMat<2>(Eps_u_Gradv(v[i], lx[0]).Shape(),tmp);
|
|
1516
|
+
shape[ii++] = 1/mip.GetMeasure()*mip.GetJacobian()*tmp*Trans(mip.GetJacobian());
|
|
1517
|
+
}*/
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
template <> class HCurlCurlFE<ET_PRISM> : public T_HCurlCurlFE<ET_PRISM>
|
|
1524
|
+
{
|
|
1525
|
+
public:
|
|
1526
|
+
enum { incrorder_xx1 = 0};
|
|
1527
|
+
enum { incrorder_zz1 = 0};
|
|
1528
|
+
enum { incrorder_xx2 = 0};
|
|
1529
|
+
enum { incrorder_zz2 = 0};
|
|
1530
|
+
enum { incrorder_xx1_bd = 0};
|
|
1531
|
+
enum { incrorder_zz1_bd = 0};
|
|
1532
|
+
enum { incrorder_xx2_bd = 0};
|
|
1533
|
+
enum { incrorder_zz2_bd = 0};
|
|
1534
|
+
using T_HCurlCurlFE<ET_PRISM> :: T_HCurlCurlFE;
|
|
1535
|
+
|
|
1536
|
+
virtual void ComputeNDof()
|
|
1537
|
+
{
|
|
1538
|
+
order = 0;
|
|
1539
|
+
ndof = 0;
|
|
1540
|
+
|
|
1541
|
+
for (int i=0; i < 9; i++)
|
|
1542
|
+
{
|
|
1543
|
+
ndof += order_edge[i]+1;
|
|
1544
|
+
order = max2(order,order_edge[i]);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
for (int i=0; i<2; i++)
|
|
1548
|
+
{
|
|
1549
|
+
ndof += 3*(order_facet[i][0])*(order_facet[i][0]+1)/2;
|
|
1550
|
+
order = max2(order, order_facet[i][0]);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
for (int i=2; i<5; i++)
|
|
1554
|
+
{
|
|
1555
|
+
ndof += order_facet[i][0]*order_facet[i][0] + (order_facet[i][0]+2)*order_facet[i][0]*2 +1;
|
|
1556
|
+
order = max2(order, order_facet[i][0]);
|
|
1557
|
+
}
|
|
1558
|
+
int p = order_inner[0];
|
|
1559
|
+
int ninner = 3*p*(p+1)/2*p + (p-1)*(p)/2*(p+1) + (p+1)*p*(p+1);
|
|
1560
|
+
ndof += ninner;
|
|
1561
|
+
|
|
1562
|
+
order = 1+max2(order, p);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
template <typename Tx, typename TFA>
|
|
1567
|
+
void T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
|
|
1568
|
+
{
|
|
1569
|
+
Tx x = ip.x, y = ip.y, z = ip.z;
|
|
1570
|
+
Tx lx[6] ={ x, y, 1-x-y, x, y, 1-x-y };
|
|
1571
|
+
Tx lz[6] ={ 1-z,1-z,1-z,z,z,z };
|
|
1572
|
+
|
|
1573
|
+
int ii = 0;
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
const FACE * faces = ElementTopology::GetFaces(ET_PRISM);
|
|
1577
|
+
|
|
1578
|
+
ArrayMem<Tx,20> leg_u(order+2), leg_v(order+3);
|
|
1579
|
+
ArrayMem<Tx,20> leg_w(order+2);
|
|
1580
|
+
|
|
1581
|
+
//horizontal edge shapes
|
|
1582
|
+
for (int i = 0; i < 6; i++)
|
|
1583
|
+
{
|
|
1584
|
+
IVec<2> e = ET_trait<ET_PRISM>::GetEdgeSort (i, vnums);
|
|
1585
|
+
Tx ls = lx[e[1]], le = lx[e[0]], lm = lz[e[0]];
|
|
1586
|
+
|
|
1587
|
+
auto symdyadic = lm*MakeReggeAD(ls,le);
|
|
1588
|
+
|
|
1589
|
+
LegendrePolynomial::EvalScaled(order_edge[i], ls-le,ls+le, SBLambda([symdyadic, &ii, shape] (size_t nr, auto val)
|
|
1590
|
+
{
|
|
1591
|
+
shape[ii++] = -val*symdyadic;
|
|
1592
|
+
}));
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
//vertical edge shapes
|
|
1598
|
+
for (int i = 6; i < 9; i++)
|
|
1599
|
+
{
|
|
1600
|
+
IVec<2> e = ET_trait<ET_PRISM>::GetEdgeSort (i, vnums);
|
|
1601
|
+
Tx ls = lx[e[0]], lm1 = lz[e[0]], lm2 = lz[e[1]];
|
|
1602
|
+
auto symdyadic = ls*MakeReggeAD(lm1,lm1);
|
|
1603
|
+
LegendrePolynomial (order_edge[i],lm1-lm2, leg_v);
|
|
1604
|
+
|
|
1605
|
+
for (int j=0; j <= order_edge[i]; j++)
|
|
1606
|
+
shape[ii++] = leg_v[j]*symdyadic;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
//horizontal face shaps
|
|
1612
|
+
for(int fa = 0; fa < 2; fa++)
|
|
1613
|
+
{
|
|
1614
|
+
if (order_facet[fa][0] > 0)
|
|
1615
|
+
{
|
|
1616
|
+
IVec<4> f = ET_trait<ET_PRISM>::GetFaceSort(fa, vnums);
|
|
1617
|
+
Tx ls = lx[f[0]], le = lx[f[1]], lt = lx[f[2]], lm = lz[f[0]];
|
|
1618
|
+
|
|
1619
|
+
auto symdyadic1 = lm*lt*MakeReggeAD(ls,le);
|
|
1620
|
+
auto symdyadic2 = lm*ls*MakeReggeAD(lt,le);
|
|
1621
|
+
auto symdyadic3 = lm*le*MakeReggeAD(ls,lt);
|
|
1622
|
+
|
|
1623
|
+
DubinerBasis::Eval(order_facet[fa][0]-1, ls,le,
|
|
1624
|
+
SBLambda([symdyadic1,symdyadic2,symdyadic3, &ii, shape] (size_t nr, auto val)
|
|
1625
|
+
{
|
|
1626
|
+
shape[ii++] = val*symdyadic1;
|
|
1627
|
+
shape[ii++] = val*symdyadic2;
|
|
1628
|
+
shape[ii++] = val*symdyadic3;
|
|
1629
|
+
}));
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
//vertical face shaps
|
|
1635
|
+
for(int fa = 2; fa < 5; fa++)
|
|
1636
|
+
{
|
|
1637
|
+
int of = order_facet[fa][0];
|
|
1638
|
+
|
|
1639
|
+
int fmax = 0;
|
|
1640
|
+
for(int j = 1; j < 4; j++)
|
|
1641
|
+
if(vnums[faces[fa][j]] > vnums[faces[fa][fmax]]) fmax = j;
|
|
1642
|
+
int fz,ftrig;
|
|
1643
|
+
fz = 3 - fmax;
|
|
1644
|
+
ftrig = fmax^1;
|
|
1645
|
+
fmax = faces[fa][fmax];
|
|
1646
|
+
fz = faces[fa][fz];
|
|
1647
|
+
ftrig = faces[fa][ftrig];
|
|
1648
|
+
|
|
1649
|
+
Tx eta = lz[fz]-lz[fmax];
|
|
1650
|
+
Tx xi = lx[ftrig]-lx[fmax];
|
|
1651
|
+
|
|
1652
|
+
LegendrePolynomial (of, eta, leg_v);
|
|
1653
|
+
LegendrePolynomial (of, xi, leg_u);
|
|
1654
|
+
|
|
1655
|
+
auto W = uDv_minus_vDu(lx[ftrig],lx[fmax]);
|
|
1656
|
+
Tx W_AD;
|
|
1657
|
+
W_AD.DValue(0) = W.Value()(0);
|
|
1658
|
+
W_AD.DValue(1) = W.Value()(1);
|
|
1659
|
+
W_AD.DValue(2) = W.Value()(2);
|
|
1660
|
+
auto symdyadic = MakeReggeAD(eta,0.25*W_AD); //^= (0,1, 1,0) * P(x)*P(y)
|
|
1661
|
+
for (int j = 0; j <= of; j++)
|
|
1662
|
+
for (int k = 0; k <= of; k++)
|
|
1663
|
+
shape[ii++] = leg_v[j]*leg_u[k]*symdyadic;
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
auto symdyad = 0.25*lx[ftrig]*lx[fmax]*MakeReggeAD(eta,eta); //^= x*(1-x)*(0,0, 0,1) * P(x) * P(y)
|
|
1667
|
+
for (int i = 0; i < of; i++)
|
|
1668
|
+
for (int j = 0; j <= of; j++)
|
|
1669
|
+
shape[ii++] = leg_u[i]*leg_v[j]*symdyad;
|
|
1670
|
+
|
|
1671
|
+
symdyad = 0.25*lz[fz]*lz[fmax]*MakeReggeAD(lx[ftrig],lx[fmax]); //^= y*(1-y)*(1,0, 0,0) * P(x)*P(y)
|
|
1672
|
+
for (int j = 0; j < of; j++)
|
|
1673
|
+
for (int i = 0; i <= of; i++)
|
|
1674
|
+
shape[ii++] = leg_u[i]*leg_v[j]*symdyad;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
//inner shapes
|
|
1678
|
+
int p = order_inner[0];
|
|
1679
|
+
if (p > 0)
|
|
1680
|
+
{
|
|
1681
|
+
|
|
1682
|
+
IVec<4> f = ET_trait<ET_PRISM>::GetFaceSort(0, vnums);
|
|
1683
|
+
|
|
1684
|
+
Tx ls = lx[f[0]], le = lx[f[1]], lt = lx[f[2]], lm = lz[0], ln = lz[3];
|
|
1685
|
+
|
|
1686
|
+
auto symdyadic1 = lm*ln*lt*MakeReggeAD(ls,le);
|
|
1687
|
+
auto symdyadic2 = lm*ln*ls*MakeReggeAD(lt,le);
|
|
1688
|
+
auto symdyadic3 = lm*ln*le*MakeReggeAD(ls,lt);
|
|
1689
|
+
|
|
1690
|
+
Tx eta = lz[0]-lz[4];
|
|
1691
|
+
LegendrePolynomial (p, eta, leg_w);
|
|
1692
|
+
|
|
1693
|
+
// Reg(T) x [0,1]
|
|
1694
|
+
DubinerBasis::Eval(p-1, ls,le,
|
|
1695
|
+
SBLambda([symdyadic1,symdyadic2,symdyadic3, &ii, shape,p,leg_w] (size_t nr, auto val)
|
|
1696
|
+
{
|
|
1697
|
+
for(int j=0; j < p; j++)
|
|
1698
|
+
{
|
|
1699
|
+
shape[ii++] = leg_w[j]*val*symdyadic1;
|
|
1700
|
+
shape[ii++] = leg_w[j]*val*symdyadic2;
|
|
1701
|
+
shape[ii++] = leg_w[j]*val*symdyadic3;
|
|
1702
|
+
}
|
|
1703
|
+
}));
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
// H1(T) x [0,1]
|
|
1707
|
+
auto symdyadic = ls*le*lt*MakeReggeAD(eta,eta);
|
|
1708
|
+
DubinerBasis::Eval(p-2, ls,le,
|
|
1709
|
+
SBLambda([symdyadic, &ii, shape,p,leg_w] (size_t nr, auto val)
|
|
1710
|
+
{
|
|
1711
|
+
for(int j=0; j <= p; j++)
|
|
1712
|
+
{
|
|
1713
|
+
shape[ii++] = val*leg_w[j]*symdyadic;
|
|
1714
|
+
}
|
|
1715
|
+
}));
|
|
1716
|
+
|
|
1717
|
+
|
|
1718
|
+
// Nedelec_1 x [0,1]
|
|
1719
|
+
DubinerBasis::EvalMult(p-2, lx[f[0]], lx[f[1]],lx[f[0]]*lx[f[1]]*lx[f[2]],
|
|
1720
|
+
SBLambda([&](int nr, auto val)
|
|
1721
|
+
{
|
|
1722
|
+
auto tmp = Du(val);
|
|
1723
|
+
Tx tmp_AD;
|
|
1724
|
+
tmp_AD.DValue(0) = tmp.Value()(0);
|
|
1725
|
+
tmp_AD.DValue(1) = tmp.Value()(1);
|
|
1726
|
+
tmp_AD.DValue(2) = tmp.Value()(2);
|
|
1727
|
+
auto symdyadic = MakeReggeAD(tmp_AD,eta);
|
|
1728
|
+
for(int j=0; j <= p; j++)
|
|
1729
|
+
shape[ii++] = leg_w[j]*symdyadic;
|
|
1730
|
+
}));
|
|
1731
|
+
|
|
1732
|
+
DubinerBasis::EvalMult(p-1, lx[f[0]], lx[f[1]], lx[f[0]],
|
|
1733
|
+
SBLambda([&ii,shape,p,leg_w,eta,f,lx](int nr, auto val)
|
|
1734
|
+
{
|
|
1735
|
+
auto tmp = wuDv_minus_wvDu (lx[f[1]], lx[f[2]], val);
|
|
1736
|
+
Tx tmp_AD;
|
|
1737
|
+
tmp_AD.DValue(0) = tmp.Value()(0);
|
|
1738
|
+
tmp_AD.DValue(1) = tmp.Value()(1);
|
|
1739
|
+
tmp_AD.DValue(2) = tmp.Value()(2);
|
|
1740
|
+
auto symdyadic = MakeReggeAD(tmp_AD,eta);
|
|
1741
|
+
for(int j=0; j <= p; j++)
|
|
1742
|
+
shape[ii++] = leg_w[j]*symdyadic;
|
|
1743
|
+
}));
|
|
1744
|
+
|
|
1745
|
+
LegendrePolynomial::EvalMult(p-1, lx[f[2]]-lx[f[1]], lx[f[2]],
|
|
1746
|
+
SBLambda([&ii,shape,p,leg_w,eta,lx,f] (int j, auto val)
|
|
1747
|
+
{
|
|
1748
|
+
auto tmp = wuDv_minus_wvDu (lx[f[1]], lx[f[0]], val);
|
|
1749
|
+
Tx tmp_AD;
|
|
1750
|
+
tmp_AD.DValue(0) = tmp.Value()(0);
|
|
1751
|
+
tmp_AD.DValue(1) = tmp.Value()(1);
|
|
1752
|
+
tmp_AD.DValue(2) = tmp.Value()(2);
|
|
1753
|
+
auto symdyadic = MakeReggeAD(tmp_AD,eta);
|
|
1754
|
+
for(int j=0; j <= p; j++)
|
|
1755
|
+
shape[ii++] = leg_w[j]*symdyadic;
|
|
1756
|
+
}));
|
|
1757
|
+
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
|
|
1763
|
+
template <typename MIP, typename TFA>
|
|
1764
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
1765
|
+
{
|
|
1766
|
+
throw Exception ("Hcurlcurlfe calcdualshape2 not implementend for element type ET_PRISM");
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
};
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
template <> class HCurlCurlFE<ET_TET> : public T_HCurlCurlFE<ET_TET>
|
|
1774
|
+
{
|
|
1775
|
+
public:
|
|
1776
|
+
using T_HCurlCurlFE<ET_TET> :: T_HCurlCurlFE;
|
|
1777
|
+
|
|
1778
|
+
virtual void ComputeNDof()
|
|
1779
|
+
{
|
|
1780
|
+
order = 0;
|
|
1781
|
+
ndof = 0;
|
|
1782
|
+
|
|
1783
|
+
for (int i=0; i<6; i++)
|
|
1784
|
+
{
|
|
1785
|
+
ndof += order_edge[i]+1;
|
|
1786
|
+
order = max2(order, order_edge[i]);
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
for (int i=0; i<4; i++)
|
|
1790
|
+
{
|
|
1791
|
+
ndof += 3*(order_facet[i][0])*(order_facet[i][0]+1)/2;
|
|
1792
|
+
order = max2(order, order_facet[i][0]);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
int p = order_inner[0];
|
|
1796
|
+
int ninner = p > 1 ? 6*(p+1)*(p)*(p-1)/6 : 0;
|
|
1797
|
+
ndof += ninner;
|
|
1798
|
+
|
|
1799
|
+
order = max2(order, p);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
template <typename Tx, typename TFA>
|
|
1805
|
+
void T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
|
|
1806
|
+
{
|
|
1807
|
+
Tx x = ip.x, y = ip.y, z = ip.z;
|
|
1808
|
+
Tx lam[4] = {x, y, z, 1-x-y-z};
|
|
1809
|
+
int ii = 0;
|
|
1810
|
+
|
|
1811
|
+
for (int i = 0; i < 6; i++)
|
|
1812
|
+
{
|
|
1813
|
+
IVec<2> e = ET_trait<ET_TET>::GetEdgeSort (i, vnums);
|
|
1814
|
+
Tx ls = lam[e[1]], le = lam[e[0]];
|
|
1815
|
+
|
|
1816
|
+
auto symdyadic = MakeReggeAD(ls, le);
|
|
1817
|
+
LegendrePolynomial::EvalScaled(order_edge[i], ls-le,ls+le, SBLambda([symdyadic, &ii, shape] (size_t nr, auto val)
|
|
1818
|
+
{
|
|
1819
|
+
shape[ii++] = -val*symdyadic;
|
|
1820
|
+
}));
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
for(int fa = 0; fa < 4; fa++)
|
|
1825
|
+
{
|
|
1826
|
+
if (order_facet[fa][0] > 0)
|
|
1827
|
+
{
|
|
1828
|
+
IVec<4> f = ET_trait<ET_TET>::GetFaceSort(fa, vnums);
|
|
1829
|
+
Tx ls = lam[f[0]], le = lam[f[1]], lt = lam[f[2]];
|
|
1830
|
+
|
|
1831
|
+
auto symdyadic1 = lt*MakeReggeAD(ls, le);
|
|
1832
|
+
auto symdyadic2 = ls*MakeReggeAD(lt, le);
|
|
1833
|
+
auto symdyadic3 = le*MakeReggeAD(ls, lt);
|
|
1834
|
+
|
|
1835
|
+
DubinerBasis::Eval(order_facet[fa][0]-1, ls,le,
|
|
1836
|
+
SBLambda([symdyadic1,symdyadic2,symdyadic3, &ii, shape] (size_t nr, auto val)
|
|
1837
|
+
{
|
|
1838
|
+
shape[ii++] = val*symdyadic1;
|
|
1839
|
+
shape[ii++] = val*symdyadic2;
|
|
1840
|
+
shape[ii++] = val*symdyadic3;
|
|
1841
|
+
}));
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
if (order_inner[0] > 1)
|
|
1846
|
+
{
|
|
1847
|
+
Tx li = lam[0], lj = lam[1], lk = lam[2], ll = lam[3];
|
|
1848
|
+
|
|
1849
|
+
auto symdyadic1 = li*lj*MakeReggeAD(lk, ll);
|
|
1850
|
+
auto symdyadic2 = lj*lk*MakeReggeAD(ll, li);
|
|
1851
|
+
auto symdyadic3 = lk*ll*MakeReggeAD(li, lj);
|
|
1852
|
+
auto symdyadic4 = ll*li*MakeReggeAD(lj, lk);
|
|
1853
|
+
auto symdyadic5 = li*lk*MakeReggeAD(lj, ll);
|
|
1854
|
+
auto symdyadic6 = lj*ll*MakeReggeAD(li, lk);
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
DubinerBasis3D::Eval (order_inner[0]-2, lam[0], lam[1], lam[2], SBLambda([&ii, shape, symdyadic1, symdyadic2, symdyadic3, symdyadic4, symdyadic5, symdyadic6](size_t j, auto val)
|
|
1858
|
+
{
|
|
1859
|
+
shape[ii++] = val*symdyadic1;
|
|
1860
|
+
shape[ii++] = val*symdyadic2;
|
|
1861
|
+
shape[ii++] = val*symdyadic3;
|
|
1862
|
+
shape[ii++] = val*symdyadic4;
|
|
1863
|
+
shape[ii++] = val*symdyadic5;
|
|
1864
|
+
shape[ii++] = val*symdyadic6;
|
|
1865
|
+
}));
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
template <typename MIP, typename TFA>
|
|
1873
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
1874
|
+
{
|
|
1875
|
+
auto & ip = mip.IP();
|
|
1876
|
+
typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
|
|
1877
|
+
T x = ip(0), y = ip(1), z = ip(2);
|
|
1878
|
+
T lam[4] = { x, y, z, 1-x-y-z };
|
|
1879
|
+
Vec<3,T> pnts[4] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } , { 0, 0, 0 } };
|
|
1880
|
+
int facetnr = ip.FacetNr();
|
|
1881
|
+
|
|
1882
|
+
int ii = 0;
|
|
1883
|
+
|
|
1884
|
+
if (ip.VB() == BBND)
|
|
1885
|
+
{ // facet shapes
|
|
1886
|
+
for (int i = 0; i < 6; i++)
|
|
1887
|
+
{
|
|
1888
|
+
int p = order_edge[i];
|
|
1889
|
+
|
|
1890
|
+
if (i == facetnr)
|
|
1891
|
+
{
|
|
1892
|
+
IVec<2> e = ET_trait<ET_TET>::GetEdgeSort (i, vnums);
|
|
1893
|
+
|
|
1894
|
+
T xi = lam[e[1]]-lam[e[0]];
|
|
1895
|
+
Vec<3,T> tauref = pnts[e[1]] - pnts[e[0]];
|
|
1896
|
+
Vec<3,T> tau = mip.GetJacobian()*tauref;
|
|
1897
|
+
Mat<3,3,T> tt = DyadProd(tau,tau);
|
|
1898
|
+
LegendrePolynomial::Eval
|
|
1899
|
+
(p, xi,
|
|
1900
|
+
SBLambda([&] (size_t nr, T val)
|
|
1901
|
+
{
|
|
1902
|
+
shape[nr+ii] = 1/mip.GetMeasure()*val*tt;
|
|
1903
|
+
}));
|
|
1904
|
+
}
|
|
1905
|
+
ii += (p+1);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
else
|
|
1909
|
+
{
|
|
1910
|
+
for (int i = 0; i < 6; i++)
|
|
1911
|
+
ii += order_edge[i]+1;
|
|
1912
|
+
}
|
|
1913
|
+
if (ip.VB() == BND)
|
|
1914
|
+
{
|
|
1915
|
+
for (int i = 0; i < 4; i++)
|
|
1916
|
+
{
|
|
1917
|
+
auto p = order_facet[i][0]-1;
|
|
1918
|
+
if( p >= 0 && i == facetnr )
|
|
1919
|
+
{
|
|
1920
|
+
IVec<4> fav = ET_trait<ET_TET>:: GetFaceSort(facetnr, vnums);
|
|
1921
|
+
Vec<3,T> adxi = pnts[fav[0]] - pnts[fav[2]];
|
|
1922
|
+
Vec<3,T> adeta = pnts[fav[1]] - pnts[fav[2]];
|
|
1923
|
+
T xi = lam[fav[0]];
|
|
1924
|
+
T eta = lam[fav[1]];
|
|
1925
|
+
|
|
1926
|
+
Matrix<T> F(3,2);
|
|
1927
|
+
F.Col(0) = adxi;
|
|
1928
|
+
F.Col(1) = adeta;
|
|
1929
|
+
|
|
1930
|
+
Matrix<T> Ftmp(2,2);
|
|
1931
|
+
Ftmp = Trans(F)*F;
|
|
1932
|
+
auto det = sqrt(Ftmp(0,0)*Ftmp(1,1)-Ftmp(1,0)*Ftmp(0,1));
|
|
1933
|
+
|
|
1934
|
+
DubinerBasis::Eval (p, xi, eta,
|
|
1935
|
+
SBLambda([&] (size_t nr, T val)
|
|
1936
|
+
{
|
|
1937
|
+
shape[ii++] = 1/(det*mip.GetMeasure())*val*Mat<3,3,T>(mip.GetJacobian()*F*Matrix<>({{1,0},{0,0}})*Trans(mip.GetJacobian()*F));
|
|
1938
|
+
shape[ii++] = 1/(det*mip.GetMeasure())*val*Mat<3,3,T>(mip.GetJacobian()*F*Matrix<>({{0,0},{0,1}})*Trans(mip.GetJacobian()*F));
|
|
1939
|
+
shape[ii++] = 1/(det*mip.GetMeasure())*val*Mat<3,3,T>(mip.GetJacobian()*F*Matrix<>({{0,1},{1,0}})*Trans(mip.GetJacobian()*F));
|
|
1940
|
+
}));
|
|
1941
|
+
}
|
|
1942
|
+
else
|
|
1943
|
+
ii += 3*(order_facet[i][0])*(order_facet[i][0]+1)/2;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
else
|
|
1947
|
+
{
|
|
1948
|
+
for (int i = 0; i < 4; i++)
|
|
1949
|
+
ii += 3*(order_facet[i][0])*(order_facet[i][0]+1)/2;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
if (ip.VB() == VOL && order_inner[0] >= 2)
|
|
1953
|
+
{
|
|
1954
|
+
DubinerBasis3D::Eval (order_inner[0]-2, lam[0], lam[1], lam[2], SBLambda([&](size_t j, T val)
|
|
1955
|
+
{
|
|
1956
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{1,0,0},{0,0,0},{0,0,0}}))*Trans(mip.GetJacobian());
|
|
1957
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{0,0,0},{0,1,0},{0,0,0}}))*Trans(mip.GetJacobian());
|
|
1958
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{0,0,0},{0,0,0},{0,0,1}}))*Trans(mip.GetJacobian());
|
|
1959
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{0,0,0},{0,0,1},{0,1,0}}))*Trans(mip.GetJacobian());
|
|
1960
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{0,0,1},{0,0,0},{1,0,0}}))*Trans(mip.GetJacobian());
|
|
1961
|
+
shape[ii++] = 1/mip.GetMeasure()*val*mip.GetJacobian()*Mat<3,3>(Matrix<>({{0,1,0},{1,0,0},{0,0,0}}))*Trans(mip.GetJacobian());
|
|
1962
|
+
}));
|
|
1963
|
+
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
};
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
template <> class HCurlCurlFE<ET_HEX> : public T_HCurlCurlFE<ET_HEX>
|
|
1971
|
+
{
|
|
1972
|
+
public:
|
|
1973
|
+
using T_HCurlCurlFE<ET_HEX> :: T_HCurlCurlFE;
|
|
1974
|
+
|
|
1975
|
+
virtual void ComputeNDof()
|
|
1976
|
+
{
|
|
1977
|
+
order = 0;
|
|
1978
|
+
ndof = 0;
|
|
1979
|
+
for (int i=0; i < 12; i++)
|
|
1980
|
+
{
|
|
1981
|
+
ndof += order_edge[i]+1;
|
|
1982
|
+
order = max2(order,order_edge[i]);
|
|
1983
|
+
}
|
|
1984
|
+
for (int i=0; i<6; i++)
|
|
1985
|
+
{
|
|
1986
|
+
ndof += order_facet[i][0]*order_facet[i][0] + 2*(order_facet[i][0]+2)*order_facet[i][0]+1;
|
|
1987
|
+
order = max2(order, order_facet[i][0]);
|
|
1988
|
+
}
|
|
1989
|
+
int p = order_inner[0];
|
|
1990
|
+
ndof += 3*(p*(p+1)*(p+1) + p*p*(p+1) );
|
|
1991
|
+
|
|
1992
|
+
order = 1 + max2(order, p);
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
template <typename Tx, typename TFA>
|
|
1997
|
+
void T_CalcShape (TIP<3,Tx> ip, TFA & shape) const
|
|
1998
|
+
{
|
|
1999
|
+
Tx x = ip.x, y = ip.y, z = ip.z;
|
|
2000
|
+
Tx lx[2] ={ 1-x, x};
|
|
2001
|
+
Tx ly[2] ={ 1-y, y};
|
|
2002
|
+
Tx lz[2] ={ 1-z, z};
|
|
2003
|
+
Tx lami[8]={(1-x)*(1-y)*(1-z),x*(1-y)*(1-z),x*y*(1-z),(1-x)*y*(1-z),
|
|
2004
|
+
(1-x)*(1-y)*z,x*(1-y)*z,x*y*z,(1-x)*y*z};
|
|
2005
|
+
Tx sigma[8]={(1-x)+(1-y)+(1-z),x+(1-y)+(1-z),x+y+(1-z),(1-x)+y+(1-z),
|
|
2006
|
+
(1-x)+(1-y)+z,x+(1-y)+z,x+y+z,(1-x)+y+z};
|
|
2007
|
+
int ii = 0;
|
|
2008
|
+
|
|
2009
|
+
const FACE * faces = ElementTopology::GetFaces(ET_HEX);
|
|
2010
|
+
|
|
2011
|
+
ArrayMem<Tx,20> leg_u(order+2), leg_v(order+2), leg_w(order+2);
|
|
2012
|
+
|
|
2013
|
+
// edges
|
|
2014
|
+
for (int i = 0; i < 12; i++)
|
|
2015
|
+
{
|
|
2016
|
+
int p = order_edge[i];
|
|
2017
|
+
IVec<2> e = ET_trait<ET_HEX>::GetEdgeSort (i, vnums);
|
|
2018
|
+
Tx xi = sigma[e[1]]-sigma[e[0]];
|
|
2019
|
+
Tx lam_e = lami[e[0]]+lami[e[1]];
|
|
2020
|
+
auto symdyadic = MakeReggeAD(xi,xi);
|
|
2021
|
+
|
|
2022
|
+
//IntLegNoBubble::
|
|
2023
|
+
LegendrePolynomial::
|
|
2024
|
+
EvalMult (p, xi, 0.25*lam_e, SBLambda ([&](int i, auto val)
|
|
2025
|
+
{
|
|
2026
|
+
shape[ii++] = val*symdyadic;
|
|
2027
|
+
}));
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
for (int i = 0; i<6; i++)
|
|
2032
|
+
{
|
|
2033
|
+
int p = order_facet[i][0];
|
|
2034
|
+
|
|
2035
|
+
Tx lam_f(0);
|
|
2036
|
+
for (int j = 0; j < 4; j++)
|
|
2037
|
+
lam_f += lami[faces[i][j]];
|
|
2038
|
+
|
|
2039
|
+
IVec<4> f = ET_trait<ET_HEX>::GetFaceSort (i, vnums);
|
|
2040
|
+
Tx xi = sigma[f[0]] - sigma[f[1]];
|
|
2041
|
+
Tx eta = sigma[f[0]] - sigma[f[3]];
|
|
2042
|
+
|
|
2043
|
+
LegendrePolynomial (p, eta, leg_u);
|
|
2044
|
+
LegendrePolynomial (p, xi, leg_v);
|
|
2045
|
+
|
|
2046
|
+
auto symdyadic = 0.25*lam_f*MakeReggeAD(eta,xi);
|
|
2047
|
+
for (int j = 0; j <= p; j++)
|
|
2048
|
+
for (int k = 0; k <= p; k++)
|
|
2049
|
+
shape[ii++] = leg_u[j]*leg_v[k]*symdyadic;
|
|
2050
|
+
|
|
2051
|
+
symdyadic = 0.25*lam_f*(1-eta*eta)*MakeReggeAD(xi,xi);
|
|
2052
|
+
for (int j = 0; j < p; j++)
|
|
2053
|
+
for (int k = 0; k <= p; k++)
|
|
2054
|
+
shape[ii++] = leg_u[j]*leg_v[k]*symdyadic;
|
|
2055
|
+
|
|
2056
|
+
symdyadic = 0.25*lam_f*(1-xi*xi)*MakeReggeAD(eta,eta);
|
|
2057
|
+
for (int k = 0; k < p; k++)
|
|
2058
|
+
for (int j = 0; j <= p; j++)
|
|
2059
|
+
shape[ii++] = leg_u[j]*leg_v[k]*symdyadic;
|
|
2060
|
+
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
int p = order_inner[0];
|
|
2064
|
+
if (p > 0)
|
|
2065
|
+
{
|
|
2066
|
+
Tx xi = sigma[0] - sigma[1];
|
|
2067
|
+
Tx eta = sigma[0] - sigma[3];
|
|
2068
|
+
Tx nv = sigma[0] - sigma[4];
|
|
2069
|
+
|
|
2070
|
+
LegendrePolynomial (p, xi, leg_u);
|
|
2071
|
+
LegendrePolynomial (p, eta, leg_v);
|
|
2072
|
+
LegendrePolynomial (p, nv, leg_w);
|
|
2073
|
+
|
|
2074
|
+
auto symdyadic1 = lz[0]*lz[1]*MakeReggeAD(eta,xi);
|
|
2075
|
+
auto symdyadic2 = lx[0]*lx[1]*MakeReggeAD(nv,eta);
|
|
2076
|
+
auto symdyadic3 = ly[0]*ly[1]*MakeReggeAD(xi,nv);
|
|
2077
|
+
for (int i = 0; i <= p; i++)
|
|
2078
|
+
for (int j = 0; j <= p; j++)
|
|
2079
|
+
for (int k = 0; k < p; k++)
|
|
2080
|
+
{
|
|
2081
|
+
shape[ii++] = leg_u[i]*leg_v[j]*leg_w[k]*symdyadic1;
|
|
2082
|
+
shape[ii++] = leg_v[i]*leg_w[j]*leg_u[k]*symdyadic2;
|
|
2083
|
+
shape[ii++] = leg_w[i]*leg_u[j]*leg_v[k]*symdyadic3;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
symdyadic1 = ly[0]*ly[1]*lz[0]*lz[1]*MakeReggeAD(xi,xi);
|
|
2087
|
+
symdyadic2 = lz[0]*lz[1]*lx[0]*lx[1]*MakeReggeAD(eta,eta);
|
|
2088
|
+
symdyadic3 = lx[0]*lx[1]*ly[0]*ly[1]*MakeReggeAD(nv,nv);
|
|
2089
|
+
|
|
2090
|
+
for (int i = 0; i <= p; i++)
|
|
2091
|
+
for (int j = 0; j < p; j++)
|
|
2092
|
+
for (int k = 0; k < p; k++)
|
|
2093
|
+
{
|
|
2094
|
+
shape[ii++] = leg_u[i]*leg_v[j]*leg_w[k]*symdyadic1;
|
|
2095
|
+
shape[ii++] = leg_v[i]*leg_w[j]*leg_u[k]*symdyadic2;
|
|
2096
|
+
shape[ii++] = leg_w[i]*leg_u[j]*leg_v[k]*symdyadic3;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
template <typename MIP, typename TFA>
|
|
2102
|
+
void CalcDualShape2 (const MIP & mip, TFA & shape) const
|
|
2103
|
+
{
|
|
2104
|
+
auto & ip = mip.IP();
|
|
2105
|
+
typedef typename std::remove_const<typename std::remove_reference<decltype(mip.IP()(0))>::type>::type T;
|
|
2106
|
+
|
|
2107
|
+
T x = ip(0), y = ip(1), z = ip(2);
|
|
2108
|
+
// T lx[4] = { 1-x, x, x, 1-x };
|
|
2109
|
+
// T ly[4] = { 1-y, 1-y, y, y };
|
|
2110
|
+
// T lz[4] = { 1-z, 1-z, z, z };
|
|
2111
|
+
// T lam[4] = { 1-x-y+x*y, x*(1-y), x*y, y*(1-x) };
|
|
2112
|
+
T sigma[8]={(1-x)+(1-y)+(1-z),x+(1-y)+(1-z),x+y+(1-z),(1-x)+y+(1-z),
|
|
2113
|
+
(1-x)+(1-y)+z,x+(1-y)+z,x+y+z,(1-x)+y+z};
|
|
2114
|
+
|
|
2115
|
+
/*Vec<2,AutoDiff<2,T>> adip = ip;
|
|
2116
|
+
auto tip = TIP<2,AutoDiffDiff<2,T>>(adip);
|
|
2117
|
+
AutoDiffDiff<2,T> xxx = tip.x, yyy = tip.y;
|
|
2118
|
+
AutoDiff<2,T> xx(xxx.Value(), &xxx.DValue(0));
|
|
2119
|
+
AutoDiff<2,T> yy(yyy.Value(), &yyy.DValue(0));
|
|
2120
|
+
AutoDiff<2,T> lami[4] = {(1-xx)*(1-yy),xx*(1-yy),xx*yy,(1-xx)*yy};
|
|
2121
|
+
AutoDiff<2,T> sigma[4] = {(1-xx)+(1-yy),xx+(1-yy),xx+yy,(1-xx)+yy}; */
|
|
2122
|
+
|
|
2123
|
+
Vec<3,T> pnts[8] = { { 0, 0, 0 }, { 1, 0, 0 }, { 1, 1, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 0, 1, 1 } };
|
|
2124
|
+
int facetnr = ip.FacetNr();
|
|
2125
|
+
|
|
2126
|
+
int ii = 0;
|
|
2127
|
+
|
|
2128
|
+
ArrayMem<T,20> v(order+2), u(order+2), w(order+2);
|
|
2129
|
+
|
|
2130
|
+
if (mip.IP().VB() == BBND)
|
|
2131
|
+
{ // edge shapes
|
|
2132
|
+
for (int i = 0; i < 12; i++)
|
|
2133
|
+
{
|
|
2134
|
+
int p = order_edge[i];
|
|
2135
|
+
|
|
2136
|
+
if (i == facetnr)
|
|
2137
|
+
{
|
|
2138
|
+
IVec<2> e = ET_trait<ET_HEX>::GetEdgeSort (i, vnums);
|
|
2139
|
+
|
|
2140
|
+
T xi = sigma[e[1]]-sigma[e[0]];
|
|
2141
|
+
Vec<3,T> tauref = pnts[e[0]] - pnts[e[1]];
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
auto tv = mip.GetJacobian()*tauref;
|
|
2145
|
+
|
|
2146
|
+
auto tt = DyadProd(tv,tv);
|
|
2147
|
+
LegendrePolynomial::Eval
|
|
2148
|
+
(p, xi,
|
|
2149
|
+
SBLambda([&] (size_t nr, T val)
|
|
2150
|
+
{
|
|
2151
|
+
shape[nr+ii] = 1/mip.GetMeasure()*val*tt;
|
|
2152
|
+
}));
|
|
2153
|
+
|
|
2154
|
+
}
|
|
2155
|
+
ii += (p+1);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
else
|
|
2159
|
+
{
|
|
2160
|
+
for (int i = 0; i < 12; i++)
|
|
2161
|
+
ii += order_edge[i]+1;
|
|
2162
|
+
}
|
|
2163
|
+
if (mip.IP().VB() == BND)
|
|
2164
|
+
{
|
|
2165
|
+
for (int i = 0; i < 6; i++)
|
|
2166
|
+
{
|
|
2167
|
+
int p = order_facet[i][0];
|
|
2168
|
+
|
|
2169
|
+
if (i == facetnr)
|
|
2170
|
+
{
|
|
2171
|
+
IVec<4> f = ET_trait<ET_HEX>::GetFaceSort (i, vnums);
|
|
2172
|
+
Vec<3,T> tauref1 = pnts[f[0]] - pnts[f[1]];
|
|
2173
|
+
Vec<3,T> tauref2 = pnts[f[0]] - pnts[f[3]];
|
|
2174
|
+
T xi = sigma[f[0]] - sigma[f[1]];
|
|
2175
|
+
T eta = sigma[f[0]] - sigma[f[3]];
|
|
2176
|
+
//Vec<6, T> symdyadic = SymDyadProd(GetGradient(etaa),GetGradient(xia));
|
|
2177
|
+
auto tv1 = mip.GetJacobian()*tauref1;
|
|
2178
|
+
auto tv2 = mip.GetJacobian()*tauref2;
|
|
2179
|
+
auto symdyadic = SymDyadProd(tv1,tv2);
|
|
2180
|
+
|
|
2181
|
+
LegendrePolynomial (p, eta, u);
|
|
2182
|
+
LegendrePolynomial (p, xi, v);
|
|
2183
|
+
for (int j = 0; j <= p; j++)
|
|
2184
|
+
for (int k = 0; k <= p; k++)
|
|
2185
|
+
shape[ii + j*(p+1) + k] = u[j]*v[k]*symdyadic;
|
|
2186
|
+
|
|
2187
|
+
/* T eta = ly[2]-ly[1];
|
|
2188
|
+
T xi = lx[1]-lx[0];
|
|
2189
|
+
LegendrePolynomial (p, eta, v);
|
|
2190
|
+
LegendrePolynomial (p, xi, u);
|
|
2191
|
+
|
|
2192
|
+
for (int i = 0; i <= p; i++)
|
|
2193
|
+
for (int j = 0; j <= p; j++)
|
|
2194
|
+
{
|
|
2195
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{0,1},{1,0}}))*Trans(mip.GetJacobian());
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
//auto symdyad = lx[1]*lx[0]*SymDyadProd(Vec<2,T>(0,1),Vec<2,T>(0,1));//x*(1-x)*(0,0, 0,1) * P(y) * P(x)
|
|
2200
|
+
for (int i = 0; i < p; i++)
|
|
2201
|
+
for (int j = 0; j <= p; j++)
|
|
2202
|
+
{
|
|
2203
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{0,0},{0,1}}))*Trans(mip.GetJacobian());
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
//symdyad = ly[2]*ly[1]*SymDyadProd(Vec<2,T>(1,0),Vec<2,T>(1,0)); //y*(1-y)*(1,0, 0,0) * P(x) * P(y)
|
|
2207
|
+
|
|
2208
|
+
for (int j = 0; j < p; j++)
|
|
2209
|
+
for (int i = 0; i <= p; i++)
|
|
2210
|
+
{
|
|
2211
|
+
shape[ii++] = 1/mip.GetMeasure()*u[i]*v[j]*mip.GetJacobian()*Mat<2,2>(Matrix<>({{1,0},{0,0}}))*Trans(mip.GetJacobian());
|
|
2212
|
+
}*/
|
|
2213
|
+
}
|
|
2214
|
+
ii += p*p + (p+2)*p*2 + 1;
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
else
|
|
2218
|
+
{
|
|
2219
|
+
for (int i = 0; i < 6; i++)
|
|
2220
|
+
ii += order_facet[i][0]*order_facet[i][0] + (order_facet[i][0]+2)*order_facet[i][0]*2 + 1;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
if (mip.IP().VB() == VOL)
|
|
2224
|
+
{
|
|
2225
|
+
if (order_inner[0])
|
|
2226
|
+
throw Exception ("Hcurlcurlfe calcdualshape2 not implementend for element type ET_HEX for high-order");
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2232
|
+
|
|
2233
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_SEGM>;
|
|
2234
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_TRIG>;
|
|
2235
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_QUAD>;
|
|
2236
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_TET>;
|
|
2237
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_PRISM>;
|
|
2238
|
+
HCURLCURLFE_EXTERN template class T_HCurlCurlFE<ET_HEX>;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
#endif
|