50 #define _IFT_Subdivision_Name "subdiv" 54 #define SHARED_IRREGULAR_DATA_TAG 7654 55 #define SUBDIVISION_SHARED_IRREGULAR_REC_TAG 7655 56 #define SUBDIVISION_END_DATA 7656 57 #define SUBDIVISION_MIGRATE_REMOTE_ELEMENTS_TAG 7657 58 #define SHARED_EDGE_DATA_TAG 7658 59 #define SUBDIVISION_SHARED_EDGE_REC_TAG 7659 62 class ProcessCommunicator;
89 #ifdef __PARALLEL_MODE 102 this->requiredDensity = rd;
103 this->boundary = boundary;
104 this->parent = parent;
105 this->globalNumber = 0;
106 #ifdef __PARALLEL_MODE 129 #ifdef __PARALLEL_MODE 130 void numberSharedEdges();
147 RS_IrregularNode(
int n,
Subdivision :: RS_Mesh * mesh,
int parent,
FloatArray & c,
double rd,
bool boundary) :
RS_Node(n, mesh, parent, c, rd, boundary) { }
180 #ifdef __PARALLEL_MODE 187 this->number = number;
191 this->parent = parent;
192 this->queue_flag =
false;
193 this->globalNumber = -1;
194 #ifdef __PARALLEL_MODE 209 virtual void bisect(std :: queue< int > &subdivqueue, std :: list< int > &sharedIrregularsQueue) { }
210 virtual void generate(std :: list< int > &sharedEdgesQueue) { }
213 virtual double giveRequiredDensity();
218 void setNeighbor(
int iside,
int nb) { this->neghbours_base_elements.
at(iside) = nb; }
220 virtual void giveSideNodes(
int iside,
IntArray &snodes) = 0;
231 virtual int giveEdgeIndex(
int iNode,
int jNode) = 0;
243 #ifdef __PARALLEL_MODE 244 virtual void numberSharedEdges(
int iNode,
IntArray &connNodes) = 0;
246 virtual void makeSharedEdges() = 0;
259 int evaluateLongestEdge();
260 void bisect(std :: queue< int > &subdivqueue, std :: list< int > &sharedIrregularsQueue);
261 void generate(std :: list< int > &sharedEdgesQueue);
262 void update_neighbours();
263 double giveDensity();
265 void giveSideNodes(
int iside,
IntArray &snodes);
266 int giveEdgeIndex(
int iNode,
int jNode);
271 #ifdef __PARALLEL_MODE 272 void numberSharedEdges(
int iNode,
IntArray &connNodes);
274 shared_edges.resize(3);
286 int evaluateLongestEdge();
287 void bisect(std :: queue< int > &subdivqueue, std :: list< int > &sharedIrregularsQueue);
288 void generate(std :: list< int > &sharedEdgesQueue);
289 void update_neighbours();
290 double giveDensity();
292 void giveSideNodes(
int iside,
IntArray &snodes);
293 int giveEdgeIndex(
int iNode,
int jNode);
298 #ifdef __PARALLEL_MODE 299 void numberSharedEdges(
int iNode,
IntArray &connNodes);
301 shared_edges.resize(6);
307 #ifdef __PARALLEL_MODE 333 int giveSharedPartitions(
IntArray &partitions);
340 std :: vector< std :: unique_ptr< Subdivision :: RS_Node > >
nodes;
341 std :: vector< std :: unique_ptr< Subdivision :: RS_Element > >
elements;
342 #ifdef __PARALLEL_MODE 343 std :: vector< std :: unique_ptr< Subdivision :: RS_SharedEdge > >
edges;
347 #ifdef __PARALLEL_MODE 348 std :: map< int, Subdivision :: RS_Node * >sharedNodeMap;
355 #ifdef __PARALLEL_MODE 357 this->subdivision = s;
358 sharedNodeMapInitialized =
false;
362 this->subdivision = s;
373 #ifdef __PARALLEL_MODE 379 int sharedNodeGlobal2Local(
int _globnum);
392 int operator() (
int i,
int j);
412 smoothingFlag =
false;
431 void assignGlobalNumbersToElements(
Domain *d);
433 #ifdef __PARALLEL_MODE 438 bool exchangeSharedIrregulars();
441 void assignGlobalNumbersToSharedIrregulars();
444 void exchangeSharedEdges();
452 int giveNumberOfProcesses();
461 #endif // subdivision_h
void eraseSorted(int value)
Erase the element of given value.
Subdivision * giveSubdivision()
void setEdgeNodes(int i, int j)
int giveLeIndex()
Returns the longest edge index of the receiver.
std::list< int > sharedIrregularsQueue
virtual int evaluateLongestEdge()
void setLeIndex(int _n)
Sets the longest edge index.
void initGlobalSharedNodeMap()
dofManagerParallelMode giveParallelMode() const
void eraseConnectedElement(int num)
void setEdgeNodes(int i, int j)
virtual void update_neighbours()
bool hasIrregulars()
Returns true if element has some irregular nodes.
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
bool sharedNodeMapInitialized
sharedNodeMap init flag
double & at(int i)
Coefficient access function.
const char * giveClassName()
const IntArray * giveNeighbors()
std::queue< int > subdivqueue
virtual void generate(std::list< int > &sharedEdgesQueue)
int giveSharedEdge(int iedge)
void setNeighbor(int iside, int nb)
RS_IrregularNode(int n, Subdivision::RS_Mesh *mesh, int parent, FloatArray &c, double rd, bool boundary)
Subdivision(Domain *d)
Constructor.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
IntArray neghbours_base_elements
FloatArray * giveCoordinates()
IntArray partitions
List of partition sharing the shared dof manager or remote partion containing remote dofmanager count...
dofManagerParallelMode
In parallel mode, this type indicates the mode of DofManager.
RS_CompareNodePositions(RS_Mesh *_m)
void setPartitions(IntArray _p)
bool isTerminal()
Returns true if receiver is terminal (not further subdivided)
This class represents the Rivara Subdivision algorithm for triangular meshes.
bool containsOnlyZeroes() const
Checks if receiver is all zero.
void setConnectedElements(IntArray _conn)
virtual void bisect(std::queue< int > &subdivqueue, std::list< int > &sharedIrregularsQueue)
void addEdge(Subdivision::RS_SharedEdge *obj)
void setParallelMode(dofManagerParallelMode _mode)
double giveCoordinate(int i)
elementParallelMode giveParallelMode() const
const IntArray * givePartitions()
virtual bool isIrregular()
void insertSorted(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
void addPartition(int _p, int allocChunk)
void setIrregular(int iedge, int ir)
std::vector< std::unique_ptr< Subdivision::RS_Element > > elements
void insertConnectedElement(int num)
void clear()
Clears the array (zero size).
void addElement(Subdivision::RS_Element *obj)
RS_Node(int n, Subdivision::RS_Mesh *m, int parent, FloatArray &c, double rd, bool boundary)
The base class representing the interface to mesh generation package.
int giveNeighbor(int iside)
Class representing connectivity table.
Class representing process communicator for engineering model.
void giveEdgeNodes(int &i, int &j)
double giveRequiredDensity()
int giveIrregular(int iedge)
dofManagerParallelMode parallel_mode
elementParallelMode
In parallel mode, this type indicates the mode of element.
int giveNumberOfElements()
void setSharedEdge(int iedge, int num)
Subdivision * subdivision
RS_Element(int number, Subdivision::RS_Mesh *m, int parent, IntArray &nodes)
Class representing vector of real numbers.
Subdivision::RS_Mesh * giveMesh()
void setNumber(int newNum)
virtual void drawGeometry()
Element is local, there are no contributions from other domains to this element.
void setGlobalNumber(int gn)
const IntArray * giveChildren()
bool containsNode(int _node)
virtual double giveDensity()
Subdivision::RS_SharedEdge * giveEdge(int i)
std::vector< std::unique_ptr< Subdivision::RS_Node > > nodes
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
const IntArray * givePartitions()
RS_SharedEdge(Subdivision::RS_Mesh *m)
void giveEdgeNodes(int &i, int &j)
virtual bool isIrregular()
void addNode(Subdivision::RS_Node *obj)
void setParallelMode(elementParallelMode _mode)
void preallocate(int futureSize)
Preallocates receiver to given futureSize if larger then allocatedSize.
std::list< int > sharedEdgesQueue
const IntArray * giveNodes()
elementParallelMode parallel_mode
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setQueueFlag(bool _qf)
IntArray connectedElements
DofManager is local, there are no contribution from other domains to this DofManager.
Subdivision::RS_Element * giveElement(int i)
Subdivision::RS_Node * giveNode(int i)
const IntArray * giveSharedEdges()
std::vector< std::unique_ptr< Subdivision::RS_SharedEdge > > edges
Class representing solution step.
void preallocateConnectedElements(int size)
void setPartitions(IntArray _p)
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
void setGlobalNumber(int gn)
const IntArray * giveConnectedElements()