cell2D.hh

Go to the documentation of this file.
1 
8 #ifndef cell2D_hh
9 #define cell2D_hh
10 
11 #include <iostream>
12 
13 #include "basics/outputOperator.hh"
14 #include "basics/typedefs.hh"
15 #include "basics/level.hh"
16 #include "topology.hh"
17 #include "cell.hh"
18 #include "cell1D.hh"
19 #include "elementMaps.hh"
20 
21 namespace concepts {
22 
23 
24  // ************************************************************ Triangle2d **
25 
31  class Triangle2d : public Cell2 {
32  public:
33 
34  /* Type for indices in the hierarchical definition of the cells
35 
36  Use a type with a larger range depending on the number of cell
37  refinements.
38  */
39  typedef uint index_type;
40 
41  // Maximal number of levels in the cell refinement
42 
43  static uint MAX_LEVEL;
44 
46  struct Index {
49 
55 
61 
62  Index();
64  std::ostream& info(std::ostream& os) const;
65  };
66 
67  friend std::ostream& operator<<(std::ostream& os,
68  const Triangle2d::Index& i);
69 
76  virtual ~Triangle2d();
77 
83  virtual Triangle2d* child(uint i);
88  virtual const Triangle2d* child(uint i) const;
89 
91  inline Triangle& connector() const { return cntr_; }
92 
98  ushort level() const { return idx_.l_; }
99 
109  Real2d chi(Real xi, Real eta) const;
110 
111 
112  Real3d elemMap(const Real2d& coord_local) const
113  {
114  return chi(coord_local[0], coord_local[1]);
115  }
116 
120  Real jacobianDeterminant(const Real x, const Real y) const;
121 
133 
135  Real area() const;
136 
140  MapReal2d jacobianInverse(const Real x, const Real y) const;
141 
142  Real3d vertex(uint i) const;
143  Real3d center() const {return chi(0.66666666666, 0.5);}
145  inline const MappingTriangle2d* map() const {return map_;}
146 
148  inline Triangle2d* clone(Triangle& cntr, MappingTriangle2d* map) const {
149  return new Triangle2d(cntr, map, idx_);}
150 
155  static Real2d duffyInv(const Real2d& x);
156  protected:
157  virtual std::ostream& info(std::ostream& os) const;
158  private:
161 
164 
167 
172 
175 
178  };
179 
180  std::ostream& operator<<(std::ostream& os, const Triangle2d::Index& i);
181 
182 
183  // **************************************************************** QuadNd **
187  class QuadNd : public Cell2 {
188  public:
189  /* Type for indices in the hierarchical definition of the cells
190 
191  Use a type with a larger range depending on the number of cell
192  refinements.
193  */
194  typedef uint index_type;
195 
196  // Maximal number of levels in the cell refinement
197 
198  static uint MAX_LEVEL;
199 
201  struct Index {
204 
210 
216 
217  Index() : level_(0), i_(0), j_(0) {}
219  level_(k), i_(i), j_(j) { level_.l_[1] = l; }
220  std::ostream& info(std::ostream& os) const;
221  };
222 
223  QuadNd( Quad &cntr ) : cntr_(cntr) { }
224 
225  QuadNd( Quad &cntr, const Index &idx ) : cntr_(cntr), idx_(idx) { }
226 
227  friend std::ostream& operator<<(std::ostream& os,
228  const QuadNd::Index& i);
229 
231  virtual uint dim() const = 0;
232 
234  inline Quad& connector() const {
235  return cntr_;
236  }
237 
248  virtual Real gramDeterminantRoot(const Real xi, const Real eta) const = 0;
249 
250  virtual Real lineElement(const Real xi, const uint edge) const = 0;
251 
257  Level<2> level() const { return idx_.level_; }
258 
259  protected:
264 
265  };
266 
267  // ***************************************************** Quad2dSubdivision **
268 
269  class Quad2d;
270 
284  public:
287  virtual void createChildren(Quad2d& q) const = 0;
290  virtual void removeChildren(Quad2d& q) const;
293  virtual const QuadSubdivision* topologicalStrategy() const = 0;
294  };
295 
296  // ********************************************************* Quad2dSubdiv4 **
297 
307  public:
308  virtual void createChildren(Quad2d& q) const;
309  virtual const QuadSubdiv4* topologicalStrategy() const;
310  static const Quad2dSubdiv4* instance();
311  virtual ~Quad2dSubdiv4();
312  protected:
313  virtual std::ostream& info(std::ostream& os) const;
314  private:
315  static std::unique_ptr<Quad2dSubdiv4> instance_;
316  };
317 
318  // ******************************************************** Quad2dSubdiv2H **
319 
327  public:
328  virtual void createChildren(Quad2d& q) const;
329  virtual const QuadSubdiv2H* topologicalStrategy() const;
330  static const Quad2dSubdiv2H* instance();
331  virtual ~Quad2dSubdiv2H();
332  protected:
333  virtual std::ostream& info(std::ostream& os) const;
334  private:
335  static std::unique_ptr<Quad2dSubdiv2H> instance_;
336  };
337 
338  // ******************************************************** Quad2dSubdiv2V **
339 
347  public:
348  virtual void createChildren(Quad2d& q) const;
349  virtual const QuadSubdiv2V* topologicalStrategy() const;
350  static const Quad2dSubdiv2V* instance();
351  virtual ~Quad2dSubdiv2V();
352  protected:
353  virtual std::ostream& info(std::ostream& os) const;
354  private:
355  static std::unique_ptr<Quad2dSubdiv2V> instance_;
356  };
357 
358  // **************************************************************** Quad2d **
359 
378  class Quad2d : public QuadNd {
379  friend class Quad2dSubdivision;
380  friend class Quad2dSubdiv4;
381  friend class Quad2dSubdiv2H;
382  friend class Quad2dSubdiv2V;
383  public:
389  Quad2d(Quad& cntr, const MappingQuad2d& map);
390  virtual ~Quad2d();
391 
392  private:
393  Quad2d(const Quad2d& other);
394  Quad2d& operator=(const Quad2d& other);
395 
396  public:
397 
403  virtual Quad2d* child(uint i);
408  virtual const Quad2d* child(uint i) const;
409  inline bool hasChildren() const { return chld_ != 0; }
410 
419  const Quad2d*
420  child(uint i, Real xi, Real eta, Real& xiC, Real& etaC) const {
421  const Quad2d* chld = child(i);
422  if (chld == 0) return 0;
423 
424  Level<2> l = chld->level();
425  if (idx_.level_.l_[0] == l.l_[0]) xiC = xi;
426  else {
427  xiC = (xi + idx_.i_) * 2.0 - chld->idx_.i_;
428  if (xiC < 0.0 || xiC > 1.0) return 0;
429  }
430  if (idx_.level_.l_[1] == l.l_[1]) etaC = eta;
431  else {
432  etaC = (eta + idx_.j_) * 2.0 - chld->idx_.j_;
433  if (etaC < 0.0 || etaC > 1.0) return 0;
434  }
435  return chld;
436  }
437 
445  Real2d chi(Real xi, Real eta) const;
446 
447  Real3d elemMap(const Real2d& coord_local) const
448  {
449  return chi(coord_local[0], coord_local[1]);
450  }
451 
475  MapReal2d jacobian(const Real xi, const Real eta) const;
476 
478 
480  MapReal2d jacobianInverse(const Real xi, const Real eta) const {
481  return jacobian(xi, eta).inverse();
482  }
483 
487  Real jacobianDeterminant(const Real xi, const Real eta) const {
488  return jacobian(xi, eta).determinant();
489  }
490 
491  virtual Real gramDeterminantRoot(const Real xi, const Real eta) const
492  {
493  return jacobianDeterminant(xi, eta);
494  }
495 
506  MapReal2d inverseLaplace(const Real xi, const Real eta) const;
507 
513  virtual Real lineElement(const Real xi, const uint edge) const;
514 
515  Real3d vertex(uint i) const;
516  Real3d center() const {return chi(0.5, 0.5);}
517 
521  inline const MappingQuad2d* map() const {return map_;}
522 
533  MappingEdge2d* edgeMap(uint edge) const;
534 
536  inline Quad2d* clone(Quad& cntr, MappingQuad2d* map) const {
537  return new Quad2d(cntr, map, idx_);}
538 
551  virtual void setStrategy(const Quad2dSubdivision* strategy = 0)
552  throw(StrategyChange);
553 
559  const Quad2dSubdivision* getStrategy() const { return subdivStrategy_; }
560 
561  virtual uint dim() const { return 2; }
562  protected:
563  virtual std::ostream& info(std::ostream& os) const;
564 
567 
571  Quad2d* createChild_(Quad& cntr, const Index& idx, bool flag) const;
572 
574  Quad2d(Quad& cntr, MappingQuad2d* map, const Index& idx);
575  private:
578 
583 
586 
587  // Edges as cells
589 
596  virtual Quad2d* createChild_(Quad& cntr, const Index& idx) const;
597  };
598 
599  std::ostream& operator<<(std::ostream& os, const Quad2d::Index& i);
600 
601  // ******************************************************** InfiniteQuad2d **
602 
610  class InfiniteQuad2d : public Cell2 {
611  public:
620  InfiniteQuad2d(InfiniteQuad& cntr, const Real2d& vtx0, const Real2d& vtx1);
621 
622  virtual Real2d chi(Real xi, Real eta) const = 0;
623 
624  Real3d vertex(uint i) const;
625 
626  virtual MapReal2d jacobian(const Real xi, const Real eta) const = 0;
627 
629  inline InfiniteQuad& connector() const { return cntr_; }
630  protected:
631  virtual std::ostream& info(std::ostream& os) const;
632  private:
637  };
638 
639  // ******************************************************** InfiniteRect2d **
640 
649  public:
655  InfiniteRect2d(InfiniteQuad& cntr, const Real2d& vtx0, const Real2d& vtx1);
656  virtual ~InfiniteRect2d();
657 
663  virtual InfiniteRect2d* child(uint i);
668  virtual const InfiniteRect2d* child(uint i) const;
669  inline bool hasChildren() const { return chld_ != 0; }
670 
678  virtual Real2d chi(Real xi, Real eta) const;
679 
680  Real3d elemMap(const Real2d& coord_local) const
681  {
682  return chi(coord_local[0], coord_local[1]);
683  }
684 
685  virtual MapReal2d jacobian(const Real xi, const Real eta) const;
686 
688  Real3d center() const;
689 
692  const Real2d& vtx0, const Real2d& vtx1) const
693  {
694  return new InfiniteRect2d(cntr, vtx0, vtx1);
695  }
696 
697  protected:
698  virtual std::ostream& info(std::ostream& os) const;
699  private:
702 
705 
710  };
711 
712  // ************************************************************ Triangle3d **
713 
719  class Triangle3d : public Cell2 {
720  public:
721 
722  /* Type for indices in the hierarchical definition of the cells
723 
724  Use a type with a larger range depending on the number of cell
725  refinements.
726  */
727  typedef uint index_type;
728 
729  // Maximal number of levels in the cell refinement
730 
731  static uint MAX_LEVEL;
732 
734  struct Index {
737 
743 
749 
750  Index();
752  std::ostream& info(std::ostream& os) const;
753  };
754 
755  friend std::ostream& operator<<(std::ostream& os,
756  const Triangle3d::Index& i);
757 
764  virtual ~Triangle3d();
765 
771  virtual Triangle3d* child(uint i);
776  virtual const Triangle3d* child(uint i) const;
777 
779  Triangle& connector() const { return cntr_; }
780 
788  Real3d chi(Real xi, Real eta) const;
789 
790  Real3d elemMap(const Real2d& coord_local) const
791  {
792  return chi(coord_local[0], coord_local[1]);
793  }
794 
795  Real3d vertex(uint i) const;
796  Real3d center() const {return chi(0.66666666666, 0.5);}
797 
799  inline const MapTriangle3d* map() const {return map_;}
800 
802  inline Triangle3d* clone(Triangle& cntr, MapTriangle3d* map) const {
803  return new Triangle3d(cntr, map, idx_);}
804  protected:
805  virtual std::ostream& info(std::ostream& os) const;
806  private:
809 
812 
815 
820 
823 
825  Triangle3d(Triangle& cntr, MapTriangle3d* map, const Index& key);
826  };
827 
828  std::ostream& operator<<(std::ostream& os, const Triangle3d::Index& i);
829 
830  // **************************************************************** Quad3d **
831 
832  // forward declaration
833  class MappingQuad3d;
834 
850  class Quad3d : public QuadNd {
851 // friend class Quad3dSubdivision;
852 // friend class Quad3dSubdiv4;
853 // friend class Quad3dSubdiv2H;
854 // friend class Quad3dSubdiv2V;
855 
856  public:
866  Quad3d(Quad& cntr, const MappingQuad3d& map, const Z2 dir = 0);
867  virtual ~Quad3d();
868 
869  private:
870  Quad3d(Quad& cntr, MappingQuad3d* map, const Index& idx, const Z2 dir = 0);
871  Quad3d(const Quad3d& other);
872  Quad3d& operator=(const Quad3d& other);
873 
874  public:
875 
881  virtual Quad3d* child(uint i);
886  virtual const Quad3d* child(uint i) const;
887  inline bool hasChildren() const { return chld_ != 0; }
888 
896  Real3d chi(Real xi, Real eta) const;
897 
898  Real3d elemMap(const Real2d& coord_local) const
899  {
900  return chi(coord_local[0], coord_local[1]);
901  }
902 
928  Real3d jacobianColumn(uint i, const Real xi, const Real eta) const;
929 
933  Real faceElement(const Real xi, const Real eta) const;
934 
935  virtual Real gramDeterminantRoot(const Real xi, const Real eta) const
936  {
937  return faceElement(xi, eta);
938  }
939 
940  virtual Real lineElement(const Real xi, const uint edge) const;
941 
944  Real3d n0(Real xi, Real eta) const;
945 
946  Real3d vertex(uint i) const;
947  Real3d center() const {return chi(0.5, 0.5);}
948 
952  inline const MappingQuad3d* map() const {return map_;}
953 
955  inline Quad3d* clone(Quad& cntr, MappingQuad3d* map) const {
956  return new Quad3d(cntr, map, idx_);}
957 
970 // virtual void setStrategy(const Quad3dSubdivision* strategy = 0)
971 // throw(StrategyChange);
972 
978 // const Quad3dSubdivision* getStrategy() const { return subdivStrategy_; }
979 
980  virtual uint dim() const { return 3; }
981 
984  Z2 dir() const { return dir_; }
985 
986  protected:
987  virtual std::ostream& info(std::ostream& os) const;
988 
990  MappingQuad3d* map_;
991 
995  Quad3d* createChild_(Quad& cntr, const Index& idx, bool flag) const;
996 
997  private:
1000 
1005 
1008 
1010 // const Quad3dSubdivision* subdivStrategy_;
1011 
1018  virtual Quad3d* createChild_(Quad& cntr, const Index& idx) const;
1019  };
1020 
1021 
1022 } // namespace concepts
1023 
1024 #endif // cell2D_hh
index_type j_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:748
friend std::ostream & operator<<(std::ostream &os, const QuadNd::Index &i)
virtual Real gramDeterminantRoot(const Real xi, const Real eta) const =0
Returns the square root of the Gram determinant.
Mapping< F, DimX, DimY > inverse() const
Returns the inverse of the matrix.
virtual const InfiniteRect2d * child(uint i) const
Returns a child.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual const QuadSubdiv4 * topologicalStrategy() const
Returns the respective topological subdivision strategy.
MapTriangle3d * map_
Pointer to the element map.
Definition: cell2D.hh:822
MapReal2d jacobian(const Real xi, const Real eta) const
Computes the Jacobian for xi, eta .
virtual const Triangle2d * child(uint i) const
Returns a child.
Level< 2 > level() const
Returns the level of the cell.
Definition: cell2D.hh:257
Triangle2d(Triangle &cntr, const MappingTriangle2d &map)
Constructor.
std::ostream & info(std::ostream &os) const
A 2D cell: quadrilateral.
Definition: cell2D.hh:378
Real2d chi(Real xi, Real eta) const
Evaluates the element map.
Quad3d(Quad &cntr, const MappingQuad3d &map, const Z2 dir=0)
Constructor.
Quad2d(Quad &cntr, MappingQuad2d *map, const Index &idx)
Private constructor.
Triangle & connector() const
Returns the triangle connector (topology)
Definition: cell2D.hh:91
InfiniteQuad2d(InfiniteQuad &cntr, const Real2d &vtx0, const Real2d &vtx1)
Constructor.
virtual uint dim() const
Returns the dimension of the space.
Definition: cell2D.hh:561
MapReal2d jacobian(Real x, Real y) const
Returns the Jacobian in a 2D linear map.
F determinant() const
Returns the determinant of the matrix (only valid for square matrices)
Quad3d(const Quad3d &other)
Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
Definition: cell2D.hh:447
virtual const QuadSubdiv2V * topologicalStrategy() const
Returns the respective topological subdivision strategy.
Quad2d * createChild_(Quad &cntr, const Index &idx, bool flag) const
Non-virtual form of the private createChild_() method.
index_type j_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:60
Real3d center() const
Returns the center of the cell.
Definition: cell2D.hh:516
A 3D element map for a triangle.
static std::unique_ptr< Quad2dSubdiv2H > instance_
Definition: cell2D.hh:335
A infinite quadrilateral in the topology, which possess one Edge and two InfiniteEdges since one edge...
Definition: topology.hh:423
A quadrilateral in the topology.
Definition: topology.hh:272
Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
Definition: cell2D.hh:790
virtual ~Quad2d()
Interface for topological subdivision strategies for quadrilaterals.
Definition: quadsubdiv.hh:37
virtual void createChildren(Quad2d &q) const
If no children of q exist, they are created.
Index(uchar l, index_type i, index_type j)
QuadNd(Quad &cntr)
Definition: cell2D.hh:223
Real faceElement(const Real xi, const Real eta) const
Returns the face element for the transformation at xi, eta .
friend std::ostream & operator<<(std::ostream &os, const Triangle3d::Index &i)
const Quad2dSubdivision * subdivStrategy_
Subdivision strategy for the quadrilateral.
Definition: cell2D.hh:585
const Quad2d * child(uint i, Real xi, Real eta, Real &xiC, Real &etaC) const
Returns a child.
Definition: cell2D.hh:420
A 2D element map for a triangle.
Definition: elementMaps.hh:520
bool hasChildren() const
Definition: cell2D.hh:669
unsigned char uchar
Abbreviation for unsigned char.
Definition: typedefs.hh:45
Quad & connector() const
Returns the quadrilateral connector (topology)
Definition: cell2D.hh:234
UnitNd< 2 > n_
Direction of the infinite edges (normalised)
Definition: cell2D.hh:701
Real3d center() const
Returns the center of the cell.
Definition: cell2D.hh:796
A 2D cell: triangle.
Definition: cell2D.hh:31
MappingEdge2d * edgeMap(uint edge) const
Returns the mapping of an edge.
bool hasChildren() const
Definition: cell2D.hh:409
InfiniteQuad & cntr_
Reference to the quadrilateral connector (topology)
Definition: cell2D.hh:636
virtual Quad2d * child(uint i)
Returns a child.
virtual Real lineElement(const Real xi, const uint edge) const
Computes the differential element on an edge.
MapReal2d inverseLaplace(const Real xi, const Real eta) const
Computes the second partial derivatives of the inverse Mapping.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real2d chi(Real xi, Real eta) const =0
virtual const Quad2d * child(uint i) const
Returns a child.
Exception indicating that changing the subdivision strategy is not allowed (but was tried anyway).
A 2D cell: infinite rectangle.
Definition: cell2D.hh:648
MapReal2d jacobianInverse(const Real x, const Real y) const
Returns the inverse of the Jacobian in a 2D linear map.
virtual Triangle2d * child(uint i)
Returns a child.
virtual void createChildren(Quad2d &q) const =0
If no children of q exist, they are created.
MappingQuad2d * map_
Pointer to the element map.
Definition: cell2D.hh:566
Subdivision strategy for quadrilaterals which generates two children.
Definition: quadsubdiv.hh:117
static std::unique_ptr< Quad2dSubdiv2V > instance_
Definition: cell2D.hh:355
Quad3d * chld_
Pointer to the first child.
Definition: cell2D.hh:1004
index_type j_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:215
static uint MAX_LEVEL
Definition: cell2D.hh:731
Real jacobianDeterminant(const Real x, const Real y) const
Returns determinant of the Jacobian.
Index idx_
Index of this element.
Definition: cell2D.hh:160
MappingTriangle2d * map_
Pointer to the element map.
Definition: cell2D.hh:174
Real3d center() const
Returns the center of the cell.
Definition: cell2D.hh:143
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
MapReal2d jacobianInverse(const Real xi, const Real eta) const
Returns the inverse of the Jacobian for xi, eta .
Definition: cell2D.hh:480
std::ostream & info(std::ostream &os) const
Quad & cntr_
Reference to the quadrilateral connector (topology)
Definition: cell2D.hh:261
Triangle2d(Triangle &cntr, MappingTriangle2d *map, const Index &idx)
Private constructor.
An array of objects.
Definition: bilinearForm.hh:23
Base class for a quadrilateral in any dimension.
Definition: cell2D.hh:187
Triangle3d * chld_
Pointer to the first child.
Definition: cell2D.hh:819
virtual Quad3d * child(uint i)
Returns a child.
Real3d chi(Real xi, Real eta) const
The element map.
InfiniteQuad & connector() const
Returns the quadrilateral connector (topology)
Definition: cell2D.hh:629
static uint MAX_LEVEL
Definition: cell2D.hh:198
Real area() const
Returns the area of the element.
Triangle & connector() const
Returns the triangle connector (topology)
Definition: cell2D.hh:779
Level< 2 > level_
Level of this element.
Definition: cell2D.hh:203
const Quad2dSubdivision * getStrategy() const
Returns the subdivision strategy of this quad.
Definition: cell2D.hh:559
Triangle2d * clone(Triangle &cntr, MappingTriangle2d *map) const
Returns a copy of itself.
Definition: cell2D.hh:148
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Array< Edge2d * > edge_
Definition: cell2D.hh:588
Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
Definition: cell2D.hh:680
A quadrilateral cell in 3D.
Definition: cell2D.hh:850
virtual uint dim() const
Sets the subdivision strategy of this quad.
Definition: cell2D.hh:980
std::ostream & operator<<(std::ostream &os, const Level< dim > &c)
virtual ~Quad3d()
virtual void createChildren(Quad2d &q) const
If no children of q exist, they are created.
friend std::ostream & operator<<(std::ostream &os, const Triangle2d::Index &i)
MapReal2d jacobian(const concepts::Real2d &p) const
bool hasChildren() const
Definition: cell2D.hh:887
Subclass of Triangle2d representing its index.
Definition: cell2D.hh:46
Triangle & cntr_
Reference to the triangle connector (topology)
Definition: cell2D.hh:163
Quad2d * chld_
Pointer to the first child.
Definition: cell2D.hh:582
ushort level() const
Returns the level of the cell.
Definition: cell2D.hh:98
virtual void createChildren(Quad2d &q) const
If no children of q exist, they are created.
Triangle3d * clone(Triangle &cntr, MapTriangle3d *map) const
Returns a copy of itself.
Definition: cell2D.hh:802
Index(uchar l, index_type i, index_type j)
Quad3d * lnk_
Pointer to a sibling.
Definition: cell2D.hh:999
Subdivision strategy for quadrilaterals which generates two children.
Definition: cell2D.hh:346
virtual const Quad3d * child(uint i) const
Returns a child.
Two dimensional cell.
Definition: cell.hh:89
InfiniteRect2d * chld_
Pointer to the first child.
Definition: cell2D.hh:709
index_type i_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:209
Subdivision strategy for quadrilaterals which generates two children.
Definition: quadsubdiv.hh:95
Real3d center() const
Returns the center of the cell.
Definition: cell2D.hh:947
uchar l_
Level of this element.
Definition: cell2D.hh:48
Quad2d(Quad &cntr, const MappingQuad2d &map)
Constructor.
virtual Real lineElement(const Real xi, const uint edge) const
virtual Real2d chi(Real xi, Real eta) const
Evaluates the element map.
Real3d jacobianColumn(uint i, const Real xi, const Real eta) const
Computes the Jacobian for xi, eta .
Subclass of QuadNd representing its index.
Definition: cell2D.hh:201
virtual MapReal2d jacobian(const Real xi, const Real eta) const
MappingQuad3d * map_
Pointer to the element map.
Definition: cell2D.hh:990
A 2D cell: infinite quadrilateral.
Definition: cell2D.hh:610
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Index(uchar k, uchar l, index_type i, index_type j)
Definition: cell2D.hh:218
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
Definition: cell2D.hh:112
static const Quad2dSubdiv2V * instance()
Quad3d * clone(Quad &cntr, MappingQuad3d *map) const
Returns a copy of itself.
Definition: cell2D.hh:955
Interface for geometrical subdivision strategies for quadrilaterals.
Definition: cell2D.hh:283
virtual uint dim() const =0
Returns the dimension of the space.
Triangle3d * lnk_
Pointer to a sibling.
Definition: cell2D.hh:814
Triangle2d * lnk_
Pointer to a sibling.
Definition: cell2D.hh:166
Real2d vtx_[2]
Vertices.
Definition: cell2D.hh:634
Z2 dir() const
Returns the direction of the normal vector.
Definition: cell2D.hh:984
Subdivision strategy for quadrilaterals which generates two children.
Definition: cell2D.hh:326
Real jacobianDeterminant(const Real xi, const Real eta) const
Returns the determinant of the Jacobian for xi, eta .
Definition: cell2D.hh:487
virtual Quad2d * createChild_(Quad &cntr, const Index &idx) const
Creates and returns a child.
index_type i_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:54
Real3d n0(Real xi, Real eta) const
Returns the normal vector on a point of the quad.
InfiniteRect2d * clone(InfiniteQuad &cntr, const Real2d &vtx0, const Real2d &vtx1) const
Returns a copy of itself.
Definition: cell2D.hh:691
Real3d center() const
Makes no sense. Calling throws an exception.
Quad2d * lnk_
Pointer to a sibling.
Definition: cell2D.hh:577
Triangle & cntr_
Reference to the triangle connector (topology)
Definition: cell2D.hh:811
Index idx_
Index of this element.
Definition: cell2D.hh:263
const MappingQuad3d * map() const
Returns the stored element map (same for all family related to one ancestor).
Definition: cell2D.hh:952
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
Definition: cell2D.hh:898
virtual void setStrategy(const Quad2dSubdivision *strategy=0)
Sets the subdivision strategy of this quad.
Quad3d(Quad &cntr, MappingQuad3d *map, const Index &idx, const Z2 dir=0)
static const Quad2dSubdiv4 * instance()
A 2D element map for a quadrilateral.
Definition: elementMaps.hh:667
short l_[dim]
Level.
Definition: level.hh:24
Triangle2d * chld_
Pointer to the first child.
Definition: cell2D.hh:171
A 2D element map for an edge.
Definition: elementMaps.hh:84
const MappingTriangle2d * map() const
Returns the element map.
Definition: cell2D.hh:145
Real2d chi(Real xi, Real eta) const
Evaluates the element map.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
QuadNd(Quad &cntr, const Index &idx)
Definition: cell2D.hh:225
static const Quad2dSubdiv2H * instance()
const MappingQuad2d * map() const
Returns the stored element map (same for all family related to one ancestor).
Definition: cell2D.hh:521
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
A 3D cell: triangle.
Definition: cell2D.hh:719
virtual const Triangle3d * child(uint i) const
Returns a child.
Subdivision strategy for quadrilaterals which generates four children.
Definition: quadsubdiv.hh:73
static uint MAX_LEVEL
Definition: cell2D.hh:43
Z2 dir_
Direction of the normal vector.
Definition: cell2D.hh:1007
virtual Triangle3d * child(uint i)
Returns a child.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
static std::unique_ptr< Quad2dSubdiv4 > instance_
Definition: cell2D.hh:315
virtual InfiniteRect2d * child(uint i)
Returns a child.
Quad2d * clone(Quad &cntr, MappingQuad2d *map) const
Returns a copy of itself.
Definition: cell2D.hh:536
Triangle3d(Triangle &cntr, const MapTriangle3d &map)
Constructor.
Binary group (algebraic): only the values 0 and 1 are represented.
Definition: Zm.hh:16
Quad3d * createChild_(Quad &cntr, const Index &idx, bool flag) const
Non-virtual form of the private createChild_() method.
Index idx_
Index of this element.
Definition: cell2D.hh:808
uchar l_
Level of this element.
Definition: cell2D.hh:736
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
Subdivision strategy for quadrilaterals which generates four children.
Definition: cell2D.hh:306
virtual Real gramDeterminantRoot(const Real xi, const Real eta) const
Returns the square root of the Gram determinant.
Definition: cell2D.hh:935
virtual Real lineElement(const Real xi, const uint edge) const =0
virtual const QuadSubdiv2H * topologicalStrategy() const
Returns the respective topological subdivision strategy.
A triangle in the topology.
Definition: topology.hh:193
virtual Quad3d * createChild_(Quad &cntr, const Index &idx) const
Subdivision strategy for the quadrilateral.
static Real2d duffyInv(const Real2d &x)
Maps coordinates from to to use them in chi.
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
Class providing an output operator.
const MapTriangle3d * map() const
Returns the element map.
Definition: cell2D.hh:799
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Triangle3d(Triangle &cntr, MapTriangle3d *map, const Index &key)
Private constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual const QuadSubdivision * topologicalStrategy() const =0
Returns the respective topological subdivision strategy.
std::ostream & info(std::ostream &os) const
InfiniteRect2d(InfiniteQuad &cntr, const Real2d &vtx0, const Real2d &vtx1)
Constructor.
Quad3d & operator=(const Quad3d &other)
virtual Real gramDeterminantRoot(const Real xi, const Real eta) const
Returns the square root of the Gram determinant.
Definition: cell2D.hh:491
Real3d chi(Real xi, Real eta) const
Evaluates the element map.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Subclass of Quad2d representing its index.
Definition: cell2D.hh:734
index_type i_
Index of this element on the local level with respect to the element in the original mesh.
Definition: cell2D.hh:742
virtual MapReal2d jacobian(const Real xi, const Real eta) const =0
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
InfiniteRect2d * lnk_
Pointer to a sibling.
Definition: cell2D.hh:704
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Quad2d(const Quad2d &other)
virtual void removeChildren(Quad2d &q) const
If there are children, they are removed.
Quad2d & operator=(const Quad2d &other)
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich