netgen-mesher 6.2.2506.post35.dev0__cp314-cp314-win_amd64.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.
Files changed (340) hide show
  1. netgen/NgOCC.py +7 -0
  2. netgen/__init__.py +114 -0
  3. netgen/__init__.pyi +22 -0
  4. netgen/__main__.py +53 -0
  5. netgen/cmake/NetgenConfig.cmake +79 -0
  6. netgen/cmake/netgen-targets-release.cmake +69 -0
  7. netgen/cmake/netgen-targets.cmake +146 -0
  8. netgen/config/__init__.py +1 -0
  9. netgen/config/__init__.pyi +52 -0
  10. netgen/config/__main__.py +4 -0
  11. netgen/config/config.py +68 -0
  12. netgen/config/config.pyi +54 -0
  13. netgen/csg.py +25 -0
  14. netgen/geom2d.py +178 -0
  15. netgen/gui.py +82 -0
  16. netgen/include/core/archive.hpp +1256 -0
  17. netgen/include/core/array.hpp +1760 -0
  18. netgen/include/core/autodiff.hpp +1131 -0
  19. netgen/include/core/autodiffdiff.hpp +733 -0
  20. netgen/include/core/bitarray.hpp +240 -0
  21. netgen/include/core/concurrentqueue.h +3619 -0
  22. netgen/include/core/exception.hpp +145 -0
  23. netgen/include/core/flags.hpp +199 -0
  24. netgen/include/core/hashtable.hpp +1281 -0
  25. netgen/include/core/localheap.hpp +318 -0
  26. netgen/include/core/logging.hpp +117 -0
  27. netgen/include/core/memtracer.hpp +221 -0
  28. netgen/include/core/mpi4py_pycapi.h +245 -0
  29. netgen/include/core/mpi_wrapper.hpp +643 -0
  30. netgen/include/core/ng_mpi.hpp +94 -0
  31. netgen/include/core/ng_mpi_generated_declarations.hpp +155 -0
  32. netgen/include/core/ng_mpi_native.hpp +25 -0
  33. netgen/include/core/ngcore.hpp +32 -0
  34. netgen/include/core/ngcore_api.hpp +152 -0
  35. netgen/include/core/ngstream.hpp +115 -0
  36. netgen/include/core/paje_trace.hpp +279 -0
  37. netgen/include/core/profiler.hpp +382 -0
  38. netgen/include/core/python_ngcore.hpp +457 -0
  39. netgen/include/core/ranges.hpp +109 -0
  40. netgen/include/core/register_archive.hpp +100 -0
  41. netgen/include/core/signal.hpp +82 -0
  42. netgen/include/core/simd.hpp +160 -0
  43. netgen/include/core/simd_arm64.hpp +407 -0
  44. netgen/include/core/simd_avx.hpp +394 -0
  45. netgen/include/core/simd_avx512.hpp +285 -0
  46. netgen/include/core/simd_generic.hpp +1053 -0
  47. netgen/include/core/simd_math.hpp +178 -0
  48. netgen/include/core/simd_sse.hpp +289 -0
  49. netgen/include/core/statushandler.hpp +37 -0
  50. netgen/include/core/symboltable.hpp +153 -0
  51. netgen/include/core/table.hpp +810 -0
  52. netgen/include/core/taskmanager.hpp +1161 -0
  53. netgen/include/core/type_traits.hpp +65 -0
  54. netgen/include/core/utils.hpp +385 -0
  55. netgen/include/core/version.hpp +102 -0
  56. netgen/include/core/xbool.hpp +47 -0
  57. netgen/include/csg/algprim.hpp +563 -0
  58. netgen/include/csg/brick.hpp +150 -0
  59. netgen/include/csg/csg.hpp +43 -0
  60. netgen/include/csg/csgeom.hpp +389 -0
  61. netgen/include/csg/csgparser.hpp +101 -0
  62. netgen/include/csg/curve2d.hpp +67 -0
  63. netgen/include/csg/edgeflw.hpp +112 -0
  64. netgen/include/csg/explicitcurve2d.hpp +113 -0
  65. netgen/include/csg/extrusion.hpp +185 -0
  66. netgen/include/csg/gencyl.hpp +70 -0
  67. netgen/include/csg/geoml.hpp +16 -0
  68. netgen/include/csg/identify.hpp +213 -0
  69. netgen/include/csg/manifold.hpp +29 -0
  70. netgen/include/csg/meshsurf.hpp +46 -0
  71. netgen/include/csg/polyhedra.hpp +121 -0
  72. netgen/include/csg/revolution.hpp +180 -0
  73. netgen/include/csg/singularref.hpp +84 -0
  74. netgen/include/csg/solid.hpp +295 -0
  75. netgen/include/csg/specpoin.hpp +194 -0
  76. netgen/include/csg/spline3d.hpp +99 -0
  77. netgen/include/csg/splinesurface.hpp +85 -0
  78. netgen/include/csg/surface.hpp +394 -0
  79. netgen/include/csg/triapprox.hpp +63 -0
  80. netgen/include/csg/vscsg.hpp +34 -0
  81. netgen/include/general/autodiff.hpp +356 -0
  82. netgen/include/general/autoptr.hpp +39 -0
  83. netgen/include/general/gzstream.h +121 -0
  84. netgen/include/general/hashtabl.hpp +1692 -0
  85. netgen/include/general/myadt.hpp +48 -0
  86. netgen/include/general/mystring.hpp +226 -0
  87. netgen/include/general/netgenout.hpp +205 -0
  88. netgen/include/general/ngarray.hpp +797 -0
  89. netgen/include/general/ngbitarray.hpp +149 -0
  90. netgen/include/general/ngpython.hpp +74 -0
  91. netgen/include/general/optmem.hpp +44 -0
  92. netgen/include/general/parthreads.hpp +138 -0
  93. netgen/include/general/seti.hpp +50 -0
  94. netgen/include/general/sort.hpp +47 -0
  95. netgen/include/general/spbita2d.hpp +59 -0
  96. netgen/include/general/stack.hpp +114 -0
  97. netgen/include/general/table.hpp +280 -0
  98. netgen/include/general/template.hpp +509 -0
  99. netgen/include/geom2d/csg2d.hpp +750 -0
  100. netgen/include/geom2d/geometry2d.hpp +280 -0
  101. netgen/include/geom2d/spline2d.hpp +234 -0
  102. netgen/include/geom2d/vsgeom2d.hpp +28 -0
  103. netgen/include/gprim/adtree.hpp +1392 -0
  104. netgen/include/gprim/geom2d.hpp +858 -0
  105. netgen/include/gprim/geom3d.hpp +749 -0
  106. netgen/include/gprim/geomfuncs.hpp +212 -0
  107. netgen/include/gprim/geomobjects.hpp +544 -0
  108. netgen/include/gprim/geomops.hpp +404 -0
  109. netgen/include/gprim/geomtest3d.hpp +101 -0
  110. netgen/include/gprim/gprim.hpp +33 -0
  111. netgen/include/gprim/spline.hpp +778 -0
  112. netgen/include/gprim/splinegeometry.hpp +73 -0
  113. netgen/include/gprim/transform3d.hpp +216 -0
  114. netgen/include/include/acisgeom.hpp +3 -0
  115. netgen/include/include/csg.hpp +1 -0
  116. netgen/include/include/geometry2d.hpp +1 -0
  117. netgen/include/include/gprim.hpp +1 -0
  118. netgen/include/include/incopengl.hpp +62 -0
  119. netgen/include/include/inctcl.hpp +13 -0
  120. netgen/include/include/incvis.hpp +6 -0
  121. netgen/include/include/linalg.hpp +1 -0
  122. netgen/include/include/meshing.hpp +1 -0
  123. netgen/include/include/myadt.hpp +1 -0
  124. netgen/include/include/mydefs.hpp +70 -0
  125. netgen/include/include/mystdlib.h +59 -0
  126. netgen/include/include/netgen_config.hpp +27 -0
  127. netgen/include/include/netgen_version.hpp +9 -0
  128. netgen/include/include/nginterface_v2_impl.hpp +395 -0
  129. netgen/include/include/ngsimd.hpp +1 -0
  130. netgen/include/include/occgeom.hpp +1 -0
  131. netgen/include/include/opti.hpp +1 -0
  132. netgen/include/include/parallel.hpp +1 -0
  133. netgen/include/include/stlgeom.hpp +1 -0
  134. netgen/include/include/visual.hpp +1 -0
  135. netgen/include/interface/rw_medit.hpp +11 -0
  136. netgen/include/interface/writeuser.hpp +80 -0
  137. netgen/include/linalg/densemat.hpp +414 -0
  138. netgen/include/linalg/linalg.hpp +29 -0
  139. netgen/include/linalg/opti.hpp +142 -0
  140. netgen/include/linalg/polynomial.hpp +47 -0
  141. netgen/include/linalg/vector.hpp +217 -0
  142. netgen/include/meshing/adfront2.hpp +274 -0
  143. netgen/include/meshing/adfront3.hpp +332 -0
  144. netgen/include/meshing/basegeom.hpp +370 -0
  145. netgen/include/meshing/bcfunctions.hpp +53 -0
  146. netgen/include/meshing/bisect.hpp +72 -0
  147. netgen/include/meshing/boundarylayer.hpp +113 -0
  148. netgen/include/meshing/classifyhpel.hpp +1984 -0
  149. netgen/include/meshing/clusters.hpp +46 -0
  150. netgen/include/meshing/curvedelems.hpp +274 -0
  151. netgen/include/meshing/delaunay2d.hpp +73 -0
  152. netgen/include/meshing/fieldlines.hpp +103 -0
  153. netgen/include/meshing/findip.hpp +198 -0
  154. netgen/include/meshing/findip2.hpp +103 -0
  155. netgen/include/meshing/geomsearch.hpp +69 -0
  156. netgen/include/meshing/global.hpp +54 -0
  157. netgen/include/meshing/hpref_hex.hpp +330 -0
  158. netgen/include/meshing/hpref_prism.hpp +3405 -0
  159. netgen/include/meshing/hpref_pyramid.hpp +154 -0
  160. netgen/include/meshing/hpref_quad.hpp +2082 -0
  161. netgen/include/meshing/hpref_segm.hpp +122 -0
  162. netgen/include/meshing/hpref_tet.hpp +4230 -0
  163. netgen/include/meshing/hpref_trig.hpp +848 -0
  164. netgen/include/meshing/hprefinement.hpp +366 -0
  165. netgen/include/meshing/improve2.hpp +178 -0
  166. netgen/include/meshing/improve3.hpp +151 -0
  167. netgen/include/meshing/localh.hpp +223 -0
  168. netgen/include/meshing/meshclass.hpp +1076 -0
  169. netgen/include/meshing/meshfunc.hpp +47 -0
  170. netgen/include/meshing/meshing.hpp +63 -0
  171. netgen/include/meshing/meshing2.hpp +163 -0
  172. netgen/include/meshing/meshing3.hpp +123 -0
  173. netgen/include/meshing/meshtool.hpp +90 -0
  174. netgen/include/meshing/meshtype.hpp +1930 -0
  175. netgen/include/meshing/msghandler.hpp +62 -0
  176. netgen/include/meshing/paralleltop.hpp +172 -0
  177. netgen/include/meshing/python_mesh.hpp +206 -0
  178. netgen/include/meshing/ruler2.hpp +172 -0
  179. netgen/include/meshing/ruler3.hpp +211 -0
  180. netgen/include/meshing/soldata.hpp +141 -0
  181. netgen/include/meshing/specials.hpp +17 -0
  182. netgen/include/meshing/surfacegeom.hpp +73 -0
  183. netgen/include/meshing/topology.hpp +1003 -0
  184. netgen/include/meshing/validate.hpp +21 -0
  185. netgen/include/meshing/visual_interface.hpp +71 -0
  186. netgen/include/mydefs.hpp +70 -0
  187. netgen/include/nginterface.h +474 -0
  188. netgen/include/nginterface_v2.hpp +406 -0
  189. netgen/include/nglib.h +697 -0
  190. netgen/include/nglib_occ.h +50 -0
  191. netgen/include/occ/occ_edge.hpp +47 -0
  192. netgen/include/occ/occ_face.hpp +52 -0
  193. netgen/include/occ/occ_solid.hpp +23 -0
  194. netgen/include/occ/occ_utils.hpp +376 -0
  195. netgen/include/occ/occ_vertex.hpp +30 -0
  196. netgen/include/occ/occgeom.hpp +659 -0
  197. netgen/include/occ/occmeshsurf.hpp +168 -0
  198. netgen/include/occ/vsocc.hpp +33 -0
  199. netgen/include/pybind11/LICENSE +29 -0
  200. netgen/include/pybind11/attr.h +722 -0
  201. netgen/include/pybind11/buffer_info.h +208 -0
  202. netgen/include/pybind11/cast.h +2361 -0
  203. netgen/include/pybind11/chrono.h +228 -0
  204. netgen/include/pybind11/common.h +2 -0
  205. netgen/include/pybind11/complex.h +74 -0
  206. netgen/include/pybind11/conduit/README.txt +15 -0
  207. netgen/include/pybind11/conduit/pybind11_conduit_v1.h +116 -0
  208. netgen/include/pybind11/conduit/pybind11_platform_abi_id.h +87 -0
  209. netgen/include/pybind11/conduit/wrap_include_python_h.h +72 -0
  210. netgen/include/pybind11/critical_section.h +56 -0
  211. netgen/include/pybind11/detail/class.h +823 -0
  212. netgen/include/pybind11/detail/common.h +1348 -0
  213. netgen/include/pybind11/detail/cpp_conduit.h +75 -0
  214. netgen/include/pybind11/detail/descr.h +226 -0
  215. netgen/include/pybind11/detail/dynamic_raw_ptr_cast_if_possible.h +39 -0
  216. netgen/include/pybind11/detail/exception_translation.h +71 -0
  217. netgen/include/pybind11/detail/function_record_pyobject.h +191 -0
  218. netgen/include/pybind11/detail/init.h +538 -0
  219. netgen/include/pybind11/detail/internals.h +799 -0
  220. netgen/include/pybind11/detail/native_enum_data.h +209 -0
  221. netgen/include/pybind11/detail/pybind11_namespace_macros.h +82 -0
  222. netgen/include/pybind11/detail/struct_smart_holder.h +378 -0
  223. netgen/include/pybind11/detail/type_caster_base.h +1591 -0
  224. netgen/include/pybind11/detail/typeid.h +65 -0
  225. netgen/include/pybind11/detail/using_smart_holder.h +22 -0
  226. netgen/include/pybind11/detail/value_and_holder.h +90 -0
  227. netgen/include/pybind11/eigen/common.h +9 -0
  228. netgen/include/pybind11/eigen/matrix.h +723 -0
  229. netgen/include/pybind11/eigen/tensor.h +521 -0
  230. netgen/include/pybind11/eigen.h +12 -0
  231. netgen/include/pybind11/embed.h +320 -0
  232. netgen/include/pybind11/eval.h +161 -0
  233. netgen/include/pybind11/functional.h +147 -0
  234. netgen/include/pybind11/gil.h +199 -0
  235. netgen/include/pybind11/gil_safe_call_once.h +102 -0
  236. netgen/include/pybind11/gil_simple.h +37 -0
  237. netgen/include/pybind11/iostream.h +265 -0
  238. netgen/include/pybind11/native_enum.h +67 -0
  239. netgen/include/pybind11/numpy.h +2312 -0
  240. netgen/include/pybind11/operators.h +202 -0
  241. netgen/include/pybind11/options.h +92 -0
  242. netgen/include/pybind11/pybind11.h +3645 -0
  243. netgen/include/pybind11/pytypes.h +2680 -0
  244. netgen/include/pybind11/stl/filesystem.h +114 -0
  245. netgen/include/pybind11/stl.h +666 -0
  246. netgen/include/pybind11/stl_bind.h +858 -0
  247. netgen/include/pybind11/subinterpreter.h +299 -0
  248. netgen/include/pybind11/trampoline_self_life_support.h +65 -0
  249. netgen/include/pybind11/type_caster_pyobject_ptr.h +61 -0
  250. netgen/include/pybind11/typing.h +298 -0
  251. netgen/include/pybind11/warnings.h +75 -0
  252. netgen/include/stlgeom/meshstlsurface.hpp +67 -0
  253. netgen/include/stlgeom/stlgeom.hpp +491 -0
  254. netgen/include/stlgeom/stlline.hpp +193 -0
  255. netgen/include/stlgeom/stltool.hpp +331 -0
  256. netgen/include/stlgeom/stltopology.hpp +419 -0
  257. netgen/include/stlgeom/vsstl.hpp +58 -0
  258. netgen/include/visualization/meshdoc.hpp +42 -0
  259. netgen/include/visualization/mvdraw.hpp +325 -0
  260. netgen/include/visualization/vispar.hpp +128 -0
  261. netgen/include/visualization/visual.hpp +28 -0
  262. netgen/include/visualization/visual_api.hpp +10 -0
  263. netgen/include/visualization/vssolution.hpp +399 -0
  264. netgen/lib/libnggui.lib +0 -0
  265. netgen/lib/ngcore.lib +0 -0
  266. netgen/lib/nglib.lib +0 -0
  267. netgen/lib/togl.lib +0 -0
  268. netgen/libnggui.dll +0 -0
  269. netgen/libngguipy.lib +0 -0
  270. netgen/libngguipy.pyd +0 -0
  271. netgen/libngpy/_NgOCC.pyi +1545 -0
  272. netgen/libngpy/__init__.pyi +7 -0
  273. netgen/libngpy/_csg.pyi +259 -0
  274. netgen/libngpy/_geom2d.pyi +323 -0
  275. netgen/libngpy/_meshing.pyi +1111 -0
  276. netgen/libngpy/_stl.pyi +131 -0
  277. netgen/libngpy.lib +0 -0
  278. netgen/libngpy.pyd +0 -0
  279. netgen/meshing.py +65 -0
  280. netgen/ngcore.dll +0 -0
  281. netgen/nglib.dll +0 -0
  282. netgen/occ.py +52 -0
  283. netgen/read_gmsh.py +259 -0
  284. netgen/read_meshio.py +22 -0
  285. netgen/stl.py +2 -0
  286. netgen/togl.dll +0 -0
  287. netgen/version.py +2 -0
  288. netgen/webgui.py +529 -0
  289. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/boundarycondition.geo +16 -0
  290. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/boxcyl.geo +32 -0
  291. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/circle_on_cube.geo +27 -0
  292. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cone.geo +13 -0
  293. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cube.geo +16 -0
  294. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubeandring.geo +55 -0
  295. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubeandspheres.geo +21 -0
  296. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubemcyl.geo +18 -0
  297. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubemsphere.geo +19 -0
  298. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cylinder.geo +12 -0
  299. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cylsphere.geo +12 -0
  300. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/doc/ng4.pdf +0 -0
  301. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ellipsoid.geo +8 -0
  302. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ellipticcyl.geo +10 -0
  303. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/extrusion.geo +99 -0
  304. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/fichera.geo +24 -0
  305. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/frame.step +11683 -0
  306. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/hinge.stl +8486 -0
  307. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/lshape3d.geo +26 -0
  308. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/manyholes.geo +26 -0
  309. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/manyholes2.geo +26 -0
  310. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/matrix.geo +27 -0
  311. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ortho.geo +11 -0
  312. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/part1.stl +2662 -0
  313. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/period.geo +33 -0
  314. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/exportNeutral.py +26 -0
  315. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/mesh.py +19 -0
  316. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/shaft.geo +65 -0
  317. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/revolution.geo +18 -0
  318. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/screw.step +1694 -0
  319. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sculpture.geo +13 -0
  320. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/shaft.geo +65 -0
  321. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/shell.geo +10 -0
  322. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sphere.geo +8 -0
  323. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sphereincube.geo +17 -0
  324. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/square.in2d +35 -0
  325. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/squarecircle.in2d +48 -0
  326. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/squarehole.in2d +47 -0
  327. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/torus.geo +8 -0
  328. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/trafo.geo +57 -0
  329. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twobricks.geo +15 -0
  330. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twocubes.geo +18 -0
  331. netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twocyl.geo +16 -0
  332. netgen_mesher-6.2.2506.post35.dev0.dist-info/METADATA +15 -0
  333. netgen_mesher-6.2.2506.post35.dev0.dist-info/RECORD +340 -0
  334. netgen_mesher-6.2.2506.post35.dev0.dist-info/WHEEL +5 -0
  335. netgen_mesher-6.2.2506.post35.dev0.dist-info/entry_points.txt +2 -0
  336. netgen_mesher-6.2.2506.post35.dev0.dist-info/licenses/AUTHORS +1 -0
  337. netgen_mesher-6.2.2506.post35.dev0.dist-info/licenses/LICENSE +504 -0
  338. netgen_mesher-6.2.2506.post35.dev0.dist-info/top_level.txt +2 -0
  339. pyngcore/__init__.py +1 -0
  340. pyngcore/pyngcore.cp314-win_amd64.pyd +0 -0
@@ -0,0 +1,94 @@
1
+ #ifndef NG_MPI_HPP_INCLUDED
2
+ #define NG_MPI_HPP_INCLUDED
3
+
4
+ #ifdef PARALLEL
5
+
6
+ #include <cstdint>
7
+ #include <filesystem>
8
+ #include <optional>
9
+
10
+ #include "ngcore_api.hpp"
11
+
12
+ #ifndef NG_MPI_WRAPPER
13
+ #define OMPI_SKIP_MPICXX
14
+ #include <mpi.h>
15
+ #endif // NG_MPI_WRAPPER
16
+
17
+ namespace ngcore {
18
+
19
+ NGCORE_API bool MPI_Loaded();
20
+ NGCORE_API void InitMPI(
21
+ std::optional<std::filesystem::path> mpi_lib_path = std::nullopt);
22
+
23
+ #ifdef NG_MPI_WRAPPER
24
+ inline void not_implemented() { throw std::runtime_error("Not implemented"); }
25
+
26
+ struct NG_MPI_Status {
27
+ uintptr_t data[4];
28
+ };
29
+
30
+ struct NG_MPI_Comm {
31
+ uintptr_t value;
32
+ NG_MPI_Comm() { value = 0; }
33
+ NG_MPI_Comm(uintptr_t value_) : value(value_) {}
34
+ NG_MPI_Comm(const NG_MPI_Comm &comm) : value(comm.value) {}
35
+
36
+ void operator=(int value_) { value = value_; }
37
+ void operator=(uintptr_t value_) { value = value_; }
38
+ bool operator==(const NG_MPI_Comm &comm) const { return value == comm.value; }
39
+ bool operator!=(const NG_MPI_Comm &comm) const { return value != comm.value; }
40
+ };
41
+
42
+ struct NG_MPI_Datatype {
43
+ uintptr_t value = 0;
44
+ NG_MPI_Datatype() = default;
45
+ NG_MPI_Datatype(uintptr_t value_) : value(value_) {}
46
+ operator bool() const { return value != 0; }
47
+ void operator=(NG_MPI_Datatype type) { value = type.value; }
48
+ void operator=(uintptr_t value_) { value = value_; }
49
+ void operator=(void *value_) { value = reinterpret_cast<uintptr_t>(value_); }
50
+ };
51
+
52
+ struct NG_MPI_Request {
53
+ uintptr_t value = 0;
54
+ NG_MPI_Request() = default;
55
+ NG_MPI_Request(uintptr_t value_) : value(value_) {}
56
+ void operator=(uintptr_t value_) { value = value_; }
57
+ void operator=(void *value_) { value = reinterpret_cast<uintptr_t>(value_); }
58
+ };
59
+
60
+ struct NG_MPI_Op {
61
+ uintptr_t value;
62
+ NG_MPI_Op(uintptr_t value_) : value(value_) {}
63
+ void operator=(uintptr_t value_) { value = value_; }
64
+ void operator=(void *value_) { value = reinterpret_cast<uintptr_t>(value_); }
65
+ };
66
+
67
+ struct NG_MPI_Group {
68
+ uintptr_t value = 0;
69
+ NG_MPI_Group(uintptr_t value_) : value(value_) {}
70
+ NG_MPI_Group() = default;
71
+ };
72
+
73
+ struct NG_MPI_Aint {
74
+ intptr_t value = 0;
75
+ NG_MPI_Aint(intptr_t value_) : value(value_) {}
76
+ NG_MPI_Aint() = default;
77
+ };
78
+
79
+ #else // NG_MPI_WRAPPER
80
+ using NG_MPI_Comm = MPI_Comm;
81
+ using NG_MPI_Status = MPI_Status;
82
+ using NG_MPI_Datatype = MPI_Datatype;
83
+ using NG_MPI_Request = MPI_Request;
84
+ using NG_MPI_Op = MPI_Op;
85
+ using NG_MPI_Group = MPI_Group;
86
+ using NG_MPI_Aint = MPI_Aint;
87
+ #endif // NG_MPI_WRAPPER
88
+
89
+ #include "ng_mpi_generated_declarations.hpp"
90
+
91
+ } // namespace ngcore
92
+
93
+ #endif // PARALLEL
94
+ #endif // NG_MPI_HPP_INCLUDED
@@ -0,0 +1,155 @@
1
+ #ifdef NG_MPI_WRAPPER
2
+ NGCORE_API extern double (*NG_MPI_Wtime)();
3
+ NGCORE_API extern int (*NG_MPI_Allgather)(void*, int, NG_MPI_Datatype, void*, int, NG_MPI_Datatype, NG_MPI_Comm);
4
+ NGCORE_API extern int (*NG_MPI_Allreduce)(void*, void*, int, NG_MPI_Datatype, NG_MPI_Op, NG_MPI_Comm);
5
+ NGCORE_API extern int (*NG_MPI_Alltoall)(void*, int, NG_MPI_Datatype, void*, int, NG_MPI_Datatype, NG_MPI_Comm);
6
+ NGCORE_API extern int (*NG_MPI_Barrier)(NG_MPI_Comm);
7
+ NGCORE_API extern int (*NG_MPI_Bcast)(void*, int, NG_MPI_Datatype, int, NG_MPI_Comm);
8
+ NGCORE_API extern int (*NG_MPI_Ibcast)(void*, int, NG_MPI_Datatype, int, NG_MPI_Comm, NG_MPI_Request*);
9
+ NGCORE_API extern int (*NG_MPI_Comm_c2f)(NG_MPI_Comm);
10
+ NGCORE_API extern int (*NG_MPI_Comm_create)(NG_MPI_Comm, NG_MPI_Group, NG_MPI_Comm*);
11
+ NGCORE_API extern int (*NG_MPI_Comm_create_group)(NG_MPI_Comm, NG_MPI_Group, int, NG_MPI_Comm*);
12
+ NGCORE_API extern int (*NG_MPI_Comm_free)(NG_MPI_Comm*);
13
+ NGCORE_API extern int (*NG_MPI_Comm_group)(NG_MPI_Comm, NG_MPI_Group*);
14
+ NGCORE_API extern int (*NG_MPI_Comm_rank)(NG_MPI_Comm, int*);
15
+ NGCORE_API extern int (*NG_MPI_Comm_size)(NG_MPI_Comm, int*);
16
+ NGCORE_API extern int (*NG_MPI_Finalize)();
17
+ NGCORE_API extern int (*NG_MPI_Gather)(void*, int, NG_MPI_Datatype, void*, int, NG_MPI_Datatype, int, NG_MPI_Comm);
18
+ NGCORE_API extern int (*NG_MPI_Gatherv)(void*, int, NG_MPI_Datatype, void*, int*, int*, NG_MPI_Datatype, int, NG_MPI_Comm);
19
+ NGCORE_API extern int (*NG_MPI_Get_count)(NG_MPI_Status*, NG_MPI_Datatype, int*);
20
+ NGCORE_API extern int (*NG_MPI_Get_processor_name)(char*, int*);
21
+ NGCORE_API extern int (*NG_MPI_Group_incl)(NG_MPI_Group, int, int*, NG_MPI_Group*);
22
+ NGCORE_API extern int (*NG_MPI_Init)(int*, char***);
23
+ NGCORE_API extern int (*NG_MPI_Init_thread)(int*, char***, int, int*);
24
+ NGCORE_API extern int (*NG_MPI_Initialized)(int*);
25
+ NGCORE_API extern int (*NG_MPI_Iprobe)(int, int, NG_MPI_Comm, int*, NG_MPI_Status*);
26
+ NGCORE_API extern int (*NG_MPI_Irecv)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm, NG_MPI_Request*);
27
+ NGCORE_API extern int (*NG_MPI_Isend)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm, NG_MPI_Request*);
28
+ NGCORE_API extern int (*NG_MPI_Probe)(int, int, NG_MPI_Comm, NG_MPI_Status*);
29
+ NGCORE_API extern int (*NG_MPI_Query_thread)(int*);
30
+ NGCORE_API extern int (*NG_MPI_Recv)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm, NG_MPI_Status*);
31
+ NGCORE_API extern int (*NG_MPI_Recv_init)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm, NG_MPI_Request*);
32
+ NGCORE_API extern int (*NG_MPI_Reduce)(void*, void*, int, NG_MPI_Datatype, NG_MPI_Op, int, NG_MPI_Comm);
33
+ NGCORE_API extern int (*NG_MPI_Reduce_local)(void*, void*, int, NG_MPI_Datatype, NG_MPI_Op);
34
+ NGCORE_API extern int (*NG_MPI_Request_free)(NG_MPI_Request*);
35
+ NGCORE_API extern int (*NG_MPI_Scatter)(void*, int, NG_MPI_Datatype, void*, int, NG_MPI_Datatype, int, NG_MPI_Comm);
36
+ NGCORE_API extern int (*NG_MPI_Send)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm);
37
+ NGCORE_API extern int (*NG_MPI_Send_init)(void*, int, NG_MPI_Datatype, int, int, NG_MPI_Comm, NG_MPI_Request*);
38
+ NGCORE_API extern int (*NG_MPI_Startall)(int, NG_MPI_Request*);
39
+ NGCORE_API extern int (*NG_MPI_Type_commit)(NG_MPI_Datatype*);
40
+ NGCORE_API extern int (*NG_MPI_Type_contiguous)(int, NG_MPI_Datatype, NG_MPI_Datatype*);
41
+ NGCORE_API extern int (*NG_MPI_Type_create_resized)(NG_MPI_Datatype, NG_MPI_Aint, NG_MPI_Aint, NG_MPI_Datatype*);
42
+ NGCORE_API extern int (*NG_MPI_Type_create_struct)(int, int*, NG_MPI_Aint*, NG_MPI_Datatype*, NG_MPI_Datatype*);
43
+ NGCORE_API extern int (*NG_MPI_Type_free)(NG_MPI_Datatype*);
44
+ NGCORE_API extern int (*NG_MPI_Type_get_extent)(NG_MPI_Datatype, NG_MPI_Aint*, NG_MPI_Aint*);
45
+ NGCORE_API extern int (*NG_MPI_Type_indexed)(int, int*, int*, NG_MPI_Datatype, NG_MPI_Datatype*);
46
+ NGCORE_API extern int (*NG_MPI_Type_size)(NG_MPI_Datatype, int*);
47
+ NGCORE_API extern int (*NG_MPI_Wait)(NG_MPI_Request*, NG_MPI_Status*);
48
+ NGCORE_API extern int (*NG_MPI_Waitall)(int, NG_MPI_Request*, NG_MPI_Status*);
49
+ NGCORE_API extern int (*NG_MPI_Waitany)(int, NG_MPI_Request*, int*, NG_MPI_Status*);
50
+ NGCORE_API extern NG_MPI_Comm NG_MPI_COMM_NULL;
51
+ NGCORE_API extern NG_MPI_Comm NG_MPI_COMM_WORLD;
52
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_CHAR;
53
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_CXX_DOUBLE_COMPLEX;
54
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_C_BOOL;
55
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_DATATYPE_NULL;
56
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_DOUBLE;
57
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_FLOAT;
58
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_INT;
59
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_SHORT;
60
+ NGCORE_API extern NG_MPI_Datatype NG_MPI_UINT64_T;
61
+ NGCORE_API extern NG_MPI_Op NG_MPI_LOR;
62
+ NGCORE_API extern NG_MPI_Op NG_MPI_MAX;
63
+ NGCORE_API extern NG_MPI_Op NG_MPI_MIN;
64
+ NGCORE_API extern NG_MPI_Op NG_MPI_SUM;
65
+ NGCORE_API extern NG_MPI_Request NG_MPI_REQUEST_NULL;
66
+ NGCORE_API extern NG_MPI_Status* NG_MPI_STATUSES_IGNORE;
67
+ NGCORE_API extern NG_MPI_Status* NG_MPI_STATUS_IGNORE;
68
+ NGCORE_API extern int NG_MPI_ANY_SOURCE;
69
+ NGCORE_API extern int NG_MPI_ANY_TAG;
70
+ NGCORE_API extern int NG_MPI_MAX_PROCESSOR_NAME;
71
+ NGCORE_API extern int NG_MPI_PROC_NULL;
72
+ NGCORE_API extern int NG_MPI_ROOT;
73
+ NGCORE_API extern int NG_MPI_SUBVERSION;
74
+ NGCORE_API extern int NG_MPI_THREAD_MULTIPLE;
75
+ NGCORE_API extern int NG_MPI_THREAD_SINGLE;
76
+ NGCORE_API extern int NG_MPI_VERSION;
77
+ NGCORE_API extern void* NG_MPI_IN_PLACE;
78
+ #else // NG_MPI_WRAPPER
79
+ #define NG_MPI_Wtime MPI_Wtime
80
+ #define NG_MPI_Allgather MPI_Allgather
81
+ #define NG_MPI_Allreduce MPI_Allreduce
82
+ #define NG_MPI_Alltoall MPI_Alltoall
83
+ #define NG_MPI_Barrier MPI_Barrier
84
+ #define NG_MPI_Bcast MPI_Bcast
85
+ #define NG_MPI_Ibcast MPI_Ibcast
86
+ #define NG_MPI_Comm_c2f MPI_Comm_c2f
87
+ #define NG_MPI_Comm_create MPI_Comm_create
88
+ #define NG_MPI_Comm_create_group MPI_Comm_create_group
89
+ #define NG_MPI_Comm_free MPI_Comm_free
90
+ #define NG_MPI_Comm_group MPI_Comm_group
91
+ #define NG_MPI_Comm_rank MPI_Comm_rank
92
+ #define NG_MPI_Comm_size MPI_Comm_size
93
+ #define NG_MPI_Finalize MPI_Finalize
94
+ #define NG_MPI_Gather MPI_Gather
95
+ #define NG_MPI_Gatherv MPI_Gatherv
96
+ #define NG_MPI_Get_count MPI_Get_count
97
+ #define NG_MPI_Get_processor_name MPI_Get_processor_name
98
+ #define NG_MPI_Group_incl MPI_Group_incl
99
+ #define NG_MPI_Init MPI_Init
100
+ #define NG_MPI_Init_thread MPI_Init_thread
101
+ #define NG_MPI_Initialized MPI_Initialized
102
+ #define NG_MPI_Iprobe MPI_Iprobe
103
+ #define NG_MPI_Irecv MPI_Irecv
104
+ #define NG_MPI_Isend MPI_Isend
105
+ #define NG_MPI_Probe MPI_Probe
106
+ #define NG_MPI_Query_thread MPI_Query_thread
107
+ #define NG_MPI_Recv MPI_Recv
108
+ #define NG_MPI_Recv_init MPI_Recv_init
109
+ #define NG_MPI_Reduce MPI_Reduce
110
+ #define NG_MPI_Reduce_local MPI_Reduce_local
111
+ #define NG_MPI_Request_free MPI_Request_free
112
+ #define NG_MPI_Scatter MPI_Scatter
113
+ #define NG_MPI_Send MPI_Send
114
+ #define NG_MPI_Send_init MPI_Send_init
115
+ #define NG_MPI_Startall MPI_Startall
116
+ #define NG_MPI_Type_commit MPI_Type_commit
117
+ #define NG_MPI_Type_contiguous MPI_Type_contiguous
118
+ #define NG_MPI_Type_create_resized MPI_Type_create_resized
119
+ #define NG_MPI_Type_create_struct MPI_Type_create_struct
120
+ #define NG_MPI_Type_free MPI_Type_free
121
+ #define NG_MPI_Type_get_extent MPI_Type_get_extent
122
+ #define NG_MPI_Type_indexed MPI_Type_indexed
123
+ #define NG_MPI_Type_size MPI_Type_size
124
+ #define NG_MPI_Wait MPI_Wait
125
+ #define NG_MPI_Waitall MPI_Waitall
126
+ #define NG_MPI_Waitany MPI_Waitany
127
+ #define NG_MPI_COMM_NULL MPI_COMM_NULL
128
+ #define NG_MPI_COMM_WORLD MPI_COMM_WORLD
129
+ #define NG_MPI_CHAR MPI_CHAR
130
+ #define NG_MPI_CXX_DOUBLE_COMPLEX MPI_CXX_DOUBLE_COMPLEX
131
+ #define NG_MPI_C_BOOL MPI_C_BOOL
132
+ #define NG_MPI_DATATYPE_NULL MPI_DATATYPE_NULL
133
+ #define NG_MPI_DOUBLE MPI_DOUBLE
134
+ #define NG_MPI_FLOAT MPI_FLOAT
135
+ #define NG_MPI_INT MPI_INT
136
+ #define NG_MPI_SHORT MPI_SHORT
137
+ #define NG_MPI_UINT64_T MPI_UINT64_T
138
+ #define NG_MPI_LOR MPI_LOR
139
+ #define NG_MPI_MAX MPI_MAX
140
+ #define NG_MPI_MIN MPI_MIN
141
+ #define NG_MPI_SUM MPI_SUM
142
+ #define NG_MPI_REQUEST_NULL MPI_REQUEST_NULL
143
+ #define NG_MPI_STATUSES_IGNORE MPI_STATUSES_IGNORE
144
+ #define NG_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
145
+ #define NG_MPI_ANY_SOURCE MPI_ANY_SOURCE
146
+ #define NG_MPI_ANY_TAG MPI_ANY_TAG
147
+ #define NG_MPI_MAX_PROCESSOR_NAME MPI_MAX_PROCESSOR_NAME
148
+ #define NG_MPI_PROC_NULL MPI_PROC_NULL
149
+ #define NG_MPI_ROOT MPI_ROOT
150
+ #define NG_MPI_SUBVERSION MPI_SUBVERSION
151
+ #define NG_MPI_THREAD_MULTIPLE MPI_THREAD_MULTIPLE
152
+ #define NG_MPI_THREAD_SINGLE MPI_THREAD_SINGLE
153
+ #define NG_MPI_VERSION MPI_VERSION
154
+ #define NG_MPI_IN_PLACE MPI_IN_PLACE
155
+ #endif // NG_MPI_WRAPPER
@@ -0,0 +1,25 @@
1
+ #ifndef NG_MPI_NATIVE_HPP
2
+ #define NG_MPI_NATIVE_HPP
3
+
4
+ #include <mpi.h>
5
+
6
+ #include "mpi_wrapper.hpp"
7
+ #include "ng_mpi.hpp"
8
+
9
+ namespace ngcore {
10
+
11
+ MPI_Comm NG_MPI_Native(NG_MPI_Comm comm) {
12
+ return reinterpret_cast<MPI_Comm>(comm.value);
13
+ }
14
+
15
+ MPI_Comm NG_MPI_Native(NgMPI_Comm comm) {
16
+ return reinterpret_cast<MPI_Comm>(static_cast<NG_MPI_Comm>(comm).value);
17
+ }
18
+
19
+ NG_MPI_Comm NG_MPI_From_Native (MPI_Comm comm) {
20
+ return {reinterpret_cast<uintptr_t>(comm)};
21
+ }
22
+
23
+ } // namespace ngcore
24
+
25
+ #endif // NG_MPI_NATIVE_HPP
@@ -0,0 +1,32 @@
1
+ #ifndef NETGEN_CORE_NGCORE_HPP
2
+ #define NETGEN_CORE_NGCORE_HPP
3
+
4
+ #include "archive.hpp"
5
+ #include "array.hpp"
6
+ #include "bitarray.hpp"
7
+ #include "exception.hpp"
8
+ #include "flags.hpp"
9
+ #include "table.hpp"
10
+ #include "hashtable.hpp"
11
+ #include "localheap.hpp"
12
+ #include "logging.hpp"
13
+ // #include "mpi_wrapper.hpp"
14
+ #include "profiler.hpp"
15
+ #include "signal.hpp"
16
+ #include "simd.hpp"
17
+ #include "autodiff.hpp"
18
+ #include "autodiffdiff.hpp"
19
+ #include "symboltable.hpp"
20
+ #include "taskmanager.hpp"
21
+ #include "version.hpp"
22
+ #include "xbool.hpp"
23
+ #include "ngstream.hpp"
24
+ #include "utils.hpp"
25
+ #include "ranges.hpp"
26
+ #include "statushandler.hpp"
27
+
28
+ #endif // NETGEN_CORE_NGCORE_HPP
29
+
30
+
31
+
32
+
@@ -0,0 +1,152 @@
1
+ #ifndef NETGEN_CORE_NGCORE_API_HPP
2
+ #define NETGEN_CORE_NGCORE_API_HPP
3
+
4
+ #include "netgen_config.hpp"
5
+
6
+ #ifdef WIN32
7
+
8
+ // This function or variable may be unsafe. Consider using _ftime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
9
+ #pragma warning(disable:4244)
10
+ #pragma warning(disable:4996)
11
+
12
+ // multiple inheritance via dominance
13
+ #pragma warning(disable:4250)
14
+
15
+ // needs to have dll-interface to be used by clients of class
16
+ #pragma warning(disable:4251)
17
+
18
+ // size_t to int conversion:
19
+ #pragma warning(disable:4267)
20
+
21
+ // non dll-interface class 'std::exception' used as base for dll-interface class
22
+ #pragma warning(disable:4275)
23
+
24
+ // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
25
+ #pragma warning(disable:4290)
26
+
27
+ // no suitable definition provided for explicit template instantiation request
28
+ #pragma warning(disable:4661)
29
+
30
+ // bool-int conversion
31
+ #pragma warning(disable:4800)
32
+
33
+ // '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
34
+ #pragma warning(disable:4910)
35
+
36
+ #endif // WIN32
37
+
38
+
39
+ #ifdef WIN32
40
+ #define NGCORE_API_EXPORT __declspec(dllexport)
41
+ #define NGCORE_API_IMPORT __declspec(dllimport)
42
+ #else
43
+ #define NGCORE_API_EXPORT __attribute__((visibility("default")))
44
+ #define NGCORE_API_IMPORT __attribute__((visibility("default")))
45
+ #endif
46
+
47
+ #ifdef NGCORE_EXPORTS
48
+ #define NGCORE_API NGCORE_API_EXPORT
49
+ #else
50
+ #define NGCORE_API NGCORE_API_IMPORT
51
+ #endif
52
+
53
+ // Set __host__ __device__ for all inline functions
54
+ #ifdef __CUDACC__
55
+ #define NETGEN_HD __host__ __device__
56
+ #else // __CUDACC__
57
+ #define NETGEN_HD
58
+ #endif // __CUDACC__
59
+
60
+ #ifdef __INTEL_COMPILER
61
+ #define NETGEN_ALWAYS_INLINE __forceinline
62
+ #define NETGEN_INLINE __forceinline inline
63
+ #ifdef WIN32
64
+ #define NETGEN_LAMBDA_INLINE
65
+ #else
66
+ #define NETGEN_LAMBDA_INLINE __attribute__ ((__always_inline__))
67
+ #endif
68
+ #else
69
+ #ifdef __GNUC__
70
+ #define NETGEN_ALWAYS_INLINE __attribute__ ((__always_inline__))
71
+ #define NETGEN_INLINE __attribute__ ((__always_inline__)) inline NETGEN_HD
72
+ #define NETGEN_LAMBDA_INLINE __attribute__ ((__always_inline__)) NETGEN_HD
73
+ #define NETGEN_VLA
74
+ #else
75
+ #define NETGEN_ALWAYS_INLINE
76
+ #define NETGEN_INLINE inline
77
+ #define NETGEN_LAMBDA_INLINE
78
+ #endif
79
+ #endif
80
+
81
+ #if defined(__amd64__) || defined(_M_AMD64)
82
+ #define NETGEN_ARCH_AMD64
83
+ #endif
84
+
85
+ #if defined(__aarch64__) || defined(_M_ARM64)
86
+ #define NETGEN_ARCH_ARM64
87
+ #endif
88
+
89
+ #if defined(__arm__) || defined(_M_ARM)
90
+ #define NETGEN_ARCH_ARM
91
+ #endif
92
+
93
+ #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
94
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
95
+ // The c++ standard library on MacOS 10.13 and earlier has no aligned new operator,
96
+ // thus implement it here globally
97
+ #include <mm_malloc.h>
98
+ #ifdef __clang__
99
+ #pragma clang diagnostic ignored "-Winline-new-delete"
100
+ #endif
101
+ inline void * operator new (size_t s, std::align_val_t al)
102
+ {
103
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
104
+ return _mm_malloc(s, int(al));
105
+ else
106
+ return new char[s];
107
+ }
108
+
109
+ inline void * operator new[] (size_t s, std::align_val_t al)
110
+ {
111
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
112
+ return _mm_malloc(s, int(al));
113
+ else
114
+ return new char[s];
115
+ }
116
+
117
+ inline void operator delete ( void* ptr, std::align_val_t al ) noexcept
118
+ {
119
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
120
+ _mm_free(ptr);
121
+ else
122
+ delete (char*)ptr;
123
+ }
124
+
125
+ inline void operator delete[]( void* ptr, std::align_val_t al ) noexcept
126
+ {
127
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
128
+ _mm_free(ptr);
129
+ else
130
+ delete[] (char*)ptr;
131
+ }
132
+
133
+ inline void operator delete ( void* ptr, std::size_t sz, std::align_val_t al ) noexcept
134
+ {
135
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
136
+ _mm_free(ptr);
137
+ else
138
+ delete (char*)ptr;
139
+ }
140
+
141
+ inline void operator delete[]( void* ptr, std::size_t sz, std::align_val_t al ) noexcept
142
+ {
143
+ if (int(al) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
144
+ _mm_free(ptr);
145
+ else
146
+ delete[] (char*)ptr;
147
+ }
148
+
149
+ #endif // __MAC_OS_X_VERSION_MIN_REQUIRED
150
+ #endif // __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
151
+
152
+ #endif // NETGEN_CORE_NGCORE_API_HPP
@@ -0,0 +1,115 @@
1
+ #ifndef FILE_NGSTREAM
2
+ #define FILE_NGSTREAM
3
+
4
+ /**************************************************************************/
5
+ /* File: ng(s)stream.hpp */
6
+ /* Author: Joachim Schoeberl */
7
+ /* Date: 20. Jul. 2011 */
8
+ /**************************************************************************/
9
+
10
+ // #include <ios>
11
+ // #include <iostream>
12
+ namespace ngcore
13
+ {
14
+
15
+ NGCORE_API extern int printmessage_importance;
16
+
17
+ // important message
18
+ class IM
19
+ {
20
+ int value;
21
+ public:
22
+ IM (int val) : value(val) { ; }
23
+ int Value () const { return value; }
24
+ };
25
+
26
+ class trunc
27
+ {
28
+ double eps;
29
+ public:
30
+ trunc (double aeps) : eps(aeps) { ; }
31
+ double Eps() const { return eps; }
32
+ };
33
+
34
+ class NGSOStream
35
+ {
36
+ std::ostream & ost;
37
+ bool active;
38
+ NGCORE_API static bool glob_active;
39
+ double trunc;
40
+ public:
41
+ NGSOStream (std::ostream & aost, bool aactive)
42
+ : ost(aost), active(aactive), trunc(-1) { ; }
43
+ NGSOStream & SetTrunc (double atrunc) { trunc = atrunc; return *this; }
44
+ double GetTrunc () const { return trunc; }
45
+ bool Active () const { return active && glob_active; }
46
+ std::ostream & GetStream () { return ost; }
47
+ static void SetGlobalActive (bool b) { glob_active = b; }
48
+ };
49
+
50
+ inline NGSOStream operator<< (std::ostream & ost, const IM & im)
51
+ {
52
+ return NGSOStream (ost,
53
+ (im.Value() <= printmessage_importance));
54
+ }
55
+
56
+ /*
57
+ // doesn't work for matrices
58
+ inline NGSOStream operator<< (ostream & ost, trunc tr)
59
+ {
60
+ cout << "set trunc modifier" << endl;
61
+ return NGSOStream (ost, true).SetTrunc (tr.Eps());
62
+ }
63
+ */
64
+
65
+
66
+ template <typename T>
67
+ inline NGSOStream operator<< (NGSOStream ngsost, const T & data)
68
+ {
69
+ if (ngsost.Active())
70
+ ngsost.GetStream() << data;
71
+ return ngsost;
72
+ }
73
+
74
+ /*
75
+ inline NGSOStream operator<< (NGSOStream ngsost, const double & data)
76
+ {
77
+ cout << "double out" << endl;
78
+ if (ngsost.Active())
79
+ {
80
+ double hdata = data;
81
+ if (fabs (hdata) < ngsost.GetTrunc()) hdata = 0.0;
82
+ ngsost.GetStream() << hdata;
83
+ }
84
+ return ngsost;
85
+ }
86
+ */
87
+
88
+ inline NGSOStream operator<< (NGSOStream ngsost, std::ostream& ( *pf )(std::ostream&))
89
+ {
90
+ if ( ngsost.Active() )
91
+ ngsost.GetStream() << (*pf);
92
+
93
+ return ngsost;
94
+ }
95
+
96
+ inline NGSOStream operator<< (NGSOStream ngsost, std::ios& ( *pf )(std::ios&))
97
+ {
98
+ if ( ngsost.Active() )
99
+ ngsost.GetStream() << (*pf);
100
+
101
+ return ngsost;
102
+ }
103
+
104
+ inline NGSOStream operator<< (NGSOStream ngsost, std::ios_base& ( *pf )(std::ios_base&))
105
+ {
106
+ if ( ngsost.Active() )
107
+ ngsost.GetStream() << (*pf);
108
+
109
+ return ngsost;
110
+ }
111
+
112
+
113
+ }
114
+
115
+ #endif