OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Interface to Triangle (Delaunay mesher). More...
#include <trianglemesherinterface.h>
Public Member Functions | |
TriangleMesherInterface (double minAngle, double maxArea, bool quadratic) | |
Constructor. More... | |
~TriangleMesherInterface () | |
Destructor. More... | |
bool | meshPSLG (const Triangle_PSLG &pslg, const IntArray &outside, const IntArray &inside, std::vector< FloatArray > &nodes, std::vector< IntArray > &n_markers, std::vector< IntArray > &triangles, IntArray &t_markers, std::vector< IntArray > &segments, IntArray &s_markers) const |
Constructs a mesh from a PSLG. More... | |
Static Public Member Functions | |
static void | simplifyPSLG (Triangle_PSLG &coarse, const Triangle_PSLG &pslg, double limit, double minlen=0.0) |
Simplifies a PSLG while respecting topology, running in linear time. More... | |
Static Protected Member Functions | |
static void | fixNodeMarkers (const std::vector< FloatArray > &nodes, std::vector< IntArray > &n_markers, const std::vector< IntArray > &triangles, const IntArray &t_markers, const std::vector< IntArray > &segments, const IntArray &s_markers) |
Adds all neighboring regions to every node region. More... | |
Protected Attributes | |
double | minAngle |
double | maxArea |
bool | useRegions |
bool | quadratic |
Interface to Triangle (Delaunay mesher).
Definition at line 64 of file trianglemesherinterface.h.
|
inline |
Constructor.
minAngle | Minimum angle. Should be less than 33 (20 is default). |
maxArea | Maximum allowed area of a triangle. |
quadratic | True if generated mesh should be quadratic (6 nodes). |
Definition at line 79 of file trianglemesherinterface.h.
|
inline |
Destructor.
Definition at line 82 of file trianglemesherinterface.h.
|
staticprotected |
Adds all neighboring regions to every node region.
Necessary since triangle can only store a single node number.
Definition at line 539 of file trianglemesherinterface.C.
Referenced by meshPSLG().
bool oofem::TriangleMesherInterface::meshPSLG | ( | const Triangle_PSLG & | pslg, |
const IntArray & | outside, | ||
const IntArray & | inside, | ||
std::vector< FloatArray > & | nodes, | ||
std::vector< IntArray > & | n_markers, | ||
std::vector< IntArray > & | triangles, | ||
IntArray & | t_markers, | ||
std::vector< IntArray > & | segments, | ||
IntArray & | s_markers | ||
) | const |
Constructs a mesh from a PSLG.
The PSLG needs to be oriented correctly, as every segment determines the bulk region number at both sides, which then spreads to surrounding elements. The length of those arrays must be at least as big as the largest segment region number. Inconsistent regions are automatically detected.
[in] | pslg | Input PSLG. |
[in] | outside | Segment region to bulk region mapping. |
[in] | inside | Segment region to bulk region mapping. |
[out] | nodes | Output nodes. |
[out] | n_markers | Node markers. |
[out] | triangles | Output triangles (3 or 6 nodes depending on option). |
[out] | t_markers | Triangle markers |
[out] | segments | Output segments (2 or 3 nodes depending on option). |
[out] | s_markers | Segment markers. |
Definition at line 389 of file trianglemesherinterface.C.
References oofem::IntArray::at(), oofem::IntArray::findFirstIndexOf(), fixNodeMarkers(), oofem::IntArray::givePointer(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), maxArea, minAngle, oofem::Triangle_PSLG::nx, oofem::Triangle_PSLG::ny, OOFEM_ERROR, quadratic, oofem::IntArray::resize(), oofem::Triangle_PSLG::segment_a, oofem::Triangle_PSLG::segment_b, and oofem::Triangle_PSLG::segment_marker.
Referenced by oofem::ParticleTopologyDescription::generateMesh().
|
static |
Simplifies a PSLG while respecting topology, running in linear time.
The algorithm removes unnecessary nodes while preserving topology. This means any node with other than 2 edges are kept. The error measure is is the distance from any point to the simplified curve. A straight line will be simplified to its end points, even for zero limit value. Direction of edges is preserved.
coarse | Resulting PSLG. |
pslg | Input PSLG. |
limit | Maximum difference allowed from new to old line. |
minlen | Minimum length of any segment (shorter segments will be forcibly removed). Will not respect the error limit. |
Definition at line 557 of file trianglemesherinterface.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatArray::computeNorm(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::Triangle_PSLG::nx, oofem::Triangle_PSLG::ny, oofem::IntArray::resize(), oofem::FloatArray::resize(), oofem::Triangle_PSLG::segment_a, oofem::Triangle_PSLG::segment_b, oofem::Triangle_PSLG::segment_marker, oofem::FloatArray::subtract(), oofem::FloatArray::times(), and oofem::IntArray::zero().
Referenced by oofem::ParticleTopologyDescription::generatePSLG().
|
protected |
Definition at line 68 of file trianglemesherinterface.h.
Referenced by meshPSLG().
|
protected |
Definition at line 67 of file trianglemesherinterface.h.
Referenced by meshPSLG().
|
protected |
Definition at line 70 of file trianglemesherinterface.h.
Referenced by meshPSLG().
|
protected |
Definition at line 69 of file trianglemesherinterface.h.