Overture  Version 25
OGFunction.h
Go to the documentation of this file.
1 #ifndef OG_FUNCTION_H
2 #define OG_FUNCTION_H "OGFunction.h"
3 
4 #include "Overture.h"
5 
6 //
7 // Define a Function and it derivatives
8 // This function can be used to define the "exact solution" for
9 // an Overlapping Grid Appliciation (aka. TwilightZone Flow)
10 //
11 // This is the base Class from which particular functions are defineed
12 // by derivativation. See OGTrigFunction.h for example
13 
15 {
16 
17  public:
18 
19 
21  virtual ~OGFunction(){} // kkc 040415 added virtual to get rid of warnings
22 
23 // // Here are the (inline) member functions that you must define
24 // // u(x,y,z,n,t) : function value at x,y,z for component n
25 // // ux(x,y,z,n,t) : partial derivative of u with respect to x
26 // // ...etc...
27 // inline real u(const real , const real , const real , const int=0, const real=0. );
28 
29 // inline real ut(const real , const real , const real , const int=0, const real=0. );
30 
31 // inline real ux(const real , const real , const real , const int=0, const real=0. );
32 
33 // inline real uy(const real , const real , const real , const int=0, const real=0. );
34 
35 // inline real uxx(const real , const real , const real , const int=0, const real=0. );
36 
37 // inline real uxy(const real , const real , const real , const int=0, const real=0. );
38 
39 // inline real uyy(const real , const real , const real , const int=0, const real=0. );
40 
41 // inline real uz(const real , const real , const real , const int=0, const real=0. );
42 
43 // inline real uxz(const real , const real , const real , const int=0, const real=0. );
44 
45 // inline real uyz(const real , const real , const real , const int=0, const real=0. );
46 
47 // inline real uzz(const real , const real , const real , const int=0, const real=0. );
48 
49 
50  virtual real operator()(const real , const real , const real) = 0;
51  virtual real operator()(const real , const real , const real , const int) = 0;
52  virtual real operator()(const real , const real , const real , const int, const real ) = 0;
53 
54  virtual real t(const real , const real , const real , const int=0, const real=0. ) = 0;
55  virtual real x(const real , const real , const real , const int=0, const real=0. ) = 0;
56  virtual real y(const real , const real , const real , const int=0, const real=0. ) = 0;
57  virtual real xx(const real , const real , const real , const int=0, const real=0. ) = 0;
58  virtual real xy(const real , const real , const real , const int=0, const real=0. ) = 0;
59  virtual real yy(const real , const real , const real , const int=0, const real=0. ) = 0;
60  virtual real z(const real , const real , const real , const int=0, const real=0. ) = 0;
61  virtual real xz(const real , const real , const real , const int=0, const real=0. ) = 0;
62  virtual real yz(const real , const real , const real , const int=0, const real=0. ) = 0;
63  virtual real zz(const real , const real , const real , const int=0, const real=0. ) = 0;
64  virtual real xxx(const real , const real , const real , const int=0, const real=0. ) = 0;
65  virtual real xxxx(const real , const real , const real , const int=0, const real=0. ) = 0;
66  // obtain a general derivative
67  virtual real gd(const int & ntd, const int & nxd, const int & nyd, const int & nzd,
68  const real , const real , const real , const int=0, const real=0. ) = 0;
69 
70  virtual RealDistributedArray operator()(const MappedGrid & c, const Index & I1, const Index & I2,
71  const Index & I3, const Index & N) = 0;
72 
73  virtual RealDistributedArray operator()(const MappedGrid & c, const Index & I1, const Index & I2,
74  const Index & I3, const Index & N, const real t,
76 
77  virtual RealDistributedArray t(const MappedGrid & c, const Index & I1, const Index & I2,
78  const Index & I3, const Index & N, const real t=0.,
80  virtual RealDistributedArray x(const MappedGrid & c, const Index & I1, const Index & I2,
81  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
82  virtual RealDistributedArray y(const MappedGrid & c, const Index & I1, const Index & I2,
83  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
84  virtual RealDistributedArray z(const MappedGrid & c, const Index & I1, const Index & I2,
85  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
86  virtual RealDistributedArray xx(const MappedGrid & c, const Index & I1, const Index & I2,
87  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
88  virtual RealDistributedArray yy(const MappedGrid & c, const Index & I1, const Index & I2,
89  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
90  virtual RealDistributedArray zz(const MappedGrid & c, const Index & I1, const Index & I2,
91  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
92  virtual RealDistributedArray xy(const MappedGrid & c, const Index & I1, const Index & I2,
93  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
94  virtual RealDistributedArray xz(const MappedGrid & c, const Index & I1, const Index & I2,
95  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
96  virtual RealDistributedArray yz(const MappedGrid & c, const Index & I1, const Index & I2,
97  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
98 
99  virtual RealDistributedArray laplacian(const MappedGrid & c, const Index & I1, const Index & I2,
100  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
101 
102  virtual RealDistributedArray xxx(const MappedGrid & c, const Index & I1, const Index & I2,
103  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
104  virtual RealDistributedArray xxxx(const MappedGrid & c, const Index & I1, const Index & I2,
105  const Index & I3, const Index & N, const real t=0.,const GridFunctionParameters::GridFunctionType & centering=GridFunctionParameters::defaultCentering) = 0 ;
106 
107  virtual RealDistributedArray gd(const int & ntd, const int & nxd, const int & nyd, const int & nzd,
108  const MappedGrid & c, const Index & I1, const Index & I2,
109  const Index & I3, const Index & N, const real t=0.,
112 
113  realMappedGridFunction& gd( realMappedGridFunction & result, // put result here
114  const int & ntd, const int & nxd, const int & nyd, const int & nzd,
115  const Index & I1, const Index & I2,
116  const Index & I3, const Index & N,
117  const real t=0., int option =0 );
118 
119  // set result(J1,J2,J3,M) = exact(I1,I2,I3,N)
120  realMappedGridFunction& gd( realMappedGridFunction & result, // put result here
121  const int & ntd, const int & nxd, const int & nyd, const int & nzd,
122  const Index & I1, const Index & I2, const Index & I3, const Index & N,
123  const Index & J1, const Index & J2, const Index & J3, const Index & M,
124  const real t=0., int option =0 );
125 
126 
127 // Here are versions that only operate on serial arrays
128 virtual realSerialArray& gd( realSerialArray & result, // put result here
129  const realSerialArray & x, // coordinates to use if isRectangular==true
130  const int numberOfDimensions,
131  const bool isRectangular,
132  const int & ntd, const int & nxd, const int & nyd, const int & nzd,
133  const Index & I1, const Index & I2,
134  const Index & I3, const Index & N,
135  const real t=0., int option =0 ) = 0;
136 
137 // add this:
138 // virtual realSerialArray& gd( realSerialArray & result, // put result here
139 // const realSerialArray & x, // coordinates to use if isRectangular==true
140 // const int numberOfDimensions,
141 // const bool isRectangular,
142 // const int & ntd, const int & nxd, const int & nyd, const int & nzd,
143 // const Index & I1, const Index & I2,
144 // const Index & I3, const IntegerArray & uC, const IntegerArray & eC,
145 // const real t=0., int option =0 ) = 0;
146 
147 
148 
149  // ------------- These functions take an int for the component number -----
150  // (and call the above routines)
151 
152  RealDistributedArray operator()(const MappedGrid & c, const Index & I1, const Index & I2,
153  const Index & I3);
154  RealDistributedArray operator()(const MappedGrid & c, const Index & I1, const Index & I2,
155  const Index & I3, const int n);
156  RealDistributedArray operator()(const MappedGrid & c, const Index & I1, const Index & I2,
157  const Index & I3, const int n, const real t,
159  RealDistributedArray t(const MappedGrid & c, const Index & I1, const Index & I2,
160  const Index & I3, const int n=0, const real t=0.,
162  RealDistributedArray x(const MappedGrid & c, const Index & I1, const Index & I2,
163  const Index & I3, const int n=0, const real t=0.,
165  RealDistributedArray y(const MappedGrid & c, const Index & I1, const Index & I2,
166  const Index & I3, const int n=0, const real t=0.,
168  RealDistributedArray z(const MappedGrid & c, const Index & I1, const Index & I2,
169  const Index & I3, const int n=0, const real t=0.,
171  RealDistributedArray xx(const MappedGrid & c, const Index & I1, const Index & I2,
172  const Index & I3, const int n=0, const real t=0.,
174  RealDistributedArray yy(const MappedGrid & c, const Index & I1, const Index & I2,
175  const Index & I3, const int n=0, const real t=0.,
177  RealDistributedArray zz(const MappedGrid & c, const Index & I1, const Index & I2,
178  const Index & I3, const int n=0, const real t=0.,
180  RealDistributedArray xy(const MappedGrid & c, const Index & I1, const Index & I2,
181  const Index & I3, const int n=0, const real t=0.,
183  RealDistributedArray xz(const MappedGrid & c, const Index & I1, const Index & I2,
184  const Index & I3, const int n=0, const real t=0.,
186  RealDistributedArray yz(const MappedGrid & c, const Index & I1, const Index & I2,
187  const Index & I3, const int n=0, const real t=0.,
189 
190  RealDistributedArray laplacian(const MappedGrid & c, const Index & I1, const Index & I2,
191  const Index & I3, const int n=0, const real t=0.,
193 
194  RealDistributedArray xxx(const MappedGrid & c, const Index & I1, const Index & I2,
195  const Index & I3, const int n=0, const real t=0.,
197  RealDistributedArray xxxx(const MappedGrid & c, const Index & I1, const Index & I2,
198  const Index & I3, const int n=0, const real t=0.,
200 
201  RealDistributedArray gd(const int & ntd, const int & nxd, const int & nyd, const int & nzd,
202  const MappedGrid & c, const Index & I1, const Index & I2,
203  const Index & I3, const int n=0, const real t=0.,
205 
208  realCompositeGridFunction operator()(CompositeGrid & cg, const Index & N, const real t,
210  realCompositeGridFunction t(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
212  realCompositeGridFunction x(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
214  realCompositeGridFunction y(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
216  realCompositeGridFunction z(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
218  realCompositeGridFunction xx(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
220  realCompositeGridFunction xy(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
222  realCompositeGridFunction xz(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
224  realCompositeGridFunction yy(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
226  realCompositeGridFunction yz(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
228  realCompositeGridFunction zz(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
230 
231  realCompositeGridFunction laplacian(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
233 
234  realCompositeGridFunction xxx(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
236  realCompositeGridFunction xxxx(CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
238 
239  realCompositeGridFunction gd(const int & ntd, const int & nxd, const int & nyd, const int & nzd,
240  CompositeGrid & cg, const Index & N = nullIndex, const real t=0.,
243 
244 
245 
246 
247  //=================================================================================
248  // Assign a grid Function with values defined from the OGFunction f
249  //
250  //=================================================================================
252 
253  // ***** to add: *******************************************************************
254  // void assignGridFunction(realMappedGridFunction & v, const real t=0.);
255 
256  // utility routine:
258  const int & numberOfDimensions,
259  const MappedGrid & c,
260  const Index & I1, const Index & I2, const Index & I3,
264 
265 };
266 
267 #endif