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,46 @@
|
|
|
1
|
+
#ifndef NETGEN_CLUSTERS_HPP
|
|
2
|
+
#define NETGEN_CLUSTERS_HPP
|
|
3
|
+
|
|
4
|
+
/**************************************************************************/
|
|
5
|
+
/* File: clusers.hh */
|
|
6
|
+
/* Author: Joachim Schoeberl */
|
|
7
|
+
/* Date: 28. Apr. 01 */
|
|
8
|
+
/**************************************************************************/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
Anisotropic clusters
|
|
12
|
+
|
|
13
|
+
nodes, edges, faces, elements
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include "meshclass.hpp"
|
|
17
|
+
|
|
18
|
+
namespace netgen
|
|
19
|
+
{
|
|
20
|
+
|
|
21
|
+
class AnisotropicClusters
|
|
22
|
+
{
|
|
23
|
+
const Mesh & mesh;
|
|
24
|
+
|
|
25
|
+
int nv, ned, nfa, ne;
|
|
26
|
+
|
|
27
|
+
// connected nodes, nodes = vertices, edges, faces, elements
|
|
28
|
+
NgArray<int> cluster_reps;
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
AnisotropicClusters (const Mesh & amesh);
|
|
32
|
+
~AnisotropicClusters();
|
|
33
|
+
|
|
34
|
+
void Update();
|
|
35
|
+
|
|
36
|
+
int GetVertexRepresentant (int vnr) const
|
|
37
|
+
{ return cluster_reps.Get(vnr); }
|
|
38
|
+
int GetEdgeRepresentant (int ednr) const
|
|
39
|
+
{ return cluster_reps.Get(nv+ednr); }
|
|
40
|
+
int GetFaceRepresentant (int fnr) const
|
|
41
|
+
{ return cluster_reps.Get(nv+ned+fnr); }
|
|
42
|
+
int GetElementRepresentant (int enr) const
|
|
43
|
+
{ return cluster_reps.Get(nv+ned+nfa+enr); }
|
|
44
|
+
};
|
|
45
|
+
} // namespace netgen
|
|
46
|
+
#endif // NETGEN_CLUSTERS_HPP
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
#ifndef NETGEN_CURVEDELEMS_HPP
|
|
2
|
+
#define NETGEN_CURVEDELEMS_HPP
|
|
3
|
+
|
|
4
|
+
/**************************************************************************/
|
|
5
|
+
/* File: curvedelems.hpp */
|
|
6
|
+
/* Author: Robert Gaisbauer (first version) */
|
|
7
|
+
/* redesign by Joachim Schoeberl */
|
|
8
|
+
/* Date: 27. Sep. 02, Feb 2006 */
|
|
9
|
+
/**************************************************************************/
|
|
10
|
+
|
|
11
|
+
#include <mydefs.hpp>
|
|
12
|
+
#include <general/ngarray.hpp>
|
|
13
|
+
#include <gprim/geomobjects.hpp>
|
|
14
|
+
|
|
15
|
+
#include "meshtype.hpp"
|
|
16
|
+
#include "meshclass.hpp"
|
|
17
|
+
|
|
18
|
+
namespace netgen
|
|
19
|
+
{
|
|
20
|
+
class Refinement;
|
|
21
|
+
class Mesh;
|
|
22
|
+
|
|
23
|
+
class CurvedElements
|
|
24
|
+
{
|
|
25
|
+
const Mesh & mesh;
|
|
26
|
+
|
|
27
|
+
NgArray<int> edgeorder;
|
|
28
|
+
NgArray<int> faceorder;
|
|
29
|
+
|
|
30
|
+
NgArray<int> edgecoeffsindex;
|
|
31
|
+
NgArray<int> facecoeffsindex;
|
|
32
|
+
|
|
33
|
+
NgArray< Vec<3> > edgecoeffs;
|
|
34
|
+
NgArray< Vec<3> > facecoeffs;
|
|
35
|
+
|
|
36
|
+
NgArray< double > edgeweight; // for rational 2nd order splines
|
|
37
|
+
|
|
38
|
+
int order;
|
|
39
|
+
bool rational;
|
|
40
|
+
|
|
41
|
+
bool ishighorder;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
DLL_HEADER CurvedElements (const Mesh & amesh);
|
|
45
|
+
DLL_HEADER ~CurvedElements();
|
|
46
|
+
|
|
47
|
+
// bool IsHighOrder() const { return order > 1; }
|
|
48
|
+
bool IsHighOrder() const { return ishighorder; }
|
|
49
|
+
|
|
50
|
+
// void SetHighOrder (int aorder) { order=aorder; }
|
|
51
|
+
void SetIsHighOrder (bool ho) { ishighorder = ho; }
|
|
52
|
+
|
|
53
|
+
DLL_HEADER void BuildCurvedElements(const Refinement * ref, int aorder, bool arational = false);
|
|
54
|
+
|
|
55
|
+
int GetOrder () { return order; }
|
|
56
|
+
|
|
57
|
+
void DoArchive(Archive& ar)
|
|
58
|
+
{
|
|
59
|
+
ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs
|
|
60
|
+
& edgeweight & order & rational & ishighorder;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
DLL_HEADER bool IsSegmentCurved (SegmentIndex segnr) const;
|
|
64
|
+
DLL_HEADER bool IsSurfaceElementCurved (SurfaceElementIndex sei) const;
|
|
65
|
+
DLL_HEADER bool IsElementCurved (ElementIndex ei) const;
|
|
66
|
+
DLL_HEADER bool IsElementHighOrder (ElementIndex ei) const;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
|
70
|
+
Point<3> & x)
|
|
71
|
+
{ CalcSegmentTransformation<double> (xi, segnr, &x, NULL); };
|
|
72
|
+
|
|
73
|
+
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
|
74
|
+
Vec<3> & dxdxi)
|
|
75
|
+
{ CalcSegmentTransformation<double> (xi, segnr, NULL, &dxdxi); };
|
|
76
|
+
|
|
77
|
+
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
|
78
|
+
Point<3> & x, Vec<3> & dxdxi)
|
|
79
|
+
{ CalcSegmentTransformation<double> (xi, segnr, &x, &dxdxi, NULL); };
|
|
80
|
+
|
|
81
|
+
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
|
82
|
+
Point<3> & x, Vec<3> & dxdxi, bool & curved)
|
|
83
|
+
{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, &curved); };
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
|
88
|
+
Point<3> & x)
|
|
89
|
+
{ CalcSurfaceTransformation (xi, elnr, &x, NULL); };
|
|
90
|
+
|
|
91
|
+
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
|
92
|
+
Mat<3,2> & dxdxi)
|
|
93
|
+
{ CalcSurfaceTransformation (xi, elnr, NULL, &dxdxi); };
|
|
94
|
+
|
|
95
|
+
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
|
96
|
+
Point<3> & x, Mat<3,2> & dxdxi)
|
|
97
|
+
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, NULL); };
|
|
98
|
+
|
|
99
|
+
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
|
100
|
+
Point<3> & x, Mat<3,2> & dxdxi, bool & curved)
|
|
101
|
+
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, &curved); };
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
108
|
+
Point<3> & x)
|
|
109
|
+
{ CalcElementTransformation (xi, elnr, &x, NULL); };
|
|
110
|
+
|
|
111
|
+
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
112
|
+
Mat<3,3> & dxdxi)
|
|
113
|
+
{ CalcElementTransformation (xi, elnr, NULL, &dxdxi); };
|
|
114
|
+
|
|
115
|
+
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
116
|
+
Point<3> & x, Mat<3,3> & dxdxi)
|
|
117
|
+
{ CalcElementTransformation (xi, elnr, &x, &dxdxi /* , NULL */ ); };
|
|
118
|
+
|
|
119
|
+
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
120
|
+
Point<3> & x, Mat<3,3> & dxdxi,
|
|
121
|
+
void * buffer, bool valid)
|
|
122
|
+
{ CalcElementTransformation (xi, elnr, &x, &dxdxi, /* NULL, */ buffer, valid ); };
|
|
123
|
+
|
|
124
|
+
// void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
125
|
+
// Point<3> & x, Mat<3,3> & dxdxi) // , bool & curved)
|
|
126
|
+
// { CalcElementTransformation (xi, elnr, &x, &dxdxi /* , &curved * ); }
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
/*
|
|
130
|
+
void CalcMultiPointSegmentTransformation (NgArray<double> * xi, SegmentIndex segnr,
|
|
131
|
+
NgArray<Point<3> > * x,
|
|
132
|
+
NgArray<Vec<3> > * dxdxi);
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
template <int DIM_SPACE, typename T>
|
|
136
|
+
void CalcMultiPointSegmentTransformation (SegmentIndex elnr, int n,
|
|
137
|
+
const T * xi, size_t sxi,
|
|
138
|
+
T * x, size_t sx,
|
|
139
|
+
T * dxdxi, size_t sdxdxi);
|
|
140
|
+
|
|
141
|
+
DLL_HEADER void CalcMultiPointSurfaceTransformation (NgArray< Point<2> > * xi, SurfaceElementIndex elnr,
|
|
142
|
+
NgArray< Point<3> > * x,
|
|
143
|
+
NgArray< Mat<3,2> > * dxdxi);
|
|
144
|
+
|
|
145
|
+
template <int DIM_SPACE, typename T>
|
|
146
|
+
void CalcMultiPointSurfaceTransformation (SurfaceElementIndex elnr, int n,
|
|
147
|
+
const T * xi, size_t sxi,
|
|
148
|
+
T * x, size_t sx,
|
|
149
|
+
T * dxdxi, size_t sdxdxi);
|
|
150
|
+
|
|
151
|
+
DLL_HEADER void CalcMultiPointElementTransformation (NgArray< Point<3> > * xi, ElementIndex elnr,
|
|
152
|
+
NgArray< Point<3> > * x,
|
|
153
|
+
NgArray< Mat<3,3> > * dxdxi);
|
|
154
|
+
|
|
155
|
+
template <typename T>
|
|
156
|
+
void CalcMultiPointElementTransformation (ElementIndex elnr, int n,
|
|
157
|
+
const T * xi, size_t sxi,
|
|
158
|
+
T * x, size_t sx,
|
|
159
|
+
T * dxdxi, size_t sdxdxi);
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
private:
|
|
165
|
+
|
|
166
|
+
template <typename T>
|
|
167
|
+
DLL_HEADER void CalcSegmentTransformation (const T & xi, SegmentIndex segnr,
|
|
168
|
+
Point<3,T> * x = NULL, Vec<3,T> * dxdxi = NULL, bool * curved = NULL);
|
|
169
|
+
|
|
170
|
+
DLL_HEADER void CalcSurfaceTransformation (Point<2> xi, SurfaceElementIndex elnr,
|
|
171
|
+
Point<3> * x = NULL, Mat<3,2> * dxdxi = NULL, bool * curved = NULL);
|
|
172
|
+
|
|
173
|
+
DLL_HEADER void CalcElementTransformation (Point<3> xi, ElementIndex elnr,
|
|
174
|
+
Point<3> * x = NULL, Mat<3,3> * dxdxi = NULL, // bool * curved = NULL,
|
|
175
|
+
void * buffer = NULL, bool valid = 0);
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class SegmentInfo
|
|
183
|
+
{
|
|
184
|
+
public:
|
|
185
|
+
SegmentIndex elnr;
|
|
186
|
+
int order;
|
|
187
|
+
int nv;
|
|
188
|
+
int ndof;
|
|
189
|
+
int edgenr;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
template <typename T>
|
|
193
|
+
void CalcElementShapes (SegmentInfo & elnr, T xi, TFlatVector<T> shapes) const;
|
|
194
|
+
void GetCoefficients (SegmentInfo & elnr, NgArray<Vec<3> > & coefs) const;
|
|
195
|
+
template <typename T>
|
|
196
|
+
void CalcElementDShapes (SegmentInfo & elnr, T xi, TFlatVector<T> dshapes) const;
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class ElementInfo
|
|
200
|
+
{
|
|
201
|
+
public:
|
|
202
|
+
ElementIndex elnr;
|
|
203
|
+
int order;
|
|
204
|
+
int nv;
|
|
205
|
+
int ndof;
|
|
206
|
+
int nedges;
|
|
207
|
+
int nfaces;
|
|
208
|
+
int edgenrs[12];
|
|
209
|
+
int facenrs[6];
|
|
210
|
+
Mat<3> hdxdxi;
|
|
211
|
+
Vec<3> hcoefs[10]; // enough for second order tets
|
|
212
|
+
|
|
213
|
+
void SetEdges (FlatArray<T_EDGE> edges)
|
|
214
|
+
{
|
|
215
|
+
nedges = edges.Size();
|
|
216
|
+
for (int i = 0; i < edges.Size(); i++)
|
|
217
|
+
edgenrs[i] = edges[i];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
auto GetEdges() const
|
|
221
|
+
{ return FlatArray(nedges, edgenrs); }
|
|
222
|
+
|
|
223
|
+
void SetFaces (FlatArray<T_FACE> faces)
|
|
224
|
+
{
|
|
225
|
+
nfaces = faces.Size();
|
|
226
|
+
for (int i = 0; i < faces.Size(); i++)
|
|
227
|
+
facenrs[i] = faces[i];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
auto GetFaces() const
|
|
231
|
+
{ return FlatArray(nfaces, facenrs); }
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
template <typename T>
|
|
235
|
+
void CalcElementShapes (ElementInfo & info, Point<3,T> xi, TFlatVector<T> shapes) const;
|
|
236
|
+
void GetCoefficients (ElementInfo & info, Vec<3> * coefs) const;
|
|
237
|
+
template <typename T>
|
|
238
|
+
void CalcElementDShapes (ElementInfo & info, const Point<3,T> xi, MatrixFixWidth<3,T> & dshapes) const;
|
|
239
|
+
|
|
240
|
+
template <typename T>
|
|
241
|
+
bool EvaluateMapping (ElementInfo & info, const Point<3,T> xi, Point<3,T> & x, Mat<3,3,T> & jac) const;
|
|
242
|
+
|
|
243
|
+
class SurfaceElementInfo
|
|
244
|
+
{
|
|
245
|
+
public:
|
|
246
|
+
SurfaceElementIndex elnr;
|
|
247
|
+
int order;
|
|
248
|
+
int nv;
|
|
249
|
+
int ndof;
|
|
250
|
+
NgArrayMem<int,4> edgenrs;
|
|
251
|
+
int facenr;
|
|
252
|
+
|
|
253
|
+
void SetEdges (FlatArray<T_EDGE> edges)
|
|
254
|
+
{
|
|
255
|
+
edgenrs.SetSize(edges.Size());
|
|
256
|
+
for (int i = 0; i < edges.Size(); i++)
|
|
257
|
+
edgenrs[i] = edges[i];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
template <typename T>
|
|
263
|
+
void CalcElementShapes (SurfaceElementInfo & elinfo, const Point<2,T> xi, TFlatVector<T> shapes) const;
|
|
264
|
+
template <int DIM_SPACE>
|
|
265
|
+
void GetCoefficients (SurfaceElementInfo & elinfo, NgArray<Vec<DIM_SPACE> > & coefs) const;
|
|
266
|
+
template <typename T>
|
|
267
|
+
void CalcElementDShapes (SurfaceElementInfo & elinfo, const Point<2,T> xi, MatrixFixWidth<2,T> & dshapes) const;
|
|
268
|
+
|
|
269
|
+
template <int DIM_SPACE, typename T>
|
|
270
|
+
bool EvaluateMapping (SurfaceElementInfo & info, const Point<2,T> xi, Point<DIM_SPACE,T> & x, Mat<DIM_SPACE,2,T> & jac) const;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
} //namespace netgen
|
|
274
|
+
#endif // NETGEN_CURVEDELEMS_HPP
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#include "meshing.hpp"
|
|
2
|
+
|
|
3
|
+
namespace netgen
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
static inline Point<2> P2( Point<3> p )
|
|
7
|
+
{
|
|
8
|
+
return {p[0], p[1]};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static inline Point<3> P3( Point<2> p )
|
|
12
|
+
{
|
|
13
|
+
return {p[0], p[1], 0};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class DelaunayTrig
|
|
17
|
+
{
|
|
18
|
+
PointIndex pnums[3];
|
|
19
|
+
Point<2> c;
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
double r;
|
|
23
|
+
double rad2;
|
|
24
|
+
DelaunayTrig () = default;
|
|
25
|
+
DelaunayTrig (PointIndex p1, PointIndex p2, PointIndex p3)
|
|
26
|
+
{
|
|
27
|
+
pnums[0] = p1;
|
|
28
|
+
pnums[1] = p2;
|
|
29
|
+
pnums[2] = p3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
PointIndex & operator[] (int j) { return pnums[j]; }
|
|
33
|
+
const PointIndex & operator[] (int j) const { return pnums[j]; }
|
|
34
|
+
|
|
35
|
+
void CalcCenter (FlatArray<Point<2>, PointIndex> points);
|
|
36
|
+
|
|
37
|
+
Point<2> Center() const { return c; }
|
|
38
|
+
double Radius2() const { return rad2; }
|
|
39
|
+
Box<2> BoundingBox() const { return Box<2> (c-Vec<2>(r,r), c+Vec<2>(r,r)); }
|
|
40
|
+
|
|
41
|
+
mutable PointIndex visited_pi = PointIndex::INVALID; // -1;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
class DelaunayMesh
|
|
45
|
+
{
|
|
46
|
+
ngcore::ClosedHashTable<PointIndices<2>, IVec<2>> edge_to_trig;
|
|
47
|
+
Array<DelaunayTrig> trigs;
|
|
48
|
+
unique_ptr<DelaunayTree<2>> tree;
|
|
49
|
+
Array<Point<2>, PointIndex> & points;
|
|
50
|
+
|
|
51
|
+
Array<int> closeels;
|
|
52
|
+
Array<int> intersecting;
|
|
53
|
+
Array<PointIndices<2>> edges;
|
|
54
|
+
|
|
55
|
+
int GetNeighbour( int eli, int edge );
|
|
56
|
+
|
|
57
|
+
void SetNeighbour( int eli, int edge );
|
|
58
|
+
|
|
59
|
+
void UnsetNeighbours( int eli );
|
|
60
|
+
|
|
61
|
+
void AppendTrig( PointIndex pi0, PointIndex pi1, PointIndex pi2 );
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
DelaunayMesh( Array<Point<2>, PointIndex> & points_, Box<2> box );
|
|
65
|
+
|
|
66
|
+
void CalcIntersecting( PointIndex pi_new );
|
|
67
|
+
void CalcWeights( PointIndex pi_new, std::map<PointIndex, double> & weights );
|
|
68
|
+
void AddPoint( PointIndex pi_new );
|
|
69
|
+
Array<DelaunayTrig> & GetElements() { return trigs; }
|
|
70
|
+
unique_ptr<Mesh> GetMesh(PointIndex pi_new); // for debugging purposes
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace netgen
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#ifndef FIELDLINES_HPP_INCLUDED
|
|
2
|
+
#define FIELDLINES_HPP_INCLUDED
|
|
3
|
+
|
|
4
|
+
namespace netgen
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
class RKStepper
|
|
8
|
+
{
|
|
9
|
+
private:
|
|
10
|
+
Array<double> c,b;
|
|
11
|
+
TABLE<double> *a;
|
|
12
|
+
int steps;
|
|
13
|
+
int order;
|
|
14
|
+
|
|
15
|
+
double tolerance;
|
|
16
|
+
|
|
17
|
+
Array<Vec<3>> K;
|
|
18
|
+
|
|
19
|
+
int stepcount;
|
|
20
|
+
|
|
21
|
+
double h;
|
|
22
|
+
double startt;
|
|
23
|
+
double startt_bak;
|
|
24
|
+
Point<3> startval;
|
|
25
|
+
Point<3> startval_bak;
|
|
26
|
+
|
|
27
|
+
bool adaptive;
|
|
28
|
+
int adrun;
|
|
29
|
+
Point<3> valh;
|
|
30
|
+
|
|
31
|
+
int notrestarted;
|
|
32
|
+
|
|
33
|
+
public:
|
|
34
|
+
|
|
35
|
+
DLL_HEADER ~RKStepper();
|
|
36
|
+
|
|
37
|
+
RKStepper(int type = 0);
|
|
38
|
+
|
|
39
|
+
void SetTolerance(const double tol){tolerance = tol;}
|
|
40
|
+
|
|
41
|
+
void StartNextValCalc(const Point<3> & astartval, const double astartt, const double ah, const bool aadaptive = false);
|
|
42
|
+
|
|
43
|
+
bool GetNextData(Point<3> & val, double & t, double & ah);
|
|
44
|
+
|
|
45
|
+
bool FeedNextF(const Vec<3> & f);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class FieldLineCalc
|
|
52
|
+
{
|
|
53
|
+
private:
|
|
54
|
+
const Mesh & mesh;
|
|
55
|
+
|
|
56
|
+
typedef std::function<bool (int elnr, const double *, Vec<3> &)> VectorFunction;
|
|
57
|
+
|
|
58
|
+
const VectorFunction & func;
|
|
59
|
+
RKStepper stepper;
|
|
60
|
+
|
|
61
|
+
Array<double> values;
|
|
62
|
+
Array<Point<3>> pstart, pend;
|
|
63
|
+
|
|
64
|
+
double maxlength;
|
|
65
|
+
|
|
66
|
+
int maxpoints;
|
|
67
|
+
|
|
68
|
+
int direction;
|
|
69
|
+
|
|
70
|
+
Point3d pmin, pmax;
|
|
71
|
+
double rad;
|
|
72
|
+
|
|
73
|
+
double critical_value;
|
|
74
|
+
|
|
75
|
+
bool randomized;
|
|
76
|
+
|
|
77
|
+
double thickness;
|
|
78
|
+
|
|
79
|
+
public:
|
|
80
|
+
DLL_HEADER FieldLineCalc(const Mesh & amesh, const VectorFunction & afunc,
|
|
81
|
+
const double rel_length, const int amaxpoints = -1,
|
|
82
|
+
const double rel_thickness = -1, const double rel_tolerance = -1, const int rk_type = 0, const int adirection = 0);
|
|
83
|
+
|
|
84
|
+
DLL_HEADER ~FieldLineCalc();
|
|
85
|
+
|
|
86
|
+
void SetCriticalValue(const double val) { critical_value = val; }
|
|
87
|
+
|
|
88
|
+
void Randomized(void) { randomized = true; }
|
|
89
|
+
void NotRandomized(void) { randomized = false; }
|
|
90
|
+
|
|
91
|
+
DLL_HEADER void Calc(const Point<3> & startpoint, Array<Point<3>> & points, Array<double> & vals, Array<bool> & drawelems, Array<int> & dirstart);
|
|
92
|
+
|
|
93
|
+
DLL_HEADER void GenerateFieldLines(Array<Point<3>> & potential_startpoints, const int numlines);
|
|
94
|
+
|
|
95
|
+
const auto & GetPStart() const { return pstart; }
|
|
96
|
+
const auto & GetPEnd() const { return pend; }
|
|
97
|
+
const auto & GetValues() const { return values; }
|
|
98
|
+
const auto GetThickness() const { return thickness; }
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
} // namespace netgen
|
|
102
|
+
|
|
103
|
+
#endif // VSFIELDLINES_HPP_INCLUDED
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
#ifndef NETGEN_FINDIP_HPP
|
|
2
|
+
#define NETGEN_FINDIP_HPP
|
|
3
|
+
|
|
4
|
+
// find inner point
|
|
5
|
+
|
|
6
|
+
namespace netgen
|
|
7
|
+
{
|
|
8
|
+
|
|
9
|
+
inline void Minimize (const NgArray<Vec3d> & a,
|
|
10
|
+
const NgArray<double> & c,
|
|
11
|
+
int * act,
|
|
12
|
+
Vec<3> & x, double & f,
|
|
13
|
+
int * sol)
|
|
14
|
+
{
|
|
15
|
+
int act1[4];
|
|
16
|
+
Mat<3> m, inv;
|
|
17
|
+
Vec<3> rs, xmax, center;
|
|
18
|
+
|
|
19
|
+
f = 1e99;
|
|
20
|
+
|
|
21
|
+
for (int j = 0; j < 5; j++)
|
|
22
|
+
{
|
|
23
|
+
for (int hk = 0, k = 0; hk < 4; hk++)
|
|
24
|
+
{
|
|
25
|
+
if (hk == j) k++;
|
|
26
|
+
act1[hk] = act[k];
|
|
27
|
+
k++;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (int k = 0; k < 3; k++)
|
|
31
|
+
{
|
|
32
|
+
m(k, 0) = a[act1[0]].X() - a[act1[k+1]].X();
|
|
33
|
+
m(k, 1) = a[act1[0]].Y() - a[act1[k+1]].Y();
|
|
34
|
+
m(k, 2) = a[act1[0]].Z() - a[act1[k+1]].Z();
|
|
35
|
+
rs(k) = c[act1[k+1]] - c[act1[0]];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
(*testout) << "act1 = "
|
|
40
|
+
<< act1[0] << " "
|
|
41
|
+
<< act1[1] << " "
|
|
42
|
+
<< act1[2] << " "
|
|
43
|
+
<< act1[3] << endl;
|
|
44
|
+
(*testout) << "Det = " << Det(m) << endl;
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
if (fabs (Det (m)) > 1e-10)
|
|
48
|
+
{
|
|
49
|
+
CalcInverse (m, inv);
|
|
50
|
+
xmax = inv * rs;
|
|
51
|
+
|
|
52
|
+
double fmax = -1e10;
|
|
53
|
+
for (int k = 0; k < 5; k++)
|
|
54
|
+
{
|
|
55
|
+
double hd =
|
|
56
|
+
xmax(0) * a[act[k]].X() + xmax(1) * a[act[k]].Y() + xmax(2) * a[act[k]].Z() + c[act[k]];
|
|
57
|
+
if (hd > fmax) fmax = hd;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (fmax < f)
|
|
61
|
+
{
|
|
62
|
+
f = fmax;
|
|
63
|
+
x = xmax;
|
|
64
|
+
for (int k = 0; k < 4; k++)
|
|
65
|
+
sol[k] = act1[k];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
template <typename POINTArray, typename FACEArray>
|
|
75
|
+
inline int FindInnerPoint (POINTArray & points,
|
|
76
|
+
FACEArray & faces,
|
|
77
|
+
Point3d & p)
|
|
78
|
+
{
|
|
79
|
+
static int timer = NgProfiler::CreateTimer ("FindInnerPoint");
|
|
80
|
+
NgProfiler::RegionTimer reg (timer);
|
|
81
|
+
|
|
82
|
+
NgArray<Vec3d> a;
|
|
83
|
+
NgArray<double> c;
|
|
84
|
+
Mat<3> m, inv;
|
|
85
|
+
Vec<3> rs, x = 0.0, center;
|
|
86
|
+
double f;
|
|
87
|
+
|
|
88
|
+
int nf = faces.Size();
|
|
89
|
+
|
|
90
|
+
// minimize_x max_i a_i x + c_i
|
|
91
|
+
|
|
92
|
+
a.SetSize (nf+4);
|
|
93
|
+
c.SetSize (nf+4);
|
|
94
|
+
|
|
95
|
+
for (int i = 0; i < nf; i++)
|
|
96
|
+
{
|
|
97
|
+
Point3d p1 = points[faces[i][0]];
|
|
98
|
+
a[i] = Cross (points[faces[i][1]] - p1,
|
|
99
|
+
points[faces[i][2]] - p1);
|
|
100
|
+
a[i] /= a[i].Length();
|
|
101
|
+
c[i] = - (a[i].X() * p1.X() + a[i].Y() * p1.Y() + a[i].Z() * p1.Z());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
center = 0;
|
|
106
|
+
for (int i = 0; i < points.Size(); i++)
|
|
107
|
+
center += Vec<3> (points[i]);
|
|
108
|
+
center /= points.Size();
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
center = 0;
|
|
112
|
+
for (int i = 0; i < faces.Size(); i++)
|
|
113
|
+
for (int j = 0; j < 3; j++)
|
|
114
|
+
center += Vec<3> (points[faces[i][j]]);
|
|
115
|
+
center /= (3*faces.Size());
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
// (*testout) << "center = " << center << endl;
|
|
119
|
+
|
|
120
|
+
double hmax = 0;
|
|
121
|
+
for (int i = 0; i < nf; i++)
|
|
122
|
+
{
|
|
123
|
+
// const Element2d & el = faces[i];
|
|
124
|
+
// (*testout) << "el[" << i << "] = " << el << endl;
|
|
125
|
+
for (int j : Range(3))
|
|
126
|
+
{
|
|
127
|
+
double hi = Dist (points[faces[i][j%3]],
|
|
128
|
+
points[faces[i][(j+1)%3]]);
|
|
129
|
+
if (hi > hmax) hmax = hi;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// (*testout) << "hmax = " << hmax << endl;
|
|
134
|
+
|
|
135
|
+
a[nf] = Vec<3> (1, 0, 0);
|
|
136
|
+
c[nf] = -center(0) - hmax;
|
|
137
|
+
a[nf+1] = Vec<3> (0, 1, 0);
|
|
138
|
+
c[nf+1] = -center(1) - hmax;
|
|
139
|
+
a[nf+2] = Vec<3> (0, 0, 1);
|
|
140
|
+
c[nf+2] = -center(2) - hmax;
|
|
141
|
+
a[nf+3] = Vec<3> (-1, -1, -1);
|
|
142
|
+
c[nf+3] = center(0)+center(1)+center(2)-3*hmax;
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
(*testout) << "findip, a now = " << endl << a << endl;
|
|
146
|
+
(*testout) << "findip, c now = " << endl << c << endl;
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
int act[5] = { 0, nf, nf+1, nf+2, nf+3 };
|
|
150
|
+
int sol[4];
|
|
151
|
+
|
|
152
|
+
while (1)
|
|
153
|
+
{
|
|
154
|
+
/*
|
|
155
|
+
(*testout) << "try ";
|
|
156
|
+
for (int j = 0; j < 5; j++)
|
|
157
|
+
(*testout) << act[j] << " ";
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
Minimize (a, c, act, x, f, sol);
|
|
161
|
+
|
|
162
|
+
/*
|
|
163
|
+
(*testout) << endl << "sol = ";
|
|
164
|
+
for (int j = 0; j < 4; j++)
|
|
165
|
+
(*testout) << sol[j] << " ";
|
|
166
|
+
|
|
167
|
+
(*testout) << " fmin = " << f << endl;
|
|
168
|
+
*/
|
|
169
|
+
for (int j = 0; j < 4; j++) act[j] = sol[j];
|
|
170
|
+
|
|
171
|
+
bool found = 0;
|
|
172
|
+
double maxval = f;
|
|
173
|
+
for (int j = 0; j < nf; j++)
|
|
174
|
+
{
|
|
175
|
+
double val = x(0) * a[j].X() + x(1) * a[j].Y() + x(2) * a[j].Z() + c[j];
|
|
176
|
+
if (val > maxval + hmax * 1e-6)
|
|
177
|
+
{
|
|
178
|
+
found = 1;
|
|
179
|
+
maxval = val;
|
|
180
|
+
act[4] = j;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// (*testout) << "maxval = " << maxval << endl;
|
|
185
|
+
if (!found) break;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// cout << "converged, f = " << f << endl;
|
|
189
|
+
|
|
190
|
+
p = Point3d (x(0), x(1), x(2));
|
|
191
|
+
// (*testout) << "findip, f = " << f << ", hmax = " << hmax << endl;
|
|
192
|
+
return (f < -1e-5 * hmax);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
} // namespace netgen
|
|
196
|
+
#endif // FILE_FINDINNERPOINT_HPP
|
|
197
|
+
|
|
198
|
+
|