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.
- netgen/NgOCC.py +7 -0
- netgen/__init__.py +114 -0
- netgen/__init__.pyi +22 -0
- netgen/__main__.py +53 -0
- netgen/cmake/NetgenConfig.cmake +79 -0
- netgen/cmake/netgen-targets-release.cmake +69 -0
- netgen/cmake/netgen-targets.cmake +146 -0
- netgen/config/__init__.py +1 -0
- netgen/config/__init__.pyi +52 -0
- netgen/config/__main__.py +4 -0
- netgen/config/config.py +68 -0
- netgen/config/config.pyi +54 -0
- netgen/csg.py +25 -0
- netgen/geom2d.py +178 -0
- netgen/gui.py +82 -0
- netgen/include/core/archive.hpp +1256 -0
- netgen/include/core/array.hpp +1760 -0
- netgen/include/core/autodiff.hpp +1131 -0
- netgen/include/core/autodiffdiff.hpp +733 -0
- netgen/include/core/bitarray.hpp +240 -0
- netgen/include/core/concurrentqueue.h +3619 -0
- netgen/include/core/exception.hpp +145 -0
- netgen/include/core/flags.hpp +199 -0
- netgen/include/core/hashtable.hpp +1281 -0
- netgen/include/core/localheap.hpp +318 -0
- netgen/include/core/logging.hpp +117 -0
- netgen/include/core/memtracer.hpp +221 -0
- netgen/include/core/mpi4py_pycapi.h +245 -0
- netgen/include/core/mpi_wrapper.hpp +643 -0
- netgen/include/core/ng_mpi.hpp +94 -0
- netgen/include/core/ng_mpi_generated_declarations.hpp +155 -0
- netgen/include/core/ng_mpi_native.hpp +25 -0
- netgen/include/core/ngcore.hpp +32 -0
- netgen/include/core/ngcore_api.hpp +152 -0
- netgen/include/core/ngstream.hpp +115 -0
- netgen/include/core/paje_trace.hpp +279 -0
- netgen/include/core/profiler.hpp +382 -0
- netgen/include/core/python_ngcore.hpp +457 -0
- netgen/include/core/ranges.hpp +109 -0
- netgen/include/core/register_archive.hpp +100 -0
- netgen/include/core/signal.hpp +82 -0
- netgen/include/core/simd.hpp +160 -0
- netgen/include/core/simd_arm64.hpp +407 -0
- netgen/include/core/simd_avx.hpp +394 -0
- netgen/include/core/simd_avx512.hpp +285 -0
- netgen/include/core/simd_generic.hpp +1053 -0
- netgen/include/core/simd_math.hpp +178 -0
- netgen/include/core/simd_sse.hpp +289 -0
- netgen/include/core/statushandler.hpp +37 -0
- netgen/include/core/symboltable.hpp +153 -0
- netgen/include/core/table.hpp +810 -0
- netgen/include/core/taskmanager.hpp +1161 -0
- netgen/include/core/type_traits.hpp +65 -0
- netgen/include/core/utils.hpp +385 -0
- netgen/include/core/version.hpp +102 -0
- netgen/include/core/xbool.hpp +47 -0
- netgen/include/csg/algprim.hpp +563 -0
- netgen/include/csg/brick.hpp +150 -0
- netgen/include/csg/csg.hpp +43 -0
- netgen/include/csg/csgeom.hpp +389 -0
- netgen/include/csg/csgparser.hpp +101 -0
- netgen/include/csg/curve2d.hpp +67 -0
- netgen/include/csg/edgeflw.hpp +112 -0
- netgen/include/csg/explicitcurve2d.hpp +113 -0
- netgen/include/csg/extrusion.hpp +185 -0
- netgen/include/csg/gencyl.hpp +70 -0
- netgen/include/csg/geoml.hpp +16 -0
- netgen/include/csg/identify.hpp +213 -0
- netgen/include/csg/manifold.hpp +29 -0
- netgen/include/csg/meshsurf.hpp +46 -0
- netgen/include/csg/polyhedra.hpp +121 -0
- netgen/include/csg/revolution.hpp +180 -0
- netgen/include/csg/singularref.hpp +84 -0
- netgen/include/csg/solid.hpp +295 -0
- netgen/include/csg/specpoin.hpp +194 -0
- netgen/include/csg/spline3d.hpp +99 -0
- netgen/include/csg/splinesurface.hpp +85 -0
- netgen/include/csg/surface.hpp +394 -0
- netgen/include/csg/triapprox.hpp +63 -0
- netgen/include/csg/vscsg.hpp +34 -0
- netgen/include/general/autodiff.hpp +356 -0
- netgen/include/general/autoptr.hpp +39 -0
- netgen/include/general/gzstream.h +121 -0
- netgen/include/general/hashtabl.hpp +1692 -0
- netgen/include/general/myadt.hpp +48 -0
- netgen/include/general/mystring.hpp +226 -0
- netgen/include/general/netgenout.hpp +205 -0
- netgen/include/general/ngarray.hpp +797 -0
- netgen/include/general/ngbitarray.hpp +149 -0
- netgen/include/general/ngpython.hpp +74 -0
- netgen/include/general/optmem.hpp +44 -0
- netgen/include/general/parthreads.hpp +138 -0
- netgen/include/general/seti.hpp +50 -0
- netgen/include/general/sort.hpp +47 -0
- netgen/include/general/spbita2d.hpp +59 -0
- netgen/include/general/stack.hpp +114 -0
- netgen/include/general/table.hpp +280 -0
- netgen/include/general/template.hpp +509 -0
- netgen/include/geom2d/csg2d.hpp +750 -0
- netgen/include/geom2d/geometry2d.hpp +280 -0
- netgen/include/geom2d/spline2d.hpp +234 -0
- netgen/include/geom2d/vsgeom2d.hpp +28 -0
- netgen/include/gprim/adtree.hpp +1392 -0
- netgen/include/gprim/geom2d.hpp +858 -0
- netgen/include/gprim/geom3d.hpp +749 -0
- netgen/include/gprim/geomfuncs.hpp +212 -0
- netgen/include/gprim/geomobjects.hpp +544 -0
- netgen/include/gprim/geomops.hpp +404 -0
- netgen/include/gprim/geomtest3d.hpp +101 -0
- netgen/include/gprim/gprim.hpp +33 -0
- netgen/include/gprim/spline.hpp +778 -0
- netgen/include/gprim/splinegeometry.hpp +73 -0
- netgen/include/gprim/transform3d.hpp +216 -0
- netgen/include/include/acisgeom.hpp +3 -0
- netgen/include/include/csg.hpp +1 -0
- netgen/include/include/geometry2d.hpp +1 -0
- netgen/include/include/gprim.hpp +1 -0
- netgen/include/include/incopengl.hpp +62 -0
- netgen/include/include/inctcl.hpp +13 -0
- netgen/include/include/incvis.hpp +6 -0
- netgen/include/include/linalg.hpp +1 -0
- netgen/include/include/meshing.hpp +1 -0
- netgen/include/include/myadt.hpp +1 -0
- netgen/include/include/mydefs.hpp +70 -0
- netgen/include/include/mystdlib.h +59 -0
- netgen/include/include/netgen_config.hpp +27 -0
- netgen/include/include/netgen_version.hpp +9 -0
- netgen/include/include/nginterface_v2_impl.hpp +395 -0
- netgen/include/include/ngsimd.hpp +1 -0
- netgen/include/include/occgeom.hpp +1 -0
- netgen/include/include/opti.hpp +1 -0
- netgen/include/include/parallel.hpp +1 -0
- netgen/include/include/stlgeom.hpp +1 -0
- netgen/include/include/visual.hpp +1 -0
- netgen/include/interface/rw_medit.hpp +11 -0
- netgen/include/interface/writeuser.hpp +80 -0
- netgen/include/linalg/densemat.hpp +414 -0
- netgen/include/linalg/linalg.hpp +29 -0
- netgen/include/linalg/opti.hpp +142 -0
- netgen/include/linalg/polynomial.hpp +47 -0
- netgen/include/linalg/vector.hpp +217 -0
- netgen/include/meshing/adfront2.hpp +274 -0
- netgen/include/meshing/adfront3.hpp +332 -0
- netgen/include/meshing/basegeom.hpp +370 -0
- netgen/include/meshing/bcfunctions.hpp +53 -0
- netgen/include/meshing/bisect.hpp +72 -0
- netgen/include/meshing/boundarylayer.hpp +113 -0
- netgen/include/meshing/classifyhpel.hpp +1984 -0
- netgen/include/meshing/clusters.hpp +46 -0
- netgen/include/meshing/curvedelems.hpp +274 -0
- netgen/include/meshing/delaunay2d.hpp +73 -0
- netgen/include/meshing/fieldlines.hpp +103 -0
- netgen/include/meshing/findip.hpp +198 -0
- netgen/include/meshing/findip2.hpp +103 -0
- netgen/include/meshing/geomsearch.hpp +69 -0
- netgen/include/meshing/global.hpp +54 -0
- netgen/include/meshing/hpref_hex.hpp +330 -0
- netgen/include/meshing/hpref_prism.hpp +3405 -0
- netgen/include/meshing/hpref_pyramid.hpp +154 -0
- netgen/include/meshing/hpref_quad.hpp +2082 -0
- netgen/include/meshing/hpref_segm.hpp +122 -0
- netgen/include/meshing/hpref_tet.hpp +4230 -0
- netgen/include/meshing/hpref_trig.hpp +848 -0
- netgen/include/meshing/hprefinement.hpp +366 -0
- netgen/include/meshing/improve2.hpp +178 -0
- netgen/include/meshing/improve3.hpp +151 -0
- netgen/include/meshing/localh.hpp +223 -0
- netgen/include/meshing/meshclass.hpp +1076 -0
- netgen/include/meshing/meshfunc.hpp +47 -0
- netgen/include/meshing/meshing.hpp +63 -0
- netgen/include/meshing/meshing2.hpp +163 -0
- netgen/include/meshing/meshing3.hpp +123 -0
- netgen/include/meshing/meshtool.hpp +90 -0
- netgen/include/meshing/meshtype.hpp +1930 -0
- netgen/include/meshing/msghandler.hpp +62 -0
- netgen/include/meshing/paralleltop.hpp +172 -0
- netgen/include/meshing/python_mesh.hpp +206 -0
- netgen/include/meshing/ruler2.hpp +172 -0
- netgen/include/meshing/ruler3.hpp +211 -0
- netgen/include/meshing/soldata.hpp +141 -0
- netgen/include/meshing/specials.hpp +17 -0
- netgen/include/meshing/surfacegeom.hpp +73 -0
- netgen/include/meshing/topology.hpp +1003 -0
- netgen/include/meshing/validate.hpp +21 -0
- netgen/include/meshing/visual_interface.hpp +71 -0
- netgen/include/mydefs.hpp +70 -0
- netgen/include/nginterface.h +474 -0
- netgen/include/nginterface_v2.hpp +406 -0
- netgen/include/nglib.h +697 -0
- netgen/include/nglib_occ.h +50 -0
- netgen/include/occ/occ_edge.hpp +47 -0
- netgen/include/occ/occ_face.hpp +52 -0
- netgen/include/occ/occ_solid.hpp +23 -0
- netgen/include/occ/occ_utils.hpp +376 -0
- netgen/include/occ/occ_vertex.hpp +30 -0
- netgen/include/occ/occgeom.hpp +659 -0
- netgen/include/occ/occmeshsurf.hpp +168 -0
- netgen/include/occ/vsocc.hpp +33 -0
- netgen/include/pybind11/LICENSE +29 -0
- netgen/include/pybind11/attr.h +722 -0
- netgen/include/pybind11/buffer_info.h +208 -0
- netgen/include/pybind11/cast.h +2361 -0
- netgen/include/pybind11/chrono.h +228 -0
- netgen/include/pybind11/common.h +2 -0
- netgen/include/pybind11/complex.h +74 -0
- netgen/include/pybind11/conduit/README.txt +15 -0
- netgen/include/pybind11/conduit/pybind11_conduit_v1.h +116 -0
- netgen/include/pybind11/conduit/pybind11_platform_abi_id.h +87 -0
- netgen/include/pybind11/conduit/wrap_include_python_h.h +72 -0
- netgen/include/pybind11/critical_section.h +56 -0
- netgen/include/pybind11/detail/class.h +823 -0
- netgen/include/pybind11/detail/common.h +1348 -0
- netgen/include/pybind11/detail/cpp_conduit.h +75 -0
- netgen/include/pybind11/detail/descr.h +226 -0
- netgen/include/pybind11/detail/dynamic_raw_ptr_cast_if_possible.h +39 -0
- netgen/include/pybind11/detail/exception_translation.h +71 -0
- netgen/include/pybind11/detail/function_record_pyobject.h +191 -0
- netgen/include/pybind11/detail/init.h +538 -0
- netgen/include/pybind11/detail/internals.h +799 -0
- netgen/include/pybind11/detail/native_enum_data.h +209 -0
- netgen/include/pybind11/detail/pybind11_namespace_macros.h +82 -0
- netgen/include/pybind11/detail/struct_smart_holder.h +378 -0
- netgen/include/pybind11/detail/type_caster_base.h +1591 -0
- netgen/include/pybind11/detail/typeid.h +65 -0
- netgen/include/pybind11/detail/using_smart_holder.h +22 -0
- netgen/include/pybind11/detail/value_and_holder.h +90 -0
- netgen/include/pybind11/eigen/common.h +9 -0
- netgen/include/pybind11/eigen/matrix.h +723 -0
- netgen/include/pybind11/eigen/tensor.h +521 -0
- netgen/include/pybind11/eigen.h +12 -0
- netgen/include/pybind11/embed.h +320 -0
- netgen/include/pybind11/eval.h +161 -0
- netgen/include/pybind11/functional.h +147 -0
- netgen/include/pybind11/gil.h +199 -0
- netgen/include/pybind11/gil_safe_call_once.h +102 -0
- netgen/include/pybind11/gil_simple.h +37 -0
- netgen/include/pybind11/iostream.h +265 -0
- netgen/include/pybind11/native_enum.h +67 -0
- netgen/include/pybind11/numpy.h +2312 -0
- netgen/include/pybind11/operators.h +202 -0
- netgen/include/pybind11/options.h +92 -0
- netgen/include/pybind11/pybind11.h +3645 -0
- netgen/include/pybind11/pytypes.h +2680 -0
- netgen/include/pybind11/stl/filesystem.h +114 -0
- netgen/include/pybind11/stl.h +666 -0
- netgen/include/pybind11/stl_bind.h +858 -0
- netgen/include/pybind11/subinterpreter.h +299 -0
- netgen/include/pybind11/trampoline_self_life_support.h +65 -0
- netgen/include/pybind11/type_caster_pyobject_ptr.h +61 -0
- netgen/include/pybind11/typing.h +298 -0
- netgen/include/pybind11/warnings.h +75 -0
- netgen/include/stlgeom/meshstlsurface.hpp +67 -0
- netgen/include/stlgeom/stlgeom.hpp +491 -0
- netgen/include/stlgeom/stlline.hpp +193 -0
- netgen/include/stlgeom/stltool.hpp +331 -0
- netgen/include/stlgeom/stltopology.hpp +419 -0
- netgen/include/stlgeom/vsstl.hpp +58 -0
- netgen/include/visualization/meshdoc.hpp +42 -0
- netgen/include/visualization/mvdraw.hpp +325 -0
- netgen/include/visualization/vispar.hpp +128 -0
- netgen/include/visualization/visual.hpp +28 -0
- netgen/include/visualization/visual_api.hpp +10 -0
- netgen/include/visualization/vssolution.hpp +399 -0
- netgen/lib/libnggui.lib +0 -0
- netgen/lib/ngcore.lib +0 -0
- netgen/lib/nglib.lib +0 -0
- netgen/lib/togl.lib +0 -0
- netgen/libnggui.dll +0 -0
- netgen/libngguipy.lib +0 -0
- netgen/libngguipy.pyd +0 -0
- netgen/libngpy/_NgOCC.pyi +1545 -0
- netgen/libngpy/__init__.pyi +7 -0
- netgen/libngpy/_csg.pyi +259 -0
- netgen/libngpy/_geom2d.pyi +323 -0
- netgen/libngpy/_meshing.pyi +1111 -0
- netgen/libngpy/_stl.pyi +131 -0
- netgen/libngpy.lib +0 -0
- netgen/libngpy.pyd +0 -0
- netgen/meshing.py +65 -0
- netgen/ngcore.dll +0 -0
- netgen/nglib.dll +0 -0
- netgen/occ.py +52 -0
- netgen/read_gmsh.py +259 -0
- netgen/read_meshio.py +22 -0
- netgen/stl.py +2 -0
- netgen/togl.dll +0 -0
- netgen/version.py +2 -0
- netgen/webgui.py +529 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/boundarycondition.geo +16 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/boxcyl.geo +32 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/circle_on_cube.geo +27 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cone.geo +13 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cube.geo +16 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubeandring.geo +55 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubeandspheres.geo +21 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubemcyl.geo +18 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cubemsphere.geo +19 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cylinder.geo +12 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/cylsphere.geo +12 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/doc/ng4.pdf +0 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ellipsoid.geo +8 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ellipticcyl.geo +10 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/extrusion.geo +99 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/fichera.geo +24 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/frame.step +11683 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/hinge.stl +8486 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/lshape3d.geo +26 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/manyholes.geo +26 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/manyholes2.geo +26 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/matrix.geo +27 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/ortho.geo +11 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/part1.stl +2662 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/period.geo +33 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/exportNeutral.py +26 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/mesh.py +19 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/py_tutorials/shaft.geo +65 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/revolution.geo +18 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/screw.step +1694 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sculpture.geo +13 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/shaft.geo +65 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/shell.geo +10 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sphere.geo +8 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/sphereincube.geo +17 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/square.in2d +35 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/squarecircle.in2d +48 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/squarehole.in2d +47 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/torus.geo +8 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/trafo.geo +57 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twobricks.geo +15 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twocubes.geo +18 -0
- netgen_mesher-6.2.2506.post35.dev0.data/data/share/netgen/twocyl.geo +16 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/METADATA +15 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/RECORD +340 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/WHEEL +5 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/entry_points.txt +2 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/licenses/AUTHORS +1 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/licenses/LICENSE +504 -0
- netgen_mesher-6.2.2506.post35.dev0.dist-info/top_level.txt +2 -0
- pyngcore/__init__.py +1 -0
- pyngcore/pyngcore.cp314-win_amd64.pyd +0 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
#ifndef FILE_ADFRONT3
|
|
2
|
+
#define FILE_ADFRONT3
|
|
3
|
+
|
|
4
|
+
/**************************************************************************/
|
|
5
|
+
/* File: adfront3.hh */
|
|
6
|
+
/* Author: Joachim Schoeberl */
|
|
7
|
+
/* Date: 01. Okt. 95 */
|
|
8
|
+
/**************************************************************************/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
Advancing front class for volume meshing
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#include <gprim/geomobjects.hpp>
|
|
15
|
+
#include <gprim/adtree.hpp>
|
|
16
|
+
#include "meshtype.hpp"
|
|
17
|
+
#include "geomsearch.hpp"
|
|
18
|
+
|
|
19
|
+
namespace netgen
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
/// Point in advancing front
|
|
23
|
+
class FrontPoint3
|
|
24
|
+
{
|
|
25
|
+
/// coordinates
|
|
26
|
+
Point<3> p;
|
|
27
|
+
/// global node index
|
|
28
|
+
PointIndex globalindex;
|
|
29
|
+
/// number of faces connected to point
|
|
30
|
+
int nfacetopoint;
|
|
31
|
+
/// distance to original boundary
|
|
32
|
+
int frontnr;
|
|
33
|
+
///
|
|
34
|
+
PointIndex cluster;
|
|
35
|
+
public:
|
|
36
|
+
///
|
|
37
|
+
FrontPoint3 ();
|
|
38
|
+
///
|
|
39
|
+
FrontPoint3 (const Point<3> & ap, PointIndex agi);
|
|
40
|
+
|
|
41
|
+
///
|
|
42
|
+
const Point<3> & P () const
|
|
43
|
+
{ return p; }
|
|
44
|
+
///
|
|
45
|
+
PointIndex GlobalIndex () const
|
|
46
|
+
{ return globalindex; }
|
|
47
|
+
|
|
48
|
+
///
|
|
49
|
+
void AddFace ()
|
|
50
|
+
{ nfacetopoint++; }
|
|
51
|
+
|
|
52
|
+
/// if last face is removed, then point is invalidated
|
|
53
|
+
void RemoveFace()
|
|
54
|
+
{
|
|
55
|
+
nfacetopoint--;
|
|
56
|
+
if (nfacetopoint == 0) nfacetopoint = -1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
///
|
|
60
|
+
bool Valid () const
|
|
61
|
+
{ return nfacetopoint >= 0; }
|
|
62
|
+
|
|
63
|
+
///
|
|
64
|
+
void DecFrontNr (int afrontnr)
|
|
65
|
+
{
|
|
66
|
+
if (frontnr > afrontnr) frontnr = afrontnr;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
///
|
|
70
|
+
int FrontNr () const
|
|
71
|
+
{ return frontnr; }
|
|
72
|
+
|
|
73
|
+
///
|
|
74
|
+
friend class AdFront3;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class MiniElement2d
|
|
80
|
+
{
|
|
81
|
+
protected:
|
|
82
|
+
int np;
|
|
83
|
+
PointIndex pnum[4]; // can be global or local nums
|
|
84
|
+
bool deleted;
|
|
85
|
+
public:
|
|
86
|
+
MiniElement2d ()
|
|
87
|
+
{ np = 3; deleted = 0; }
|
|
88
|
+
MiniElement2d (int anp)
|
|
89
|
+
{ np = anp; deleted = 0; }
|
|
90
|
+
|
|
91
|
+
int GetNP() const { return np; }
|
|
92
|
+
PointIndex & operator[] (int i) { return pnum[i]; }
|
|
93
|
+
const PointIndex operator[] (int i) const { return pnum[i]; }
|
|
94
|
+
|
|
95
|
+
const PointIndex PNum (int i) const { return pnum[i-1]; }
|
|
96
|
+
PointIndex & PNum (int i) { return pnum[i-1]; }
|
|
97
|
+
const PointIndex PNumMod (int i) const { return pnum[(i-1)%np]; }
|
|
98
|
+
auto PNums() { return FlatArray<PointIndex> (np, &pnum[0]); }
|
|
99
|
+
auto PNums() const { return FlatArray<const PointIndex> (np, &pnum[0]); }
|
|
100
|
+
void Delete () { deleted = true; for (PointIndex & p : pnum) p.Invalidate(); }
|
|
101
|
+
bool IsDeleted () const { return deleted; }
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
inline ostream & operator<<(ostream & s, const MiniElement2d & el)
|
|
106
|
+
{
|
|
107
|
+
s << "np = " << el.GetNP();
|
|
108
|
+
for (int j = 0; j < el.GetNP(); j++)
|
|
109
|
+
s << " " << el[j];
|
|
110
|
+
return s;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/// Face in advancing front
|
|
117
|
+
class FrontFace
|
|
118
|
+
{
|
|
119
|
+
private:
|
|
120
|
+
///
|
|
121
|
+
MiniElement2d f;
|
|
122
|
+
///
|
|
123
|
+
int qualclass;
|
|
124
|
+
///
|
|
125
|
+
char oldfront;
|
|
126
|
+
///
|
|
127
|
+
int hashvalue;
|
|
128
|
+
///
|
|
129
|
+
PointIndex cluster;
|
|
130
|
+
|
|
131
|
+
public:
|
|
132
|
+
///
|
|
133
|
+
FrontFace ();
|
|
134
|
+
///
|
|
135
|
+
FrontFace (const MiniElement2d & af);
|
|
136
|
+
///
|
|
137
|
+
const MiniElement2d & Face () const
|
|
138
|
+
{ return f; }
|
|
139
|
+
|
|
140
|
+
///
|
|
141
|
+
int QualClass () const
|
|
142
|
+
{ return qualclass; }
|
|
143
|
+
|
|
144
|
+
///
|
|
145
|
+
void IncrementQualClass ()
|
|
146
|
+
{ qualclass++; }
|
|
147
|
+
|
|
148
|
+
///
|
|
149
|
+
void ResetQualClass ()
|
|
150
|
+
{
|
|
151
|
+
if (qualclass > 1)
|
|
152
|
+
{
|
|
153
|
+
qualclass = 1;
|
|
154
|
+
oldfront = 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
///
|
|
159
|
+
bool Valid () const
|
|
160
|
+
{ return !f.IsDeleted(); }
|
|
161
|
+
|
|
162
|
+
///
|
|
163
|
+
void Invalidate ();
|
|
164
|
+
|
|
165
|
+
///
|
|
166
|
+
int HashValue() const
|
|
167
|
+
{ return hashvalue; }
|
|
168
|
+
|
|
169
|
+
///
|
|
170
|
+
void SetHashValue(int hv)
|
|
171
|
+
{ hashvalue = hv; }
|
|
172
|
+
|
|
173
|
+
///
|
|
174
|
+
friend class AdFront3;
|
|
175
|
+
|
|
176
|
+
PointIndex Cluster () const { return cluster; }
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
/// Advancing front, 3D.
|
|
183
|
+
class AdFront3
|
|
184
|
+
{
|
|
185
|
+
///
|
|
186
|
+
// NgArray<FrontPoint3, PointIndex::BASE, PointIndex> points;
|
|
187
|
+
Array<FrontPoint3, PointIndex> points
|
|
188
|
+
;
|
|
189
|
+
///
|
|
190
|
+
NgArray<FrontFace> faces;
|
|
191
|
+
///
|
|
192
|
+
Array<PointIndex> delpointl;
|
|
193
|
+
|
|
194
|
+
/// which points are connected to pi ?
|
|
195
|
+
// TABLE<PointIndex, PointIndex::BASE> * connectedpairs;
|
|
196
|
+
unique_ptr<DynamicTable<PointIndex, PointIndex>> connectedpairs;
|
|
197
|
+
|
|
198
|
+
/// number of total front faces;
|
|
199
|
+
int nff;
|
|
200
|
+
/// number of quads in front
|
|
201
|
+
int nff4;
|
|
202
|
+
|
|
203
|
+
///
|
|
204
|
+
double vol;
|
|
205
|
+
|
|
206
|
+
///
|
|
207
|
+
GeomSearch3d hashtable;
|
|
208
|
+
|
|
209
|
+
///
|
|
210
|
+
int hashon;
|
|
211
|
+
|
|
212
|
+
///
|
|
213
|
+
int hashcreated;
|
|
214
|
+
|
|
215
|
+
/// counter for rebuilding internal tables
|
|
216
|
+
int rebuildcounter;
|
|
217
|
+
/// last base element
|
|
218
|
+
int lasti;
|
|
219
|
+
/// minimal selection-value of baseelements
|
|
220
|
+
int minval;
|
|
221
|
+
Array<PointIndex, PointIndex> invpindex;
|
|
222
|
+
Array<char, PointIndex> pingroup;
|
|
223
|
+
|
|
224
|
+
///
|
|
225
|
+
class BoxTree<3> * facetree;
|
|
226
|
+
public:
|
|
227
|
+
|
|
228
|
+
///
|
|
229
|
+
AdFront3 ();
|
|
230
|
+
///
|
|
231
|
+
~AdFront3 ();
|
|
232
|
+
///
|
|
233
|
+
void GetPoints (NgArray<Point<3> > & apoints) const;
|
|
234
|
+
///
|
|
235
|
+
int GetNP() const
|
|
236
|
+
{ return points.Size(); }
|
|
237
|
+
///
|
|
238
|
+
const Point<3> & GetPoint (PointIndex pi) const
|
|
239
|
+
{ return points[pi].P(); }
|
|
240
|
+
///
|
|
241
|
+
int GetNF() const
|
|
242
|
+
{ return nff; }
|
|
243
|
+
/// 1-based
|
|
244
|
+
const MiniElement2d & GetFace (int i) const
|
|
245
|
+
{ return faces[i-1].Face(); }
|
|
246
|
+
const auto & Faces() const { return faces; }
|
|
247
|
+
///
|
|
248
|
+
void Print () const;
|
|
249
|
+
///
|
|
250
|
+
bool Empty () const
|
|
251
|
+
{ return nff == 0; }
|
|
252
|
+
///
|
|
253
|
+
bool Empty (int elnp) const
|
|
254
|
+
{
|
|
255
|
+
if (elnp == 4)
|
|
256
|
+
return (nff4 == 0);
|
|
257
|
+
return (nff - nff4 == 0);
|
|
258
|
+
}
|
|
259
|
+
///
|
|
260
|
+
int SelectBaseElement ();
|
|
261
|
+
|
|
262
|
+
///
|
|
263
|
+
void CreateTrees ();
|
|
264
|
+
|
|
265
|
+
///
|
|
266
|
+
void GetIntersectingFaces (const Point<3> & pmin, const Point<3> & pmax,
|
|
267
|
+
NgArray<int> & ifaces) const;
|
|
268
|
+
|
|
269
|
+
bool PointInsideGroup(const Array<PointIndex, PointIndex> &grouppindex,
|
|
270
|
+
const Array<MiniElement2d>& groupfaces) const;
|
|
271
|
+
|
|
272
|
+
///
|
|
273
|
+
void GetFaceBoundingBox (int i, Box3d & box) const;
|
|
274
|
+
|
|
275
|
+
///
|
|
276
|
+
int GetLocals (int baseelement,
|
|
277
|
+
Array<Point3d, PointIndex> & locpoints,
|
|
278
|
+
Array<MiniElement2d> & locfaces, // local index
|
|
279
|
+
Array<PointIndex, PointIndex> & pindex,
|
|
280
|
+
Array<INDEX> & findex,
|
|
281
|
+
INDEX_2_HASHTABLE<int> & connectedpairs,
|
|
282
|
+
float xh,
|
|
283
|
+
float relh,
|
|
284
|
+
INDEX& facesplit);
|
|
285
|
+
|
|
286
|
+
///
|
|
287
|
+
void GetGroup (int fi,
|
|
288
|
+
Array<MeshPoint, PointIndex> & grouppoints,
|
|
289
|
+
Array<MiniElement2d> & groupelements,
|
|
290
|
+
Array<PointIndex, PointIndex> & pindex,
|
|
291
|
+
Array<INDEX> & findex);
|
|
292
|
+
|
|
293
|
+
///
|
|
294
|
+
void DeleteFace (INDEX fi);
|
|
295
|
+
///
|
|
296
|
+
PointIndex AddPoint (const Point<3> & p, PointIndex globind);
|
|
297
|
+
///
|
|
298
|
+
INDEX AddFace (const MiniElement2d & e);
|
|
299
|
+
///
|
|
300
|
+
INDEX AddConnectedPair (PointIndices<2> pair);
|
|
301
|
+
///
|
|
302
|
+
void IncrementClass (INDEX fi)
|
|
303
|
+
{ faces[fi-1].IncrementQualClass(); }
|
|
304
|
+
|
|
305
|
+
///
|
|
306
|
+
void ResetClass (INDEX fi)
|
|
307
|
+
{ faces[fi-1].ResetQualClass(); }
|
|
308
|
+
|
|
309
|
+
///
|
|
310
|
+
void SetStartFront (int baseelnp = 0);
|
|
311
|
+
|
|
312
|
+
/// is Point p inside Surface ?
|
|
313
|
+
bool Inside (const Point<3> & p) const;
|
|
314
|
+
/// both points on same side ?
|
|
315
|
+
int SameSide (const Point<3> & lp1, const Point<3> & lp2,
|
|
316
|
+
const NgArray<int> * testfaces = NULL) const;
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
///
|
|
320
|
+
PointIndex GetGlobalIndex (PointIndex pi) const
|
|
321
|
+
{ return points[pi].GlobalIndex(); }
|
|
322
|
+
///
|
|
323
|
+
double Volume () const
|
|
324
|
+
{ return vol; }
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
private:
|
|
328
|
+
void RebuildInternalTables();
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
} // namespace netgen
|
|
332
|
+
#endif
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
#ifndef FILE_BASEGEOM
|
|
2
|
+
#define FILE_BASEGEOM
|
|
3
|
+
|
|
4
|
+
/**************************************************************************/
|
|
5
|
+
/* File: basegeom.hpp */
|
|
6
|
+
/* Author: Joachim Schoeberl */
|
|
7
|
+
/* Date: 23. Aug. 09 */
|
|
8
|
+
/**************************************************************************/
|
|
9
|
+
|
|
10
|
+
#include <gprim/geomobjects.hpp>
|
|
11
|
+
#include <gprim/transform3d.hpp>
|
|
12
|
+
|
|
13
|
+
#include "meshtype.hpp"
|
|
14
|
+
#include "meshclass.hpp"
|
|
15
|
+
|
|
16
|
+
struct Tcl_Interp;
|
|
17
|
+
|
|
18
|
+
namespace netgen
|
|
19
|
+
{
|
|
20
|
+
class Refinement;
|
|
21
|
+
|
|
22
|
+
struct ShapeProperties
|
|
23
|
+
{
|
|
24
|
+
optional<string> name;
|
|
25
|
+
optional<Vec<4>> col;
|
|
26
|
+
double maxh = 1e99;
|
|
27
|
+
double hpref = 0; // number of hp refinement levels (will be multiplied by factor later)
|
|
28
|
+
int layer = 1;
|
|
29
|
+
optional<bool> quad_dominated;
|
|
30
|
+
optional<Array<double>> partition;
|
|
31
|
+
void Merge(const ShapeProperties & prop2)
|
|
32
|
+
{
|
|
33
|
+
if (!name && prop2.name) name = prop2.name;
|
|
34
|
+
if (!col && prop2.col) col = prop2.col;
|
|
35
|
+
if (!partition && prop2.partition) partition = prop2.partition;
|
|
36
|
+
maxh = min2(maxh, prop2.maxh);
|
|
37
|
+
hpref = max2(hpref, prop2.hpref);
|
|
38
|
+
if(!quad_dominated.has_value()) quad_dominated = prop2.quad_dominated;
|
|
39
|
+
layer = max(layer, prop2.layer);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
string GetName() const { return name ? *name : "default"; }
|
|
43
|
+
Vec<4> GetColor() { return col ? *col : Vec<4>{0., 1., 0., 1.}; }
|
|
44
|
+
|
|
45
|
+
void DoArchive(Archive& ar);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
class GeometryShape;
|
|
49
|
+
|
|
50
|
+
struct ShapeIdentification
|
|
51
|
+
{
|
|
52
|
+
GeometryShape * from;
|
|
53
|
+
GeometryShape * to;
|
|
54
|
+
optional<Transformation<3>> trafo;
|
|
55
|
+
Identifications::ID_TYPE type;
|
|
56
|
+
string name = "";
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
class DLL_HEADER GeometryShape
|
|
60
|
+
{
|
|
61
|
+
public:
|
|
62
|
+
int nr = -1;
|
|
63
|
+
int layer = 1;
|
|
64
|
+
ShapeProperties properties;
|
|
65
|
+
Array<ShapeIdentification> identifications;
|
|
66
|
+
GeometryShape * primary;
|
|
67
|
+
optional<Transformation<3>> primary_to_me = nullopt;
|
|
68
|
+
|
|
69
|
+
virtual ~GeometryShape() {}
|
|
70
|
+
virtual bool IsMappedShape( const GeometryShape & other, const Transformation<3> & trafo, double tolerance ) const;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class DLL_HEADER GeometryVertex : public GeometryShape
|
|
75
|
+
{
|
|
76
|
+
public:
|
|
77
|
+
virtual Point<3> GetPoint() const = 0;
|
|
78
|
+
virtual bool IsMappedShape( const GeometryShape & other, const Transformation<3> & trafo, double tolerance ) const override;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
class DLL_HEADER GeometryEdge : public GeometryShape
|
|
82
|
+
{
|
|
83
|
+
protected:
|
|
84
|
+
GeometryVertex *start, *end;
|
|
85
|
+
public:
|
|
86
|
+
// Neighboring domains in 2d
|
|
87
|
+
// In 3d unused, EXCEPT for free floating edges in a domain,
|
|
88
|
+
// then both are pointing to the containing domain
|
|
89
|
+
int domin=-1, domout=-1;
|
|
90
|
+
|
|
91
|
+
GeometryEdge( GeometryVertex &start_, GeometryVertex &end_ )
|
|
92
|
+
: start(&start_), end(&end_)
|
|
93
|
+
{}
|
|
94
|
+
|
|
95
|
+
virtual const GeometryVertex& GetStartVertex() const { return *start; }
|
|
96
|
+
virtual const GeometryVertex& GetEndVertex() const { return *end; }
|
|
97
|
+
virtual GeometryVertex& GetStartVertex() { return *start; }
|
|
98
|
+
virtual GeometryVertex& GetEndVertex() { return *end; }
|
|
99
|
+
virtual double GetLength() const = 0;
|
|
100
|
+
virtual Point<3> GetCenter() const = 0;
|
|
101
|
+
virtual Point<3> GetPoint(double t) const = 0;
|
|
102
|
+
// Calculate parameter step respecting edges sag value
|
|
103
|
+
virtual double CalcStep(double t, double sag) const = 0;
|
|
104
|
+
virtual bool IsDegenerated(double tol = 1e-10) const {
|
|
105
|
+
return GetLength() < tol;
|
|
106
|
+
}
|
|
107
|
+
virtual void ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const = 0;
|
|
108
|
+
virtual void PointBetween(const Point<3>& p1,
|
|
109
|
+
const Point<3>& p2,
|
|
110
|
+
double secpoint,
|
|
111
|
+
const EdgePointGeomInfo& gi1,
|
|
112
|
+
const EdgePointGeomInfo& gi2,
|
|
113
|
+
Point<3>& newp,
|
|
114
|
+
EdgePointGeomInfo& newgi) const
|
|
115
|
+
{
|
|
116
|
+
newp = p1 + secpoint * (p2-p1);
|
|
117
|
+
newgi = gi1;
|
|
118
|
+
ProjectPoint(newp, &newgi);
|
|
119
|
+
}
|
|
120
|
+
virtual Vec<3> GetTangent(double t) const = 0;
|
|
121
|
+
virtual bool IsMappedShape( const GeometryShape & other, const Transformation<3> & trafo, double tolerance ) const override;
|
|
122
|
+
virtual void Divide(const MeshingParameters & mparam, const Mesh & mesh, Array<Point<3>> & points, Array<double> & params);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
class DLL_HEADER GeometryFace : public GeometryShape
|
|
126
|
+
{
|
|
127
|
+
public:
|
|
128
|
+
Array<GeometryEdge*> edges;
|
|
129
|
+
int domin=-1, domout=-1;
|
|
130
|
+
|
|
131
|
+
virtual Point<3> GetCenter() const = 0;
|
|
132
|
+
virtual size_t GetNBoundaries() const = 0;
|
|
133
|
+
virtual Array<Segment> GetBoundary(const Mesh& mesh) const = 0;
|
|
134
|
+
|
|
135
|
+
virtual PointGeomInfo Project(Point<3>& p) const = 0;
|
|
136
|
+
// Project point using geo info. Fast if point is close to
|
|
137
|
+
// parametrization in geo info.
|
|
138
|
+
virtual bool ProjectPointGI(Point<3>& p, PointGeomInfo& gi) const =0;
|
|
139
|
+
virtual bool CalcPointGeomInfo(const Point<3>& p, PointGeomInfo& gi) const
|
|
140
|
+
{
|
|
141
|
+
auto pnew = p;
|
|
142
|
+
gi = Project(pnew);
|
|
143
|
+
return (p-pnew).Length() < 1e-10 * GetBoundingBox().Diam() ;
|
|
144
|
+
}
|
|
145
|
+
virtual Point<3> GetPoint(const PointGeomInfo& gi) const = 0;
|
|
146
|
+
virtual void CalcEdgePointGI(const GeometryEdge& edge,
|
|
147
|
+
double t,
|
|
148
|
+
EdgePointGeomInfo& egi) const = 0;
|
|
149
|
+
virtual Box<3> GetBoundingBox() const = 0;
|
|
150
|
+
|
|
151
|
+
// Get curvature in point from local coordinates in PointGeomInfo
|
|
152
|
+
virtual double GetCurvature(const PointGeomInfo& gi) const = 0;
|
|
153
|
+
|
|
154
|
+
virtual void RestrictH(Mesh& mesh, const MeshingParameters& mparam) const = 0;
|
|
155
|
+
virtual Vec<3> GetNormal(const Point<3>& p, const PointGeomInfo* gi = nullptr) const = 0;
|
|
156
|
+
|
|
157
|
+
virtual void PointBetween(const Point<3>& p1,
|
|
158
|
+
const Point<3>& p2,
|
|
159
|
+
double secpoint,
|
|
160
|
+
const PointGeomInfo& gi1,
|
|
161
|
+
const PointGeomInfo& gi2,
|
|
162
|
+
Point<3>& newp,
|
|
163
|
+
PointGeomInfo& newgi) const
|
|
164
|
+
{
|
|
165
|
+
newp = p1 + secpoint * (p2-p1);
|
|
166
|
+
newgi.trignum = gi1.trignum;
|
|
167
|
+
/*
|
|
168
|
+
newgi.u = 0.5 * (gi1.u + gi1.u);
|
|
169
|
+
newgi.v = 0.5 * (gi1.v + gi2.v);
|
|
170
|
+
*/
|
|
171
|
+
newgi.u = gi1.u + secpoint*(gi2.u - gi1.u);
|
|
172
|
+
newgi.v = gi1.v + secpoint*(gi2.v - gi1.v);
|
|
173
|
+
if(!ProjectPointGI(newp, newgi))
|
|
174
|
+
newgi = Project(newp);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
virtual bool IsMappedShape( const GeometryShape & other, const Transformation<3> & trafo, double tolerance ) const override;
|
|
178
|
+
virtual bool IsConnectingCloseSurfaces() const;
|
|
179
|
+
|
|
180
|
+
protected:
|
|
181
|
+
void RestrictHTrig(Mesh& mesh,
|
|
182
|
+
const PointGeomInfo& gi0,
|
|
183
|
+
const PointGeomInfo& gi1,
|
|
184
|
+
const PointGeomInfo& gi2,
|
|
185
|
+
const MeshingParameters& mparam,
|
|
186
|
+
int depth = 0, double h = 0.) const;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
class DLL_HEADER GeometrySolid : public GeometryShape
|
|
190
|
+
{
|
|
191
|
+
public:
|
|
192
|
+
Array<GeometryEdge*> free_edges; // edges with no adjacent face
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
class DLL_HEADER NetgenGeometry
|
|
196
|
+
{
|
|
197
|
+
unique_ptr<Refinement> ref;
|
|
198
|
+
protected:
|
|
199
|
+
Array<unique_ptr<GeometryVertex>> vertices;
|
|
200
|
+
Array<unique_ptr<GeometryEdge>> edges;
|
|
201
|
+
Array<unique_ptr<GeometryFace>> faces;
|
|
202
|
+
Array<unique_ptr<GeometrySolid>> solids;
|
|
203
|
+
Array<std::pair<Point<3>, double>> restricted_h;
|
|
204
|
+
Box<3> bounding_box;
|
|
205
|
+
int dimension = 3;
|
|
206
|
+
|
|
207
|
+
public:
|
|
208
|
+
|
|
209
|
+
NetgenGeometry()
|
|
210
|
+
{
|
|
211
|
+
ref = make_unique<Refinement>(*this);
|
|
212
|
+
}
|
|
213
|
+
virtual ~NetgenGeometry () { ; }
|
|
214
|
+
|
|
215
|
+
size_t GetNVertices() const { return vertices.Size(); }
|
|
216
|
+
size_t GetNEdges() const { return edges.Size(); }
|
|
217
|
+
size_t GetNFaces() const { return faces.Size(); }
|
|
218
|
+
size_t GetNSolids() const { return solids.Size(); }
|
|
219
|
+
|
|
220
|
+
const GeometrySolid & GetSolid(int i) const { return *solids[i]; }
|
|
221
|
+
const GeometryFace & GetFace(int i) const { return *faces[i]; }
|
|
222
|
+
const GeometryEdge & GetEdge(int i) const { return *edges[i]; }
|
|
223
|
+
const GeometryVertex & GetVertex(int i) const { return *vertices[i]; }
|
|
224
|
+
|
|
225
|
+
auto Solids() const { return FlatArray{solids}; }
|
|
226
|
+
auto Faces() const { return FlatArray{faces}; }
|
|
227
|
+
auto Edges() const { return FlatArray{edges}; }
|
|
228
|
+
auto Vertices() const { return FlatArray{vertices}; }
|
|
229
|
+
|
|
230
|
+
virtual Array<const GeometryVertex*> GetFaceVertices(const GeometryFace& face) const { return Array<const GeometryVertex*>{}; }
|
|
231
|
+
|
|
232
|
+
void Clear();
|
|
233
|
+
|
|
234
|
+
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
|
235
|
+
|
|
236
|
+
void RestrictH(const Point<3>& pnt, double maxh)
|
|
237
|
+
{
|
|
238
|
+
restricted_h.Append({pnt, maxh});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
virtual const Refinement & GetRefinement () const
|
|
242
|
+
{
|
|
243
|
+
return *ref;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
virtual void DoArchive(Archive&)
|
|
247
|
+
{ throw NgException("DoArchive not implemented for " + Demangle(typeid(*this).name())); }
|
|
248
|
+
|
|
249
|
+
virtual Mesh::GEOM_TYPE GetGeomType() const { return Mesh::NO_GEOM; }
|
|
250
|
+
virtual void ProcessIdentifications();
|
|
251
|
+
virtual void Analyse(Mesh& mesh,
|
|
252
|
+
const MeshingParameters& mparam) const;
|
|
253
|
+
virtual void FindEdges(Mesh& mesh, const MeshingParameters& mparam) const;
|
|
254
|
+
virtual void MeshSurface(Mesh& mesh, const MeshingParameters& mparam) const;
|
|
255
|
+
virtual bool MeshFace(Mesh& mesh, const MeshingParameters& mparam,
|
|
256
|
+
int nr, FlatArray<int, PointIndex> glob2loc) const;
|
|
257
|
+
virtual void MapSurfaceMesh( Mesh & mesh, const GeometryFace & dst, std::map<tuple<PointIndex, int>, PointIndex> & mapto) const;
|
|
258
|
+
virtual void OptimizeSurface(Mesh& mesh, const MeshingParameters& mparam) const;
|
|
259
|
+
|
|
260
|
+
virtual void FinalizeMesh(Mesh& mesh) const;
|
|
261
|
+
|
|
262
|
+
virtual PointGeomInfo ProjectPoint (int surfind, Point<3> & p) const
|
|
263
|
+
{
|
|
264
|
+
if(surfind <= faces.Size() && surfind > 0)
|
|
265
|
+
return faces[surfind-1]->Project(p);
|
|
266
|
+
return PointGeomInfo();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
virtual void ProjectPointEdge (int surfind, int surfind2, Point<3> & p, EdgePointGeomInfo* gi = nullptr) const
|
|
270
|
+
{
|
|
271
|
+
if(gi && gi->edgenr < edges.Size() && gi->edgenr >= 0)
|
|
272
|
+
edges[gi->edgenr]->ProjectPoint(p, gi);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
virtual bool CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p3) const
|
|
276
|
+
{
|
|
277
|
+
return faces[surfind-1]->CalcPointGeomInfo(p3, gi);
|
|
278
|
+
}
|
|
279
|
+
virtual bool ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const
|
|
280
|
+
{
|
|
281
|
+
if(surfind > 0 && surfind <= faces.Size())
|
|
282
|
+
return faces[surfind-1]->ProjectPointGI(p, gi);
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
virtual Vec<3> GetNormal(int surfind, const Point<3> & p, const PointGeomInfo* gi = nullptr) const
|
|
287
|
+
{
|
|
288
|
+
if(surfind > 0 && surfind <= faces.Size())
|
|
289
|
+
return faces[surfind-1]->GetNormal(p, gi);
|
|
290
|
+
else
|
|
291
|
+
return {0., 0., 0.};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
virtual void PointBetween (const Point<3> & p1,
|
|
295
|
+
const Point<3> & p2, double secpoint,
|
|
296
|
+
int surfi,
|
|
297
|
+
const PointGeomInfo & gi1,
|
|
298
|
+
const PointGeomInfo & gi2,
|
|
299
|
+
Point<3> & newp,
|
|
300
|
+
PointGeomInfo & newgi) const
|
|
301
|
+
{
|
|
302
|
+
if(faces.Size() >= surfi && surfi > 0)
|
|
303
|
+
{
|
|
304
|
+
faces[surfi-1]->PointBetween(p1, p2, secpoint, gi1, gi2, newp, newgi);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
newp = p1 + secpoint * (p2-p1);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
virtual void PointBetweenEdge(const Point<3> & p1,
|
|
311
|
+
const Point<3> & p2, double secpoint,
|
|
312
|
+
int surfi1, int surfi2,
|
|
313
|
+
const EdgePointGeomInfo & ap1,
|
|
314
|
+
const EdgePointGeomInfo & ap2,
|
|
315
|
+
Point<3> & newp,
|
|
316
|
+
EdgePointGeomInfo & newgi) const
|
|
317
|
+
{
|
|
318
|
+
if(ap1.edgenr < edges.Size() && ap1.edgenr >= 0)
|
|
319
|
+
{
|
|
320
|
+
edges[ap1.edgenr]->PointBetween(p1, p2, secpoint,
|
|
321
|
+
ap1, ap2, newp, newgi);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
newp = p1+secpoint*(p2-p1);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
virtual Vec<3> GetTangent(const Point<3> & p, int surfi1,
|
|
328
|
+
int surfi2,
|
|
329
|
+
const EdgePointGeomInfo & egi) const
|
|
330
|
+
{
|
|
331
|
+
throw Exception("Base geometry get tangent called");
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
virtual void Save (const filesystem::path & filename) const;
|
|
335
|
+
virtual void SaveToMeshFile (ostream & /* ost */) const { ; }
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
class DLL_HEADER GeometryRegister
|
|
343
|
+
{
|
|
344
|
+
public:
|
|
345
|
+
virtual ~GeometryRegister();
|
|
346
|
+
virtual NetgenGeometry * Load (const filesystem::path & filename) const = 0;
|
|
347
|
+
virtual NetgenGeometry * LoadFromMeshFile (istream & /* ist */, string) const { return NULL; }
|
|
348
|
+
virtual class VisualScene * GetVisualScene (const NetgenGeometry * /* geom */) const
|
|
349
|
+
{ return NULL; }
|
|
350
|
+
virtual void SetParameters (Tcl_Interp * /* interp */) { ; }
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
class DLL_HEADER GeometryRegisterArray : public NgArray<GeometryRegister*>
|
|
354
|
+
{
|
|
355
|
+
public:
|
|
356
|
+
virtual ~GeometryRegisterArray()
|
|
357
|
+
{
|
|
358
|
+
for (int i = 0; i < Size(); i++)
|
|
359
|
+
delete (*this)[i];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
virtual shared_ptr<NetgenGeometry> LoadFromMeshFile (istream & ist) const;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
DLL_HEADER GeometryRegisterArray& GeometryRegister();
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
#endif
|