Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 18214051 : unsigned int numEdges() const { return _edges.size(); } 50 40094862 : 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 19388 : 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 : };