Overture  Version 25
SquareMapping.h
Go to the documentation of this file.
1 #ifndef SQUARE_MAPPING_H
2 #define SQUARE_MAPPING_H "Square.h"
3 
4 #include "Mapping.h"
5 
6 class SquareMapping : public Mapping
7 {
8 //-------------------------------------------------------------
9 // Here is a derived class to define a square in 2D
10 //-------------------------------------------------------------
11 public:
12 
13  SquareMapping( const real xa=0.,
14  const real xb=1.,
15  const real ya=0.,
16  const real yb=1. );
17 
18  // Copy constructor is deep by default
19  SquareMapping( const SquareMapping &, const CopyType copyType=DEEP );
20 
22 
24 
27 
30 
31  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
33 
34  virtual void basicInverseS(const RealArray & x,
35  RealArray & r,
38 
39  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
40  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
41 
42  void setVertices(const real xa=0.,
43  const real xb=1.,
44  const real ya=0.,
45  const real yb=1.,
46  const real z=0. );
47 
48  real getVertices(real & xa, real & xb, real & ya, real & yb ) const;
49 
51  aString getClassName() const { return SquareMapping::className; }
52 
53  int update( MappingInformation & mapInfo ) ;
54 
55  virtual RealArray getBoundingBox( const int & side=-1, const int & axis=-1 ) const;
56  virtual int getBoundingBox( const IntegerArray & indexRange, const IntegerArray & gridIndexRange,
57  RealArray & xBounds, bool local=false ) const;
58  virtual int getBoundingBox( const RealArray & rBounds, RealArray & xBounds ) const;
59 
60 private:
61  aString className;
62  RealArray xyab;
63  real xa,xb,ya,yb;
64  real z; // z level if 3D
65 
66  private:
67 
68  //
69  // Virtual member functions used only through class ReferenceCounting:
70  //
72  { return operator=((SquareMapping &)x); }
73  virtual void reference( const ReferenceCounting& x)
74  { reference((SquareMapping &)x); } // *** Conversion to this class for the virtual = ****
75  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
76  { return ::new SquareMapping(*this, ct); }
77 
78 };
79 
80 
81 #endif // SQUARE_H
82 
83