Overture  Version 25
TFIMapping.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef TFI_MAPPING_H
3 #define TFI_MAPPING_H
4 
5 #include "Mapping.h"
6 
7 //-------------------------------------------------------------
8 // Define a Mapping by Transfinite-Interpolation (Coon's patch)
9 //-------------------------------------------------------------
10 class TFIMapping : public Mapping
11 {
12 
13 public:
14 
16  {
20  };
21 
22  // supply 0, 2, 4 or 6 curves.
23  TFIMapping(Mapping *left =NULL, // r_1=0
24  Mapping *right =NULL, // r_1=1
25  Mapping *bottom =NULL, // r_2=0
26  Mapping *top =NULL, // r_2=1
27  Mapping *front =NULL, // r_3=0
28  Mapping *back =NULL); // r_3=1
29 
30  // Copy constructor is deep by default
31  TFIMapping( const TFIMapping &, const CopyType copyType=DEEP );
32 
33  ~TFIMapping();
34 
35  TFIMapping & operator =( const TFIMapping & X0 );
36 
37  // supply 0, 2, 4 or 6 curves.
38  int setSides(Mapping *left =NULL, // r_1=0
39  Mapping *right =NULL, // r_1=1
40  Mapping *bottom =NULL, // r_2=0
41  Mapping *top =NULL, // r_2=1
42  Mapping *front =NULL, // r_3=0
43  Mapping *back =NULL); // r_3=1
44 
45  // set the interpolation type along each axis
46  int setInterpolationType(const InterpolationType & direction1,
47  const InterpolationType & direction2 =linear,
48  const InterpolationType & direction3 =linear);
49 
52 
53  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
55 
56  int flipper(); // try to flip the curve parameterizations to make the mapping non-singular.
57 
58  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
59  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
60 
62  aString getClassName() const { return TFIMapping::className; }
63 
64  int update( MappingInformation & mapInfo ) ;
65 
66  private:
67 
68  aString className;
69  int numberOfSidesSpecified; // can be 2,4 or 6
70  InterpolationType interpolationType[3]; // type of interpolation along each dimension
71 
72  RealArray corner;
73  IntegerArray flip;
74 
75  //**** should reference count these so we can delete them *****************************************
76  Mapping *curve[2][3]; // These curves are the sides of the TFI mapping, at most 6
77  Mapping *blendingFunction; // general blending function
78 
79  // member function to initialize some of the data, especially the Corner array
80  void initialize();
81 
82  int setMappingProperties();
83 
84  int checkEdge( const int & sideCurve1, const int & axisCurve1, const int & side1, const int & dir1,
85  const int & sideCurve2, const int & axisCurve2, const int & side2, const int & dir2 );
86 
87 
88 
89  //-------------FIXING SGI COMPILER BUG
90  void mapNumberOfSides2( const RealArray & r, RealArray & x,
93 
94  void mapNumberOfSides4AndDim2(
95  const RealArray & r, RealArray & x,
98 
99  void mapNumberOfSides4AndDim3(
100  const RealArray & r, RealArray & x,
103 
104  void mapNumberOfSides6(
105  const RealArray & r, RealArray & x,
108 
109 
110 
111 
112  //
113  // Virtual member functions used only through class ReferenceCounting:
114  //
116  { return operator=((TFIMapping &)x); }
117  virtual void reference( const ReferenceCounting& x)
118  { reference((TFIMapping &)x); } // *** Conversion to this class for the virtual = ****
119  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
120  { return ::new TFIMapping(*this, ct); }
121 
122 };
123 
124 
125 #endif