ngsolve 6.2.2501.post21.dev1__cp312-cp312-macosx_10_15_universal2.whl → 6.2.2501.post37.dev1__cp312-cp312-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 -15
  237. ngsolve/eigenvalues.pyi +0 -30
  238. ngsolve/fem.pyi +0 -1707
  239. ngsolve/krylovspace.pyi +0 -301
  240. ngsolve/la.pyi +0 -1218
  241. ngsolve/ngslib.so +0 -0
  242. ngsolve/ngstd.pyi +0 -58
  243. ngsolve/nonlinearsolvers.pyi +0 -97
  244. ngsolve/preconditioners.pyi +0 -6
  245. ngsolve/solve.pyi +0 -108
  246. ngsolve/solvers.pyi +0 -14
  247. ngsolve/timestepping.pyi +0 -27
  248. ngsolve/timing.pyi +0 -54
  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,170 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "Poisson Equation\n",
8
- "==="
9
- ]
10
- },
11
- {
12
- "cell_type": "markdown",
13
- "metadata": {},
14
- "source": [
15
- "Import Netgen/NGSolve Python modules:"
16
- ]
17
- },
18
- {
19
- "cell_type": "code",
20
- "execution_count": null,
21
- "metadata": {},
22
- "outputs": [],
23
- "source": [
24
- "from ngsolve import *\n",
25
- "from netgen.geom2d import unit_square\n",
26
- "import netgen.gui\n",
27
- "%gui tk"
28
- ]
29
- },
30
- {
31
- "cell_type": "markdown",
32
- "metadata": {},
33
- "source": [
34
- "The unit_square is a predefined domain, use Netgen to generate a mesh:"
35
- ]
36
- },
37
- {
38
- "cell_type": "code",
39
- "execution_count": null,
40
- "metadata": {},
41
- "outputs": [],
42
- "source": [
43
- "mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))\n",
44
- "Draw (mesh)"
45
- ]
46
- },
47
- {
48
- "cell_type": "markdown",
49
- "metadata": {},
50
- "source": [
51
- "Define a finite element space on that mesh. "
52
- ]
53
- },
54
- {
55
- "cell_type": "code",
56
- "execution_count": null,
57
- "metadata": {},
58
- "outputs": [],
59
- "source": [
60
- "fes = H1(mesh, order=3, dirichlet=\"left|right|bottom|top\")\n",
61
- "print (\"ndof =\", fes.ndof)"
62
- ]
63
- },
64
- {
65
- "cell_type": "markdown",
66
- "metadata": {},
67
- "source": [
68
- "Define linear and bilinear-forms. Forms are expressed in terms of trial and test-functions:"
69
- ]
70
- },
71
- {
72
- "cell_type": "code",
73
- "execution_count": null,
74
- "metadata": {},
75
- "outputs": [],
76
- "source": [
77
- "u = fes.TrialFunction()\n",
78
- "v = fes.TestFunction()\n",
79
- "\n",
80
- "f = LinearForm(fes)\n",
81
- "f += 32 * (y*(1-y)+x*(1-x)) * v * dx\n",
82
- "\n",
83
- "a = BilinearForm(fes)\n",
84
- "a += grad(u)*grad(v)*dx\n",
85
- "\n",
86
- "a.Assemble()\n",
87
- "f.Assemble()"
88
- ]
89
- },
90
- {
91
- "cell_type": "markdown",
92
- "metadata": {},
93
- "source": [
94
- "Solve the problem:"
95
- ]
96
- },
97
- {
98
- "cell_type": "code",
99
- "execution_count": null,
100
- "metadata": {},
101
- "outputs": [],
102
- "source": [
103
- "gfu = GridFunction(fes)\n",
104
- "gfu.vec.data = a.mat.Inverse(fes.FreeDofs()) * f.vec"
105
- ]
106
- },
107
- {
108
- "cell_type": "markdown",
109
- "metadata": {},
110
- "source": [
111
- "Plot the solution:"
112
- ]
113
- },
114
- {
115
- "cell_type": "code",
116
- "execution_count": null,
117
- "metadata": {},
118
- "outputs": [],
119
- "source": [
120
- "Draw (gfu)\n",
121
- "Draw (-grad(gfu), mesh, \"Flux\")"
122
- ]
123
- },
124
- {
125
- "cell_type": "code",
126
- "execution_count": null,
127
- "metadata": {},
128
- "outputs": [],
129
- "source": [
130
- "exact = 16*x*(1-x)*y*(1-y)\n",
131
- "print (\"L2-error:\", sqrt (Integrate ( (gfu-exact)*(gfu-exact), mesh)))"
132
- ]
133
- },
134
- {
135
- "cell_type": "code",
136
- "execution_count": null,
137
- "metadata": {},
138
- "outputs": [],
139
- "source": []
140
- },
141
- {
142
- "cell_type": "code",
143
- "execution_count": null,
144
- "metadata": {},
145
- "outputs": [],
146
- "source": []
147
- }
148
- ],
149
- "metadata": {
150
- "kernelspec": {
151
- "display_name": "Python 3",
152
- "language": "python",
153
- "name": "python3"
154
- },
155
- "language_info": {
156
- "codemirror_mode": {
157
- "name": "ipython",
158
- "version": 3
159
- },
160
- "file_extension": ".py",
161
- "mimetype": "text/x-python",
162
- "name": "python",
163
- "nbconvert_exporter": "python",
164
- "pygments_lexer": "ipython3",
165
- "version": "3.8.5"
166
- }
167
- },
168
- "nbformat": 4,
169
- "nbformat_minor": 2
170
- }
@@ -1,41 +0,0 @@
1
- # solve the Poisson equation -Delta u = f
2
- # with Dirichlet boundary condition u = 0
3
-
4
- from ngsolve import *
5
- # from netgen.geom2d import unit_square
6
-
7
- ngsglobals.msg_level = 1
8
-
9
- # generate a triangular mesh of mesh-size 0.2
10
- mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))
11
-
12
- # H1-conforming finite element space
13
- fes = H1(mesh, order=3, dirichlet=[1,2,3,4])
14
-
15
- # define trial- and test-functions
16
- u = fes.TrialFunction()
17
- v = fes.TestFunction()
18
-
19
- # the right hand side
20
- f = LinearForm(fes)
21
- f += 32 * (y*(1-y)+x*(1-x)) * v * dx
22
-
23
- # the bilinear-form
24
- a = BilinearForm(fes, symmetric=True)
25
- a += grad(u)*grad(v)*dx
26
-
27
- a.Assemble()
28
- f.Assemble()
29
-
30
- # the solution field
31
- gfu = GridFunction(fes)
32
- gfu.vec.data = a.mat.Inverse(fes.FreeDofs(), inverse="sparsecholesky") * f.vec
33
- # print (u.vec)
34
-
35
-
36
- # plot the solution (netgen-gui only)
37
- Draw (gfu)
38
- Draw (-grad(gfu), mesh, "Flux")
39
-
40
- exact = 16*x*(1-x)*y*(1-y)
41
- print ("L2-error:", sqrt (Integrate ( (gfu-exact)*(gfu-exact), mesh)))
File without changes
@@ -1,87 +0,0 @@
1
- from netgen.csg import *
2
- import netgen.meshing
3
-
4
- from ngsolve import *
5
-
6
- from mpi4py.MPI import COMM_WORLD as comm
7
- rank = comm.rank
8
- np = comm.size
9
-
10
- do_vtk = False
11
-
12
- def MakeGeometry():
13
- geometry = CSGeometry()
14
- box = OrthoBrick(Pnt(-1,-1,-1),Pnt(2,1,2)).bc("outer")
15
-
16
- core = OrthoBrick(Pnt(0,-0.05,0),Pnt(0.8,0.05,1))- \
17
- OrthoBrick(Pnt(0.1,-1,0.1),Pnt(0.7,1,0.9))- \
18
- OrthoBrick(Pnt(0.5,-1,0.4),Pnt(1,1,0.6)).maxh(0.2).mat("core")
19
-
20
- coil = (Cylinder(Pnt(0.05,0,0), Pnt(0.05,0,1), 0.3) - \
21
- Cylinder(Pnt(0.05,0,0), Pnt(0.05,0,1), 0.15)) * \
22
- OrthoBrick (Pnt(-1,-1,0.3),Pnt(1,1,0.7)).maxh(0.2).mat("coil")
23
-
24
- geometry.Add ((box-core-coil).mat("air"))
25
- geometry.Add (core)
26
- geometry.Add (coil)
27
- return geometry
28
-
29
- # For curving, we need the geometry. We have to
30
- # generate it everywhere and then set it.
31
- # It is not distributed automatically.
32
- geom = MakeGeometry()
33
- if rank==0:
34
- # master proc generates and immediately distributes
35
- ngmesh = geom.GenerateMesh(maxh=0.5)
36
- ngmesh.Distribute(comm)
37
- else:
38
- # worker procs receive mesh
39
- ngmesh = netgen.meshing.Mesh.Receive(comm)
40
- # and then manually set the geometry
41
- ngmesh.SetGeometry(geom)
42
- mesh = Mesh(ngmesh)
43
-
44
- # now we can curve!
45
- mesh.Curve(5)
46
-
47
- ngsglobals.msg_level = 5
48
-
49
- fes = HCurl(mesh, order=4, dirichlet="outer", nograds = True)
50
-
51
-
52
- u = fes.TrialFunction()
53
- v = fes.TestFunction()
54
-
55
- mur = { "core" : 1000, "coil" : 1, "air" : 1 }
56
- mu0 = 1.257e-6
57
-
58
- nu_coef = [ 1/(mu0*mur[mat]) for mat in mesh.GetMaterials() ]
59
-
60
- nu = CoefficientFunction(nu_coef)
61
- a = BilinearForm(fes, symmetric=True)
62
- a += SymbolicBFI(nu*curl(u)*curl(v) + 1e-6*nu*u*v)
63
-
64
- c = Preconditioner(a, type="bddc", flags={"inverse":"masterinverse"})
65
- #c = Preconditioner(a, type="bddc", inverse = "mumps")
66
-
67
- f = LinearForm(fes)
68
- f += SymbolicLFI(CoefficientFunction((y,0.05-x,0)) * v, definedon=mesh.Materials("coil"))
69
-
70
- u = GridFunction(fes)
71
-
72
-
73
- a.Assemble()
74
- f.Assemble()
75
- solver = CGSolver(mat=a.mat, pre=c.mat)
76
- u.vec.data = solver * f.vec
77
-
78
- if do_vtk:
79
- import os
80
- output_path = os.path.dirname(os.path.realpath(__file__)) + "/cmagnet_output"
81
- if rank==0 and not os.path.exists(output_path):
82
- os.mkdir(output_path)
83
- comm.Barrier() #wait until master has created the directory!!
84
- vtk = VTKOutput(ma=mesh, coefs=[u.Deriv()], names=["sol"], filename=output_path+"/vtkout", subdivision=2)
85
- vtk.Do()
86
-
87
- #Draw (u.Deriv(), mesh, "B-field", draw_surf=False)
@@ -1,117 +0,0 @@
1
- import netgen.meshing
2
- from netgen.geom2d import SplineGeometry
3
-
4
-
5
- from ngsolve import *
6
-
7
- SetNumThreads(1)
8
-
9
- from mpi4py.MPI import COMM_WORLD as comm
10
- rank = comm.rank
11
- np = comm.size
12
-
13
- do_vtk = False
14
-
15
- # viscosity
16
- nu = 0.001
17
-
18
- # timestepping parameters
19
- tau = 0.001
20
- tend = 3
21
-
22
- # mesh = Mesh("cylinder.vol")
23
- geo = SplineGeometry()
24
- geo.AddRectangle( (0, 0), (2, 0.41), bcs = ("wall", "outlet", "wall", "inlet"))
25
- geo.AddCircle ( (0.2, 0.2), r=0.05, leftdomain=0, rightdomain=1, bc="cyl")
26
- if rank==0:
27
- ngmesh = geo.GenerateMesh(maxh=0.08)
28
- ngmesh.Distribute(comm)
29
- else:
30
- ngmesh = netgen.meshing.Mesh.Receive(comm)
31
- ngmesh.SetGeometry(geo)
32
-
33
- mesh = Mesh(ngmesh)
34
-
35
- #does not work with mpi yet...
36
- #mesh.Curve(3)
37
-
38
- V = H1(mesh,order=3, dirichlet="wall|cyl|inlet")
39
- Q = H1(mesh,order=2)
40
-
41
- X = FESpace([V,V,Q])
42
-
43
- ux,uy,p = X.TrialFunction()
44
- vx,vy,q = X.TestFunction()
45
-
46
- div_u = grad(ux)[0]+grad(uy)[1]
47
- div_v = grad(vx)[0]+grad(vy)[1]
48
-
49
- stokes = nu*grad(ux)*grad(vx)+nu*grad(uy)*grad(vy)+div_u*q+div_v*p - 1e-10*p*q
50
- a = BilinearForm(X)
51
- a += SymbolicBFI(stokes)
52
- a.Assemble()
53
-
54
- # nothing here ...
55
- f = LinearForm(X)
56
- f.Assemble()
57
-
58
- # gridfunction for the solution
59
- gfu = GridFunction(X)
60
-
61
- # parabolic inflow at bc=1:
62
- uin = 1.5*4*y*(0.41-y)/(0.41*0.41)
63
- gfu.components[0].Set(uin, definedon=mesh.Boundaries("inlet"))
64
-
65
- velocity = CoefficientFunction(gfu.components[0:2])
66
-
67
-
68
- # solve Stokes problem for initial conditions:
69
- #inv_stokes = a.mat.Inverse(X.FreeDofs(), inverse="mumps")
70
- inv_stokes = a.mat.Inverse(X.FreeDofs(), inverse="masterinverse")
71
- res = f.vec.CreateVector()
72
- res.data = f.vec - a.mat*gfu.vec
73
- gfu.vec.data += inv_stokes * res
74
-
75
- # matrix for implicit Euler
76
- mstar = BilinearForm(X)
77
- mstar += SymbolicBFI(ux*vx+uy*vy + tau*stokes)
78
- mstar.Assemble()
79
-
80
- # inv = mstar.mat.Inverse(X.FreeDofs(), inverse="masterinverse")
81
- inv = mstar.mat.Inverse(X.FreeDofs(), inverse="masterinverse")
82
-
83
- # the non-linear term
84
- conv = BilinearForm(X, nonassemble = True)
85
- conv += SymbolicBFI( CoefficientFunction( (ux,uy) ) * (grad(ux)*vx+grad(uy)*vy) )
86
-
87
- t = 0
88
- vtk_interval = int(0.05/tau);
89
-
90
- import os
91
- #output_path = os.path.dirname(os.path.realpath(__file__)) + "/navierstokes_output"
92
- output_path = os.path.dirname(os.path.realpath(__file__)) + "/navierstokes_output"
93
- if rank==0 and not os.path.exists(output_path):
94
- os.mkdir(output_path)
95
- comm.Barrier() #wait until master has created the directory!!
96
-
97
- if do_vtk:
98
- vtk = VTKOutput(ma=mesh,coefs=[velocity],names=["u"],filename=output_path+"/vtkout",subdivision=2)
99
- vtk.Do()
100
-
101
- count = 1;
102
- # implicit Euler/explicit Euler splitting method:
103
- with TaskManager():
104
- while t < tend:
105
- if rank==0:
106
- print ("t=", t)
107
-
108
- conv.Apply (gfu.vec, res)
109
- res.data += a.mat*gfu.vec
110
- gfu.vec.data -= tau * inv * res
111
-
112
- if count%vtk_interval==0 and do_vtk:
113
- vtk.Do(time = t)
114
- count = count+1;
115
-
116
- t = t + tau
117
- comm.Barrier()
@@ -1,89 +0,0 @@
1
- # Call with:
2
- # mpirun -np 5 ngspy mpi_poisson.py
3
-
4
- # Solves -laplace(u)=f on [0,1]^3
5
-
6
- # netgen-imports
7
- #from netgen.geom2d import unit_square
8
- from netgen.csg import unit_cube
9
- import netgen.meshing
10
-
11
- # ngsolve-imports
12
- from ngsolve import *
13
-
14
- # initialize MPI
15
- from mpi4py.MPI import COMM_WORLD as comm
16
- rank = comm.rank
17
- np = comm.size
18
-
19
- do_vtk = False
20
-
21
- print("Hello from rank "+str(rank)+" of "+str(np))
22
-
23
- if rank==0:
24
- # master-proc generates mesh
25
- mesh = unit_cube.GenerateMesh(maxh=0.3)
26
- # and saves it to file
27
- mesh.Save("some_mesh.vol")
28
-
29
- # wait for master to be done meshing
30
- comm.Barrier()
31
-
32
- # now load mesh from file
33
- ngmesh = netgen.meshing.Mesh(dim=3, comm=comm)
34
- ngmesh.Load("some_mesh.vol")
35
-
36
- #refine once?
37
- # ngmesh.Refine()
38
-
39
- mesh = Mesh(ngmesh)
40
-
41
- # build H1-FESpace as usual
42
- V = H1(mesh, order=3, dirichlet=[1,2,3,4])
43
- u = V.TrialFunction()
44
- v = V.TestFunction()
45
-
46
- print("rank "+str(rank)+" has "+str(V.ndof)+" of "+str(V.ndofglobal)+" dofs!")
47
-
48
- # RHS does not change either!
49
- f = LinearForm (V)
50
- f += SymbolicLFI(32 * (y*(1-y)+x*(1-x)) * v)
51
- f.Assemble()
52
-
53
- # neither does the BLF!
54
- a = BilinearForm (V, symmetric=False)
55
- a += SymbolicBFI(grad(u)*grad(v))
56
-
57
- # Some possible preconditioners:
58
- c = Preconditioner(a, type="direct", inverse = "masterinverse") # direct solve with mumps
59
- #c = Preconditioner(a, type="bddc", inverse = "mumps") # BBDC + mumps for coarse inverse
60
- #c = Preconditioner(a, type="hypre") # BoomerAMG (use only for order 1)
61
- #c = Preconditioner(a, type="bddc", usehypre = True) # BDDC + BoomerAMG for coarse matrix
62
-
63
- a.Assemble()
64
-
65
- # solve the equation
66
- u = GridFunction (V)
67
- u.vec.data = CGSolver(a.mat, c.mat) * f.vec # use CG-solver with preconditioner c
68
- # u.vec.data = a.mat.Inverse(V.FreeDofs(), inverse="mumps") * f.vec # use MUMPS parallel inverse
69
- # u.vec.data = a.mat.Inverse(V.FreeDofs(), inverse="masterinverse") * f.vec # use masterinverse (master proc does all the work!)
70
-
71
-
72
- #exact solution
73
- exact = 16*x*(1-x)*y*(1-y)
74
-
75
- # error
76
- error = Integrate ( (u-exact)*(u-exact) , mesh)
77
- if rank==0:
78
- print("L2-error", error )
79
-
80
- if do_vtk:
81
- # do VTK-output
82
- import os
83
- output_path = os.path.dirname(os.path.realpath(__file__)) + "/poisson_output"
84
- if rank==0 and not os.path.exists(output_path):
85
- os.mkdir(output_path)
86
- comm.Barrier() #wait until master has created the directory!!
87
-
88
- vtk = VTKOutput(mesh, coefs=[u], names=["sol"], filename=output_path+"/vtkout", subdivision=2)
89
- vtk.Do()
@@ -1,82 +0,0 @@
1
- # Call with:
2
- # mpirun -np 5 ngspy mpi_timeDG.py
3
-
4
- # Then make movie with:
5
- # python3 make_timeDG_movie.py
6
- # (this only works if you have paraview+python3 configured properly)
7
-
8
- # circular convection; time-DG with skeleton-formulation
9
-
10
-
11
- from netgen.geom2d import unit_square
12
- import netgen.meshing
13
-
14
-
15
- from ngsolve import *
16
-
17
- SetNumThreads(1)
18
-
19
- from mpi4py.MPI import COMM_WORLD as comm
20
- rank = comm.rank
21
- np = comm.size
22
-
23
- do_vtk = False
24
-
25
- if rank==0:
26
- ngmesh = unit_square.GenerateMesh(maxh=0.05)
27
- ngmesh.Distribute(comm)
28
- else:
29
- ngmesh = netgen.meshing.Mesh.Receive(comm)
30
- mesh = Mesh(ngmesh)
31
-
32
- # build L2-FESpace
33
- fes = L2(mesh, order=4)
34
-
35
- # Trial- and Test-functions
36
- u = fes.TrialFunction()
37
- v = fes.TestFunction()
38
-
39
- # RHS
40
- b = CoefficientFunction( (y-0.5,0.5-x) )
41
- bn = b*specialcf.normal(2)
42
-
43
- # Skeleton DG-formulation
44
- a = BilinearForm(fes)
45
- a += SymbolicBFI (-u * b*grad(v))
46
- a += SymbolicBFI ( bn*IfPos(bn, u, u.Other()) * (v-v.Other()), VOL, skeleton=True)
47
- a += SymbolicBFI ( bn*IfPos(bn, u, 0) * v, BND, skeleton=True)
48
-
49
- u = GridFunction(fes)
50
- u.Set(exp (-40 * ( (x-0.7)*(x-0.7) + (y-0.7)*(y-0.7) )))
51
-
52
- w = u.vec.CreateVector()
53
-
54
- t = 0
55
- tau = 5e-4
56
- tend = 2
57
- count = 0
58
-
59
- vtk_interval = int(0.02/tau);
60
-
61
- if do_vtk:
62
- import os
63
- output_path = os.path.dirname(os.path.realpath(__file__)) + "/timeDG_output"
64
- if rank==0 and not os.path.exists(output_path):
65
- os.mkdir(output_path)
66
- comm.Barrier() #wait until master has created the directory!!
67
- vtk = VTKOutput(ma=mesh,coefs=[u],names=["sol"],filename=output_path+"/vtkout",subdivision=2)
68
-
69
- with TaskManager():
70
- while t < tend:
71
- if rank==0:
72
- print("t = ", t)
73
- a.Apply (u.vec, w)
74
- fes.SolveM (rho=CoefficientFunction(1), vec=w)
75
- u.vec.data -= tau * w
76
- t += tau
77
-
78
- if count%vtk_interval==0 and do_vtk:
79
- vtk.Do(time=t)
80
- count = count+1;
81
-
82
- comm.Barrier()
ngsolve/directsolvers.pyi DELETED
@@ -1,15 +0,0 @@
1
- from __future__ import annotations
2
- from ngsolve.comp import BilinearForm
3
- import ngsolve.la
4
- from ngsolve.la import BaseMatrix
5
- from ngsolve.la import BaseVector
6
- import pyngcore.pyngcore
7
- from pyngcore.pyngcore import BitArray
8
- __all__ = ['BaseMatrix', 'BaseVector', 'BilinearForm', 'BitArray', 'SuperLU']
9
- class SuperLU(ngsolve.la.BaseMatrix):
10
- def Mult(self, x: ngsolve.la.BaseVector, y: ngsolve.la.BaseVector):
11
- ...
12
- def Update(self):
13
- ...
14
- def __init__(self, a, freedofs: pyngcore.pyngcore.BitArray = None):
15
- ...
ngsolve/eigenvalues.pyi DELETED
@@ -1,30 +0,0 @@
1
- from __future__ import annotations
2
- from math import sqrt
3
- from ngsolve.bla import Matrix
4
- from ngsolve.bla import Norm
5
- from ngsolve.bla import Vector
6
- from ngsolve.la import IdentityMatrix
7
- from ngsolve.la import InnerProduct
8
- from ngsolve.la import MultiVector
9
- from ngsolve.la import Projector
10
- __all__ = ['Arnoldi', 'IdentityMatrix', 'InnerProduct', 'LOBPCG', 'Matrix', 'MultiVector', 'Norm', 'Orthogonalize', 'PINVIT', 'PINVIT1', 'Projector', 'SOAR', 'TOAR', 'Vector', 'sqrt']
11
- def Arnoldi(mat, tol = 1e-10, maxiter = 200):
12
- ...
13
- def LOBPCG(mata, matm, pre, num = 1, maxit = 20, initial = None, printrates = True, largest = False):
14
- """
15
- Knyazev's cg-like extension of PINVIT
16
- """
17
- def Orthogonalize(vecs, mat):
18
- ...
19
- def PINVIT(mata, matm, pre, num = 1, maxit = 20, printrates = True, GramSchmidt = True):
20
- """
21
- preconditioned inverse iteration
22
- """
23
- def PINVIT1(mata, matm, pre, num = 1, maxit = 20, printrates = True, GramSchmidt = False):
24
- """
25
- preconditioned inverse iteration
26
- """
27
- def SOAR(A, B, maxiter = 200):
28
- ...
29
- def TOAR(A, B, maxiter = 200):
30
- ...