ngsolve 6.2.2501.post21.dev1__cp313-cp313-macosx_10_15_universal2.whl → 6.2.2501.post37.dev1__cp313-cp313-macosx_10_15_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ngsolve might be problematic. Click here for more details.

Files changed (286) hide show
  1. ngsolve/webgui.py +1 -1
  2. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/METADATA +2 -2
  3. ngsolve-6.2.2501.post37.dev1.dist-info/RECORD +25 -0
  4. netgen/include/arnoldi.hpp +0 -55
  5. netgen/include/bandmatrix.hpp +0 -334
  6. netgen/include/basematrix.hpp +0 -957
  7. netgen/include/basevector.hpp +0 -1268
  8. netgen/include/bdbequations.hpp +0 -2752
  9. netgen/include/bdbintegrator.hpp +0 -1659
  10. netgen/include/bessel.hpp +0 -1064
  11. netgen/include/bilinearform.hpp +0 -963
  12. netgen/include/bla.hpp +0 -29
  13. netgen/include/blockalloc.hpp +0 -95
  14. netgen/include/blockjacobi.hpp +0 -316
  15. netgen/include/bspline.hpp +0 -114
  16. netgen/include/calcinverse.hpp +0 -141
  17. netgen/include/cg.hpp +0 -368
  18. netgen/include/chebyshev.hpp +0 -44
  19. netgen/include/cholesky.hpp +0 -720
  20. netgen/include/clapack.h +0 -7254
  21. netgen/include/code_generation.hpp +0 -296
  22. netgen/include/coefficient.hpp +0 -2006
  23. netgen/include/coefficient_impl.hpp +0 -18
  24. netgen/include/coefficient_stdmath.hpp +0 -157
  25. netgen/include/commutingAMG.hpp +0 -106
  26. netgen/include/comp.hpp +0 -79
  27. netgen/include/compatibility.hpp +0 -41
  28. netgen/include/complex_wrapper.hpp +0 -73
  29. netgen/include/compressedfespace.hpp +0 -110
  30. netgen/include/contact.hpp +0 -231
  31. netgen/include/diagonalmatrix.hpp +0 -154
  32. netgen/include/differentialoperator.hpp +0 -276
  33. netgen/include/diffop.hpp +0 -1286
  34. netgen/include/diffop_impl.hpp +0 -326
  35. netgen/include/discontinuous.hpp +0 -84
  36. netgen/include/dump.hpp +0 -949
  37. netgen/include/eigen.hpp +0 -60
  38. netgen/include/eigensystem.hpp +0 -18
  39. netgen/include/elasticity_equations.hpp +0 -595
  40. netgen/include/elementbyelement.hpp +0 -195
  41. netgen/include/elementtopology.hpp +0 -1760
  42. netgen/include/elementtransformation.hpp +0 -339
  43. netgen/include/evalfunc.hpp +0 -405
  44. netgen/include/expr.hpp +0 -1655
  45. netgen/include/facetfe.hpp +0 -175
  46. netgen/include/facetfespace.hpp +0 -178
  47. netgen/include/facethofe.hpp +0 -111
  48. netgen/include/facetsurffespace.hpp +0 -112
  49. netgen/include/fe_interfaces.hpp +0 -32
  50. netgen/include/fem.hpp +0 -87
  51. netgen/include/fesconvert.hpp +0 -14
  52. netgen/include/fespace.hpp +0 -1445
  53. netgen/include/finiteelement.hpp +0 -286
  54. netgen/include/globalinterfacespace.hpp +0 -77
  55. netgen/include/globalspace.hpp +0 -115
  56. netgen/include/gridfunction.hpp +0 -525
  57. netgen/include/h1amg.hpp +0 -41
  58. netgen/include/h1hofe.hpp +0 -188
  59. netgen/include/h1hofe_impl.hpp +0 -1262
  60. netgen/include/h1hofefo.hpp +0 -148
  61. netgen/include/h1hofefo_impl.hpp +0 -185
  62. netgen/include/h1hofespace.hpp +0 -167
  63. netgen/include/h1lofe.hpp +0 -1237
  64. netgen/include/h1lumping.hpp +0 -35
  65. netgen/include/hcurl_equations.hpp +0 -1352
  66. netgen/include/hcurlcurlfe.hpp +0 -2221
  67. netgen/include/hcurlcurlfespace.hpp +0 -78
  68. netgen/include/hcurlfe.hpp +0 -259
  69. netgen/include/hcurlfe_utils.hpp +0 -107
  70. netgen/include/hcurlhdiv_dshape.hpp +0 -857
  71. netgen/include/hcurlhdivfes.hpp +0 -308
  72. netgen/include/hcurlhofe.hpp +0 -175
  73. netgen/include/hcurlhofe_impl.hpp +0 -1871
  74. netgen/include/hcurlhofespace.hpp +0 -193
  75. netgen/include/hcurllofe.hpp +0 -1146
  76. netgen/include/hdiv_equations.hpp +0 -865
  77. netgen/include/hdivdivfe.hpp +0 -2923
  78. netgen/include/hdivdivsurfacespace.hpp +0 -76
  79. netgen/include/hdivfe.hpp +0 -206
  80. netgen/include/hdivfe_utils.hpp +0 -716
  81. netgen/include/hdivfes.hpp +0 -75
  82. netgen/include/hdivhofe.hpp +0 -447
  83. netgen/include/hdivhofe_impl.hpp +0 -1107
  84. netgen/include/hdivhofefo.hpp +0 -229
  85. netgen/include/hdivhofespace.hpp +0 -175
  86. netgen/include/hdivhosurfacefespace.hpp +0 -106
  87. netgen/include/hdivlofe.hpp +0 -773
  88. netgen/include/hidden.hpp +0 -74
  89. netgen/include/householder.hpp +0 -181
  90. netgen/include/hypre_ams_precond.hpp +0 -123
  91. netgen/include/hypre_precond.hpp +0 -73
  92. netgen/include/integrator.hpp +0 -2024
  93. netgen/include/integratorcf.hpp +0 -253
  94. netgen/include/interpolate.hpp +0 -49
  95. netgen/include/intrule.hpp +0 -2541
  96. netgen/include/irspace.hpp +0 -49
  97. netgen/include/jacobi.hpp +0 -136
  98. netgen/include/l2hofe.hpp +0 -193
  99. netgen/include/l2hofe_impl.hpp +0 -564
  100. netgen/include/l2hofefo.hpp +0 -542
  101. netgen/include/l2hofespace.hpp +0 -344
  102. netgen/include/la.hpp +0 -38
  103. netgen/include/linearform.hpp +0 -266
  104. netgen/include/matrix.hpp +0 -2140
  105. netgen/include/memusage.hpp +0 -41
  106. netgen/include/meshaccess.hpp +0 -1358
  107. netgen/include/mgpre.hpp +0 -204
  108. netgen/include/mptools.hpp +0 -2145
  109. netgen/include/multigrid.hpp +0 -42
  110. netgen/include/multivector.hpp +0 -447
  111. netgen/include/mumpsinverse.hpp +0 -187
  112. netgen/include/mycomplex.hpp +0 -361
  113. netgen/include/ng_lapack.hpp +0 -1661
  114. netgen/include/ngblas.hpp +0 -1099
  115. netgen/include/ngs_defines.hpp +0 -30
  116. netgen/include/ngs_stdcpp_include.hpp +0 -106
  117. netgen/include/ngs_utils.hpp +0 -121
  118. netgen/include/ngsobject.hpp +0 -1019
  119. netgen/include/ngsstream.hpp +0 -113
  120. netgen/include/ngstd.hpp +0 -72
  121. netgen/include/nodalhofe.hpp +0 -96
  122. netgen/include/nodalhofe_impl.hpp +0 -141
  123. netgen/include/normalfacetfe.hpp +0 -223
  124. netgen/include/normalfacetfespace.hpp +0 -98
  125. netgen/include/normalfacetsurfacefespace.hpp +0 -84
  126. netgen/include/order.hpp +0 -251
  127. netgen/include/parallel_matrices.hpp +0 -222
  128. netgen/include/paralleldofs.hpp +0 -340
  129. netgen/include/parallelngs.hpp +0 -23
  130. netgen/include/parallelvector.hpp +0 -269
  131. netgen/include/pardisoinverse.hpp +0 -200
  132. netgen/include/periodic.hpp +0 -125
  133. netgen/include/plateaufespace.hpp +0 -25
  134. netgen/include/pml.hpp +0 -275
  135. netgen/include/pmltrafo.hpp +0 -631
  136. netgen/include/postproc.hpp +0 -142
  137. netgen/include/precomp.hpp +0 -60
  138. netgen/include/preconditioner.hpp +0 -602
  139. netgen/include/prolongation.hpp +0 -235
  140. netgen/include/python_comp.hpp +0 -107
  141. netgen/include/python_fem.hpp +0 -89
  142. netgen/include/python_linalg.hpp +0 -58
  143. netgen/include/python_ngstd.hpp +0 -385
  144. netgen/include/recursive_pol.hpp +0 -4844
  145. netgen/include/recursive_pol_tet.hpp +0 -395
  146. netgen/include/recursive_pol_trig.hpp +0 -492
  147. netgen/include/reorderedfespace.hpp +0 -81
  148. netgen/include/sample_sort.hpp +0 -105
  149. netgen/include/scalarfe.hpp +0 -335
  150. netgen/include/shapefunction_utils.hpp +0 -113
  151. netgen/include/simd_complex.hpp +0 -284
  152. netgen/include/smoother.hpp +0 -253
  153. netgen/include/solve.hpp +0 -89
  154. netgen/include/sparsecholesky.hpp +0 -313
  155. netgen/include/sparsematrix.hpp +0 -1038
  156. netgen/include/sparsematrix_dyn.hpp +0 -91
  157. netgen/include/sparsematrix_impl.hpp +0 -920
  158. netgen/include/special_matrix.hpp +0 -461
  159. netgen/include/specialelement.hpp +0 -125
  160. netgen/include/statushandler.hpp +0 -33
  161. netgen/include/stringops.hpp +0 -12
  162. netgen/include/superluinverse.hpp +0 -136
  163. netgen/include/symbolicintegrator.hpp +0 -849
  164. netgen/include/symmetricmatrix.hpp +0 -144
  165. netgen/include/tangentialfacetfe.hpp +0 -224
  166. netgen/include/tangentialfacetfespace.hpp +0 -106
  167. netgen/include/tensor.hpp +0 -522
  168. netgen/include/tensorcoefficient.hpp +0 -446
  169. netgen/include/tensorproductintegrator.hpp +0 -113
  170. netgen/include/thcurlfe.hpp +0 -128
  171. netgen/include/thcurlfe_impl.hpp +0 -380
  172. netgen/include/thdivfe.hpp +0 -80
  173. netgen/include/thdivfe_impl.hpp +0 -426
  174. netgen/include/tpdiffop.hpp +0 -461
  175. netgen/include/tpfes.hpp +0 -133
  176. netgen/include/tpintrule.hpp +0 -224
  177. netgen/include/triangular.hpp +0 -465
  178. netgen/include/tscalarfe.hpp +0 -245
  179. netgen/include/tscalarfe_impl.hpp +0 -1029
  180. netgen/include/umfpackinverse.hpp +0 -148
  181. netgen/include/vector.hpp +0 -1219
  182. netgen/include/voxelcoefficientfunction.hpp +0 -41
  183. netgen/include/vtkoutput.hpp +0 -198
  184. netgen/include/vvector.hpp +0 -208
  185. netgen/include/webgui.hpp +0 -92
  186. netgen/libngbla.dylib +0 -0
  187. netgen/libngcomp.dylib +0 -0
  188. netgen/libngfem.dylib +0 -0
  189. netgen/libngla.dylib +0 -0
  190. netgen/libngsolve.dylib +0 -0
  191. netgen/libngstd.dylib +0 -0
  192. ngsolve/__init__.pyi +0 -231
  193. ngsolve/bla.pyi +0 -1139
  194. ngsolve/bvp.pyi +0 -32
  195. ngsolve/cmake/NGSolveConfig.cmake +0 -102
  196. ngsolve/cmake/ngsolve-targets-release.cmake +0 -69
  197. ngsolve/cmake/ngsolve-targets.cmake +0 -163
  198. ngsolve/comp/__init__.pyi +0 -5382
  199. ngsolve/comp/pml.pyi +0 -89
  200. ngsolve/config/__init__.py +0 -1
  201. ngsolve/config/__init__.pyi +0 -43
  202. ngsolve/config/__main__.py +0 -4
  203. ngsolve/config/config.py +0 -60
  204. ngsolve/config/config.pyi +0 -45
  205. ngsolve/demos/TensorProduct/__init__.py +0 -0
  206. ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +0 -80
  207. ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +0 -73
  208. ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +0 -72
  209. ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +0 -66
  210. ngsolve/demos/__init__.py +0 -0
  211. ngsolve/demos/howto/__init__.py +0 -0
  212. ngsolve/demos/howto/hhj.py +0 -44
  213. ngsolve/demos/howto/hybrid_dg.py +0 -53
  214. ngsolve/demos/howto/mixed.py +0 -30
  215. ngsolve/demos/howto/nonlin.py +0 -29
  216. ngsolve/demos/howto/pickling.py +0 -26
  217. ngsolve/demos/howto/pml.py +0 -31
  218. ngsolve/demos/howto/taskmanager.py +0 -20
  219. ngsolve/demos/howto/tdnns.py +0 -47
  220. ngsolve/demos/howto/timeDG-skeleton.py +0 -45
  221. ngsolve/demos/howto/timeDG.py +0 -38
  222. ngsolve/demos/howto/timeDGlap.py +0 -42
  223. ngsolve/demos/howto/timeDGwave.py +0 -61
  224. ngsolve/demos/intro/__init__.py +0 -0
  225. ngsolve/demos/intro/adaptive.py +0 -123
  226. ngsolve/demos/intro/cmagnet.py +0 -62
  227. ngsolve/demos/intro/elasticity.py +0 -76
  228. ngsolve/demos/intro/navierstokes.py +0 -74
  229. ngsolve/demos/intro/poisson.ipynb +0 -170
  230. ngsolve/demos/intro/poisson.py +0 -41
  231. ngsolve/demos/mpi/__init__.py +0 -0
  232. ngsolve/demos/mpi/mpi_cmagnet.py +0 -87
  233. ngsolve/demos/mpi/mpi_navierstokes.py +0 -117
  234. ngsolve/demos/mpi/mpi_poisson.py +0 -89
  235. ngsolve/demos/mpi/mpi_timeDG.py +0 -82
  236. ngsolve/directsolvers.pyi +0 -18
  237. ngsolve/eigenvalues.pyi +0 -30
  238. ngsolve/fem.pyi +0 -1707
  239. ngsolve/krylovspace.pyi +0 -309
  240. ngsolve/la.pyi +0 -1218
  241. ngsolve/ngslib.so +0 -0
  242. ngsolve/ngstd.pyi +0 -58
  243. ngsolve/nonlinearsolvers.pyi +0 -98
  244. ngsolve/preconditioners.pyi +0 -6
  245. ngsolve/solve.pyi +0 -108
  246. ngsolve/solvers.pyi +0 -14
  247. ngsolve/timestepping.pyi +0 -34
  248. ngsolve/timing.pyi +0 -57
  249. ngsolve/utils.pyi +0 -279
  250. ngsolve-6.2.2501.post21.dev1.data/data/Netgen.icns +0 -0
  251. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngscxx +0 -17
  252. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngsld +0 -13
  253. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngsolve.tcl +0 -648
  254. ngsolve-6.2.2501.post21.dev1.data/data/bin/ngspy +0 -2
  255. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/beam.geo +0 -17
  256. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/beam.vol +0 -240
  257. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/chip.in2d +0 -41
  258. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/chip.vol +0 -614
  259. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coil.geo +0 -12
  260. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coil.vol +0 -2560
  261. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coilshield.geo +0 -24
  262. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/coilshield.vol +0 -3179
  263. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/cube.geo +0 -19
  264. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/cube.vol +0 -1832
  265. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d10_DGdoubleglazing.pde +0 -50
  266. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d11_chip_nitsche.pde +0 -40
  267. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d1_square.pde +0 -43
  268. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d2_chip.pde +0 -35
  269. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d3_helmholtz.pde +0 -22
  270. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d4_cube.pde +0 -46
  271. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d5_beam.pde +0 -74
  272. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d6_shaft.pde +0 -73
  273. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d7_coil.pde +0 -50
  274. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d8_coilshield.pde +0 -49
  275. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/d9_hybridDG.pde +0 -72
  276. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/doubleglazing.in2d +0 -27
  277. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/doubleglazing.vol +0 -737
  278. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  279. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/shaft.geo +0 -73
  280. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/shaft.vol +0 -4291
  281. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/square.in2d +0 -17
  282. ngsolve-6.2.2501.post21.dev1.data/data/share/ngsolve/square.vol +0 -149
  283. ngsolve-6.2.2501.post21.dev1.dist-info/RECORD +0 -304
  284. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/LICENSE +0 -0
  285. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/WHEEL +0 -0
  286. {ngsolve-6.2.2501.post21.dev1.dist-info → ngsolve-6.2.2501.post37.dev1.dist-info}/top_level.txt +0 -0
@@ -1,963 +0,0 @@
1
- #ifndef FILE_BILINEARFORM
2
- #define FILE_BILINEARFORM
3
-
4
- /*********************************************************************/
5
- /* File: bilinearform.hpp */
6
- /* Author: Joachim Schoeberl */
7
- /* Date: 25. Mar. 2000 */
8
- /*********************************************************************/
9
-
10
-
11
- #include "fespace.hpp"
12
- #include <specialelement.hpp>
13
- #include <sparsematrix.hpp>
14
- #include <elementbyelement.hpp>
15
-
16
-
17
- namespace ngcomp
18
- {
19
- class LinearForm;
20
- class Preconditioner;
21
-
22
-
23
- /**
24
- A bilinear-form.
25
- A bilinear-form provides the system matrix.
26
- It knows about its definition in terms of integrators.
27
- In most cases, it is defined on two copies of the same space V,
28
- but it can also live on V x W.
29
- */
30
- class NGS_DLL_HEADER BilinearForm : public NGS_Object
31
- {
32
- protected:
33
- /// Finite element space
34
- shared_ptr<FESpace> fespace;
35
- /// Test-space if different from trial-space, otherwise NULL
36
- shared_ptr<FESpace> fespace2;
37
-
38
- /// don't assemble matrix
39
- bool nonassemble;
40
- /// store only diagonal of matrix
41
- bool diagonal = false;
42
- /// element-matrix for ref-elements
43
- bool geom_free = false;
44
- /// stores geom-free B factors, and D factors in integration points
45
- bool matrix_free_bdb = false;
46
- /// stores geom-free B factors, and D factors in integration points, and compiled CF
47
- bool nonlinear_matrix_free_bdb = false;
48
- /// store matrices on mesh hierarchy
49
- bool multilevel;
50
- /// galerkin projection of coarse grid matrices
51
- bool galerkin;
52
- /// complex forms are hermitean (non operational)
53
- bool hermitean;
54
- /// bilinear form is symmetric
55
- bool symmetric;
56
- /// bilinear form is symmetric and positive definite (experimental)
57
- bool spd;
58
- /// add epsilon for regularization
59
- double eps_regularization;
60
- /// diagonal value for unused dofs
61
- double unuseddiag;
62
- /// check if all dofs declared used are used in assemble
63
- bool check_unused = true;
64
- /// low order bilinear-form, 0 if not used
65
- shared_ptr<BilinearForm> low_order_bilinear_form;
66
-
67
- /// modify linear form due to static condensation
68
- LinearForm * linearform;
69
-
70
- /// some preconditioners need element matrices
71
- Array<Preconditioner*> preconditioners;
72
-
73
- /// matrices (sparse, application, diagonal, ...)
74
- Array<shared_ptr<BaseMatrix>> mats;
75
- size_t graph_timestamp = 0;
76
-
77
- /// bilinearform-integrators
78
- Array<shared_ptr<BilinearFormIntegrator>> parts;
79
- Array<shared_ptr<BilinearFormIntegrator>> VB_parts[4];
80
-
81
- // loop over facets, VB=0 .. inner facets, VB=1 .. boundary facets
82
- Array<shared_ptr<FacetBilinearFormIntegrator>> facetwise_skeleton_parts[2];
83
-
84
- // geometry-free parts (only for apply)
85
- Array<shared_ptr<BilinearFormIntegrator>> geom_free_parts;
86
-
87
- // loop over elements
88
- Array<shared_ptr<FacetBilinearFormIntegrator>> elementwise_skeleton_parts;
89
-
90
- // #ifdef PARALLEL
91
- Array<shared_ptr<FacetBilinearFormIntegrator> > mpi_facet_parts;
92
- // #endif
93
-
94
- /// special elements for hacks (used for contact, periodic-boundary-penalty-constraints, ...
95
- Array<unique_ptr<SpecialElement>> specialelements;
96
- mutable unique_ptr<Table<int>> special_element_coloring;
97
-
98
- size_t specialelements_timestamp = 0;
99
-
100
-
101
- /*
102
- Array<BilinearFormIntegrator*> independent_parts;
103
- Array<bool> independent_parts_deletable;
104
- Array< Vec<2,int> > independent_meshindex;
105
- */
106
-
107
- /// does some timing in assemble
108
- bool timing;
109
- /// prints assembled matrix to testout
110
- bool print;
111
- /// prints element matrices to testout
112
- bool printelmat;
113
- /// calculates eigenvalues of element matrices
114
- bool elmat_ev;
115
- /// does static condensation of internal dofs
116
- bool eliminate_internal;
117
- /// does static condensation of hidden dofs
118
- bool eliminate_hidden;
119
- /// keeps matrices for reconstruction of internal dofs
120
- bool keep_internal;
121
- /// should A_ii itself be stored?!
122
- bool store_inner;
123
-
124
- /// precomputes some data for each element
125
- bool precompute;
126
- /// precomputed element-wise data
127
- Array<void*> precomputed_data;
128
- /// output of norm of matrix entries
129
- bool checksum;
130
- ///
131
- optional<double> delete_zero_elements;
132
-
133
- mutable std::map<size_t, Matrix<>> precomputed;
134
- public:
135
- /// generate a bilinear-form
136
- BilinearForm (shared_ptr<FESpace> afespace,
137
- const string & aname,
138
- const Flags & flags);
139
-
140
- /// generate a bilinear-form
141
- BilinearForm (shared_ptr<FESpace> afespace,
142
- shared_ptr<FESpace> afespace2,
143
- const string & aname,
144
- const Flags & flags);
145
- BilinearForm (const BilinearForm&) = delete;
146
- BilinearForm& operator= (const BilinearForm&) = delete;
147
- virtual ~BilinearForm ();
148
-
149
-
150
- ///
151
- virtual BilinearForm & AddIntegrator (shared_ptr<BilinearFormIntegrator> bfi);
152
-
153
- BilinearForm & operator+= (shared_ptr<BilinearFormIntegrator> bfi)
154
- {
155
- return AddIntegrator(bfi);
156
- }
157
-
158
- /*
159
- void AddIndependentIntegrator (BilinearFormIntegrator * bfi,
160
- const int master_surface,
161
- const int other)
162
- */
163
-
164
- const Array<shared_ptr<BilinearFormIntegrator>> & Integrators() const
165
- {
166
- return parts;
167
- }
168
-
169
- ///
170
- int NumIntegrators () const
171
- {
172
- return parts.Size();
173
- }
174
-
175
- /*
176
- int NumIndependentIntegrators(void) const {return independent_parts.Size();}
177
- */
178
-
179
- /// the i-th integrator
180
- shared_ptr<BilinearFormIntegrator> GetIntegrator (int i) const { return parts[i]; }
181
-
182
- // const BilinearFormIntegrator * GetIntegrator (int i) const { return parts[i]; }
183
-
184
-
185
- /*
186
- BilinearFormIntegrator * GetIndependentIntegrator (const int i)
187
- { return independent_parts[i]; }
188
-
189
- const BilinearFormIntegrator * GetIndependentIntegrator (const int i) const
190
- { return independent_parts[i]; }
191
-
192
- int GetIndependentMasterSurfaceIndex(const int i) const
193
- {
194
- return independent_meshindex[i](0);
195
- }
196
- int GetIndependentOtherIndex(const int i) const
197
- {
198
- return independent_meshindex[i](1);
199
- }
200
- */
201
-
202
- void AddSpecialElement (unique_ptr<SpecialElement> spel);
203
- auto & GetSpecialElements() const { return specialelements; }
204
- void DeleteSpecialElement(size_t index);
205
- void DeleteSpecialElements();
206
- Table<int> & SpecialElementColoring() const;
207
-
208
- /// for static condensation of internal bubbles
209
- void SetLinearForm (LinearForm * alf) { linearform = alf; }
210
-
211
- /// preconditioner gets element-matrix
212
- void SetPreconditioner (Preconditioner * pre);
213
-
214
- /// unregister preconditioner
215
- void UnsetPreconditioner(Preconditioner* pre);
216
-
217
- /// generates matrix graph
218
- virtual MatrixGraph GetGraph (int level, bool symmetric);
219
-
220
- /// assembles the matrix
221
- void Assemble (LocalHeap & lh);
222
-
223
- /// re-assembles the matrix.
224
- /// if reallocate is false, the existing matrix is reused
225
- void ReAssemble (LocalHeap & lh, bool reallocate = 0);
226
-
227
- /// assembles matrix at linearization point given by lin
228
- /// needed for Newton's method
229
- virtual void AssembleLinearization (const BaseVector & lin,
230
- LocalHeap & lh,
231
- bool reallocate = 0) = 0;
232
-
233
- /// applies the matrix without assembling
234
- void ApplyMatrix (const BaseVector & x,
235
- BaseVector & y, LocalHeap & lh) const
236
- {
237
- x.Cumulate();
238
- y = 0;
239
- AddMatrix (1, x, y, lh);
240
- y.SetParallelStatus(DISTRIBUTED);
241
- }
242
-
243
- /// y += val * Mat * x
244
- virtual void AddMatrix (double val, const BaseVector & x,
245
- BaseVector & y, LocalHeap & lh) const = 0;
246
-
247
- /// y += val * Mat * x
248
- virtual void AddMatrix (Complex val, const BaseVector & x,
249
- BaseVector & y, LocalHeap & lh) const = 0;
250
-
251
- /// y += val * Mat^T * x
252
- virtual void AddMatrixTrans (double val, const BaseVector & x,
253
- BaseVector & y, LocalHeap & lh) const = 0;
254
-
255
- /// y += val * lin.mat * x
256
- virtual void ApplyLinearizedMatrixAdd (double val,
257
- const BaseVector & lin,
258
- const BaseVector & x,
259
- BaseVector & y, LocalHeap & lh) const = 0;
260
- /// y += val * lin.mat * x
261
- virtual void ApplyLinearizedMatrixAdd (Complex val,
262
- const BaseVector & lin,
263
- const BaseVector & x,
264
- BaseVector & y, LocalHeap & lh) const = 0;
265
-
266
- /// evaulates internal energy (usually 1/2 x^T A x)
267
- virtual double Energy (const BaseVector & x, LocalHeap & lh) const = 0;
268
-
269
- /// returns the assembled matrix
270
- const BaseMatrix & GetMatrix () const { return *mats.Last(); }
271
- const BaseMatrix & GetMatrix (int level) const { return *mats[level]; }
272
- void DeleteMatrix()
273
- {
274
- if(mats.Size())
275
- mats.DeleteLast();
276
- }
277
- /// returns the assembled matrix
278
- shared_ptr<BaseMatrix> GetMatrixPtr () const;
279
-
280
- // operator const BaseMatrix& () const { return GetMatrix(); }
281
-
282
- /// returns the assembled matrix on a given level
283
- shared_ptr<BaseMatrix> GetMatrixPtr (int level) const { return mats[level]; }
284
-
285
- BaseMatrix & GetMatrix () { return *mats.Last(); }
286
- BaseMatrix & GetMatrix (int level) { return *mats[level]; }
287
-
288
- /// reconstruct internal dofs from static condensation
289
- /// -A_ii^{-1} A_ib
290
- virtual shared_ptr<BaseMatrix> GetHarmonicExtension () const = 0;
291
-
292
- /// modify rhs doue to static condensation.
293
- /// -A_bi A_ii^{-1}
294
- /// stored only for non-symmetric biforms
295
- virtual shared_ptr<BaseMatrix> GetHarmonicExtensionTrans () const = 0;
296
-
297
- /// returns inverse of A_ii
298
- virtual shared_ptr<BaseMatrix> GetInnerSolve () const = 0;
299
-
300
- /// returns A_ii
301
- virtual shared_ptr<BaseMatrix> GetInnerMatrix () const = 0;
302
-
303
- /// is there a low-order biform ?
304
- bool HasLowOrderBilinearForm () const { return low_order_bilinear_form != NULL; }
305
-
306
- /// returns the low-order biform, if we can provide it ...
307
- virtual shared_ptr<BilinearForm> GetLowOrderBilinearForm()
308
- {
309
- return low_order_bilinear_form;
310
- }
311
-
312
-
313
- /// use static condensation ?
314
- bool UsesEliminateInternal () const { return eliminate_internal; }
315
-
316
- /// use static condensation for hidden?
317
- bool UsesEliminateHidden () const { return eliminate_hidden; }
318
-
319
- /// stores the matrices for reconstructing internal dofs ?
320
- bool UsesKeepInternal () const { return keep_internal; }
321
-
322
- /// does it store Aii ?
323
- bool UsesStoreInner () const { return store_inner; }
324
-
325
-
326
- /// the finite element space
327
- // const FESpace & GetFESpace() const { return *fespace; }
328
-
329
-
330
- /// uses mixed spaces (non operational)
331
- bool MixedSpaces () const { return fespace2 != NULL; }
332
-
333
- /// returns the second space (form mixed spaces)
334
- // const FESpace & GetFESpace2() const { return *fespace2; }
335
-
336
- /// the finite element space
337
- shared_ptr<FESpace> GetFESpace() const { return fespace; }
338
- /// the finite element test space
339
- shared_ptr<FESpace> GetFESpace2() const { return fespace2; }
340
-
341
- shared_ptr<FESpace> GetTrialSpace() const { return fespace; }
342
- shared_ptr<FESpace> GetTestSpace() const { return fespace2 ? fespace2 : fespace; }
343
- ///
344
- int GetNLevels() const { return mats.Size(); }
345
-
346
- /// is the form symmetric ?
347
- bool IsSymmetric() const { return symmetric; }
348
-
349
- /// is the form symmetric and positive definite ?
350
- bool IsSPD() const { return spd; }
351
-
352
- ///
353
- virtual bool SymmetricStorage() const { return false; }
354
-
355
- /// don't assemble the matrix
356
- void SetNonAssemble (bool na = true) { nonassemble = na; }
357
- bool NonAssemble() const { return nonassemble; }
358
-
359
- ///
360
- void SetGalerkin (bool agalerkin = true) { galerkin = agalerkin; }
361
-
362
- ///
363
- void SetDiagonal (bool adiagonal = true) { diagonal = adiagonal; }
364
-
365
- ///
366
- void SetSymmetric (bool asymmetric = true) { symmetric = asymmetric; }
367
-
368
- ///
369
- void SetHermitean (bool ahermitean = true) { hermitean = ahermitean; }
370
-
371
- ///
372
- void SetMultiLevel (bool amultilevel = 1) { multilevel = amultilevel; }
373
-
374
- ///
375
- void SetTiming (bool at) { timing = at; }
376
-
377
- void SetEliminateInternal (bool eliminate)
378
- { eliminate_internal = eliminate; }
379
-
380
- void SetEliminateHidden (bool eliminate)
381
- { eliminate_hidden = eliminate; }
382
-
383
- void SetKeepInternal (bool keep)
384
- { keep_internal = keep; }
385
-
386
- void SetStoreInner (bool storei)
387
- { store_inner = storei; }
388
-
389
- void SetPrint (bool ap);
390
- void SetPrintElmat (bool ap);
391
- void SetElmatEigenValues (bool ee);
392
- void SetCheckUnused (bool b);
393
-
394
- /// computes low-order matrices from fines matrix
395
- void GalerkinProjection ();
396
-
397
- /// reconstruct internal dofs
398
- virtual void ComputeInternal (BaseVector & u, const BaseVector & f, LocalHeap & lh) const = 0;
399
-
400
- /// modify rhs due to static condensation
401
- virtual void ModifyRHS (BaseVector & f) const = 0;
402
-
403
-
404
-
405
- /// add eps I to the assembled matrix
406
- void SetEpsRegularization(double val) { eps_regularization = val; }
407
-
408
- /// set matrix diagonal for unused dofs to this value
409
- void SetUnusedDiag (double val) { unuseddiag = val; }
410
-
411
- /// does it use Galerkin projection ?
412
- bool UseGalerkin () const { return galerkin; }
413
-
414
- /// biform object
415
- virtual string GetClassName () const
416
- {
417
- return "BilinearForm";
418
- }
419
-
420
- /// prints report to file
421
- virtual void PrintReport (ostream & ost) const;
422
-
423
- ///
424
- virtual Array<MemoryUsage> GetMemoryUsage () const;
425
-
426
- /// creates a compatible vector
427
- virtual AutoVector CreateRowVector() const;
428
- virtual AutoVector CreateColVector() const;
429
-
430
- /// frees matrix
431
- virtual void CleanUpLevel() { ; }
432
-
433
- protected:
434
- /// assemble matrix
435
- virtual void DoAssemble (LocalHeap & lh) = 0;
436
- void AssembleGF (LocalHeap & lh);
437
- void AssembleBDB (LocalHeap & lh, bool linear);
438
-
439
- /// allocates (sparse) matrix data-structure
440
- virtual void AllocateMatrix () = 0;
441
- virtual void AllocateInternalMatrices () = 0;
442
- };
443
-
444
-
445
-
446
-
447
-
448
-
449
- /**
450
- We specify the scalar (double or Complex) of the biform.
451
- */
452
- template <class SCAL>
453
- class NGS_DLL_HEADER S_BilinearForm : public BilinearForm
454
- {
455
- protected:
456
-
457
- // have parallel wrapper for distributed meshes:
458
- shared_ptr<BaseMatrix> harmonicext;
459
- shared_ptr<BaseMatrix> harmonicexttrans;
460
- shared_ptr<BaseMatrix> innersolve;
461
- shared_ptr<BaseMatrix> innermatrix;
462
-
463
- // local operators:
464
- ElementByElementMatrix<SCAL> *harmonicext_ptr, *harmonicexttrans_ptr, *innersolve_ptr, *innermatrix_ptr;
465
-
466
-
467
- //data for mpi-facets; only has data if there are relevant integrators in the BLF!
468
- mutable bool have_mpi_facet_data = false;
469
- mutable Array<int> os_per;
470
- mutable Table<SCAL> send_table;
471
- mutable Table<SCAL> recv_table;
472
-
473
-
474
- public:
475
- ///
476
- using BilinearForm::BilinearForm;
477
-
478
- virtual ~S_BilinearForm();
479
-
480
- ///
481
- void AddMatrix1 (SCAL val, const BaseVector & x,
482
- BaseVector & y, LocalHeap & lh) const;
483
-
484
- void AddMatrixGF (SCAL val, const BaseVector & x,
485
- BaseVector & y, bool transpose, LocalHeap & lh) const;
486
-
487
- virtual void AddMatrix (double val, const BaseVector & x,
488
- BaseVector & y, LocalHeap & lh) const override
489
- {
490
- x.Cumulate();
491
- y.Distribute();
492
-
493
- AddMatrix1 (val, x, y, lh);
494
- }
495
-
496
- virtual void AddMatrixTP (SCAL val, const BaseVector & x,
497
- BaseVector & y, LocalHeap & lh) const;
498
-
499
- virtual void AddMatrix (Complex val, const BaseVector & x,
500
- BaseVector & y, LocalHeap & lh) const override
501
- {
502
- x.Cumulate();
503
- y.Distribute();
504
-
505
- // AddMatrix1 (ConvertTo<SCAL> (val), x, y, lh);
506
- if constexpr (std::is_constructible<SCAL,Complex>())
507
- AddMatrix1 (SCAL(val), x, y, lh);
508
- else
509
- throw Exception("BilinearForm::AddMatrix(complex) called for real BilinearForm");
510
- }
511
-
512
- virtual void AddMatrixTrans (double val, const BaseVector & x,
513
- BaseVector & y, LocalHeap & lh) const override;
514
-
515
- virtual void LapackEigenSystem(FlatMatrix<SCAL> & elmat, LocalHeap & lh) const;
516
- // { ; }
517
-
518
- void ApplyLinearizedMatrixAdd1 (SCAL val,
519
- const BaseVector & lin,
520
- const BaseVector & x,
521
- BaseVector & y, LocalHeap & lh) const;
522
-
523
- virtual void ApplyLinearizedMatrixAdd (double val,
524
- const BaseVector & lin,
525
- const BaseVector & x,
526
- BaseVector & y, LocalHeap & lh) const override
527
- {
528
- lin.Cumulate();
529
- x.Cumulate();
530
- y.Distribute();
531
-
532
- ApplyLinearizedMatrixAdd1 (val, lin, x, y, lh);
533
- }
534
-
535
- virtual void ApplyLinearizedMatrixAdd (Complex val,
536
- const BaseVector & lin,
537
- const BaseVector & x,
538
- BaseVector & y, LocalHeap & lh) const override
539
- {
540
- lin.Cumulate();
541
- x.Cumulate();
542
- y.Distribute();
543
-
544
- if constexpr (std::is_constructible<SCAL,Complex>())
545
- ApplyLinearizedMatrixAdd1 (SCAL(val), lin, x, y, lh);
546
- else
547
- throw Exception("BilinearForm::ApplyLinearizedMatrix(complex) called for real BilinearForm");
548
- }
549
-
550
-
551
- virtual double Energy (const BaseVector & x, LocalHeap & lh) const override;
552
-
553
- virtual void ComputeInternal (BaseVector & u, const BaseVector & f, LocalHeap & lh) const override;
554
-
555
- virtual void ModifyRHS (BaseVector & fd) const override;
556
-
557
- ///
558
- virtual void DoAssemble (LocalHeap & lh) override;
559
- virtual void Assemble_facetwise_skeleton_parts_VOL (Array<bool>& useddof, size_t & gcnt, LocalHeap & lh, const BaseVector * lin = nullptr);
560
- ///
561
- // virtual void DoAssembleIndependent (BitArray & useddof, LocalHeap & lh);
562
- ///
563
- virtual void AssembleLinearization (const BaseVector & lin,
564
- LocalHeap & lh,
565
- bool reallocate = 0) override;
566
- ///
567
- virtual void AddElementMatrix (FlatArray<int> dnums1,
568
- FlatArray<int> dnums2,
569
- BareSliceMatrix<SCAL> elmat,
570
- ElementId id, bool addatomic,
571
- LocalHeap & lh) = 0;
572
-
573
-
574
- virtual void AddDiagElementMatrix (FlatArray<int> dnums1,
575
- FlatVector<SCAL> diag,
576
- bool inner_element, int elnr,
577
- LocalHeap & lh);
578
-
579
-
580
- shared_ptr<BaseMatrix> GetHarmonicExtension () const override
581
- {
582
- return harmonicext;
583
- }
584
- ///
585
- shared_ptr<BaseMatrix> GetHarmonicExtensionTrans () const override
586
- {
587
- return harmonicexttrans;
588
- }
589
- ///
590
- shared_ptr<BaseMatrix> GetInnerSolve () const override
591
- {
592
- return innersolve;
593
- }
594
- ///
595
- shared_ptr<BaseMatrix> GetInnerMatrix () const override
596
- {
597
- return innermatrix;
598
- }
599
-
600
- virtual void AllocateInternalMatrices () override;
601
- };
602
-
603
-
604
-
605
- template <class TM, class TV = typename mat_traits<TM>::TV_COL>
606
- class NGS_DLL_HEADER T_BilinearForm : public S_BilinearForm<typename mat_traits<TM>::TSCAL>
607
- {
608
- public:
609
- typedef typename mat_traits<TM>::TSCAL TSCAL;
610
- typedef TV TV_COL;
611
- typedef SparseMatrix<TM,TV,TV> TMATRIX;
612
- shared_ptr<TMATRIX> mymatrix;
613
- protected:
614
-
615
- public:
616
- using S_BilinearForm<TSCAL> :: S_BilinearForm;
617
- ///
618
- virtual ~T_BilinearForm () { };
619
-
620
- ///
621
- virtual shared_ptr<BilinearForm> GetLowOrderBilinearForm() override;
622
-
623
- virtual void AllocateMatrix () override;
624
-
625
- ///
626
- virtual void CleanUpLevel() override;
627
-
628
- ///
629
- virtual void AddElementMatrix (FlatArray<int> dnums1,
630
- FlatArray<int> dnums2,
631
- BareSliceMatrix<TSCAL> elmat,
632
- ElementId id, bool addatomic,
633
- LocalHeap & lh) override;
634
- };
635
-
636
-
637
-
638
-
639
-
640
-
641
- template <class TM, class TV = typename mat_traits<TM>::TV_COL>
642
- class NGS_DLL_HEADER T_BilinearFormSymmetric : public S_BilinearForm<typename mat_traits<TM>::TSCAL>
643
- {
644
-
645
- public:
646
- typedef typename mat_traits<TM>::TSCAL TSCAL;
647
- typedef TV TV_COL;
648
- typedef SparseMatrixSymmetric<TM,TV> TMATRIX;
649
- shared_ptr<TMATRIX> mymatrix;
650
- protected:
651
-
652
-
653
- public:
654
- T_BilinearFormSymmetric (shared_ptr<FESpace> afespace, const string & aname,
655
- const Flags & flags);
656
- virtual ~T_BilinearFormSymmetric () override;
657
-
658
- virtual void AllocateMatrix () override;
659
- virtual void CleanUpLevel() override;
660
- virtual shared_ptr<BilinearForm> GetLowOrderBilinearForm() override;
661
-
662
- virtual void AddElementMatrix (FlatArray<int> dnums1,
663
- FlatArray<int> dnums2,
664
- BareSliceMatrix<TSCAL> elmat,
665
- ElementId id, bool addatomic,
666
- LocalHeap & lh) override;
667
-
668
- virtual bool SymmetricStorage() const override { return true; }
669
- virtual void LapackEigenSystem(FlatMatrix<TSCAL> & elmat, LocalHeap & lh) const override;
670
- };
671
-
672
-
673
-
674
- template <class TSCAL>
675
- class NGS_DLL_HEADER T_BilinearFormDynBlocks : public S_BilinearForm<TSCAL>
676
- {
677
- public:
678
- typedef SparseBlockMatrix<TSCAL> TMATRIX;
679
- shared_ptr<TMATRIX> mymatrix;
680
- size_t blockheight, blockwidth;
681
- protected:
682
-
683
- public:
684
- T_BilinearFormDynBlocks (shared_ptr<FESpace> afespace,
685
- const string & aname, const Flags & flags)
686
- : S_BilinearForm<TSCAL> (afespace, aname, flags),
687
- blockheight(afespace->GetDimension()),
688
- blockwidth(afespace->GetDimension()) { }
689
-
690
- T_BilinearFormDynBlocks (shared_ptr<FESpace> afespace,
691
- shared_ptr<FESpace> afespace2,
692
- const string & aname, const Flags & flags)
693
- : S_BilinearForm<TSCAL> (afespace, afespace2, aname, flags),
694
- blockheight(afespace2->GetDimension()),
695
- blockwidth(afespace->GetDimension()) { }
696
-
697
- virtual ~T_BilinearFormDynBlocks () { };
698
-
699
- virtual shared_ptr<BilinearForm> GetLowOrderBilinearForm() override;
700
-
701
- virtual void AllocateMatrix () override;
702
-
703
- virtual void CleanUpLevel() override;
704
-
705
- virtual void AddElementMatrix (FlatArray<int> dnums1,
706
- FlatArray<int> dnums2,
707
- BareSliceMatrix<TSCAL> elmat,
708
- ElementId id, bool addatomic,
709
- LocalHeap & lh) override;
710
- };
711
-
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
- template <class TSCAL>
720
- class NGS_DLL_HEADER S_BilinearFormNonAssemble : public S_BilinearForm<TSCAL>
721
- {
722
- public:
723
- S_BilinearFormNonAssemble (shared_ptr<FESpace> afespace, const string & aname,
724
- const Flags & flags);
725
- S_BilinearFormNonAssemble (shared_ptr<FESpace> afespace, shared_ptr<FESpace> afespace2,
726
- const string & aname, const Flags & flags);
727
- // virtual ~T_BilinearFormSymmetric ();
728
-
729
- virtual void AllocateMatrix () { cout << "S_BilinearFormNonAssemble :: Allocate: nothing to do" << endl; }
730
- virtual void CleanUpLevel() { ; }
731
-
732
- virtual void AddElementMatrix (FlatArray<int> dnums1,
733
- FlatArray<int> dnums2,
734
- BareSliceMatrix<TSCAL> elmat,
735
- ElementId id, bool addatomic,
736
- LocalHeap & lh)
737
- {
738
- throw Exception ("AddElementMatrix for non-assemble biform called");
739
- }
740
-
741
- virtual bool SymmetricStorage() const { return true; }
742
-
743
- virtual void LapackEigenSystem(FlatMatrix<TSCAL> & elmat, LocalHeap & lh) const
744
- { cout << "no eigensystem available" << endl; }
745
- };
746
-
747
-
748
-
749
-
750
-
751
-
752
-
753
- class ComponentBilinearForm : public BilinearForm
754
- {
755
- shared_ptr<BilinearForm> base_blf;
756
- int comp; // , ncomp;
757
- public:
758
- ComponentBilinearForm (shared_ptr<BilinearForm> abase_blf, int acomp, int ancomp);
759
- virtual BilinearForm & AddIntegrator (shared_ptr<BilinearFormIntegrator> bfi);
760
-
761
- virtual void Assemble (LocalHeap & lh) { cerr << "comp - assemble is illegal" << endl; }
762
-
763
- virtual void AssembleLinearization (const BaseVector & lin,
764
- LocalHeap & lh,
765
- bool reallocate = 0)
766
- { throw Exception ("comp-bf - AssembleLinearization is illegal"); }
767
-
768
- virtual void AddMatrix (double val, const BaseVector & x,
769
- BaseVector & y, LocalHeap & lh) const
770
- { throw Exception ("comp-bf - AddMatrix is illegal"); }
771
-
772
- virtual void AddMatrix (Complex val, const BaseVector & x,
773
- BaseVector & y, LocalHeap & lh) const
774
- { throw Exception ("comp-bf - AddMatrix is illegal"); }
775
-
776
- virtual void AddMatrixTrans (double val, const BaseVector & x,
777
- BaseVector & y, LocalHeap & lh) const
778
- { throw Exception ("comp-bf - AddMatrixTrans is illegal"); }
779
-
780
- virtual void ApplyLinearizedMatrixAdd (double val,
781
- const BaseVector & lin,
782
- const BaseVector & x,
783
- BaseVector & y, LocalHeap & lh) const
784
- { throw Exception ("comp-bf - AddMatrix is illegal"); }
785
-
786
- virtual void ApplyLinearizedMatrixAdd (Complex val,
787
- const BaseVector & lin,
788
- const BaseVector & x,
789
- BaseVector & y, LocalHeap & lh) const
790
- { throw Exception ("comp-bf - AddMatrix is illegal"); }
791
-
792
- virtual shared_ptr<BaseMatrix> GetHarmonicExtension () const
793
- { throw Exception ("comp-bf - GetHarmonicExt is illegal"); }
794
-
795
- virtual shared_ptr<BaseMatrix> GetHarmonicExtensionTrans () const
796
- { throw Exception ("comp-bf - GetHarmonicExtTrans is illegal"); }
797
- virtual shared_ptr<BaseMatrix> GetInnerSolve () const
798
- { throw Exception ("comp-bf - GetInnerSolve is illegal"); }
799
- virtual shared_ptr<BaseMatrix> GetInnerMatrix () const
800
- { throw Exception ("comp-bf - GetInnerMatrix is illegal"); }
801
- virtual void ComputeInternal (BaseVector & u, const BaseVector & f, LocalHeap & lh) const
802
- { throw Exception ("comp-bf - ComputeInternal is illegal"); }
803
- virtual void ModifyRHS (BaseVector & f) const
804
- { throw Exception ("comp-bf - ModifyRHS is illegal"); }
805
- virtual AutoVector CreateRowVector() const
806
- { throw Exception ("comp-bf - CreateRowVector is illegal"); }
807
- virtual AutoVector CreateColVector() const
808
- { throw Exception ("comp-bf - CreateColVector is illegal"); }
809
- virtual void DoAssemble (LocalHeap & lh)
810
- { throw Exception ("comp-bf - DoAssemble is illegal"); }
811
- virtual void AllocateMatrix ()
812
- { throw Exception ("comp-bf - AllocateMatrix is illegal"); }
813
- virtual void AllocateInternalMatrices ()
814
- { throw Exception ("comp-bf - AllocateInternalMatrices is illegal"); }
815
- virtual double Energy (const BaseVector & x, LocalHeap & lh) const
816
- { throw Exception ("comp-bf - Energy is illegal"); }
817
-
818
- /*
819
- virtual shared_ptr<BaseVector> GetVectorPtr() const
820
- { throw Exception ("comp - GetVectorPtr is illegal"); }
821
- virtual BaseVector & GetVector () const
822
- { throw Exception ("comp - GetVector is illegal"); }
823
- */
824
- };
825
-
826
-
827
-
828
-
829
-
830
-
831
- /**
832
- Allocates a bilinearform.
833
- Some flags are:
834
- -symmetric ... assembles a symmetric matrix
835
- */
836
- extern NGS_DLL_HEADER shared_ptr<BilinearForm> CreateBilinearForm (shared_ptr<FESpace> space,
837
- const string & name,
838
- const Flags & flags);
839
-
840
- extern NGS_DLL_HEADER shared_ptr<BilinearForm> CreateBilinearForm (shared_ptr<FESpace> space,
841
- shared_ptr<FESpace> space2,
842
- const string & name,
843
- const Flags & flags);
844
-
845
-
846
-
847
- /**
848
- This objects provide the bilinear-form application as matrix vector product.
849
- If the bilinearform is indeed non-linear in the first argumen, the operator*
850
- will perform the non-linear operator application.
851
- */
852
- class NGS_DLL_HEADER BilinearFormApplication : public BaseMatrix
853
- {
854
- protected:
855
- ///
856
- shared_ptr<BilinearForm> bf;
857
- LocalHeap & lh;
858
- public:
859
- ///
860
- BilinearFormApplication (shared_ptr<BilinearForm> abf, LocalHeap & alh);
861
-
862
- virtual bool IsComplex() const override
863
- {
864
- return bf->GetFESpace()->IsComplex();
865
- }
866
-
867
- ///
868
- virtual void Mult (const BaseVector & v, BaseVector & prod) const override;
869
- ///
870
- virtual void MultAdd (double val, const BaseVector & v, BaseVector & prod) const override;
871
- ///
872
- virtual void MultAdd (Complex val, const BaseVector & v, BaseVector & prod) const override;
873
- ///
874
- virtual void MultTransAdd (double val, const BaseVector & v, BaseVector & prod) const override;
875
-
876
- virtual AutoVector CreateVector () const override;
877
- virtual AutoVector CreateRowVector () const override;
878
- virtual AutoVector CreateColVector () const override;
879
-
880
- ///
881
- virtual int VHeight() const override
882
- {
883
- if (bf->GetFESpace2())
884
- return bf->GetFESpace2()->GetNDof();
885
- return bf->GetFESpace()->GetNDof();
886
- }
887
- ///
888
- virtual int VWidth() const override
889
- {
890
- return bf->GetFESpace()->GetNDof();
891
- }
892
- };
893
-
894
- /**
895
- Applies the matrix-vector product of linearized matrix.
896
- Linearization point is given in the constructor
897
- */
898
- class NGS_DLL_HEADER LinearizedBilinearFormApplication : public BilinearFormApplication
899
- {
900
- protected:
901
- const BaseVector * veclin;
902
-
903
- public:
904
- ///
905
- LinearizedBilinearFormApplication (shared_ptr<BilinearForm> abf,
906
- const BaseVector * aveclin,
907
- LocalHeap & alh);
908
-
909
- ///
910
- virtual void Mult (const BaseVector & v, BaseVector & prod) const override;
911
- ///
912
- virtual void MultAdd (double val, const BaseVector & v, BaseVector & prod) const override;
913
- ///
914
- virtual void MultAdd (Complex val, const BaseVector & v, BaseVector & prod) const override;
915
- };
916
-
917
-
918
-
919
- class ApplyIntegrationPoints : public BaseMatrix
920
- {
921
- Array<shared_ptr<CoefficientFunction>> coefs;
922
- Array<ProxyFunction*> trialproxies;
923
-
924
- typedef void (*lib_function)(size_t nip, double * input, size_t dist_input,
925
- double * output, size_t dist_output,
926
- size_t dist, double * points, double * normals);
927
-
928
- unique_ptr<SharedLibrary> library;
929
- lib_function compiled_function = nullptr;
930
-
931
- size_t dimx, dimy;
932
- size_t nip;
933
- Matrix<double> points;
934
- Matrix<double> normals;
935
-
936
- public:
937
- ApplyIntegrationPoints (Array<shared_ptr<CoefficientFunction>> acoefs,
938
- const Array<ProxyFunction*> & atrialproxies,
939
- Matrix<double> apoints, Matrix<double> anormals,
940
- size_t adimx, size_t adimy, size_t anip);
941
-
942
- AutoVector CreateColVector() const override;
943
- AutoVector CreateRowVector() const override;
944
-
945
- virtual int VHeight() const override { return nip*dimy; }
946
- virtual int VWidth() const override { return nip*dimx; }
947
-
948
- virtual void Mult (const BaseVector & x, BaseVector & y) const override;
949
-
950
- const Array<shared_ptr<CoefficientFunction>> & GetCFs() const { return coefs; }
951
- const Array<ProxyFunction*> & GetTrialProxies() const { return trialproxies; }
952
- size_t GetDimX() const { return dimx; }
953
- size_t GetDimY() const { return dimy; }
954
- size_t GetNIP() const { return nip; }
955
- };
956
-
957
-
958
-
959
-
960
-
961
- }
962
-
963
- #endif