Overture  Version 25
ReductionMapping.h
Go to the documentation of this file.
1 #ifndef REDUCTION_MAPPING_H
2 #define REDUCTION_MAPPING_H
3 
4 #include "Mapping.h"
5 
6 //-------------------------------------------------------------
7 // Define a new Mapping for the face or edge of another Mapping, thus
8 // reducing the domain dimension.
9 //-------------------------------------------------------------
10 class ReductionMapping : public Mapping
11 {
12 
13 public:
14 
16  ReductionMapping(Mapping & mapToReduce,
17  const real & inactiveAxis1Value =0. ,
18  const real & inactiveAxis2Value =-1.,
19  const real & inactiveAxis3Value =-1. );
20  ReductionMapping(Mapping & mapToReduce,
21  const int & inactiveAxis,
22  const real & inactiveAxisValue );
23 
24  // Copy constructor is deep by default
25  ReductionMapping( const ReductionMapping &, const CopyType copyType=DEEP );
26 
28 
30 
33 
34  void basicInverse(const realArray & x,
35  realArray & r,
38 
39  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
41 
42  virtual void basicInverseS(const RealArray & x,
43  RealArray & r,
46 
47  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
48  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
49 
50  int set(Mapping & mapToReduce,
51  const real & inactiveAxis1Value =0. ,
52  const real & inactiveAxis2Value =-1.,
53  const real & inactiveAxis3Value =-1. );
54 
55  int set(Mapping & mapToReduce,
56  const int & inactiveAxis,
57  const real & inactiveAxisValue );
58 
59  int setInActiveAxes( const real & inactiveAxis1Value =0.,
60  const real & inactiveAxis2Value =-1.,
61  const real & inactiveAxis3Value =-1.);
62 
63  int setInActiveAxes( const int & inactiveAxis,
64  const real & inactiveAxisValue );
65 
67  aString getClassName() const { return ReductionMapping::className; }
68 
69  int update( MappingInformation & mapInfo ) ;
70 
71  const Mapping * getOriginalMapping() const { return originalMap; }
72 
73  int getActiveAxis(int a) const { return activeAxis[a]; }
74  int getInActiveAxis(int a) const { return inActiveAxis[a]; }
75  real getInActiveAxisValue(int a) const { return inActiveAxisValue[a]; }
76 
77 
78  private:
79  aString className;
80  Mapping *originalMap; // here is the original Mapping
81  int numberOfInActiveAxes;
82  int activeAxis[3], inActiveAxis[3];
83  real inActiveAxisValue[3]; // The fixed r-value for the inActiveAxis
84 
85  int setInActiveAxes( const real value[3] );
86  int setMappingProperties();
87 
88  private:
89 
90  //
91  // Virtual member functions used only through class ReferenceCounting:
92  //
94  { return operator=((ReductionMapping &)x); }
95  virtual void reference( const ReferenceCounting& x)
96  { reference((ReductionMapping &)x); } // *** Conversion to this class for the virtual = ****
97  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
98  { return ::new ReductionMapping(*this, ct); }
99 
100 };
101 
102 
103 #endif