elementMaps.hh

Go to the documentation of this file.
1 
7 #ifndef elementMaps_hh
8 #define elementMaps_hh
9 
10 #include "basics/outputOperator.hh"
11 #include "basics/typedefs.hh"
13 #include "basics/cloneable.hh"
14 #include "toolbox/sequence.hh"
15 #include "toolbox/arrayOp.hh"
16 
17 namespace concepts {
18 
19  // ***************************************************************** Map1d **
20 
24  class Map1d : public OutputOperator {
25  public:
26  std::ostream& info(std::ostream& os) const {return os << concepts::typeOf(*this)<<"()";};
27  };
28 
29  // ***************************************************************** Map2d **
30 
34  class Map2d : public OutputOperator {
35  public:
36  std::ostream& info(std::ostream& os) const {return os << concepts::typeOf(*this)<<"()";};
37  virtual bool straight() const {return false;};
38  };
39 
40  // ************************************************************* MapEdge1d **
41 
47  class MapEdge1d : public Map1d {
48  public:
53  inline MapEdge1d(const Real vtx0, const Real vtx1) :
54  vtx0_(vtx0), vtx1_(vtx1) {}
55 
59  inline Real operator()(const Real x) const {
60  return vtx0_*(1.0-x) + vtx1_*x; }
61 
63  inline Real jacobian(const Real) const { return vtx1_-vtx0_; }
64 
66  inline MapEdge1d* clone() const {return new MapEdge1d(vtx0_, vtx1_);};
67  protected:
68  virtual std::ostream& info(std::ostream& os) const;
69  private:
72  };
73 
74  // ********************************************************* MappingEdge2d **
75 
84  class MappingEdge2d : public Cloneable, public Map1d {
85  public:
90  MappingEdge2d(const Real2d vtx0, const Real2d vtx1);
92  MappingEdge2d(const MappingEdge2d &edgemap);
94  virtual MappingEdge2d* clone() const = 0;
96  virtual MappingEdge2d* inverse() const;
100  virtual Real2d operator()(const Real t) const = 0;
102  virtual Real2d derivative(const Real t, const uint n = 1) const = 0;
103 
105  virtual Real2d normal(const Real t) const;
107  inline Real2d n0(const Real t) const {
108  return UnitNd<2>(normal(t));
109  }
116  virtual Real curvature(const Real t, uint n = 0) const;
117 
121  virtual MappingEdge2d* part(const Real t0, const Real t1) const;
122 
124  inline const Real2d& vtx(uint i) const {return vtx_[i];}
125  protected:
126  virtual std::ostream& info(std::ostream& os) const;
129  };
130 
131  // ***************************************************** PartMappingEdge2d **
132 
138  public:
145  const Real t0, const Real t1);
149  virtual PartMappingEdge2d* clone() const;
151  virtual PartMappingEdge2d* inverse() const;
155  virtual Real2d operator()(const Real t) const;
157  virtual Real2d derivative(const Real t, const uint n = 1) const;
158  protected:
159  virtual std::ostream& info(std::ostream& os) const;
160  private:
162  std::unique_ptr<const MappingEdge2d> edgemap_;
164  const Real t0_, t1_;
165 
167  inline const Real t_(const Real t) const {
168  return t0_*(1. - t) + t1_*t;
169  }
170  };
171 
172  // ************************************************** InverseMappingEdge2d **
173 
180  public:
186 
187  virtual InverseMappingEdge2d* clone() const;
188  virtual MappingEdge2d* inverse() const {
189  return edgemap_->clone();
190  }
194  virtual Real2d operator()(const Real t) const;
196  virtual Real2d derivative(const Real t, const uint n = 1) const;
203  virtual Real curvature(const Real t, uint n = 0) const;
204  PartMappingEdge2d* part(const Real t0, const Real t1) const;
205  protected:
206  virtual std::ostream& info(std::ostream& os) const;
209  };
210 
211  // ************************************************* MappingStraightEdge2d **
212 
219  public:
224  MappingStraightEdge2d(const Real2d vtx0, const Real2d vtx1);
228  virtual MappingStraightEdge2d* clone() const;
229  virtual MappingStraightEdge2d* inverse() const {
230  return new MappingStraightEdge2d(vtx(1), vtx(0));
231  }
235  virtual Real2d operator()(const Real t) const;
237  virtual Real2d derivative(const Real t, const uint n = 1) const;
238  virtual Real curvature(const Real t, uint n = 0) const;
239  MappingStraightEdge2d* part(const Real t0, const Real t1) const;
240  protected:
241  virtual std::ostream& info(std::ostream& os) const;
244  };
245 
246  // ************************************************** CircleMappingEdge2d **
247 
260  public:
276  CircleMappingEdge2d(const Real r, const Real2d vtx0, const Real2d vtx1);
284  CircleMappingEdge2d(const Real2d center, const Real r,
285  const Real angle0, const Real angle1);
297  CircleMappingEdge2d(const Real2d vtx0, const Real2d vtxm, const Real2d vtx1);
301  virtual CircleMappingEdge2d* clone() const;
302  virtual MappingEdge2d* inverse() const;
303 
305  bool straight() const;
306 
307  virtual Real2d operator()(const Real t) const;
308  virtual Real2d derivative(const Real t, const uint n = 1) const;
309  virtual Real curvature(const Real t, const uint n = 0) const;
310  MappingEdge2d* part(const Real t0, const Real t1) const;
311  protected:
312  virtual std::ostream& info(std::ostream& os) const;
313  private:
320 
321  inline Real phi_(const Real t) const {
322  return angle0_ * (1.-t) + angle1_ * t;
323  }
324  };
325 
326  // ************************************************** EllipseMappingEdge2d **
327 
339  public:
346  EllipseMappingEdge2d(const Real2d center, const Real a, const Real b,
347  const Real2d vtx0, const Real2d vtx1);
351  virtual EllipseMappingEdge2d* clone() const;
352  virtual EllipseMappingEdge2d* inverse() const;
353 
354  virtual Real2d operator()(const Real t) const;
355  virtual Real2d derivative(const Real t, const uint n = 1) const;
356  EllipseMappingEdge2d* part(const Real t0, const Real t1) const;
357  protected:
358  virtual std::ostream& info(std::ostream& os) const;
359  private:
366 
367  EllipseMappingEdge2d(const Real2d center, const Real a, const Real b,
368  const Real angle0, const Real angle1);
369  };
370 
371  // ************************************************** ParabelMappingEdge2d **
372 
381  public:
388  ParabelMappingEdge2d(const Real2d vtx0, const Real2d vtx1,
389  const Real2d cusp, const Real2d ap);
393  virtual ParabelMappingEdge2d* clone() const;
394 
395  virtual Real2d operator()(const Real t) const;
396  virtual Real2d derivative(const Real t, const uint n = 1) const;
397  ParabelMappingEdge2d* part(const Real t0, const Real t1) const;
398  protected:
399  virtual std::ostream& info(std::ostream& os) const;
400  private:
404  const Real2d cusp_;
406  const Real s0_, deltas_;
410  const Real s_(const Real t) const;
411  };
412 
413  // ************************************************ MappingParallelEdge2d **
414 
422  public:
432  MappingParallelEdge2d(const MappingEdge2d &edgemap, const Real d);
436  virtual MappingParallelEdge2d* clone() const;
437 
438  virtual Real2d operator()(const Real t) const;
439  virtual Real2d derivative(const Real t, const uint n = 1) const;
440  virtual Real curvature(const Real t, const uint n = 0) const;
441  virtual Real2d n0(const Real t) const;
442 
444  inline const MappingEdge2d& map() const { return *edgemap_; }
446  inline const Real d() const { return d_; }
447  MappingParallelEdge2d* part(const Real t0, const Real t1) const;
448  protected:
449  virtual std::ostream& info(std::ostream& os) const;
450  private:
452  std::unique_ptr<const MappingEdge2d> edgemap_;
455  };
456 
457  class MappingQuad2d;
458 
459  // ***************************************************** MappingQuadEdge2d **
460 
466  public:
476  MappingQuadEdge2d(const MappingQuad2d& map, const uint edge);
484  const Real2d xi0, const Real2d xi1);
488  virtual MappingQuadEdge2d* clone() const;
489 
490  virtual Real2d operator()(const Real t) const;
491  virtual Real2d derivative(const Real t, const uint n = 1) const;
492  virtual MappingQuadEdge2d* inverse() const {
493  return new MappingQuadEdge2d(*map_, xi_ + xidiff_, xi_);
494  }
495  protected:
496  virtual std::ostream& info(std::ostream& os) const;
497  private:
499  std::unique_ptr<MappingQuad2d> map_;
502 
503  // Local coordinate of an point on the edge
504  inline const Real2d lcoord_(const Real t) const {
505  return xi_ + xidiff_*t;
506  }
507  // Derivative of the local mapping
508  inline const Real2d lderiv_(const Real t) const {
509  return xidiff_;
510  }
511  };
512 
513  // ***************************************************** MappingTriangle2d **
514 
520  class MappingTriangle2d : public Map2d {
521  public:
526  virtual Real2d operator()(const Real x, const Real y) const = 0;
527 
531  virtual MappingTriangle2d* clone() const = 0;
532 
538  //virtual bool curved() const = 0;
539 
541  virtual Real jacobianDeterminant(const Real x, const Real y) const;
542 
544  virtual MapReal2d jacobian(const Real x, const Real y) const = 0;
545 
547  virtual MapReal2d jacobianInverse(const Real x, const Real y) const;
548  };
549 
550  // ****************************************************** VertexTriangle2d **
551 
558  public:
566 
569 
570  virtual ~VertexTriangle2d();
571  virtual VertexTriangle2d* clone() const;
572  //virtual bool curved() const;
573 
578  virtual bool straight() const {return true;};
579 
580  virtual MapReal2d jacobian(const Real x, const Real y) const {
581  return jacobian_;
582  }
583 
584  Real2d operator()(const Real x, const Real y) const {
585  conceptsAssert(0.0 <= y, Assertion());
586  conceptsAssert(0.0 <= x, Assertion());
587  conceptsAssert(y <= x, Assertion());
588  conceptsAssert(x <= 1.0, Assertion());
589 
590  Real2d res(vtx1_); res -= vtx0_; res *= x;
591  Real2d res2(vtx2_); res2 -= vtx1_; res2 *= y;
592  res += res2;
593 
594  res += vtx0_;
595  return res;
596  }
597  protected:
598  virtual std::ostream& info(std::ostream& os) const;
599  private:
604  };
605 
606  // ******************************************************* MapTriangle2d **
607 
616  public:
627  MapTriangle2d(char* map, const Real scX, const Real scY);
628 
631 
632  virtual ~MapTriangle2d();
633  virtual MapTriangle2d* clone() const;
634  //virtual bool curved() const;
635  virtual MapReal2d jacobian(const Real x, const Real y) const;
636 
637  Real2d operator()(const Real x, const Real y) const {
638  conceptsAssert(0.0 <= y, Assertion());
639  conceptsAssert(0.0 <= x, Assertion());
640  conceptsAssert(y <= x, Assertion());
641  conceptsAssert(x <= 1.0, Assertion());
642  return Real2d(map_, scx_ * x, scy_ * (x == 0 ? 0 : y/x));
643  }
644  protected:
645  virtual std::ostream& info(std::ostream& os) const;
646  private:
649 
651  uint sz_;
652 
654  const Real scx_;
655 
657  const Real scy_;
658  };
659 
660 
661  // ********************************************************* MappingQuad2d **
662 
667  class MappingQuad2d : public Map2d {
668  public:
673  virtual Real2d operator()(Real x, Real y) const = 0;
674 
676  virtual Real jacobianDeterminant(const Real x, const Real y) const;
677 
679  virtual MapReal2d jacobian(const Real x, const Real y) const = 0;
680 
682  virtual MapReal2d jacobianInverse(const Real x, const Real y) const;
683 
688  virtual MapReal2d hessian(uint i, const Real x, const Real y) const = 0;
689 
702  virtual MapReal2d inverseLaplace(const Real x, const Real y) const;
703 
704 
722  virtual Real lineElement(const Real x, const uint edge) const;
723 
731  virtual MappingEdge2d* edge(const uint edge) const {
732  return new MappingQuadEdge2d(*this, edge);
733  }
734 
738  virtual MappingQuad2d* part(const Real2d x0, const Real2d y0) const;
739 
741  virtual MappingQuad2d* clone() const = 0;
742  protected:
743  virtual std::ostream& info(std::ostream& os) const;
744  };
745 
746  // ************************************************************* MapQuad2d **
747 
756  class MapQuad2d : public MappingQuad2d {
757  public:
770  MapQuad2d(const char* map, Real scX, Real scY,
771  Real2d org = Real2d(0.0, 0.0), Real stretch = 1.0);
772  MapQuad2d(const char* map, Real scX, Real scY, Real2d org,
773  Real2d scaling);
774 
776  MapQuad2d(const MapQuad2d &map);
777  virtual ~MapQuad2d();
778 
779  virtual Real2d operator()(Real x, Real y) const {
780  Real2d v(map_, scx_ * x, scy_ * y);
781  return Real2d(v[0]*scaling_[0] + org_[0], v[1]*scaling_[1] + org_[0]);
782  }
783 
784  virtual MapReal2d jacobian(const Real x, const Real y) const;
785 
786  virtual MapReal2d hessian(uint i, const Real x, const Real y) const;
787 
788  virtual MapQuad2d* clone() const { return new MapQuad2d(*this); }
789  protected:
790  virtual std::ostream& info(std::ostream& os) const;
791  private:
794 
796  uint sz_;
797 
800 
803 
806 
808  void operator=(const MapQuad2d &);
809  };
810 
811  // ********************************************************** VertexQuad2d **
812 
818  class VertexQuad2d : public MappingQuad2d {
819  public:
822  VertexQuad2d(Real2d vtx0, Real2d vtx1, Real2d vtx2, Real2d vtx3);
825  virtual ~VertexQuad2d();
826  virtual Real2d operator()(Real x, Real y) const;
827 
832  virtual MapReal2d jacobian(const Real x, const Real y) const;
833 
834  virtual MapReal2d hessian(uint i, const Real x, const Real y) const;
835 
840  virtual Real lineElement(const Real x, const uint edge) const;
841 
842  virtual MappingStraightEdge2d* edge(const uint edge) const;
843 
844  virtual VertexQuad2d* part(const Real2d x0, const Real2d y0) const;
845 
846  virtual VertexQuad2d* clone() const;
847 
848  virtual bool straight() const {return true;};
849  protected:
850  virtual std::ostream& info(std::ostream& os) const;
851  private:
855  mutable Real len_[4];
858  };
859 
860  // ********************************************************* BlendingQuad2d **
861 
872  class BlendingQuad2d : public MappingQuad2d {
873  public:
903  BlendingQuad2d(const MappingEdge2d* edgemap0,
904  const MappingEdge2d* edgemap1,
905  const MappingEdge2d* edgemap2,
906  const MappingEdge2d* edgemap3 = 0,
907  const Real2d* vtx0 = 0, const Real2d* vtx1 = 0,
908  const Real2d* vtx2 = 0, const Real2d* vtx3 = 0);
912  virtual Real2d operator()(Real x, Real y) const;
913  virtual MapReal2d jacobian(const Real x, const Real y) const;
914  virtual MapReal2d hessian(uint i, const Real x, const Real y) const;
915  virtual Real lineElement(const Real x, const uint edge) const;
916  virtual MappingEdge2d* edge(const uint edge) const {
917  conceptsAssert(edge < 4, Assertion());
918  return edgemap_[edge]->clone();
919  }
920  virtual BlendingQuad2d* clone() const { return new BlendingQuad2d(*this); }
921  protected:
922  virtual std::ostream& info(std::ostream& os) const;
923  private:
929  void testJacobian_() const;
930  };
931 
932  // ***************************************************** PartMappingQuad2d **
933 
939  public:
947  const Real2d xi0, const Real2d xi1);
951  virtual PartMappingQuad2d* clone() const;
955  virtual Real2d operator()(Real x, Real y) const;
956  virtual MapReal2d jacobian(const Real x, const Real y) const;
957  virtual MapReal2d hessian(uint i, const Real x, const Real y) const;
958  virtual MappingEdge2d* edge(const uint edge) const;
959  protected:
960  virtual std::ostream& info(std::ostream& os) const;
961  private:
963  std::unique_ptr<const MappingQuad2d> map_;
967  const Real2d x0_;
971  const Real2d d_;
972 
974  inline const Real2d xi_(const Real x, const Real y) const {
975  return x0_ + Real2d(x * d_[0], y * d_[1]);
976  }
977  };
978 
979  // ********************************************* InverseVertexQuadSector2d **
980 
988  public:
991  InverseVertexQuadSector2d(const Real2d vtx0, const Real2d vtx1,
992  const Real2d vtx2, const Real2d vtx3);
997  // Copy constructor
1000  virtual Real2d operator()(const Real2d x) const;
1001  virtual MapReal2d jacobian(const Real2d x) const;
1002  virtual bool is_inregion(const Real2d x) const;
1003  virtual bool is_inpatch(const Real2d x) const;
1005 
1006  protected:
1007  virtual std::ostream& info(std::ostream& os) const;
1008 
1009  private:
1011  void construct_(const Real2d vtx0, const Real2d vtx1,
1012  const Real2d vtx2, const Real2d vtx3);
1017  };
1018 
1019  // ********************************************************* MapTriangle3d **
1020 
1023  class MapTriangle3d : public Map2d {
1024  public:
1035  MapTriangle3d(const char* map, Real scX, Real scY);
1036 
1043  MapTriangle3d(Real3d vtx0, Real3d vtx1, Real3d vtx2);
1044 
1047  ~MapTriangle3d() { delete[] map_; };
1048 
1056  Real3d operator()(Real x, Real y) const {
1057  if (map_)
1058  return Real3d(map_, scx_ * x, scy_ * y);
1059  else {
1060  Real3d res;
1061  res.lincomb(B1_, B2_, x, x*y);
1062  res += b_;
1063  return res;
1064  }
1065  }
1066 
1068  inline MapTriangle3d* clone() const {return new MapTriangle3d(*this);};
1069  private:
1072 
1074  uint sz_;
1075 
1078 
1081 
1084 
1086  void operator=(const MapTriangle3d &);
1087  };
1088 
1089 } // namespace concepts
1090 
1091 #endif // elementMaps_hh
InverseVertexQuadSector2d(const InverseVertexQuadSector2d &v)
virtual InverseVertexQuadSector2d * clone() const
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: elementMaps.hh:26
virtual MappingParallelEdge2d * clone() const
Virtual copy constructor.
virtual Real2d operator()(const Real t) const
Application operator.
2D element map for an parabel arc.
Definition: elementMaps.hh:380
virtual Real2d operator()(Real x, Real y) const
Application operator.
virtual Real curvature(const Real t, uint n=0) const
Returns the n-th derivative of the curvature.
In existant 2D element map for an edge the direction in the edge are inversed.
Definition: elementMaps.hh:179
bool straight() const
returns true if the mapping is straight, i.e. the radius equals zero.
Real2d sector_p_[4]
Sector points, namely vtx0~vtx3, using to decide the sector number.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real2d operator()(const Real x, const Real y) const =0
Application operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const Real2d xi_(const Real x, const Real y) const
Returns the parameter in the original mapping.
Definition: elementMaps.hh:974
Real scx_
Right border of the x parameter domain.
MappingParallelEdge2d(const MappingEdge2d &edgemap, const Real d)
Constructor.
Part of a edge mapping.
Definition: elementMaps.hh:137
MappingQuadEdge2d(const MappingQuad2d &map, const uint edge)
Constructor for a real edge.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
std::unique_ptr< const MappingQuad2d > map_
Original edge map.
Definition: elementMaps.hh:963
const Real scy_
Right border of the y parameter domain.
Definition: elementMaps.hh:657
Real3d operator()(Real x, Real y) const
Returns a point in 3D mapped from the unit square onto the element in the original mesh.
const Real2d cusp_
Coordinates of the cusp.
Definition: elementMaps.hh:404
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the Jacobian in a 2D linear map.
virtual Real2d operator()(const Real t) const
Application operator.
uint sz_
Length of the parsed formula.
MappingEdge2d(const MappingEdge2d &edgemap)
Copy Constructor.
virtual MapTriangle2d * clone() const
Creates a clone of itself and returns it.
ParabelMappingEdge2d(const ParabelMappingEdge2d &edgemap)
Copy Constructor.
virtual MapReal2d jacobianInverse(const Real x, const Real y) const
Returns the inverse of the Jacobian in a 2D linear map.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
EllipseMappingEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
BlendingQuad2d(const BlendingQuad2d &v)
Copy constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
MappingStraightEdge2d(const Real2d vtx0, const Real2d vtx1)
Constructor.
virtual InverseMappingEdge2d * clone() const
Virtual copy constructor.
virtual VertexQuad2d * clone() const
Returns a copy of the map.
virtual Real jacobianDeterminant(const Real x, const Real y) const
Returns determinant of the Jacobian.
virtual VertexTriangle2d * clone() const
Creates a clone of itself and returns it.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A 3D element map for a triangle.
virtual MappingQuad2d * part(const Real2d x0, const Real2d y0) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
virtual MappingEdge2d * edge(const uint edge) const
Returns a copy of the edge mapping of one edge.
Definition: elementMaps.hh:916
Real angle0_
Angles between one vertex and the ellipse center.
Definition: elementMaps.hh:365
Real jacobian(const Real) const
Returns the jacobian.
Definition: elementMaps.hh:63
A 2D element map for a quadrilateral given by a the four vertices.
Definition: elementMaps.hh:818
virtual Real2d operator()(const Real t) const
Application operator.
PartMappingQuad2d(const PartMappingQuad2d &map)
Copy Constructor.
virtual MappingEdge2d * edge(const uint edge) const
Returns a copy of the edge mapping of one edge.
EllipseMappingEdge2d(const EllipseMappingEdge2d &edgemap)
Copy Constructor.
virtual Real curvature(const Real t, const uint n=0) const
Returns the n-th derivative of the curvature.
Point< Real, 2 > Real2d
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real2d n0(const Real t) const
MappingQuadEdge2d(const MappingQuad2d &map, const Real2d xi0, const Real2d xi1)
Constructor for an locally straight edge inside the quad.
void testJacobian_() const
Tests if the jacobian is positive.
CircleMappingEdge2d(const Real r, const Real2d vtx0, const Real2d vtx1)
Constructor.
MapReal2d jacobian_
Jacobian.
Definition: elementMaps.hh:603
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
A 2D element map for a triangle.
Definition: elementMaps.hh:520
virtual bool is_inpatch(const Real2d x) const
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
unsigned char uchar
Abbreviation for unsigned char.
Definition: typedefs.hh:45
const MappingEdge2d & map() const
Returns the edge to which this edge is parallel.
Definition: elementMaps.hh:444
virtual MapReal2d jacobian(const Real2d x) const
virtual Real2d operator()(const Real t) const
Application operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
CircleMappingEdge2d(const Real2d vtx0, const Real2d vtxm, const Real2d vtx1)
Constructor.
virtual PartMappingEdge2d * clone() const
Virtual copy constructor.
InverseVertexQuadSector2d(const Sequence< Real2d > x)
Constructor.
VertexQuad2d(const VertexQuad2d &v)
Copy constructor.
uchar * map_
Parsed formula for the map.
Definition: elementMaps.hh:648
uint sz_
Length of the parsed formula.
Definition: elementMaps.hh:796
virtual CircleMappingEdge2d * clone() const
Virtual copy constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const Real t0_
Parameter of the vertices in the original mapping.
Definition: elementMaps.hh:164
Point< Real, 3 > Real3d
virtual Real2d derivative(const Real t, const uint n=1) const =0
Returns the n-th derivative.
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
virtual Real2d operator()(const Real t) const
Application operator.
Real2d m_
Mid point of the ellipse.
Definition: elementMaps.hh:361
virtual Real lineElement(const Real x, const uint edge) const
Returns factor of differential element integrating over an edge.
CircleMappingEdge2d(const Real2d center, const Real r, const Real angle0, const Real angle1)
Constructor.
VertexTriangle2d(Real2d vtx0, Real2d vtx1, Real2d vtx2)
Constructor.
PartMappingQuad2d(const MappingQuad2d &map, const Real2d xi0, const Real2d xi1)
Constructor.
virtual Real2d normal(const Real t) const
Returns the right normal vector, length is that of the derivative.
CircleMappingEdge2d(const CircleMappingEdge2d &edgemap)
Copy Constructor.
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the jacobian of the element map.
Real2d vtx_[4]
Vector that contains the vertices.
Definition: elementMaps.hh:925
virtual Real curvature(const Real t, uint n=0) const
Returns the n-th derivative of the curvature.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
EllipseMappingEdge2d(const Real2d center, const Real a, const Real b, const Real angle0, const Real angle1)
const MappingEdge2d * edgemap_[4]
Map of the edges.
Definition: elementMaps.hh:927
virtual MappingEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
2D element map for an circular arc.
Definition: elementMaps.hh:259
virtual MapReal2d hessian(uint i, const Real x, const Real y) const =0
Returns the Hessian in a 2D linear map.
Real2d vtx_[4]
Vertices.
Definition: elementMaps.hh:853
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
virtual Real jacobianDeterminant(const Real x, const Real y) const
Returns true if the resulting triangle has curved edges.
BlendingQuad2d(const MappingEdge2d *edgemap0, const MappingEdge2d *edgemap1, const MappingEdge2d *edgemap2, const MappingEdge2d *edgemap3=0, const Real2d *vtx0=0, const Real2d *vtx1=0, const Real2d *vtx2=0, const Real2d *vtx3=0)
Constructor.
EllipseMappingEdge2d(const Real2d center, const Real a, const Real b, const Real2d vtx0, const Real2d vtx1)
Constructor.
InverseMappingEdge2d(const MappingEdge2d &edgemap)
Constructor.
virtual PartMappingQuad2d * clone() const
Virtual copy constructor.
virtual MappingTriangle2d * clone() const =0
Creates a clone of itself and returns it.
virtual EllipseMappingEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
MapTriangle3d(const MapTriangle3d &map)
Copy constructor.
const Real scx_
Right border of the x parameter domain.
Definition: elementMaps.hh:654
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the Jacobian in a 2D linear map.
Exception class for assertions.
Definition: exceptions.hh:258
Part of a map of a quadrilateral.
Definition: elementMaps.hh:938
2D element map for an ellipsoidal arc (not skewed)
Definition: elementMaps.hh:338
virtual Real2d operator()(Real x, Real y) const
Returns a point in 2D mapped from the unit square [0,1]2 onto the element in the original mesh.
virtual Real2d operator()(const Real t) const
Application operator.
virtual MappingQuadEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
Definition: elementMaps.hh:492
virtual ParabelMappingEdge2d * clone() const
Virtual copy constructor.
virtual bool straight() const
Definition: elementMaps.hh:848
virtual Real2d operator()(const Real t) const
Application operator.
virtual MapQuad2d * clone() const
Returns a copy of the map.
Definition: elementMaps.hh:788
bool hasLength_
Length computed?
Definition: elementMaps.hh:857
virtual Real2d operator()(const Real t) const =0
Application operator.
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the Jacobian in a 2D linear map.
Definition: elementMaps.hh:580
Cloneable interface.
Definition: cloneable.hh:16
virtual Real lineElement(const Real x, const uint edge) const
Returns factor of differential element integrating over an edge.
std::unique_ptr< MappingQuad2d > map_
Mapping of the Quad.
Definition: elementMaps.hh:499
Real2d m_
Mid point of the circle.
Definition: elementMaps.hh:317
VertexTriangle2d(const VertexTriangle2d &map)
Copy constructor.
Real2d vtx0_
Vertices of the triangle.
Definition: elementMaps.hh:601
A 2D element map for a quadrilateral given by a formula.
Definition: elementMaps.hh:756
virtual EllipseMappingEdge2d * clone() const
Virtual copy constructor.
A 1D element map for an edge.
Definition: elementMaps.hh:47
uint sz_
Length of the parsed formula.
Definition: elementMaps.hh:651
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real2d operator()(Real x, Real y) const
Returns a point in 2D mapped from the unit square [0,1]2 onto the element in the original mesh.
Definition: elementMaps.hh:779
virtual MapReal2d jacobian(const Real x, const Real y) const =0
Returns the Jacobian in a 2D linear map.
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
Sequence with operations, output operator, and method of the particular element types.
Definition: sequence.hh:39
MapTriangle3d(const char *map, Real scX, Real scY)
Constructor.
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
virtual Real curvature(const Real t, uint n=0) const
Returns the n-th derivative of the curvature.
virtual bool straight() const
Returns true if the resulting triangle has straight edges.
Definition: elementMaps.hh:578
virtual MapReal2d jacobian(const Real x, const Real y) const =0
Returns the Jacobian in a 2D linear map.
virtual MappingEdge2d * clone() const =0
Virtual copy constructor.
virtual Real2d operator()(Real x, Real y) const =0
Returns a point in 2D mapped from the unit square [0,1]2 onto the element in the original mesh.
const Real2d lderiv_(const Real t) const
Definition: elementMaps.hh:508
virtual Real curvature(const Real t, const uint n=0) const
Returns the n-th derivative of the curvature.
MapTriangle3d * clone() const
Returns a copy of the map.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual MappingStraightEdge2d * edge(const uint edge) const
Returns a copy of the edge mapping of one edge.
Real2d operator()(const Real x, const Real y) const
Application operator.
Definition: elementMaps.hh:637
virtual VertexQuad2d * part(const Real2d x0, const Real2d y0) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
Real len_[4]
Length of Edges, used for computation of the line elements.
Definition: elementMaps.hh:855
virtual MappingEdge2d * edge(const uint edge) const
Returns a copy of the edge mapping of one edge.
Definition: elementMaps.hh:731
virtual MapReal2d jacobianInverse(const Real x, const Real y) const
Returns the inverse of the Jacobian in a 2D linear map.
MappingStraightEdge2d(const MappingStraightEdge2d &edgemap)
Copy Constructor.
virtual MappingQuadEdge2d * clone() const
Virtual copy constructor.
An abstract class for a 2d map.
Definition: elementMaps.hh:34
MapQuad2d(const MapQuad2d &map)
Copy constructor.
Real2d vtx_[4]
helper vectors, vtx_0=vtx0, vtx_1,3=vtx1,3-vtx0, vtx2= -vtx1+vtx2-vtx3
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual PartMappingEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
Real scy_
Right border of the y parameter domain.
virtual bool is_inregion(const Real2d x) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
void construct_(const Real2d vtx0, const Real2d vtx1, const Real2d vtx2, const Real2d vtx3)
used in construtor, calculate values and assign to private variables
MappingQuadEdge2d(const MappingQuadEdge2d &edgemap)
Copy Constructor.
Real2d operator()(const Real x, const Real y) const
Application operator.
Definition: elementMaps.hh:584
MappingParallelEdge2d(const MappingParallelEdge2d &edgemap)
Copy Constructor.
Real2d n0(const Real t) const
Returns the normalised right normal vector.
Definition: elementMaps.hh:107
Real angle0_
Angles between one vertex and the circle center.
Definition: elementMaps.hh:319
MapTriangle2d(char *map, const Real scX, const Real scY)
Constructor.
InverseVertexQuadSector2d(const Real2d vtx0, const Real2d vtx1, const Real2d vtx2, const Real2d vtx3)
Constructor.
MapQuad2d(const char *map, Real scX, Real scY, Real2d org=Real2d(0.0, 0.0), Real stretch=1.0)
Constructor.
A 2D element map for a triangle.
Definition: elementMaps.hh:615
const Real s_(const Real t) const
Returns the parameter s on the parabel arc.
virtual Real2d operator()(const Real2d x) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
uchar * map_
Parsed formula for the map.
Definition: elementMaps.hh:793
const Real t_(const Real t) const
Returns the parameter in the original mapping.
Definition: elementMaps.hh:167
const Real d() const
Returns the distance.
Definition: elementMaps.hh:446
std::unique_ptr< const MappingEdge2d > edgemap_
Edge to which this edge is parallel.
Definition: elementMaps.hh:452
A 2D element map for a curved quadrilateral.
Definition: elementMaps.hh:872
virtual MapReal2d hessian(uint i, const Real x, const Real y) const
Returns the Hessian in a 2D linear map.
virtual MapReal2d hessian(uint i, const Real x, const Real y) const
Returns the Hessian in a 2D linear map.
const Real2d x0_
Parameter of the lower left vertex in the reference cell of the original map.
Definition: elementMaps.hh:967
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
virtual MappingStraightEdge2d * clone() const
Virtual copy constructor.
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the Jacobian in a 2D linear map.
virtual MappingQuad2d * clone() const =0
Returns a copy of the map.
const MappingEdge2d * edgemap_
Original edge map.
Definition: elementMaps.hh:208
Real scy_
Right border of the y parameter domain.
Definition: elementMaps.hh:802
virtual MapReal2d jacobian(const Real x, const Real y) const
Returns the Jacobian in a 2D linear map.
PartMappingEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
A 2D element map for a quadrilateral.
Definition: elementMaps.hh:667
const Real2d d_
Vector from the lower left to the upper right vertex in the reference cell of original map.
Definition: elementMaps.hh:971
Real r_
Radius of the circle, zero if straight line (no sign)
Definition: elementMaps.hh:315
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real lineElement(const Real x, const uint edge) const
Returns factor of differential element integrating over an edge.
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: elementMaps.hh:36
A 2d inverse mapping from a sector to reference element.
Definition: elementMaps.hh:987
A 2D element map for an edge.
Definition: elementMaps.hh:84
Real2d delta_
Vector from first to second vertex.
Definition: elementMaps.hh:243
virtual Real2d operator()(const Real t) const
Application operator.
const UnitNd< 2 > v_
Direction of the aperture and clockwise by 90 degree rotated vector.
Definition: elementMaps.hh:402
void operator=(const MapQuad2d &)
Private assignement operator.
Real phi_(const Real t) const
Definition: elementMaps.hh:321
2D element map for an edge parallel to another one.
Definition: elementMaps.hh:421
ParabelMappingEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
virtual MapReal2d hessian(uint i, const Real x, const Real y) const
Returns the Hessian in a 2D linear map.
void operator=(const MapTriangle3d &)
Private assignement operator.
virtual MappingStraightEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
Definition: elementMaps.hh:229
virtual MappingEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
Definition: elementMaps.hh:188
MappingEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
MapTriangle3d(Real3d vtx0, Real3d vtx1, Real3d vtx2)
Constructor.
uchar * map_
Parsed formula for the map.
MapEdge1d * clone() const
Returns a copy of the map.
Definition: elementMaps.hh:66
Real2d xi_
First vertex and direction of the edge in local coordinates.
Definition: elementMaps.hh:501
A 2D element map for a triangle.
Definition: elementMaps.hh:557
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
An abstract class for a 1d map.
Definition: elementMaps.hh:24
MappingParallelEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
void lincomb(const Point< F, dim > &a, const Point< F, dim > &b, const F ca=1.0, const F cb=1.0)
Assign the vector the linear combination of a and b.
const Real2d & vtx(uint i) const
Spit out one vertex of the edge.
Definition: elementMaps.hh:124
virtual MapReal2d inverseLaplace(const Real x, const Real y) const
NEW:
A 2D element map for an edge of a straight line.
Definition: elementMaps.hh:218
ParabelMappingEdge2d(const Real2d vtx0, const Real2d vtx1, const Real2d cusp, const Real2d ap)
Constructor.
virtual BlendingQuad2d * clone() const
Returns a copy of the map.
Definition: elementMaps.hh:920
const Real2d lcoord_(const Real t) const
Definition: elementMaps.hh:504
PartMappingEdge2d(const PartMappingEdge2d &edgemap)
Copy Constructor.
2D element map for an edge as part of an quad.
Definition: elementMaps.hh:465
virtual bool straight() const
Definition: elementMaps.hh:37
MappingEdge2d(const Real2d vtx0, const Real2d vtx1)
Constructor.
virtual MapReal2d hessian(uint i, const Real x, const Real y) const
Returns the Hessian in a 2D linear map.
virtual MappingEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
Class providing an output operator.
Real scx_
Right border of the x parameter domain.
Definition: elementMaps.hh:799
MappingStraightEdge2d * part(const Real t0, const Real t1) const
Returns a new object of an element map for a rectangular part of the reference cell defined by the tw...
std::unique_ptr< const MappingEdge2d > edgemap_
Original edge map.
Definition: elementMaps.hh:162
MapQuad2d(const char *map, Real scX, Real scY, Real2d org, Real2d scaling)
virtual Real2d operator()(Real x, Real y) const
Returns a point in 2D mapped from the unit square [0,1]2 onto the element in the original mesh.
Real3d B1_
Computed map.
VertexQuad2d(Real2d vtx0, Real2d vtx1, Real2d vtx2, Real2d vtx3)
Constructor.
MapEdge1d(const Real vtx0, const Real vtx1)
Constructor.
Definition: elementMaps.hh:53
PartMappingEdge2d(const MappingEdge2d &edgemap, const Real t0, const Real t1)
Constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Real vtx0_
Coordinates of the vertices.
Definition: elementMaps.hh:71
virtual MappingEdge2d * inverse() const
Returns the mapping of the edge in inverse direction.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Real operator()(const Real x) const
Application operator.
Definition: elementMaps.hh:59
Real p_
Radius of curvature circle at the cusp.
Definition: elementMaps.hh:408
const Real s0_
Values describing the vertices on the parabel.
Definition: elementMaps.hh:406
Real2d vtx_[2]
Coordinates of the vertices at either end of the edge.
Definition: elementMaps.hh:128
MapTriangle2d(const MapTriangle2d &map)
Copy constructor.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real2d derivative(const Real t, const uint n=1) const
Returns the n-th derivative.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich