www.mooseframework.org
EFAFace.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include <vector>
13 
14 class EFANode;
15 class EFAEdge;
16 class EFAFaceNode;
17 class EFAFragment2D;
18 
19 class EFAFace
20 {
21 public:
22  EFAFace(unsigned int n_nodes, unsigned int num_interior_face_nodes = 0);
23  EFAFace(const EFAFace & other_face);
24  EFAFace(const EFAFragment2D * frag);
25 
26  ~EFAFace();
27 
28 private:
29  unsigned int _num_nodes;
30  std::vector<EFANode *> _nodes;
31  unsigned int _num_edges;
32  std::vector<EFAEdge *> _edges;
33  std::vector<EFAFaceNode *> _interior_nodes;
34  std::vector<EFANode *> _face_interior_nodes;
35 
36 public:
37  unsigned int numNodes() const;
38  void setNode(unsigned int node_id, EFANode * node);
39  EFANode * getNode(unsigned int node_id) const;
40  void switchNode(EFANode * new_node, EFANode * old_node);
41  bool getMasterInfo(EFANode * node,
42  std::vector<EFANode *> & master_nodes,
43  std::vector<double> & master_weights) const;
44  bool getEdgeNodeParametricCoords(EFANode * node, std::vector<double> & xi_2d) const;
45  bool getFaceNodeParametricCoords(EFANode * node, std::vector<double> & xi_2d) const;
46  unsigned int numInteriorNodes() const;
47  void createNodes();
48 
49  unsigned int numEdges() const { return _edges.size(); }
50  EFAEdge * getEdge(unsigned int edge_id) const { return _edges[edge_id]; }
51  void setEdge(unsigned int edge_id, EFAEdge * new_edge);
52  void createEdges();
53  void combineTwoEdges(unsigned int edge_id1, unsigned int edge_id2);
54  void sortEdges();
55  void reverseEdges();
56  bool isTriOrQuad() const;
57 
58  EFANode * getInteriorFaceNode(unsigned int i) const { return _face_interior_nodes[i]; };
59  void setInteriorFaceNode(unsigned int i, EFANode * node);
60  bool equivalent(const EFAFace * other_face) const;
61  bool containsNode(const EFANode * node) const;
62  bool containsFace(const EFAFace * other_face) const;
63  bool ownsEdge(const EFAEdge * other_edge) const;
64  void removeEmbeddedNode(EFANode * emb_node);
65  std::vector<EFAFace *> split() const;
66  EFAFace * combineWithFace(const EFAFace * other_face) const;
67  void resetEdgeIntersection(const EFAFace * ref_face);
68 
69  unsigned int getNumCuts() const;
70  bool hasIntersection() const;
71  void copyIntersection(const EFAFace & from_face);
72  bool isAdjacent(const EFAFace * other_face) const;
73  unsigned int adjacentCommonEdge(const EFAFace * other_face) const;
74  bool hasSameOrientation(const EFAFace * other_face) const;
75  EFAFaceNode * getInteriorNode(unsigned int index) const;
76 
77 private:
78  void mapParametricCoordsFrom1DTo2D(unsigned int edge_id,
79  double xi_1d,
80  std::vector<double> & xi_2d) const;
81 };
void copyIntersection(const EFAFace &from_face)
Definition: EFAFace.C:577
bool isAdjacent(const EFAFace *other_face) const
Definition: EFAFace.C:588
bool getMasterInfo(EFANode *node, std::vector< EFANode *> &master_nodes, std::vector< double > &master_weights) const
Definition: EFAFace.C:132
void setEdge(unsigned int edge_id, EFAEdge *new_edge)
Definition: EFAFace.C:254
unsigned int numEdges() const
Definition: EFAFace.h:49
bool hasIntersection() const
Definition: EFAFace.C:568
EFAFace * combineWithFace(const EFAFace *other_face) const
Definition: EFAFace.C:449
bool containsNode(const EFANode *node) const
Definition: EFAFace.C:362
void resetEdgeIntersection(const EFAFace *ref_face)
Definition: EFAFace.C:513
void setInteriorFaceNode(unsigned int i, EFANode *node)
Definition: EFAFace.C:81
void createEdges()
Definition: EFAFace.C:260
bool hasSameOrientation(const EFAFace *other_face) const
Definition: EFAFace.C:615
void mapParametricCoordsFrom1DTo2D(unsigned int edge_id, double xi_1d, std::vector< double > &xi_2d) const
Definition: EFAFace.C:647
bool isTriOrQuad() const
Definition: EFAFace.C:346
void combineTwoEdges(unsigned int edge_id1, unsigned int edge_id2)
Definition: EFAFace.C:276
bool equivalent(const EFAFace *other_face) const
Definition: EFAFace.C:355
~EFAFace()
Definition: EFAFace.C:60
std::vector< EFAEdge * > _edges
Definition: EFAFace.h:32
EFANode * getNode(unsigned int node_id) const
Definition: EFAFace.C:99
unsigned int getNumCuts() const
Definition: EFAFace.C:556
bool getFaceNodeParametricCoords(EFANode *node, std::vector< double > &xi_2d) const
Definition: EFAFace.C:210
bool getEdgeNodeParametricCoords(EFANode *node, std::vector< double > &xi_2d) const
Definition: EFAFace.C:183
const dof_id_type n_nodes
bool containsFace(const EFAFace *other_face) const
Definition: EFAFace.C:376
unsigned int numNodes() const
Definition: EFAFace.C:87
void sortEdges()
Definition: EFAFace.C:317
EFAEdge * getEdge(unsigned int edge_id) const
Definition: EFAFace.h:50
std::vector< EFAFace * > split() const
Definition: EFAFace.C:424
bool ownsEdge(const EFAEdge *other_edge) const
Definition: EFAFace.C:391
EFANode * getInteriorFaceNode(unsigned int i) const
Definition: EFAFace.h:58
std::vector< EFANode * > _face_interior_nodes
Definition: EFAFace.h:34
unsigned int _num_edges
Definition: EFAFace.h:31
EFAFaceNode * getInteriorNode(unsigned int index) const
Definition: EFAFace.C:641
std::vector< EFAFaceNode * > _interior_nodes
Definition: EFAFace.h:33
void switchNode(EFANode *new_node, EFANode *old_node)
Definition: EFAFace.C:105
void reverseEdges()
Definition: EFAFace.C:337
void removeEmbeddedNode(EFANode *emb_node)
Definition: EFAFace.C:400
unsigned int numInteriorNodes() const
Definition: EFAFace.C:236
std::vector< EFANode * > _nodes
Definition: EFAFace.h:30
void createNodes()
Definition: EFAFace.C:242
unsigned int adjacentCommonEdge(const EFAFace *other_face) const
Definition: EFAFace.C:603
void setNode(unsigned int node_id, EFANode *node)
Definition: EFAFace.C:93
EFAFace(unsigned int n_nodes, unsigned int num_interior_face_nodes=0)
Definition: EFAFace.C:19
unsigned int _num_nodes
Definition: EFAFace.h:29