Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FiniteElement.hpp
1#ifndef FiniteElement_hpp
2#define FiniteElement_hpp
3
4#include "feddlib/core/FEDDCore.hpp"
5#include "Elements.hpp"
14
15namespace FEDD {
16class Elements;
17class FiniteElement {
18
19 public:
20 typedef default_lo LO;
21 typedef default_go GO;
22 typedef default_no NO;
23
24 typedef std::vector<int> vec_int_Type;
25 typedef std::vector<long long> vec_long_Type;
26 typedef std::vector<std::vector<int> > vec2D_int_Type;
27
28 typedef Elements Elements_Type;
29 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
30
31 typedef Teuchos::RCP<const Map<LO,GO,NO> > MapConstPtr_Type;
32
33 FiniteElement();
34
35 FiniteElement( vec_LO_Type& localNodeList );
36
37 FiniteElement( vec_LO_Type& localNodeList, LO elementFlag );
38
39 bool operator==(const FiniteElement &other);
40
41 FiniteElement& operator=(const FiniteElement& in);
42
43 void setElement( vec_int_Type& localNodeList );
44
45 int getFlag() const {return flag_;};
46
47 void setFlag( int elementFlag );
48
49 const vec_LO_Type& getVectorNodeList() const { return localNodeIDs_; };
50
51 vec_LO_Type getVectorNodeListNonConst(){ return localNodeIDs_; };
52
53 int size() { return localNodeIDs_.size(); };
54
55 int getNode( int i ) const;
56
57 int numSubElements();
58
59 bool subElementsInitialized();
60
61 void initializeSubElements( std::string feType, int dim ) ;
62
63 void addSubElement( FiniteElement& fe );
64
65 ElementsPtr_Type getSubElements(){ return subElements_; };
66
67 void setSubElements( ElementsPtr_Type& subElements );
68
69 void globalToLocalIDs( MapConstPtr_Type map );
70
72 void addSubElementIfPart( FiniteElement& feSub, const vec2D_int_Type& permutation, std::string& feType, int dim );
73
74 void findEdgeFlagInSubElements( const vec_LO_Type& edgeIDs, vec_int_Type& flags, bool isSubElement, const vec2D_int_Type& permutation, bool& foundLineSegment );
75
76 bool findEdgeInElement( const vec_LO_Type& edgeIDs, vec_int_Type& flags, const vec2D_int_Type& permutation );
77
78 void print(MapConstPtr_Type mapRepeated=Teuchos::null);
79
80 void setFiniteElementRefinementType( std::string reType ){ refinementType_ = reType; }; // assigning a certain refinement typ, i.e. red, blue, green
81
82 std::string getFiniteElementRefinementType( ){ return refinementType_; };
83
84 void tagForRefinement(){taggedForRefinement_ = true; }; // assigning simply the information whether element is tagged for refinement
85
86 void untagForRefinement(){taggedForRefinement_ = false; }; // untagging previously tagged element
87
88 bool isTaggedForRefinement(){ return taggedForRefinement_; };
89
90 bool isInterfaceElement(){return isInterfaceElement_; };
91
92 void setInterfaceElement( bool interface){ isInterfaceElement_ = interface; };
93
94 void setPredecessorElement(GO id) {predecessorElement_ = id; };
95
96 GO getPredecessorElement(){return predecessorElement_; };
97
98 void setRefinementEdge(LO id){refinementEdge_=id;};
99
100 LO getRefinementEdge(){return refinementEdge_;};
101
102 void setMarkedEdges(LO id){markedEdges_.push_back(id);};
103
104 vec_LO_Type getMarkedEdges(){return markedEdges_;};
105
106 void markEdge(){markedEdge_ = true;};
107
108 bool isMarkedEdge(){return markedEdge_;};
109
110private:
111
112 vec_LO_Type localNodeIDs_;
113 int flag_;
114 ElementsPtr_Type subElements_;
115 int numSubElements_;
116 bool taggedForRefinement_ = false;
117 bool markedEdge_ = false;
118 std::string refinementType_; // Tag of finite Element
119 bool isInterfaceElement_ = false;
120 GO predecessorElement_ = -1;
121 LO refinementEdge_=-1;
122 vec_LO_Type markedEdges_;
123
124
125public:
126
127};
128}
129#endif
Definition Elements.hpp:22
void addSubElementIfPart(FiniteElement &feSub, const vec2D_int_Type &permutation, std::string &feType, int dim)
Definition FiniteElement.cpp:101
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5