buildDofsBase.hh

Go to the documentation of this file.
1 
8 #ifndef buildDofsBase2D_hh
9 #define buildDofsBase2D_hh
10 
11 #include "hp2D/space.hh"
12 
13 namespace hp2D {
14 
15  // forward declaration
16  class Space;
17 
18  // ********************************************************* BuildDofsBase **
19 
31  class BuildDofsBase {
32  public:
34  BuildDofsBase() : spc_(0) {}
35 
36  virtual ~BuildDofsBase() {}
37 
41  BuildDofsBase(Space& spc) : spc_(&spc) {}
47  virtual void operator()(concepts::Quad& cntr,
49  const uint nn[2]) = 0;
58  virtual BuildDofsBase* clone(Space* spc = 0) const = 0;
60  Space* space() { return spc_; }
61  protected:
63  inline concepts::AdaptiveControl<>& ctrl0_(uint idx);
65  inline concepts::AdaptiveControlP<1>& ctrl1_(uint idx);
67  inline concepts::AdaptiveControlP<2>& ctrl2_(uint idx);
69  inline std::map<uint, concepts::VertexData>::const_iterator
70  vertexListFind(uint idx) const;
72  inline std::map<uint, concepts::VertexData>::const_iterator
73  vertexListEnd() const;
75  inline std::map<uint, concepts::EdgeData>::const_iterator
76  edgeListFind(uint idx) const;
78  inline std::map<uint, concepts::EdgeData>::const_iterator
79  edgeListEnd() const;
81  uint& dim_() { return spc_->dim_; }
83  inline void deactivate_(const concepts::Vertex& vtx);
86  inline void deactivate_(const concepts::Edge& edg);
88  inline void computePmax_(const concepts::Quad& cntr, ushort Pmax[2]) const;
91  };
92 
95  return spc_->ctrl0_[idx];
96  }
97 
100  return (*(spc_->ctrl1_))[idx];
101  }
102 
105  return spc_->ctrl2_[idx];
106  }
107 
108  std::map<uint, concepts::VertexData>::const_iterator
111  return spc_->vertexList_.find(idx);
112  }
113 
114  std::map<uint, concepts::VertexData>::const_iterator
117  return spc_->vertexList_.end();
118  }
119 
120  std::map<uint, concepts::EdgeData>::const_iterator
121  BuildDofsBase::edgeListFind(uint idx) const {
123  return spc_->edgeList_.find(idx);
124  }
125 
126  std::map<uint, concepts::EdgeData>::const_iterator
129  return spc_->edgeList_.end();
130  }
131 
134  spc_->deactivate_(vtx);
135  }
136 
139  spc_->deactivate_(edg);
140  }
141 
143  ushort Pmax[2]) const {
145  spc_->computePmax_(cntr, Pmax);
146  }
147 
148 } // namespace hp2D
149 
150 #endif // buildDofsBase2D_hh
A column of a T matrix.
Definition: analytical.hh:18
std::map< uint, concepts::EdgeData >::const_iterator edgeListEnd() const
Returns the end of the list with edge data.
concepts::AdaptiveControl & ctrl0_(uint idx)
Returns vertex tag of vertex with key idx.
void deactivate_(const concepts::Vertex &vtx)
Deactivates the children of the vertex vtx.
uint dim_
Dimension of the FE space.
Definition: space.hh:200
virtual ~BuildDofsBase()
void computePmax_(const concepts::Quad &cntr, ushort Pmax[2]) const
Computes maximal polynomial Pmax degree in cntr in tensor form.
A quadrilateral in the topology.
Definition: topology.hh:272
std::unordered_map< uint, concepts::AdaptiveControlP< 2 > > ctrl2_
Hash table of the control information for the 2D elements.
Definition: space.hh:213
concepts::AdaptiveControlP< 1 > & ctrl1_(uint idx)
Returns edge tag of edge with key idx.
std::map< uint, concepts::VertexData > vertexList_
List of vertices.
Definition: space.hh:226
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
2D hp-FEM for H1-conforming elements.
Exception class for assertions.
Definition: exceptions.hh:258
Space * spc_
Space to build the vertex degrees of freedom from.
BuildDofsBase(Space &spc)
Constructor.
A vertex in the topology.
Definition: topology.hh:40
std::unique_ptr< std::unordered_map< uint, concepts::AdaptiveControlP< 1 > > > ctrl1_
Hash table of the control information for the edges.
Definition: space.hh:211
std::map< uint, concepts::VertexData >::const_iterator vertexListEnd() const
Returns the end of the list with vertex data.
void deactivate_(const concepts::Edge &edg)
Mesh.
std::map< uint, concepts::EdgeData > edgeList_
List of edges.
Definition: space.hh:224
void computePmax_(const concepts::Connector2 &cntr, ushort Pmax[2]) const
Computes the maximal polynomial degree of cell in each direction.
virtual BuildDofsBase * clone(Space *spc=0) const =0
Virtual copy constructor with a twist.
A 2D hp FEM space with continuous, piecewise polynomial basis functions.
Definition: space.hh:88
virtual void operator()(concepts::Quad &cntr, concepts::TColumn< Real > *&T1, const uint nn[2])=0
Builds the degrees of freedom.
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
BuildDofsBase()
Default constructor.
concepts::AdaptiveControlP< 2 > & ctrl2_(uint idx)
Returns face tag of face with key idx.
Responsible to build the degrees of freedom in a space.
std::unordered_map< uint, concepts::AdaptiveControl<> > ctrl0_
Hash table of the control information for the vertices.
Definition: space.hh:209
uint & dim_()
Returns a reference to the dimension of the space.
An edge in the topology.
Definition: topology.hh:73
Space * space()
Returns the space.
std::map< uint, concepts::VertexData >::const_iterator vertexListFind(uint idx) const
Returns the iterator to the vertex data of the vertex with key idx.
std::map< uint, concepts::EdgeData >::const_iterator edgeListFind(uint idx) const
Returns the iterator to the edge data of the edge with key idx.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich