www.mooseframework.org
EFAFace.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 EFAFACE_H
9 #define EFAFACE_H
10 
11 #include <vector>
12 
13 class EFANode;
14 class EFAEdge;
15 class EFAFaceNode;
16 class EFAFragment2D;
17 
18 class EFAFace
19 {
20 public:
21  EFAFace(unsigned int n_nodes, unsigned int num_interior_face_nodes = 0);
22  EFAFace(const EFAFace & other_face);
23  EFAFace(const EFAFragment2D * frag);
24 
25  ~EFAFace();
26 
27 private:
28  unsigned int _num_nodes;
29  std::vector<EFANode *> _nodes;
30  unsigned int _num_edges;
31  std::vector<EFAEdge *> _edges;
32  std::vector<EFAFaceNode *> _interior_nodes;
33  std::vector<EFANode *> _face_interior_nodes;
34 
35 public:
36  unsigned int numNodes() const;
37  void setNode(unsigned int node_id, EFANode * node);
38  EFANode * getNode(unsigned int node_id) const;
39  void switchNode(EFANode * new_node, EFANode * old_node);
40  bool getMasterInfo(EFANode * node,
41  std::vector<EFANode *> & master_nodes,
42  std::vector<double> & master_weights) const;
43  bool getEdgeNodeParametricCoords(EFANode * node, std::vector<double> & xi_2d) const;
44  bool getFaceNodeParametricCoords(EFANode * node, std::vector<double> & xi_2d) const;
45  unsigned int numInteriorNodes() const;
46  void createNodes();
47 
48  unsigned int numEdges() const;
49  EFAEdge * getEdge(unsigned int edge_id) const;
50  void setEdge(unsigned int edge_id, EFAEdge * new_edge);
51  void createEdges();
52  void combineTwoEdges(unsigned int edge_id1, unsigned int edge_id2);
53  void sortEdges();
54  void reverseEdges();
55  bool isTriOrQuad() const;
56 
57  EFANode * getInteriorFaceNode(unsigned int i) const { return _face_interior_nodes[i]; };
58  void setInteriorFaceNode(unsigned int i, EFANode * node);
59  bool equivalent(const EFAFace * other_face) const;
60  bool containsNode(const EFANode * node) const;
61  bool containsFace(const EFAFace * other_face) const;
62  bool ownsEdge(const EFAEdge * other_edge) const;
63  void removeEmbeddedNode(EFANode * emb_node);
64  std::vector<EFAFace *> split() const;
65  EFAFace * combineWithFace(const EFAFace * other_face) const;
66  void resetEdgeIntersection(const EFAFace * ref_face);
67 
68  unsigned int getNumCuts() const;
69  bool hasIntersection() const;
70  void copyIntersection(const EFAFace & from_face);
71  bool isAdjacent(const EFAFace * other_face) const;
72  unsigned int adjacentCommonEdge(const EFAFace * other_face) const;
73  bool hasSameOrientation(const EFAFace * other_face) const;
74  EFAFaceNode * getInteriorNode(unsigned int index) const;
75 
76 private:
77  void mapParametricCoordsFrom1DTo2D(unsigned int edge_id,
78  double xi_1d,
79  std::vector<double> & xi_2d) const;
80 };
81 
82 #endif
bool getEdgeNodeParametricCoords(EFANode *node, std::vector< double > &xi_2d) const
Definition: EFAFace.C:181
unsigned int numNodes() const
Definition: EFAFace.C:85
bool isTriOrQuad() const
Definition: EFAFace.C:356
void copyIntersection(const EFAFace &from_face)
Definition: EFAFace.C:616
void setEdge(unsigned int edge_id, EFAEdge *new_edge)
Definition: EFAFace.C:264
std::vector< EFAFace * > split() const
Definition: EFAFace.C:463
unsigned int numInteriorNodes() const
Definition: EFAFace.C:234
bool hasIntersection() const
Definition: EFAFace.C:607
bool getFaceNodeParametricCoords(EFANode *node, std::vector< double > &xi_2d) const
Definition: EFAFace.C:208
bool ownsEdge(const EFAEdge *other_edge) const
Definition: EFAFace.C:430
void resetEdgeIntersection(const EFAFace *ref_face)
Definition: EFAFace.C:552
void setInteriorFaceNode(unsigned int i, EFANode *node)
Definition: EFAFace.C:79
void createEdges()
Definition: EFAFace.C:270
EFAEdge * getEdge(unsigned int edge_id) const
Definition: EFAFace.C:258
unsigned int adjacentCommonEdge(const EFAFace *other_face) const
Definition: EFAFace.C:642
bool equivalent(const EFAFace *other_face) const
Definition: EFAFace.C:365
unsigned int numEdges() const
Definition: EFAFace.C:252
bool containsFace(const EFAFace *other_face) const
Definition: EFAFace.C:415
void combineTwoEdges(unsigned int edge_id1, unsigned int edge_id2)
Definition: EFAFace.C:286
~EFAFace()
Definition: EFAFace.C:58
std::vector< EFAEdge * > _edges
Definition: EFAFace.h:31
void sortEdges()
Definition: EFAFace.C:327
EFAFaceNode * getInteriorNode(unsigned int index) const
Definition: EFAFace.C:682
void mapParametricCoordsFrom1DTo2D(unsigned int edge_id, double xi_1d, std::vector< double > &xi_2d) const
Definition: EFAFace.C:688
bool containsNode(const EFANode *node) const
Definition: EFAFace.C:389
std::vector< EFANode * > _face_interior_nodes
Definition: EFAFace.h:33
unsigned int _num_edges
Definition: EFAFace.h:30
bool isAdjacent(const EFAFace *other_face) const
Definition: EFAFace.C:627
std::vector< EFAFaceNode * > _interior_nodes
Definition: EFAFace.h:32
bool hasSameOrientation(const EFAFace *other_face) const
Definition: EFAFace.C:656
void switchNode(EFANode *new_node, EFANode *old_node)
Definition: EFAFace.C:103
void reverseEdges()
Definition: EFAFace.C:347
void removeEmbeddedNode(EFANode *emb_node)
Definition: EFAFace.C:439
EFANode * getInteriorFaceNode(unsigned int i) const
Definition: EFAFace.h:57
unsigned int getNumCuts() const
Definition: EFAFace.C:595
std::vector< EFANode * > _nodes
Definition: EFAFace.h:29
bool getMasterInfo(EFANode *node, std::vector< EFANode * > &master_nodes, std::vector< double > &master_weights) const
Definition: EFAFace.C:130
void createNodes()
Definition: EFAFace.C:240
void setNode(unsigned int node_id, EFANode *node)
Definition: EFAFace.C:91
EFANode * getNode(unsigned int node_id) const
Definition: EFAFace.C:97
EFAFace(unsigned int n_nodes, unsigned int num_interior_face_nodes=0)
Definition: EFAFace.C:17
unsigned int _num_nodes
Definition: EFAFace.h:28
EFAFace * combineWithFace(const EFAFace *other_face) const
Definition: EFAFace.C:488