buildDofsBase.hh

Go to the documentation of this file.
1 
8 #ifndef buildDofsBase_hh
9 #define buildDofsBase_hh
10 
11 #include "hp3D/space.hh"
12 
13 namespace hp3D {
14 
15  // forward declaration
16  class Space;
17 
18  // ********************************************************* BuildDofsBase **
19 
31  class BuildDofsBase {
32  public:
34  BuildDofsBase() : spc_(0) {}
38  BuildDofsBase(Space& spc) : spc_(&spc) {}
44  virtual void operator()(concepts::Hexahedron& cntr,
45  concepts::TColumn<Real>*& T1) = 0;
54  virtual BuildDofsBase* clone(Space* spc = 0) const = 0;
56  Space* space() { return spc_; }
57  protected:
59  inline concepts::AdaptiveControl<>& ctrl0_(uint idx);
61  inline concepts::AdaptiveControlP<1>& ctrl1_(uint idx);
63  inline concepts::AdaptiveControlP<2>& ctrl2_(uint idx);
65  inline concepts::AdaptiveControlP<3>& ctrl3_(uint idx);
67  inline std::map<uint, concepts::VertexData>::const_iterator
68  vertexListFind(uint idx) const;
70  inline std::map<uint, concepts::VertexData>::const_iterator
71  vertexListEnd() const;
73  inline std::map<uint, concepts::EdgeData>::const_iterator
74  edgeListFind(uint idx) const;
76  inline std::map<uint, concepts::EdgeData>::const_iterator
77  edgeListEnd() const;
79  inline std::map<uint, concepts::FaceData>::const_iterator
80  faceListFind(uint idx) const;
82  inline std::map<uint, concepts::FaceData>::const_iterator
83  faceListEnd() const;
85  uint& dim_() { return spc_->dim_; }
87  inline void deactivate_(const concepts::Connector0& vtx);
90  inline void deactivate_(const concepts::Connector1& edg);
93  inline void deactivate_(const concepts::Connector2& face);
97  inline void computePmax_(const concepts::Hexahedron& cntr,
98  ushort Pmax[3]) const;
101  inline void getPmax_(const concepts::Hexahedron& cntr,
102  ushort Pmax[3]) const;
105  };
106 
109  return spc_->ctrl0_[idx];
110  }
111 
114  return spc_->ctrl1_->operator[](idx);
115  }
116 
119  return spc_->ctrl2_->operator[](idx);
120  }
121 
124  return spc_->ctrl3_[idx];
125  }
126 
127  std::map<uint, concepts::VertexData>::const_iterator
130  return spc_->vertexList_.find(idx);
131  }
132 
133  std::map<uint, concepts::VertexData>::const_iterator
136  return spc_->vertexList_.end();
137  }
138 
139  std::map<uint, concepts::EdgeData>::const_iterator
140  BuildDofsBase::edgeListFind(uint idx) const {
142  return spc_->edgeList_.find(idx);
143  }
144 
145  std::map<uint, concepts::EdgeData>::const_iterator
148  return spc_->edgeList_.end();
149  }
150 
151  std::map<uint, concepts::FaceData>::const_iterator
152  BuildDofsBase::faceListFind(uint idx) const {
154  return spc_->faceList_.find(idx);
155  }
156 
157  std::map<uint, concepts::FaceData>::const_iterator
160  return spc_->faceList_.end();
161  }
162 
165  spc_->deactivate_(vtx);
166  }
167 
170  spc_->deactivate_(edg);
171  }
172 
175  spc_->deactivate_(face);
176  }
177 
179  ushort Pmax[3]) const {
181  spc_->computePmax_(cntr, Pmax);
182  }
183 
185  ushort Pmax[3]) const {
187  spc_->getPmax_(cntr, Pmax);
188  }
189 
190 } // namespace hp3D
191 
192 #endif // buildDofsBase_hh
A column of a T matrix.
Definition: analytical.hh:18
Space * space()
Returns the space.
uint & dim_()
Returns a reference to the dimension of the space.
std::unique_ptr< std::unordered_map< uint, concepts::AdaptiveControlP< 2 > > > ctrl2_
Hash table of the control information for the faces.
Definition: space.hh:287
std::map< uint, concepts::EdgeData > edgeList_
List of edges.
Definition: space.hh:298
BuildDofsBase(Space &spc)
Constructor.
std::unordered_map< uint, concepts::AdaptiveControlP< 3 > > ctrl3_
Hash table of the control information for the 3D elements.
Definition: space.hh:289
std::map< uint, concepts::EdgeData >::const_iterator edgeListEnd() const
Returns the end of the list with edge data.
std::map< uint, concepts::VertexData >::const_iterator vertexListEnd() const
Returns the end of the list with vertex data.
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
std::unique_ptr< std::unordered_map< uint, concepts::AdaptiveControlP< 1 > > > ctrl1_
Hash table of the control information for the edges.
Definition: space.hh:284
A 3D hp FEM space with continuous, picewise polynomial basis functions.
Definition: space.hh:84
std::map< uint, concepts::VertexData >::const_iterator vertexListFind(uint idx) const
Returns the iterator to the vertex data of the vertex with key idx.
void deactivate_(const concepts::Connector0 &vtx)
Deactivates the children of the vertex vtx.
BuildDofsBase()
Default constructor.
virtual void operator()(concepts::Hexahedron &cntr, concepts::TColumn< Real > *&T1)=0
Builds the degrees of freedom.
void getPmax_(const concepts::Hexahedron &cntr, ushort Pmax[3]) const
Gets the polynomial degrees Pmax of the shape function on cntr (returned in tensor form)
concepts::AdaptiveControl & ctrl0_(uint idx)
Returns vertex tag of vertex with key idx.
Exception class for assertions.
Definition: exceptions.hh:258
A hexahedron in the topology.
Definition: topology3D.hh:134
std::map< uint, concepts::FaceData > faceList_
List of faces.
Definition: space.hh:296
uint dim_
Dimension of the FE space.
Definition: space.hh:274
std::map< uint, concepts::FaceData >::const_iterator faceListEnd() const
Returns the end of the list with face data.
A 2D element of the topology.
Definition: connector.hh:226
std::map< uint, concepts::VertexData > vertexList_
List of vertices.
Definition: space.hh:300
std::unordered_map< uint, concepts::AdaptiveControl<> > ctrl0_
Hash table of the control information for the vertices.
Definition: space.hh:281
void computePmax_(const concepts::Hexahedron &cntr, ushort Pmax[3]) const
Computes maximal polynomial Pmax degree on topological objects adjacent to cntr that contributes dire...
void deactivate_(const concepts::Connector2 &face)
Deactivates the children of face (including the new edges and vertices).
Responsible to build the degrees of freedom in a space.
std::map< uint, concepts::EdgeData >::const_iterator edgeListFind(uint idx) const
Returns the iterator to the edge data of the edge with key idx.
concepts::AdaptiveControlP< 2 > & ctrl2_(uint idx)
Returns face tag of face with key idx.
virtual BuildDofsBase * clone(Space *spc=0) const =0
Virtual copy constructor with a twist.
std::map< uint, concepts::FaceData >::const_iterator faceListFind(uint idx) const
Returns the iterator to the face data of the face with key idx.
concepts::AdaptiveControlP< 1 > & ctrl1_(uint idx)
Returns edge tag of edge with key idx.
A 1D element of the topology.
Definition: connector.hh:182
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
Space * spc_
Space to build the vertex degrees of freedom from.
void computePmax_(const concepts::Hexahedron &cntr, ushort Pmax[3]) const
Computes the maximal polynomial degree of cell in each direction.
3D hp-FEM for H1-conforming elements.
Definition: meshDX.hh:23
void getPmax_(const concepts::Hexahedron &cntr, ushort Pmax[3]) const
Returns the polynomial degrees of the shape function space on connector.
A 0D element of the topology.
Definition: connector.hh:147
concepts::AdaptiveControlP< 3 > & ctrl3_(uint idx)
Returns cell tag of cell with key idx.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich