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 : 16 : class EFAEdge 17 : { 18 : public: 19 : EFAEdge(EFANode * node1, EFANode * node2); 20 : EFAEdge(const EFAEdge & other_edge); 21 : 22 : ~EFAEdge(); 23 : 24 : private: 25 : EFANode * _edge_node1; 26 : EFANode * _edge_node2; 27 : EFANode * _edge_interior_node; // The interior edge node for quad8 and quad9 elements 28 : std::vector<EFANode *> _embedded_nodes; 29 : std::vector<double> _intersection_x; 30 : 31 : public: 32 : std::pair<EFANode *, EFANode *> getSortedNodes() const 33 : { 34 160147550 : return {std::min(_edge_node1, _edge_node2), std::max(_edge_node1, _edge_node2)}; 35 : } 36 : 37 : bool equivalent(const EFAEdge & other) const; 38 : bool isEmbeddedPermanent() const; 39 : 40 : bool isPartialOverlap(const EFAEdge & other) const; 41 : bool containsEdge(const EFAEdge & other) const; 42 : bool getNodeMasters(EFANode * node, 43 : std::vector<EFANode *> & master_nodes, 44 : std::vector<double> & master_weights) const; 45 : // bool operator < (const EFAEdge & other) const; 46 : 47 : void addIntersection(double position, EFANode * embedded_node_tmp, EFANode * from_node); 48 : void resetIntersection(double position, EFANode * embedded_node_tmp, EFANode * from_node); 49 : void copyIntersection(const EFAEdge & other, unsigned int from_node_id); 50 : EFANode * getNode(unsigned int index) const; 51 8525 : EFANode * getInteriorNode() const { return _edge_interior_node; }; 52 83976 : void setInteriorNode(EFANode * node) { _edge_interior_node = node; }; 53 : void reverseNodes(); 54 : 55 : bool hasIntersection() const; 56 : bool hasIntersectionAtPosition(double position, EFANode * from_node) const; 57 : double getIntersection(unsigned int emb_id, EFANode * from_node) const; 58 : double distanceFromNode1(EFANode * node) const; 59 : bool isEmbeddedNode(const EFANode * node) const; 60 : unsigned int getEmbeddedNodeIndex(EFANode * node) const; 61 : unsigned int getEmbeddedNodeIndex(double position, EFANode * from_node) const; 62 : 63 : EFANode * getEmbeddedNode(unsigned int index) const; 64 : unsigned int numEmbeddedNodes() const; 65 : void consistencyCheck(); 66 : void switchNode(EFANode * new_node, EFANode * old_node); 67 : bool containsNode(const EFANode * node) const; 68 : void removeEmbeddedNodes(); 69 : void removeEmbeddedNode(EFANode * node); 70 : };