neumannTraceSpace3d.hh

Go to the documentation of this file.
1 
6 #ifndef HP3D_NEUMANNTRACESPACE3D_HH_
7 #define HP3D_NEUMANNTRACESPACE3D_HH_
8 
9 
10 
11 
12 #include "toolbox/sequence.hh"
13 #include "formula/boundary.hh"
14 #include "formula/exceptions.hh"
17 #include "space/space.hh"
18 #include "hp2D/element.hh"
19 #include "hp3D.hh"
20 #include "hp3D/element.hh"
21 #include "hp3D/face.hh"
22 #include "hp3D/hexFunctions.hh"
23 
24 #include "geometry/normalVector.hh"
26 
27 #include "neumannTraceElement3d.hh"
28 
29 
30 
31 
32 namespace concepts {
33 
34  // forward declaration
35  class FaceNormalVectorRule;
36 }
37 
38 namespace hp3D {
39 
40  using concepts::Real;
41 
42  // forward declaration
43  class Hexahedron;
44 
45  // ************************************************************ NeumannTraceSpace **
46 
62  public:
65 
67 
68 
69 
70 // //struct representing a quad and a underlying hexahedron's refinement level (only one hex)
71 // struct quad_lvl: public concepts::OutputOperator{
72 // quad_lvl(const UnderlyingQuad* quad,const concepts::Level<3> level,uint k) :level(level), quad(quad), k(k) {
73 // //just same level on quads are allowed, i.e. appears for bisection only
74 // if(level.l_[0]!=level.l_[1])
75 // throw conceptsException(concepts::MissingFeature("not implemented"));
76 // }
77 //
78 //
79 // // With this ordering a finer Edge is followed by at most 2 coarse edge where the finer edge is a child of one of them
80 // //
81 // //old // application this set is build of a endpoint nodes underlying Edges
82 // // therefor each finer Edge is followed by its general father edge
83 // //
84 //
85 //
86 //
87 // // with this ordering a Set of it has the finest edges in the first places
88 // // then the key sorting comes into account
89 //
90 //
91 // bool operator<(edge_lvl const& right) const {
92 // const concepts::Edge* edgeP = dynamic_cast<const concepts::Edge*>(edge->elm);
93 // const concepts::Edge* edgeR = dynamic_cast<const concepts::Edge*>(right.edge->elm);
94 //
95 // if(this->level.l_[0] == right.level.l_[0])
96 // return edgeP->key().key()<edgeR->key().key();
97 // //Note here is ">" that makes level sorting other way
98 // return this->level.l_[0] > right.level.l_[0];
99 //
105 //
107 // }
108 //
109 // bool operator==(edge_lvl const& right){
110 // const concepts::Edge* edgeP = dynamic_cast<const concepts::Edge*>(edge->elm);
111 // const concepts::Edge* edgeR = dynamic_cast<const concepts::Edge*>(right.edge->elm);
112 // return edgeP->key().key()==edgeR->key().key();
113 //
114 // }
115 //
116 //
117 // const UnderlyingQuad* quad;
118 // const concepts::Level<3> level;
119 //
120 // //the UnderlyingEdge is the k-th Edge of its underlying unique quad
121 // const uint k;
122 //
123 // protected:
124 // virtual std::ostream& info(std::ostream& os) const {
125 // return os << "edge_lvl("<<edge->elm->key()<<","<<level.l_[0]<<", k= "<<k<<")";
126 // }
127 // };
128 //
129 
153  const concepts::Set<uint> faceAttr,
157  normalVectorRule = concepts::FaceNormalVectorRule(),
158  bool emptyElm= true);
159 
160 
183  bool emptyElm= true);
184 
189 
193  virtual uint dim() const { return dim_; }
194 
198  virtual uint nelm() const { return nelm_; }
199 
203  virtual Scan* scan() const{
204  return new concepts::PListScan<hp2D::Element<Real> >(*elm_);
205  }
206 
210 // const concepts::Sequence<UnderlyingElement>
211 // uelm(const concepts::Edge edge) const
212 // {
213 // concepts::HashMap<hp3D::NeumannTraceElement3d<Real>*>::
214 // const_iterator i = edges_.find(edge.key());
215 // if (i == edges_.end())
216 // return concepts::Sequence<UnderlyingElement>();
217 // return i->second->uelm();
218 // }
219 
223  //virtual void recomputeShapefunctions();
224  protected:
225  virtual std::ostream& info(std::ostream& os) const;
226  private:
228  const uint dim_;
229 
231  uint nelm_;
232 
233 
234  // concepts::Sequence<concepts::Quad3d*> coarseCells_;
235 // //number of irregular builded elements
236 // uint nIrrelm_;
237 
240 
243 
250 
251  //flag controlling elements with no dofs in the space
253 
254 
255  // Builds the NeumanntraceElements with Informations about the Underyling Elements
257 
258 
259  //method reconstruct all child edges belonging to a coarse edge and writes information into the coarsetochld_map
260  //
261  // TODO: present the algorithm here
262  //
263  //
264  //
265  //
268  concepts::HashMap<concepts::Sequence<UnderlyingQuad> >::const_iterator iterNode,
269  concepts::Set<uint>& buildedEdges,
271 
272 // //Builds the NeumannTraceElements between irregular Elements, i.e. on k - irregular meshes
273 // void prepareIrregularElements_(concepts::HashMap<concepts::Sequence<UnderlyingElement> >& irregular_uelm);
274 //
275 // //actually creates the irregular ELements with the help of the mappings
276 // void buildIrregularElements_(concepts::HashMap<concepts::Sequence<UnderlyingElement> >& irregular_uelm,
277 // concepts::HashMap<concepts::Sequence<UnderlyingQuad> >& coarsetochld_map);
278 
279 
290  Real weight_(bool first,const concepts::Z2 dir, const uint nUelm, const concepts::Attribute attrb) const;
291 
292 
293  //test for face-attribute is in the Set of requested quadAttributes
294  bool activeQuad_(const concepts::Set<uint>& quadAttr, const concepts::Connector2& quad) {
295  return quadAttr.exist(quad.attrib());
296  }
297 
301  template<class F>
302  void test_(const concepts::ElementWithCell<Real>& elm, F condition);
303 
304  };
305 
306 } // namespace hp2D
307 
308 
309 
310 
311 
312 #endif /* HP3D_NEUMANNTRACESPACE3D_HH_ */
const uint dim_
Dimension of the FE space.
virtual std::ostream & info(std::ostream &os) const
Returns the underlying 3D elements of the given edge if existing.
concepts::HashMap< hp3D::NeumannTraceElement3d< Real > * > quads_
Map from key of (topological) quad to the element.
const Attribute & attrib() const
Returns the attribute of the connector.
Definition: connector.hh:108
bool activeQuad_(const concepts::Set< uint > &quadAttr, const concepts::Connector2 &quad)
Joiner class with multiple successors, i.e.
NeumannTraceSpace3d(const concepts::SpaceOnCells< Real > &spc, const concepts::Set< uint > faceAttr, concepts::FacetteTraceType< concepts::FaceNormalVectorRule >::traceTypes=concepts::FacetteTraceType< concepts::FaceNormalVectorRule >::FIRST, const concepts::FaceNormalVectorRule &normalVectorRule=concepts::FaceNormalVectorRule(), bool emptyElm=true)
Constructor.
Class FacetteTraceType holding the information about the TraceType, i.e.
concepts::ElementAndFacette< concepts::Quad > UnderlyingQuad
void test_(const concepts::ElementWithCell< Real > &elm, F condition)
Test if not implemented elements have edges w.r.t.
virtual Scan * scan() const
Returns a scanner to iterate over the elements of the space TODO: why is this not working.
virtual ~NeumannTraceSpace3d()
Deconstructor.
concepts::Scan< hp2D::Element< Real > > Scan
A 2D element of the topology.
Definition: connector.hh:226
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
concepts::ElementAndFacette< hp3D::Element< Real > > UnderlyingElement
Sequence with operations, output operator, and method of the particular element types.
Definition: sequence.hh:39
virtual uint nelm() const
Returns the number of NeumannTraceElements in the Space.
Abstract class for a space.
Definition: space.hh:81
concepts::Joiner< hp2D::Element< Real > *, 1 > * elm_
Linked list of the elements.
uint nelm_
Number of elements currently active in the mesh.
bool buildElements_(concepts::HashMap< concepts::Sequence< UnderlyingElement > > &uelm, const concepts::BoundaryConditions *bc)
A the NeumannTrace space of a given 3D - Finite Element space.
concepts::FacetteTraceTypes< concepts::FaceNormalVectorRule > trTypes_
Mapping from Attributes to a given EdgeTracetype.
virtual uint dim() const
Returns the dimension of the underlying Finite Element Space.
Real weight_(bool first, const concepts::Z2 dir, const uint nUelm, const concepts::Attribute attrb) const
Consider the outwards pointing normalvector evaluations of a neumantrace basis function u.
Binary group (algebraic): only the values 0 and 1 are represented.
Definition: Zm.hh:16
3D hp-FEM for H1-conforming elements.
Definition: meshDX.hh:23
void reconstruct_(concepts::HashMap< concepts::Sequence< UnderlyingElement > > &irregular_uelm, concepts::HashMap< concepts::Sequence< UnderlyingQuad > > &nodeMap, concepts::HashMap< concepts::Sequence< UnderlyingQuad > >::const_iterator iterNode, concepts::Set< uint > &buildedEdges, concepts::HashMap< concepts::Sequence< UnderlyingQuad > > &coarsetochld_map)
NeumannTraceSpace3d(concepts::SpaceOnCells< Real > &spc, const concepts::FacetteTraceTypes< concepts::FaceNormalVectorRule > &fttypes, bool emptyElm=true)
Constructor.
Attributes for elements of the topology.
Definition: connector.hh:22
Container for an element and one facette (edge or face).
Definition: element.hh:113
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Scanner for a list of pointers.
Class for defining rules in which direction the normal vector should point for created faces from hex...
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich