www.mooseframework.org
ElementFragmentAlgorithm.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef ELEMENTFRAGMENTALGORITHM_H
9 #define ELEMENTFRAGMENTALGORITHM_H
10 
11 #include <vector>
12 #include <map>
13 #include <set>
14 
15 #include "EFANode.h"
16 #include "EFAElement.h"
17 
19 {
20 public:
24  ElementFragmentAlgorithm(std::ostream & os);
25 
27 
28 private:
29  std::ostream & _ostream;
30  // unsigned int MaxElemId;
31  std::map<unsigned int, EFANode *> _permanent_nodes;
32  std::map<unsigned int, EFANode *> _embedded_nodes;
33  std::map<unsigned int, EFANode *> _temp_nodes;
34  std::map<unsigned int, EFANode *> _embedded_permanent_nodes;
35  std::map<unsigned int, EFAElement *> _elements;
36  // std::map< std::set< EFAnode* >, std::set< EFAelement* > > _merged_edge_map;
37  std::set<EFAElement *> _crack_tip_elements;
38  std::vector<EFANode *> _new_nodes;
39  std::vector<EFANode *> _deleted_nodes;
40  std::vector<EFAElement *> _child_elements;
41  std::vector<EFAElement *> _parent_elements;
42  std::map<EFANode *, std::set<EFAElement *>> _inverse_connectivity;
43 
44 public:
45  unsigned int add2DElements(std::vector<std::vector<unsigned int>> & quads);
46  EFAElement * add2DElement(std::vector<unsigned int> quad, unsigned int id);
47  EFAElement * add3DElement(std::vector<unsigned int> quad, unsigned int id);
48 
49  void updateEdgeNeighbors();
50  void initCrackTipTopology();
51  void addElemEdgeIntersection(unsigned int elemid, unsigned int edgeid, double position);
52  void addElemNodeIntersection(unsigned int elemid, unsigned int nodeid);
53  bool addFragEdgeIntersection(unsigned int elemid, unsigned int frag_edge_id, double position);
54  void addElemFaceIntersection(unsigned int elemid,
55  unsigned int faceid,
56  std::vector<unsigned int> edgeid,
57  std::vector<double> position);
58  void addFragFaceIntersection(unsigned int ElemID,
59  unsigned int FragFaceID,
60  std::vector<unsigned int> FragFaceEdgeID,
61  std::vector<double> position);
62 
64 
65  void updateTopology(bool mergeUncutVirtualEdges = true);
66  void reset();
67  void clearAncestry();
68  void restoreFragmentInfo(EFAElement * const elem, const EFAElement * const from_elem);
69 
70  void createChildElements();
71  void connectFragments(bool mergeUncutVirtualEdges);
72 
73  void sanityCheck();
75  void printMesh();
76  void error(const std::string & error_string);
77 
78  const std::vector<EFAElement *> & getChildElements() { return _child_elements; };
79  const std::vector<EFAElement *> & getParentElements() { return _parent_elements; };
80  const std::vector<EFANode *> & getNewNodes() { return _new_nodes; };
81  const std::set<EFAElement *> & getCrackTipElements() { return _crack_tip_elements; };
82  const std::map<unsigned int, EFANode *> & getPermanentNodes() { return _permanent_nodes; }
83  const std::map<unsigned int, EFANode *> & getTempNodes() { return _temp_nodes; }
84  const std::map<unsigned int, EFANode *> & getEmbeddedNodes() { return _embedded_nodes; }
85  EFAElement * getElemByID(unsigned int id);
86  unsigned int getElemIdByNodes(unsigned int * node_id);
88 };
89 
90 #endif // #ifndef ELEMENTFRAGMENTALGORITHM_H
void addElemNodeIntersection(unsigned int elemid, unsigned int nodeid)
void error(const std::string &error_string)
void addElemEdgeIntersection(unsigned int elemid, unsigned int edgeid, double position)
const std::map< unsigned int, EFANode * > & getEmbeddedNodes()
ElementFragmentAlgorithm(std::ostream &os)
Constructor.
void connectFragments(bool mergeUncutVirtualEdges)
const std::vector< EFAElement * > & getChildElements()
std::vector< EFAElement * > _child_elements
std::vector< EFAElement * > _parent_elements
void addFragFaceIntersection(unsigned int ElemID, unsigned int FragFaceID, std::vector< unsigned int > FragFaceEdgeID, std::vector< double > position)
void updateTopology(bool mergeUncutVirtualEdges=true)
const std::vector< EFAElement * > & getParentElements()
std::map< unsigned int, EFAElement * > _elements
unsigned int add2DElements(std::vector< std::vector< unsigned int >> &quads)
const std::vector< EFANode * > & getNewNodes()
void addElemFaceIntersection(unsigned int elemid, unsigned int faceid, std::vector< unsigned int > edgeid, std::vector< double > position)
std::vector< EFANode * > _deleted_nodes
bool addFragEdgeIntersection(unsigned int elemid, unsigned int frag_edge_id, double position)
std::map< unsigned int, EFANode * > _embedded_permanent_nodes
std::set< EFAElement * > _crack_tip_elements
std::vector< EFANode * > _new_nodes
void restoreFragmentInfo(EFAElement *const elem, const EFAElement *const from_elem)
unsigned int getElemIdByNodes(unsigned int *node_id)
std::map< EFANode *, std::set< EFAElement * > > _inverse_connectivity
EFAElement * add2DElement(std::vector< unsigned int > quad, unsigned int id)
std::map< unsigned int, EFANode * > _temp_nodes
EFAElement * getElemByID(unsigned int id)
const std::map< unsigned int, EFANode * > & getTempNodes()
std::map< unsigned int, EFANode * > _embedded_nodes
const std::map< unsigned int, EFANode * > & getPermanentNodes()
std::map< unsigned int, EFANode * > _permanent_nodes
EFAElement * add3DElement(std::vector< unsigned int > quad, unsigned int id)
const std::set< EFAElement * > & getCrackTipElements()