src/Meshes/UniformCartesian.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  *
00007  * Visit http://people.web.psi.ch/adelmann/ for more details
00008  *
00009  ***************************************************************************/
00010 
00011 #ifndef UNIFORM_CARTESIAN_H
00012 #define UNIFORM_CARTESIAN_H
00013 
00014 // UniformCartesian.h
00015 // UniformCartesian class - represents uniform-spacing cartesian meshes.
00016 
00017 // include files
00018 #include "Meshes/Mesh.h"
00019 #include "Meshes/Centering.h"
00020 #include "Meshes/CartesianCentering.h"
00021 #include "AppTypes/Vektor.h"
00022 
00023 // forward declarations
00024 template<class T, unsigned D> class BareField;
00025 template<class T, unsigned D, class M, class C> class Field;
00026 template <unsigned Dim, class MFLOAT> class UniformCartesian;
00027 template <unsigned Dim, class MFLOAT>
00028 ostream& operator<<(ostream&, const UniformCartesian<Dim,MFLOAT>&);
00029 
00030 template <unsigned Dim, class MFLOAT=double>
00031 class UniformCartesian : public Mesh<Dim>
00032 {
00033 public: 
00034   //# public typedefs
00035   typedef Cell DefaultCentering;
00036   typedef MFLOAT MeshValue_t;
00037   typedef Vektor<MFLOAT,Dim> MeshVektor_t;
00038 
00039   // Default constructor (use initialize() to make valid)
00040   UniformCartesian()
00041   {
00042     hasSpacingFields = false;
00043   };  
00044   // Destructor
00045   ~UniformCartesian()
00046   {
00047     if (hasSpacingFields) {
00048       delete VertSpacings;
00049       delete CellSpacings;
00050       delete FlVert;
00051       delete FlCell;
00052     }
00053   }; 
00054 
00055   // Non-default constructors
00056   UniformCartesian(const NDIndex<Dim>& ndi);
00057   UniformCartesian(const Index& I);
00058   UniformCartesian(const Index& I, const Index& J);
00059   UniformCartesian(const Index& I, const Index& J, const Index& K);
00060   // These also take a MFLOAT* specifying the mesh spacings:
00061   UniformCartesian(const NDIndex<Dim>& ndi, MFLOAT* const delX);
00062   UniformCartesian(const Index& I, MFLOAT* const delX);
00063   UniformCartesian(const Index& I, const Index& J, MFLOAT* const delX);
00064   UniformCartesian(const Index& I, const Index& J, const Index& K,
00065                    MFLOAT* const delX);
00066   // These further take a Vektor<MFLOAT,Dim>& specifying the origin:
00067   UniformCartesian(const NDIndex<Dim>& ndi, MFLOAT* const delX,
00068                    const Vektor<MFLOAT,Dim>& orig);
00069   UniformCartesian(const Index& I, MFLOAT* const delX,
00070                    const Vektor<MFLOAT,Dim>& orig);
00071   UniformCartesian(const Index& I, const Index& J, MFLOAT* const delX,
00072                    const Vektor<MFLOAT,Dim>& orig);
00073   UniformCartesian(const Index& I, const Index& J, const Index& K,
00074                    MFLOAT* const delX, const Vektor<MFLOAT,Dim>& orig);
00075 
00076   // initialize functions
00077   void initialize(const NDIndex<Dim>& ndi);
00078   void initialize(const Index& I);
00079   void initialize(const Index& I, const Index& J);
00080   void initialize(const Index& I, const Index& J, const Index& K);
00081   // These also take a MFLOAT* specifying the mesh spacings:
00082   void initialize(const NDIndex<Dim>& ndi, MFLOAT* const delX);
00083   void initialize(const Index& I, MFLOAT* const delX);
00084   void initialize(const Index& I, const Index& J, MFLOAT* const delX);
00085   void initialize(const Index& I, const Index& J, const Index& K,
00086                   MFLOAT* const delX);
00087   // These further take a Vektor<MFLOAT,Dim>& specifying the origin:
00088   void initialize(const NDIndex<Dim>& ndi, MFLOAT* const delX,
00089                   const Vektor<MFLOAT,Dim>& orig);
00090   void initialize(const Index& I, MFLOAT* const delX,
00091                   const Vektor<MFLOAT,Dim>& orig);
00092   void initialize(const Index& I, const Index& J, MFLOAT* const delX,
00093                   const Vektor<MFLOAT,Dim>& orig);
00094   void initialize(const Index& I, const Index& J, const Index& K,
00095                   MFLOAT* const delX, const Vektor<MFLOAT,Dim>& orig);
00096 
00097 
00098 private:
00099 
00100   // Private member data:
00101   MFLOAT meshSpacing[Dim];   // delta-x, delta-y (>1D), delta-z (>2D)
00102   MFLOAT volume;             // Cell length(1D), area(2D), or volume (>2D)
00103   Vektor<MFLOAT,Dim> origin; // Origin of mesh coordinates (vertices)
00104   FieldLayout<Dim>* FlCell;  // Layouts for BareField* CellSpacings
00105   FieldLayout<Dim>* FlVert;  // Layouts for BareField* VertSpacings
00106 
00107   // Private member functions:
00108   void setup(); // Private function doing tasks common to all constructors.
00109   // Set only the derivative constants, using pre-set spacings:
00110   void set_Dvc();
00111 
00112 
00113 public: 
00114 
00115   // Public member data:
00116   unsigned gridSizes[Dim];        // Sizes (number of vertices)
00117   Vektor<MFLOAT,Dim> Dvc[1<<Dim]; // Constants for derivatives.
00118   bool hasSpacingFields;              // Flags allocation of the following:
00119   BareField<Vektor<MFLOAT,Dim>,Dim>* VertSpacings;
00120   BareField<Vektor<MFLOAT,Dim>,Dim>* CellSpacings;
00121 
00122   // Public member functions:
00123 
00124   // Create BareField's of vertex and cell spacings; allow for specifying 
00125   // layouts via the FieldLayout e_dim_tag and vnodes parameters (these
00126   // get passed in to construct the FieldLayout used to construct the
00127   // BareField's).
00128   void storeSpacingFields(); // Default; will have default layout
00129   // Special cases for 1-3 dimensions, ala FieldLayout ctors:
00130   void storeSpacingFields(e_dim_tag p1, int vnodes=-1);
00131   void storeSpacingFields(e_dim_tag p1, e_dim_tag p2, int vnodes=-1);
00132   void storeSpacingFields(e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, 
00133                           int vnodes=-1);
00134   // Next we have one for arbitrary dimension, ala FieldLayout ctor:
00135   // All the others call this one internally:
00136   void storeSpacingFields(e_dim_tag *p, int vnodes=-1);
00137 
00138   // These specify both the total number of vnodes and the numbers of vnodes
00139   // along each dimension for the partitioning of the index space. Obviously
00140   // this restricts the number of vnodes to be a product of the numbers along
00141   // each dimension (the constructor implementation checks this): Special
00142   // cases for 1-3 dimensions, ala FieldLayout ctors (see FieldLayout.h for
00143   // more relevant comments, including definition of recurse):
00144   void storeSpacingFields(e_dim_tag p1,
00145                           unsigned vnodes1,
00146                           bool recurse=false,
00147                           int vnodes=-1);
00148   void storeSpacingFields(e_dim_tag p1, e_dim_tag p2,
00149                           unsigned vnodes1, unsigned vnodes2,
00150                           bool recurse=false,int vnodes=-1);
00151   void storeSpacingFields(e_dim_tag p1, e_dim_tag p2, e_dim_tag p3,
00152                           unsigned vnodes1, unsigned vnodes2, unsigned vnodes3,
00153                           bool recurse=false, int vnodes=-1);
00154   // Next we have one for arbitrary dimension, ala FieldLayout ctor:
00155   // All the others call this one internally:
00156   void storeSpacingFields(e_dim_tag *p, 
00157                           unsigned* vnodesPerDirection, 
00158                           bool recurse=false, int vnodes=-1);
00159 
00160   // Accessor functions for member data:
00161   // Get the origin of mesh vertex positions:
00162   Vektor<MFLOAT,Dim> get_origin() const;
00163   // Get the spacings of mesh vertex positions along specified direction:
00164   MFLOAT get_meshSpacing(unsigned d) const;
00165   // Get the cell volume:
00166   MFLOAT get_volume() const;
00167 
00168   // Set functions for member data:
00169   // Set the origin of mesh vertex positions:
00170   void set_origin(const Vektor<MFLOAT,Dim>& o); 
00171   // Set the spacings of mesh vertex positions (recompute Dvc, cell volume):
00172   void set_meshSpacing(MFLOAT* const del);
00173 
00174   // Formatted output of UniformCartesian object:
00175   void print(ostream&);
00176 
00177   //----Other UniformCartesian methods:----------------------------------------
00178   // Volume of single cell indexed by input NDIndex;
00179   MFLOAT getCellVolume(const NDIndex<Dim>&) const;
00180   // Field of volumes of all cells:
00181   Field<MFLOAT,Dim,UniformCartesian<Dim,MFLOAT>,Cell>&
00182   getCellVolumeField(Field<MFLOAT,Dim,UniformCartesian<Dim,MFLOAT>,Cell>&) const;
00183   // Volume of range of cells bounded by verticies specified by input NDIndex:
00184   MFLOAT getVertRangeVolume(const NDIndex<Dim>&) const;
00185   // Volume of range of cells spanned by input NDIndex (index of cells):
00186   MFLOAT getCellRangeVolume(const NDIndex<Dim>&) const;
00187   // Nearest vertex index to (x,y,z):
00188   NDIndex<Dim> getNearestVertex(const Vektor<MFLOAT,Dim>&) const;
00189   // Nearest vertex index with all vertex coordinates below (x,y,z):
00190   NDIndex<Dim> getVertexBelow(const Vektor<MFLOAT,Dim>&) const;
00191   // NDIndex for cell in cell-ctrd Field containing the point (x,y,z):
00192   inline
00193   NDIndex<Dim> getCellContaining(const Vektor<MFLOAT,Dim>& x) const
00194   {
00195     return getVertexBelow(x); // I think these functions are identical. -tjw
00196   }
00197   // (x,y,z) coordinates of indexed vertex:
00198   Vektor<MFLOAT,Dim> getVertexPosition(const NDIndex<Dim>&) const;
00199   // Field of (x,y,z) coordinates of all vertices:
00200   Field<Vektor<MFLOAT,Dim>,Dim,UniformCartesian<Dim,MFLOAT>,Vert>& 
00201   getVertexPositionField(Field<Vektor<MFLOAT,Dim>,Dim,
00202                          UniformCartesian<Dim,MFLOAT>,Vert>& ) const;
00203   // (x,y,z) coordinates of indexed cell:
00204   Vektor<MFLOAT,Dim> getCellPosition(const NDIndex<Dim>&) const;
00205   // Field of (x,y,z) coordinates of all cells:
00206   Field<Vektor<MFLOAT,Dim>,Dim,UniformCartesian<Dim,MFLOAT>,Cell>& 
00207   getCellPositionField(Field<Vektor<MFLOAT,Dim>,Dim,
00208                        UniformCartesian<Dim,MFLOAT>,Cell>& ) const;
00209   // Vertex-vertex grid spacing of indexed cell:
00210   Vektor<MFLOAT,Dim> getDeltaVertex(const NDIndex<Dim>&) const;
00211   // Field of vertex-vertex grid spacings of all cells:
00212   Field<Vektor<MFLOAT,Dim>,Dim,UniformCartesian<Dim,MFLOAT>,Cell>&
00213   getDeltaVertexField(Field<Vektor<MFLOAT,Dim>,Dim,
00214                       UniformCartesian<Dim,MFLOAT>,Cell>& ) const;
00215   // Cell-cell grid spacing of indexed vertex:
00216   Vektor<MFLOAT,Dim> getDeltaCell(const NDIndex<Dim>&) const;
00217   // Field of cell-cell grid spacings of all vertices:
00218   Field<Vektor<MFLOAT,Dim>,Dim,UniformCartesian<Dim,MFLOAT>,Vert>&
00219   getDeltaCellField(Field<Vektor<MFLOAT,Dim>,Dim,
00220                     UniformCartesian<Dim,MFLOAT>,Vert>& ) const;
00221   // Array of surface normals to cells adjoining indexed cell:
00222   Vektor<MFLOAT,Dim>* getSurfaceNormals(const NDIndex<Dim>&) const;
00223   // Array of (pointers to) Fields of surface normals to all cells:
00224   void getSurfaceNormalFields(Field<Vektor<MFLOAT,Dim>,Dim,
00225                               UniformCartesian<Dim,MFLOAT>,Cell>** ) const;
00226   // Similar functions, but specify the surface normal to a single face, using
00227   // the following numbering convention: 0 means low face of 1st dim, 1 means
00228   // high face of 1st dim, 2 means low face of 2nd dim, 3 means high face of 
00229   // 2nd dim, and so on:
00230   Vektor<MFLOAT,Dim> getSurfaceNormal(const NDIndex<Dim>&, unsigned) const;
00231   Field<Vektor<MFLOAT,Dim>,Dim,UniformCartesian<Dim,MFLOAT>,Cell>& 
00232   getSurfaceNormalField(Field<Vektor<MFLOAT,Dim>,Dim,
00233                         UniformCartesian<Dim,MFLOAT>,Cell>&, unsigned) const;
00234 
00235 };
00236 
00237 // I/O
00238 
00239 // Stream formatted output of UniformCartesian object:
00240 template< unsigned Dim, class MFLOAT >
00241 inline
00242 ostream& operator<<(ostream& out, const UniformCartesian<Dim,MFLOAT>& mesh)
00243 {
00244   UniformCartesian<Dim,MFLOAT>& ncmesh =
00245     const_cast<UniformCartesian<Dim,MFLOAT>&>(mesh);
00246   ncmesh.print(out);
00247   return out;
00248 }
00249 
00250 //*****************************************************************************
00251 // Stuff taken from old Cartesian.h, which now applies to UniformCartesian:
00252 //*****************************************************************************
00253 
00254 #ifndef CARTESIAN_STENCIL_SETUP_H
00255 #include "Meshes/CartesianStencilSetup.h"
00256 #endif
00257 
00258 //----------------------------------------------------------------------
00259 //
00260 //
00261 // Definitions of stencils.
00262 //
00263 // For each one we have first we have the user level function that takes 
00264 // a Field argument and returns an expression template.  
00265 // This is the thing the user code sees.
00266 // These could use some asserts to make sure the Fields have 
00267 // enough guard cells.
00268 //
00269 // Then we have the 'apply' function that gets used in the inner loop
00270 // when evaluating the expression.  This would be better done as a
00271 // member function of the tags above, but that would require member
00272 // function templates, which we are holding off on for now.
00273 //
00274 //----------------------------------------------------------------------
00275 
00276 //----------------------------------------------------------------------
00277 //
00278 // Divergence Vert->Cell
00279 //
00280 // First is the user function for any dimension and element types.
00281 // it returns a unary element type.
00282 //
00283 //----------------------------------------------------------------------
00284 #ifdef UNDEFINED
00285 //
00286 // T1: The element type for the Field
00287 // T2: The data type for the UniformCartesian mesh
00288 // Dim: the dimension of the Field and the Mesh.
00289 //
00290 template<class T1, class T2, unsigned Dim>
00291 // Return a PETE_Expr wrapper on a StencilElem.
00292 inline PETE_Expr<StencilElem<
00293   // The iterator for the expression element
00294   Field<T1,Dim,UniformCartesian<Dim,T2>,Vert>::iterator,
00295   // The operator for the expression element.
00296   CenteredDivergence<Dim,UniformCartesian<Dim,T2>,Vert,Cell>
00297 > >
00298 Div( Field< T1 , Dim , UniformCartesian<Dim,T2> , Vert >& x)
00299 {
00300   // Some typedefs to make the return expression easier.
00301   typedef Field<T1,Dim,UniformCartesian<Dim,T2>,Vert>::iterator A;
00302   typedef CenteredDivergence<Dim,UniformCartesian<Dim,T2>,Vert,Cell> Op_t;
00303   typedef StencilElem<A,Op_t> Elem_t;
00304   // Return the expression element.
00305   return PETE_Expr<Elem_t>( Elem_t(x.begin() ) );
00306 }
00307 
00308 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00309 // NOTE: this all doesn't work now because the mesh classes are 
00310 // no longer static, so things like Mesh::Dvc are wrong. For new Cartesian
00311 // class, rather than this UniformCartesian class, Dvc is also now an array
00312 // of arrays instead of just an array. Steve K. says he will rework all this
00313 // later. For now, the non-stencil-expression version of Div(), etc. 
00314 // are okay. Comment out everything between "REIMPLEMENT..."
00315 // --Tim Williams 2/25/97
00316 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00317 
00318 /* REIMPLEMENT THIS LATER (BEGIN COMMENTED-OUT REGION)
00319 //----------------------------------------------------------------------
00320 //
00321 // Next are the elementwise 'apply' functions for Vert->Cell.
00322 // These need to be specialized on dimension, but they are still
00323 // for arbitrary element type.
00324 //
00325 // For each of these:
00326 //
00327 // A: The iterator type.
00328 // a: The instance of the iterator being passed in.
00329 // T2: The base type for the Mesh data.
00330 //
00331 //----------------------------------------------------------------------
00332 
00333 template<class A, class T2>
00334 inline
00335 UnaryReturn<Divergence<1>, A::return_type>::type
00336 apply(CenteredDivergence<1,UniformCartesian<1,T2>,Vert,Cell>, A a, int i,int,int)
00337 {
00338   typedef UniformCartesian<1,T2> Mesh;
00339   return
00340     dot(a.offset( i ),Mesh::Dvc[0]) +
00341     dot(a.offset(i+1),Mesh::Dvc[1]);
00342 }
00343 
00344 template<class A, class T2>
00345 inline
00346 UnaryReturn<Divergence<2>, A::return_type>::type
00347 apply(CenteredDivergence<2,UniformCartesian<2,T2>,Vert,Cell>, A a, int i,int j,int)
00348 {
00349   typedef UniformCartesian<2,T2> Mesh;
00350   return
00351     dot(a.offset( i , j ),Mesh::Dvc[0]) +
00352     dot(a.offset(i+1, j ),Mesh::Dvc[1]) +
00353     dot(a.offset( i ,j+1),Mesh::Dvc[2]) +
00354     dot(a.offset(i+1,j+1),Mesh::Dvc[3]);
00355 }
00356 
00357 template<class A, class T2>
00358 inline
00359 UnaryReturn<Divergence<3>, A::return_type>::type
00360 apply(CenteredDivergence<3,UniformCartesian<3,T2>,Vert,Cell>, A a, int i,int j,int k)
00361 {
00362   typedef UniformCartesian<3,T2> Mesh;
00363   return
00364     dot(a.offset( i , j , k ),Mesh::Dvc[0]) +
00365     dot(a.offset(i+1, j , k ),Mesh::Dvc[1]) +
00366     dot(a.offset( i ,j+1, k ),Mesh::Dvc[2]) +
00367     dot(a.offset(i+1,j+1, k ),Mesh::Dvc[3]) +
00368     dot(a.offset( i , j ,k+1),Mesh::Dvc[4]) +
00369     dot(a.offset(i+1, j ,k+1),Mesh::Dvc[5]) +
00370     dot(a.offset( i ,j+1,k+1),Mesh::Dvc[6]) +
00371     dot(a.offset(i+1,j+1,k+1),Mesh::Dvc[7]);
00372 }
00373 
00374 //----------------------------------------------------------------------
00375 //
00376 // Divergence Cell->Vert
00377 //
00378 // First is the user function for any dimension and element types.
00379 // it returns a stencil element type.
00380 //
00381 //----------------------------------------------------------------------
00382 
00383 //
00384 // T1: The element type for the Field.
00385 // T2: The base type for the mesh.
00386 // Dim: The dimension of the Field and the mesh.
00387 //
00388 template<class T1, class T2, unsigned Dim>
00389 // Return a PETE_Expr wrapped around a StencilElem.
00390 inline PETE_Expr<StencilElem<
00391   // The iterator for the expression.
00392   Field<T1,Dim,UniformCartesian<Dim,T2>,Cell>::iterator,
00393   // The operator tag.
00394   CenteredDivergence<Dim,UniformCartesian<Dim,T2>,Cell,Vert>
00395 > >
00396 // The function signature is way down here.
00397 Div( Field< T1 , Dim , UniformCartesian<Dim,T2> , Cell >& x)
00398 {
00399   // Some typedefs to make this a little easier to read.
00400   typedef CenteredDivergence<Dim,UniformCartesian<Dim,T2>,Cell,Vert> Op_t;
00401   typedef Field<T1,Dim,UniformCartesian<Dim,T2>,Cell>::iterator A;
00402   typedef StencilElem<A,Op_t> Elem_t;
00403   // Build and return the expression element.
00404   return PETE_Expr<Elem_t>( Elem_t(x.begin() ) );
00405 }
00406 
00407 //----------------------------------------------------------------------
00408 //
00409 // Next are the elementwise 'apply' functions for Cell->Vert.
00410 // These need to be specialized on dimension, but they are still
00411 // for arbitrary element type.
00412 //
00413 // For each of these:
00414 //
00415 // A: The iterator type.
00416 // a: The instance of the iterator being passed in.
00417 // T2: The base type for the Mesh data.
00418 //
00419 //----------------------------------------------------------------------
00420 
00421 template<class A, class T2>
00422 inline
00423 UnaryReturn<Divergence<1>, A::return_type>::type
00424 apply(CenteredDivergence<1,UniformCartesian<1,T2>,Cell,Vert>, A a)
00425 {
00426   typedef UniformCartesian<1,T2> Mesh;
00427   return
00428     dot(a.offset(-1),Mesh::Dvc[0]) +
00429     dot(a.offset( 0),Mesh::Dvc[1]);
00430 }
00431 
00432 template<class A, class T2>
00433 inline
00434 UnaryReturn<Divergence<1>, A::return_type>::type
00435 apply(CenteredDivergence<1,UniformCartesian<1,T2>,Cell,Vert>, A a,int i,int,int)
00436 {
00437   typedef UniformCartesian<1,T2> Mesh;
00438   return
00439     dot(a.offset(i-1),Mesh::Dvc[0]) +
00440     dot(a.offset( i ),Mesh::Dvc[1]);
00441 }
00442 
00443 template<class A, class T2>
00444 inline
00445 UnaryReturn<Divergence<2>, A::return_type>::type
00446 apply(CenteredDivergence<2,UniformCartesian<2,T2>,Cell,Vert>, A a, int i,int j,int)
00447 {
00448   typedef UniformCartesian<2,T2> Mesh;
00449   return
00450     dot(a.offset(i-1,j-1),Mesh::Dvc[0]) +
00451     dot(a.offset( i ,j-1),Mesh::Dvc[1]) +
00452     dot(a.offset(i-1, j ),Mesh::Dvc[2]) +
00453     dot(a.offset( i , j ),Mesh::Dvc[3]);
00454 }
00455 
00456 template<class A, class T2>
00457 inline
00458 UnaryReturn<Divergence<3>, A::return_type>::type
00459 apply(CenteredDivergence<3,UniformCartesian<3,T2>,Cell,Vert>, A a, int i,int j,int k)
00460 {
00461   typedef UniformCartesian<3,T2> Mesh;
00462   return
00463     dot(a.offset(i-1,j-1,k-1),Mesh::Dvc[0]) +
00464     dot(a.offset( i ,j-1,k-1),Mesh::Dvc[1]) +
00465     dot(a.offset(i-1, j ,k-1),Mesh::Dvc[2]) +
00466     dot(a.offset( i , j ,k-1),Mesh::Dvc[3]) +
00467     dot(a.offset(i-1,j-1, k ),Mesh::Dvc[4]) +
00468     dot(a.offset( i ,j-1, k ),Mesh::Dvc[5]) +
00469     dot(a.offset(i-1, j , k ),Mesh::Dvc[6]) +
00470     dot(a.offset( i , j , k ),Mesh::Dvc[7]);
00471 }
00472 REIMPLEMENT THIS LATER (BEGIN COMMENTED-OUT END) */
00473 #endif
00474 
00476 //
00477 // Here are the old style definitions.
00478 //
00480 
00481 //----------------------------------------------------------------------
00482 // Divergence Vektor/Vert -> Scalar/Cell
00483 //----------------------------------------------------------------------
00484 template < class T, class MFLOAT >
00485 Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00486 Div(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00487     Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00488 //----------------------------------------------------------------------
00489 template < class T, class MFLOAT >
00490 Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00491 Div(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00492     Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00493 //----------------------------------------------------------------------
00494 template < class T, class MFLOAT >
00495 Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00496 Div(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00497     Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00498 //----------------------------------------------------------------------
00499 // Divergence Vektor/Cell -> Scalar/Vert
00500 //----------------------------------------------------------------------
00501 template < class T, class MFLOAT >
00502 Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00503 Div(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00504     Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00505 //----------------------------------------------------------------------
00506 template < class T, class MFLOAT >
00507 Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00508 Div(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00509     Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00510 //----------------------------------------------------------------------
00511 template < class T, class MFLOAT >
00512 Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00513 Div(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00514     Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00515 //----------------------------------------------------------------------
00516 // Divergence Vektor/Vert -> Scalar/Vert
00517 //----------------------------------------------------------------------
00518 template < class T, class MFLOAT >
00519 Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00520 Div(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00521     Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00522 //----------------------------------------------------------------------
00523 template < class T, class MFLOAT >
00524 Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00525 Div(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00526     Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00527 //----------------------------------------------------------------------
00528 template < class T, class MFLOAT >
00529 Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00530 Div(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00531     Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00532 //----------------------------------------------------------------------
00533 // Divergence Vektor/Cell -> Scalar/Cell
00534 //----------------------------------------------------------------------
00535 template < class T, class MFLOAT >
00536 Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00537 Div(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00538     Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00539 //----------------------------------------------------------------------
00540 template < class T, class MFLOAT >
00541 Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00542 Div(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00543     Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00544 //----------------------------------------------------------------------
00545 template < class T, class MFLOAT >
00546 Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00547 Div(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00548     Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00549 //----------------------------------------------------------------------
00550 // Divergence Tenzor/Vert -> Vektor/Cell
00551 //----------------------------------------------------------------------
00552 template < class T, class MFLOAT >
00553 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00554 Div(Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00555     Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00556 //----------------------------------------------------------------------
00557 template < class T, class MFLOAT >
00558 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00559 Div(Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00560     Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00561 //----------------------------------------------------------------------
00562 template < class T, class MFLOAT >
00563 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00564 Div(Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00565     Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00566 //----------------------------------------------------------------------
00567 // Divergence Tenzor/Cell -> Vektor/Vert
00568 //----------------------------------------------------------------------
00569 template < class T, class MFLOAT >
00570 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00571 Div(Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00572     Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00573 //----------------------------------------------------------------------
00574 template < class T, class MFLOAT >
00575 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00576 Div(Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00577     Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00578 //----------------------------------------------------------------------
00579 template < class T, class MFLOAT >
00580 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00581 Div(Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00582     Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00583 
00584 //----------------------------------------------------------------------
00585 // Grad Scalar/Vert -> Vektor/Cell
00586 //----------------------------------------------------------------------
00587 template < class T, class MFLOAT >
00588 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00589 Grad(Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00590      Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00591 //----------------------------------------------------------------------
00592 template < class T, class MFLOAT >
00593 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00594 Grad(Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00595      Field<Vektor<T,2u>,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00596 //----------------------------------------------------------------------
00597 template < class T, class MFLOAT >
00598 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00599 Grad(Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00600      Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00601 //----------------------------------------------------------------------
00602 // Grad Scalar/Cell -> Vektor/Vert
00603 //----------------------------------------------------------------------
00604 template < class T, class MFLOAT >
00605 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00606 Grad(Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00607      Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00608 //----------------------------------------------------------------------
00609 template < class T, class MFLOAT >
00610 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00611 Grad(Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00612      Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00613 //----------------------------------------------------------------------
00614 template < class T, class MFLOAT >
00615 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00616 Grad(Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00617      Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00618 //----------------------------------------------------------------------
00619 // Grad Scalar/Vert -> Vektor/Vert
00620 //----------------------------------------------------------------------
00621 template < class T, class MFLOAT >
00622 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00623 Grad(Field<T,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00624      Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00625 //----------------------------------------------------------------------
00626 template < class T, class MFLOAT >
00627 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00628 Grad(Field<T,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00629      Field<Vektor<T,2u>,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00630 //----------------------------------------------------------------------
00631 template < class T, class MFLOAT >
00632 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00633 Grad(Field<T,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00634      Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00635 //----------------------------------------------------------------------
00636 // Grad Scalar/Cell -> Vektor/Cell
00637 //----------------------------------------------------------------------
00638 template < class T, class MFLOAT >
00639 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00640 Grad(Field<T,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00641      Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00642 //----------------------------------------------------------------------
00643 template < class T, class MFLOAT >
00644 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00645 Grad(Field<T,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00646      Field<Vektor<T,2u>,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00647 //----------------------------------------------------------------------
00648 template < class T, class MFLOAT >
00649 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00650 Grad(Field<T,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00651      Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00652 //----------------------------------------------------------------------
00653 // Grad Vektor/Vert -> Tenzor/Cell
00654 //----------------------------------------------------------------------
00655 template < class T, class MFLOAT >
00656 Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00657 Grad(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00658      Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& r);
00659 //----------------------------------------------------------------------
00660 template < class T, class MFLOAT >
00661 Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00662 Grad(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00663      Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00664 //----------------------------------------------------------------------
00665 template < class T, class MFLOAT >
00666 Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00667 Grad(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00668      Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00669 //----------------------------------------------------------------------
00670 // Grad Vektor/Cell -> Tenzor/Vert
00671 //----------------------------------------------------------------------
00672 template < class T, class MFLOAT >
00673 Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00674 Grad(Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00675      Field<Tenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00676 //----------------------------------------------------------------------
00677 template < class T, class MFLOAT >
00678 Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00679 Grad(Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00680      Field<Tenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00681 //----------------------------------------------------------------------
00682 template < class T, class MFLOAT >
00683 Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00684 Grad(Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00685      Field<Tenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00686 //----------------------------------------------------------------------
00687 // Divergence SymTenzor/Vert -> Vektor/Cell
00688 //----------------------------------------------------------------------
00689 //----------------------------------------------------------------------
00690 template < class T, class MFLOAT >
00691 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00692 Div(Field<SymTenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00693     Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00694 //----------------------------------------------------------------------
00695 template < class T, class MFLOAT >
00696 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00697 Div(Field<SymTenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00698     Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00699 //----------------------------------------------------------------------
00700 // Divergence SymTenzor/Cell -> Vektor/Vert
00701 //----------------------------------------------------------------------
00702 template < class T, class MFLOAT >
00703 Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00704 Div(Field<SymTenzor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00705     Field<Vektor<T,1U>,1U,UniformCartesian<1U,MFLOAT>,Vert>& r);
00706 //----------------------------------------------------------------------
00707 template < class T, class MFLOAT >
00708 Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00709 Div(Field<SymTenzor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00710     Field<Vektor<T,2U>,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00711 //----------------------------------------------------------------------
00712 template < class T, class MFLOAT >
00713 Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00714 Div(Field<SymTenzor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00715     Field<Vektor<T,3U>,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00716 //----------------------------------------------------------------------
00717 // Weighted average Cell to Vert
00718 //----------------------------------------------------------------------
00719 template < class T1, class T2, class MFLOAT >
00720 Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00721 Average(Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00722         Field<T2,1U,UniformCartesian<1U,MFLOAT>,Cell>& w, 
00723         Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& r) ;
00724 //----------------------------------------------------------------------
00725 template < class T1, class T2, class MFLOAT >
00726 Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00727 Average(Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00728         Field<T2,2U,UniformCartesian<2U,MFLOAT>,Cell>& w, 
00729         Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00730 //----------------------------------------------------------------------
00731 template < class T1, class T2, class MFLOAT >
00732 Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00733 Average(Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00734         Field<T2,3U,UniformCartesian<3U,MFLOAT>,Cell>& w, 
00735         Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00736 
00737 //----------------------------------------------------------------------
00738 // Weighted average Vert to Cell
00739 //----------------------------------------------------------------------
00740 template < class T1, class T2, class MFLOAT >
00741 Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00742 Average(Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00743         Field<T2,1U,UniformCartesian<1U,MFLOAT>,Vert>& w, 
00744         Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& r) ;
00745 //----------------------------------------------------------------------
00746 template < class T1, class T2, class MFLOAT >
00747 Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00748 Average(Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00749         Field<T2,2U,UniformCartesian<2U,MFLOAT>,Vert>& w, 
00750         Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00751 //----------------------------------------------------------------------
00752 template < class T1, class T2, class MFLOAT >
00753 Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00754 Average(Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00755         Field<T2,3U,UniformCartesian<3U,MFLOAT>,Vert>& w, 
00756         Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00757 
00758 //----------------------------------------------------------------------
00759 
00760 //----------------------------------------------------------------------
00761 // Unweighted average Cell to Vert
00762 //----------------------------------------------------------------------
00763 template < class T1, class MFLOAT >
00764 Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& 
00765 Average(Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& x, 
00766         Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& r) ;
00767 //----------------------------------------------------------------------
00768 template < class T1, class MFLOAT >
00769 Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& 
00770 Average(Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& x, 
00771         Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& r);
00772 //----------------------------------------------------------------------
00773 template < class T1, class MFLOAT >
00774 Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& 
00775 Average(Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& x, 
00776         Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& r);
00777 
00778 //----------------------------------------------------------------------
00779 // Unweighted average Vert to Cell
00780 //----------------------------------------------------------------------
00781 template < class T1, class MFLOAT >
00782 Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& 
00783 Average(Field<T1,1U,UniformCartesian<1U,MFLOAT>,Vert>& x, 
00784         Field<T1,1U,UniformCartesian<1U,MFLOAT>,Cell>& r) ;
00785 //----------------------------------------------------------------------
00786 template < class T1, class MFLOAT >
00787 Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& 
00788 Average(Field<T1,2U,UniformCartesian<2U,MFLOAT>,Vert>& x, 
00789         Field<T1,2U,UniformCartesian<2U,MFLOAT>,Cell>& r);
00790 //----------------------------------------------------------------------
00791 template < class T1, class MFLOAT >
00792 Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& 
00793 Average(Field<T1,3U,UniformCartesian<3U,MFLOAT>,Vert>& x, 
00794         Field<T1,3U,UniformCartesian<3U,MFLOAT>,Cell>& r);
00795 
00796 //----------------------------------------------------------------------
00797 
00798 #include "Meshes/UniformCartesian.cpp"
00799 
00800 #endif // UNIFORM_CARTESIAN_H
00801 
00802 /***************************************************************************
00803  * $RCSfile: UniformCartesian.h,v $   $Author: adelmann $
00804  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:28 $
00805  * IPPL_VERSION_ID: $Id: UniformCartesian.h,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $ 
00806  ***************************************************************************/

Generated on Mon Jan 16 13:23:51 2006 for IPPL by  doxygen 1.4.6