www.mooseframework.org
EFAElement3D.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 EFAELEMENT3D_H
9 #define EFAELEMENT3D_H
10 
11 #include "EFAElement.h"
12 #include "EFAPoint.h"
13 
14 class EFANode;
15 class EFAFace;
16 class EFAVolumeNode;
17 class EFAFragment3D;
18 
19 class EFAElement3D : public EFAElement
20 {
21 public:
22  EFAElement3D(unsigned int eid, unsigned int n_nodes, unsigned int n_faces);
23  EFAElement3D(const EFAElement3D * from_elem, bool convert_to_local);
24 
25  ~EFAElement3D();
26 
27 private:
28  unsigned int _num_faces;
29  std::vector<EFAFace *> _faces;
30  std::vector<EFAVolumeNode *> _interior_nodes;
31  std::vector<std::vector<EFAElement3D *>> _face_neighbors;
32  std::vector<EFAFragment3D *> _fragments;
33  std::vector<std::vector<EFAFace *>> _faces_adjacent_to_faces;
34  unsigned int _num_vertices;
36  std::vector<EFAPoint> _local_node_coor;
37 
38 public:
39  // override virtual methods in base class
40  virtual unsigned int numFragments() const;
41  virtual bool isPartial() const;
42  virtual void getNonPhysicalNodes(std::set<EFANode *> & non_physical_nodes) const;
43 
44  virtual void switchNode(EFANode * new_node, EFANode * old_node, bool descend_to_parent);
45  virtual void switchEmbeddedNode(EFANode * new_node, EFANode * old_node);
46  virtual void updateFragmentNode();
47  virtual void getMasterInfo(EFANode * node,
48  std::vector<EFANode *> & master_nodes,
49  std::vector<double> & master_weights) const;
50  virtual unsigned int numInteriorNodes() const;
51 
52  bool overlaysElement(const EFAElement3D * other_elem) const;
53  virtual unsigned int getNeighborIndex(const EFAElement * neighbor_elem) const;
54  virtual void clearNeighbors();
55  virtual void setupNeighbors(std::map<EFANode *, std::set<EFAElement *>> & InverseConnectivityMap);
56  virtual void neighborSanityCheck() const;
57 
58  virtual void initCrackTip(std::set<EFAElement *> & CrackTipElements);
59  virtual bool shouldDuplicateForCrackTip(const std::set<EFAElement *> & CrackTipElements);
60  virtual bool shouldDuplicateCrackTipSplitElement(const std::set<EFAElement *> & CrackTipElements);
61  virtual bool shouldDuplicateForPhantomCorner();
62  virtual bool willCrackTipExtend(std::vector<unsigned int> & split_neighbors) const;
63  virtual bool isCrackTipElement() const;
64 
65  virtual unsigned int getNumCuts() const;
66  virtual bool isFinalCut() const;
67  virtual void updateFragments(const std::set<EFAElement *> & CrackTipElements,
68  std::map<unsigned int, EFANode *> & EmbeddedNodes);
69  virtual void fragmentSanityCheck(unsigned int n_old_frag_faces,
70  unsigned int n_old_frag_cuts) const;
71  virtual void restoreFragment(const EFAElement * const from_elem);
72 
73  virtual void createChild(const std::set<EFAElement *> & CrackTipElements,
74  std::map<unsigned int, EFAElement *> & Elements,
75  std::map<unsigned int, EFAElement *> & newChildElements,
76  std::vector<EFAElement *> & ChildElements,
77  std::vector<EFAElement *> & ParentElements,
78  std::map<unsigned int, EFANode *> & TempNodes);
79  virtual void removePhantomEmbeddedNode();
80  virtual void
81  connectNeighbors(std::map<unsigned int, EFANode *> & PermanentNodes,
82  std::map<unsigned int, EFANode *> & TempNodes,
83  std::map<EFANode *, std::set<EFAElement *>> & InverseConnectivityMap,
84  bool merge_phantom_faces);
85  virtual void printElement(std::ostream & ostream);
86 
87  // EFAelement3D specific methods
88  EFAFragment3D * getFragment(unsigned int frag_id) const;
89  std::set<EFANode *> getFaceNodes(unsigned int face_id) const;
90  bool getFaceNodeParametricCoordinates(EFANode * node, std::vector<double> & xi_3d) const;
91  EFAVolumeNode * getInteriorNode(unsigned int interior_node_id) const;
92  void removeEmbeddedNode(EFANode * emb_node, bool remove_for_neighbor);
93 
94  unsigned int numFaces() const;
95  void setFace(unsigned int face_id, EFAFace * face);
96  void createFaces();
97  EFAFace * getFace(unsigned int face_id) const;
98  unsigned int getFaceID(EFAFace * face) const;
99  std::vector<unsigned int> getCommonFaceID(const EFAElement3D * other_elem) const;
100  unsigned int getNeighborFaceNodeID(unsigned int face_id,
101  unsigned int node_id,
102  EFAElement3D * neighbor_elem) const;
103  unsigned int getNeighborFaceInteriorNodeID(unsigned int face_id,
104  unsigned int node_id,
105  EFAElement3D * neighbor_elem) const;
106  unsigned int getNeighborFaceEdgeID(unsigned int face_id,
107  unsigned int edg_id,
108  EFAElement3D * neighbor_elem) const;
110  EFAFace * getAdjacentFace(unsigned int face_id, unsigned int edge_id) const;
111 
112  EFAFace * getFragmentFace(unsigned int frag_id, unsigned int face_id) const;
113  std::set<EFANode *> getPhantomNodeOnFace(unsigned int face_id) const;
114  bool getFragmentFaceID(unsigned int elem_face_id, unsigned int & frag_face_id) const;
115  bool getFragmentFaceEdgeID(unsigned int ElemFaceID,
116  unsigned int ElemFaceEdgeID,
117  unsigned int & FragFaceID,
118  unsigned int & FragFaceEdgeID) const;
119  bool
120  isPhysicalEdgeCut(unsigned int ElemFaceID, unsigned int ElemFaceEdgeID, double position) const;
121  bool isFacePhantom(unsigned int face_id) const;
122  unsigned int numFaceNeighbors(unsigned int face_id) const;
123  EFAElement3D * getFaceNeighbor(unsigned int face_id, unsigned int neighbor_id) const;
124 
125  bool fragmentHasTipFaces() const;
126  std::vector<unsigned int> getTipFaceIDs() const;
127  std::set<EFANode *> getTipEmbeddedNodes() const;
128  bool faceContainsTip(unsigned int face_id) const;
129  bool fragmentFaceAlreadyCut(unsigned int ElemFaceID) const;
130 
131  void addFaceEdgeCut(unsigned int face_id,
132  unsigned int edge_id,
133  double position,
134  EFANode * embedded_node,
135  std::map<unsigned int, EFANode *> & EmbeddedNodes,
136  bool add_to_neighbor,
137  bool add_to_adjacent);
138  void addFragFaceEdgeCut(unsigned int frag_face_id,
139  unsigned int frag_edge_id,
140  double position,
141  std::map<unsigned int, EFANode *> & EmbeddedNodes,
142  bool add_to_neighbor,
143  bool add_to_adjacent);
144  std::vector<EFANode *> getCommonNodes(const EFAElement3D * other_elem) const;
145 
146 private:
147  // EFAelement3D specific methods
148  void checkNeighborFaceCut(unsigned int face_id,
149  unsigned int edge_id,
150  double position,
151  EFANode * from_node,
152  EFANode * embedded_node,
153  EFANode *& local_embedded);
154  void mapParametricCoordinateFrom2DTo3D(unsigned int face_id,
155  std::vector<double> & xi_2d,
156  std::vector<double> & xi_3d) const;
157 
158  void setLocalCoordinates();
159 };
160 
161 #endif
bool isPhysicalEdgeCut(unsigned int ElemFaceID, unsigned int ElemFaceEdgeID, double position) const
std::vector< EFAFace * > _faces
Definition: EFAElement3D.h:29
unsigned int getNeighborFaceEdgeID(unsigned int face_id, unsigned int edg_id, EFAElement3D *neighbor_elem) const
virtual void switchNode(EFANode *new_node, EFANode *old_node, bool descend_to_parent)
Definition: EFAElement3D.C:323
std::vector< std::vector< EFAFace * > > _faces_adjacent_to_faces
Definition: EFAElement3D.h:33
bool overlaysElement(const EFAElement3D *other_elem) const
Definition: EFAElement3D.C:425
EFAElement3D * getFaceNeighbor(unsigned int face_id, unsigned int neighbor_id) const
virtual bool isPartial() const
Definition: EFAElement3D.C:269
bool getFragmentFaceEdgeID(unsigned int ElemFaceID, unsigned int ElemFaceEdgeID, unsigned int &FragFaceID, unsigned int &FragFaceEdgeID) const
virtual void initCrackTip(std::set< EFAElement * > &CrackTipElements)
Definition: EFAElement3D.C:558
virtual void printElement(std::ostream &ostream)
virtual unsigned int getNeighborIndex(const EFAElement *neighbor_elem) const
Definition: EFAElement3D.C:452
bool fragmentHasTipFaces() const
std::set< EFANode * > getFaceNodes(unsigned int face_id) const
virtual bool shouldDuplicateCrackTipSplitElement(const std::set< EFAElement * > &CrackTipElements)
Definition: EFAElement3D.C:620
bool faceContainsTip(unsigned int face_id) const
EFAFace * getAdjacentFace(unsigned int face_id, unsigned int edge_id) const
void checkNeighborFaceCut(unsigned int face_id, unsigned int edge_id, double position, EFANode *from_node, EFANode *embedded_node, EFANode *&local_embedded)
unsigned int getNeighborFaceNodeID(unsigned int face_id, unsigned int node_id, EFAElement3D *neighbor_elem) const
bool getFragmentFaceID(unsigned int elem_face_id, unsigned int &frag_face_id) const
virtual bool shouldDuplicateForPhantomCorner()
Definition: EFAElement3D.C:671
unsigned int numFaces() const
virtual void fragmentSanityCheck(unsigned int n_old_frag_faces, unsigned int n_old_frag_cuts) const
Definition: EFAElement3D.C:855
void createFaces()
unsigned int _num_interior_face_nodes
Definition: EFAElement3D.h:35
virtual bool willCrackTipExtend(std::vector< unsigned int > &split_neighbors) const
Definition: EFAElement3D.C:710
void findFacesAdjacentToFaces()
std::vector< std::vector< EFAElement3D * > > _face_neighbors
Definition: EFAElement3D.h:31
virtual bool shouldDuplicateForCrackTip(const std::set< EFAElement * > &CrackTipElements)
Definition: EFAElement3D.C:596
EFAFragment3D * getFragment(unsigned int frag_id) const
bool isFacePhantom(unsigned int face_id) const
virtual void neighborSanityCheck() const
Definition: EFAElement3D.C:523
virtual unsigned int getNumCuts() const
Definition: EFAElement3D.C:767
void setFace(unsigned int face_id, EFAFace *face)
void addFragFaceEdgeCut(unsigned int frag_face_id, unsigned int frag_edge_id, double position, std::map< unsigned int, EFANode * > &EmbeddedNodes, bool add_to_neighbor, bool add_to_adjacent)
EFAVolumeNode * getInteriorNode(unsigned int interior_node_id) const
std::vector< EFAPoint > _local_node_coor
Definition: EFAElement3D.h:36
unsigned int getFaceID(EFAFace *face) const
bool fragmentFaceAlreadyCut(unsigned int ElemFaceID) const
virtual bool isFinalCut() const
Definition: EFAElement3D.C:777
bool getFaceNodeParametricCoordinates(EFANode *node, std::vector< double > &xi_3d) const
void mapParametricCoordinateFrom2DTo3D(unsigned int face_id, std::vector< double > &xi_2d, std::vector< double > &xi_3d) const
std::set< EFANode * > getPhantomNodeOnFace(unsigned int face_id) const
std::vector< EFAFragment3D * > _fragments
Definition: EFAElement3D.h:32
std::vector< EFANode * > getCommonNodes(const EFAElement3D *other_elem) const
virtual void removePhantomEmbeddedNode()
virtual void createChild(const std::set< EFAElement * > &CrackTipElements, std::map< unsigned int, EFAElement * > &Elements, std::map< unsigned int, EFAElement * > &newChildElements, std::vector< EFAElement * > &ChildElements, std::vector< EFAElement * > &ParentElements, std::map< unsigned int, EFANode * > &TempNodes)
Definition: EFAElement3D.C:917
EFAFace * getFragmentFace(unsigned int frag_id, unsigned int face_id) const
virtual void switchEmbeddedNode(EFANode *new_node, EFANode *old_node)
Definition: EFAElement3D.C:350
virtual bool isCrackTipElement() const
Definition: EFAElement3D.C:761
std::set< EFANode * > getTipEmbeddedNodes() const
std::vector< unsigned int > getTipFaceIDs() const
unsigned int _num_vertices
Definition: EFAElement3D.h:34
virtual void restoreFragment(const EFAElement *const from_elem)
Definition: EFAElement3D.C:881
unsigned int getNeighborFaceInteriorNodeID(unsigned int face_id, unsigned int node_id, EFAElement3D *neighbor_elem) const
void removeEmbeddedNode(EFANode *emb_node, bool remove_for_neighbor)
virtual void getMasterInfo(EFANode *node, std::vector< EFANode * > &master_nodes, std::vector< double > &master_weights) const
Definition: EFAElement3D.C:367
unsigned int numFaceNeighbors(unsigned int face_id) const
virtual void getNonPhysicalNodes(std::set< EFANode * > &non_physical_nodes) const
Definition: EFAElement3D.C:296
EFAFace * getFace(unsigned int face_id) const
virtual unsigned int numFragments() const
Definition: EFAElement3D.C:263
std::vector< unsigned int > getCommonFaceID(const EFAElement3D *other_elem) const
unsigned int _num_faces
Definition: EFAElement3D.h:28
virtual void setupNeighbors(std::map< EFANode *, std::set< EFAElement * >> &InverseConnectivityMap)
Definition: EFAElement3D.C:472
virtual void updateFragmentNode()
Definition: EFAElement3D.C:361
void setLocalCoordinates()
Definition: EFAElement3D.C:149
EFAElement3D(unsigned int eid, unsigned int n_nodes, unsigned int n_faces)
Definition: EFAElement3D.C:22
virtual void connectNeighbors(std::map< unsigned int, EFANode * > &PermanentNodes, std::map< unsigned int, EFANode * > &TempNodes, std::map< EFANode *, std::set< EFAElement * >> &InverseConnectivityMap, bool merge_phantom_faces)
std::vector< EFAVolumeNode * > _interior_nodes
Definition: EFAElement3D.h:30
virtual unsigned int numInteriorNodes() const
Definition: EFAElement3D.C:419
virtual void clearNeighbors()
Definition: EFAElement3D.C:464
void addFaceEdgeCut(unsigned int face_id, unsigned int edge_id, double position, EFANode *embedded_node, std::map< unsigned int, EFANode * > &EmbeddedNodes, bool add_to_neighbor, bool add_to_adjacent)
virtual void updateFragments(const std::set< EFAElement * > &CrackTipElements, std::map< unsigned int, EFANode * > &EmbeddedNodes)
Definition: EFAElement3D.C:797