51 alphaShapeEdgeList(0), triangleOctree()
78 std :: list< Edge2D > :: iterator pos;
81 if ( !polygon.empty() ) {
82 for ( pos = polygon.begin(); pos != polygon.end(); ) {
83 if ( ( * pos ) == * edge ) {
84 pos = polygon.erase(pos);
95 polygon.push_back(* edge);
108 for (
int insertedNode = 1; insertedNode <=
nnode; insertedNode++ ) {
111 std :: list< Edge2D >polygon;
149 bool hasNoBcOnItself;
155 if ( pfemEngngModel ) {
164 elem =
new TR1_2D_PFEM(num,
domain, ( * genIT )->
giveNode(1), ( * genIT )->giveNode(2), ( * genIT )->giveNode(3), mat, cs);
181 bool oneIsFree =
false;
182 hasNoBcOnItself =
true;
184 for (
Dof *dof: *dman ) {
185 type = dof->giveDofID();
186 if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
187 if ( dof->giveBcId() ) {
188 hasNoBcOnItself =
false;
193 if ( hasNoBcOnItself ) {
196 dynamic_cast< PFEMParticle *
>( dman )->setOnAlphaShape();
198 hasNoBcOnItself =
true;
200 for (
Dof *dof: *dman ) {
201 type = dof->giveDofID();
202 if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
203 if ( dof->giveBcId() ) {
204 hasNoBcOnItself =
false;
209 if ( hasNoBcOnItself ) {
212 dynamic_cast< PFEMParticle *
>( dman )->setOnAlphaShape();
216 dofOnNode1->
setBcId(pressureBC);
219 dofOnNode2->
setBcId(pressureBC);
228 bool alphaLengthInitialized =
false;
229 double minimalLength = 1.e6;
232 if ( alphaLengthInitialized ) {
233 minimalLength =
min( ( * genIT )->giveShortestEdgeLength(), minimalLength );
235 minimalLength = ( * genIT )->giveShortestEdgeLength();
236 alphaLengthInitialized =
true;
239 int par1 = ( * genIT )->giveNode(1);
240 int par2 = ( * genIT )->giveNode(2);
241 int par3 = ( * genIT )->giveNode(3);
242 double ccRadius = ( * genIT )->giveCircumRadius();
250 if ( containedEdge ) {
254 if ( ccRadius < outAlph ) {
259 if ( ccRadius > innAlph ) {
279 if ( containedEdge ) {
284 if ( ccRadius < outAlph ) {
289 if ( ccRadius > innAlph ) {
309 if ( containedEdge ) {
314 if ( ccRadius < outAlph ) {
319 if ( ccRadius > innAlph ) {
347 if ( ( * *
elIT ) == ( * alphaEdge ) ) {
361 double outBound, innBound;
367 outBound = ( * elIT )->giveOuterAlphaBound();
370 if ( ( * elIT )->giveHullFlag() ) {
371 if ( alpha > outBound ) {
375 ( * elIT )->giveShared(1)->setValidFlag(
false);
378 innBound = ( * elIT )->giveInnerAlphaBound();
379 if ( alpha > outBound && alpha < innBound ) {
381 if ( ( * elIT )->giveShared(1)->giveCircumRadius() > alpha ) {
382 ( * elIT )->giveShared(1)->setValidFlag(
false);
384 ( * elIT )->giveShared(2)->setValidFlag(
false);
388 if ( alpha < outBound ) {
389 for (
int i = 1; i <= 2; i++ ) {
390 ( * elIT )->giveShared(i)->setValidFlag(
false);
413 FloatArray *nodeCoords = ( ( (
Node * ) dman )->giveCoordinates() );
416 std :: list< DelaunayTriangle * >nonDelaunayTriangles;
417 std :: list< DelaunayTriangle * > :: iterator triangleIT;
424 for ( triangleIT = nonDelaunayTriangles.begin(); triangleIT != nonDelaunayTriangles.end(); ++triangleIT ) {
426 triangle = * triangleIT;
445 std :: list< Edge2D > :: iterator polygonIT;
446 for ( polygonIT = polygon.begin(); polygonIT != polygon.end(); polygonIT++ ) {
474 printf(
"\nUser time consumed by searching: %.3f [s]\n\n", _searchutime);
475 printf(
"\nUser time consumed by building insertion polygon: %.3f [s]\n\n", _polygonutime);
476 printf(
"\nUser time consumed by creating elements: %.3f [s]\n\n", _creativeutime);
477 printf(
"\nUser time consumed by meshing: %.3f [s]\n\n", _utime);
484 int node1 = ( * genIT )->giveNode(1);
485 int node2 = ( * genIT )->giveNode(2);
486 int node3 = ( * genIT )->giveNode(3);
491 !( ( * genIT )->giveValidFlag() ) ) {
513 for (
int ci = 1; ci <= 2; ci++ ) {
514 coords.
at(ci) -= diff;
552 double rootSize, resolutionLimit;
557 for ( i = 1; i <=
nnode; i++ ) {
559 coords =
static_cast< Node *
>( dman )->giveCoordinates();
562 for ( j = 1; j <= coords->
giveSize(); j++ ) {
563 minc.at(j) = maxc.at(j) = coords->
at(j);
566 for ( j = 1; j <= coords->
giveSize(); j++ ) {
567 if ( coords->
at(j) < minc.at(j) ) {
568 minc.at(j) = coords->
at(j);
571 if ( coords->
at(j) > maxc.at(j) ) {
572 maxc.at(j) = coords->
at(j);
582 for ( i = 1; i <= 3; i++ ) {
583 rootSize = 1.000001 *
max( rootSize, maxc.at(i) - minc.at(i) );
589 resolutionLimit =
min(1.e-3, rootSize / 1.e6);
590 for ( i = 1; i <= 3; i++ ) {
591 if ( ( maxc.at(i) - minc.at(i) ) > resolutionLimit ) {
int giveAssociatedCrossSectionNumber()
Returns number of cross section to be associated with created elements.
Squared bounding box for templated octree localizer.
void resizeDofManagers(int _newSize)
Resizes the internal data structure to accommodate space for _newSize dofManagers.
This class is the implementation of triangular PFEM element with linear (and equal order) interpolati...
Timer polygonTimer
Measures time needed for identifying polygon to be retriangulated.
void computeBBXBasedOnNodeData(BoundingBox &BBX)
Calculates the bounding box base on the domain's nodes.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Class for the boundary recognition method - alpha shape.
int giveAssociatedMaterialNumber()
Returns number of material to be associated with created elements.
void setMask(int i, int mask)
Sets the spatial mask.
Timer meshingTimer
Measures overall time of triangulation procedure.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
AlphaEdge2D * giveBackEdgeIfAlreadyContainedInList(AlphaEdge2D *alphaEdge)
Fills the edgeList with unique alphaEdges.
This class represents PFEM method for solving incompressible Navier-Stokes equations.
Edge class for Delaunay triangulation.
void setSharing(int n, DelaunayTriangle *pTE)
Stores DelaunayTriangle sharing the receiver.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
void computeAlphaComplex()
Reads the triangulation and fills tha edgeList container with alpha-shape edges and set their bounds...
Abstract base class for all finite elements.
void generateMesh()
Main call.
Base class for dof managers.
void resizeElements(int _newSize)
Resizes the internal data structure to accommodate space for _newSize elements.
void giveTimeReport()
Prints the time report.
virtual bool isActive()
Returns the activeFlag.
std::list< DelaunayTriangle * > generalTriangleList
Contains all triangles (even not valid)
Class implementing an array of integers.
Delaunay triangle for the triangulation of a set of nodes.
~DelaunayTriangulator()
Destructor.
virtual void setBcId(int bcId)
Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling...
Timer searchingTimer
Measures time needed by searching for non-delaunay triangles.
#define VERBOSE_PRINT0(str, number)
void setValidFlag(bool newFlag)
Sets the flag whether Delaunay condition is fulfilled.
Functor for finding triangles whose circumscribed circles contains given node.
std::list< AlphaEdge2D * > edgeList
contains all edges of the triangulation
std::list< DelaunayTriangle * >::iterator genIT
DofIDItem
Type representing particular dof type.
int giveAssociatedPressureBC()
Returns number of zero pressure boundary condition to be prescribed on free surface.
void buildInitialBBXMesh(InsertTriangleBasedOnCircumcircle &tInsert)
Identifies the bounding box of pfemparticles and creates initial triangulation consisting of 2 triang...
void setSize(double s)
Sets the size of the bounding box (all sides are equal)
void writeMesh()
Writes the mesh into the domain by creating new tr1_2d_pfem elements and prescribes zero-pressure bou...
void setInnerAlphaBound(double alphaMax)
Sets the inner limit.
Timer creativeTimer
Measures time needed for creating new Delaunay triangles.
void setHullFlag(bool flag)
Sets the convex hull property.
void findNonDelaunayTriangles(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Looks for non-Delaunay triangles in octree and creates a polygon.
double giveInnerAlphaBound()
Returns the inner limit.
double giveOuterAlphaBound()
Returns the outer limit.
void meshPolygon(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Retriangulates the polygon.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
OctreeSpatialLocalizerT< DelaunayTriangle * > triangleOctree
Octree with Delaunay triangles allowing fast search.
Functor for storing triangles in the octree according to theirs circumscribed circles.
void cleanUpTriangleList()
Iterates through generalTringleList und removes non-valid ones or those containing bounding box nodes...
std::list< AlphaEdge2D * >::iterator elIT
Domain * domain
Domain of the PFEM problem containing nodes to be triangulated.
void setCoordinates(FloatArray coords)
Sets node coordinates to given array.
void setDofManager(int i, DofManager *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
std::list< AlphaEdge2D * > alphaShapeEdgeList
Contains resulting alpha-shape in form of a list.
int giveNode(int i)
Gives the i-node of the triangle.
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
void setElement(int i, Element *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
void addUniqueEdgeToPolygon(Edge2D *edge, std::list< Edge2D > &polygon)
Edge is added to the polygon only if it's not contained. Otherwise both are removed (edge shared by t...
Particle class being used in PFEM computations.
void giveOrigin(FloatArray &answer)
Returns the bounding box origin.
int min(int i, int j)
Returns smaller value from two given decimals.
int giveSize() const
Returns the size of receiver.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setOuterAlphaBound(double alphaMin)
Sets the outer limit.
Class implementing node in finite element mesh.
void giveAlphaShape()
Iterates through the edgeList container and compares alpha-value with alphaEdge bounds. Alpha shape is stored in the alphaShapeEdgeList.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
double giveSize()
Gives the size of the bounding box.
DelaunayTriangulator(Domain *d, double setAlpha)
Constructor.
double getUtime()
Returns total user time elapsed in seconds.
void initializeTimers()
Initializes Timers and.
void setOrigin(FloatArray &coords)
Sets the origin of the bounding box.