src/FieldLayout/CenteredFieldLayout.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  * This program was prepared by PSI. 
00007  * All rights in the program are reserved by PSI.
00008  * Neither PSI nor the author(s)
00009  * makes any warranty, express or implied, or assumes any liability or
00010  * responsibility for the use of this software
00011  *
00012  * Visit http://www.acl.lanl.gov/POOMS for more details
00013  *
00014  ***************************************************************************/
00015 
00016 // -*- C++ -*-
00017 /***************************************************************************
00018  *
00019  * The IPPL Framework
00020  * 
00021  *
00022  * Visit http://people.web.psi.ch/adelmann/ for more details
00023  *
00024  ***************************************************************************/
00025 
00026 
00027 // include files
00028 #include "FieldLayout/CenteredFieldLayout.h"
00029 #include "Meshes/Centering.h"
00030 #include "Meshes/CartesianCentering.h"
00031 #include "Utility/PAssert.h"
00032 #include "Profile/Profiler.h"
00033 
00034 //=============================================================================
00035 // Helper global functions:
00036 // The constructors call these specialized global functions as a workaround for
00037 // lack of partial specialization:
00038 //=============================================================================
00039 
00040 //===========================Arbitrary mesh type=============================
00041 
00042 //-----------------------------------------------------------------------------
00043 // These specify only a total number of vnodes, allowing the constructor
00044 // complete control on how to do the vnode partitioning of the index space:
00045 // Constructor for arbitrary dimension with parallel/serial specifier array:
00046 
00047 //------------------Cell centering---------------------------------------------
00048 template<unsigned Dim, class Mesh>
00049 inline void
00050 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Cell> & cfl,
00051                    const Mesh& mesh, 
00052                    e_dim_tag* edt, 
00053                    int vnodes)
00054 {
00055   NDIndex<Dim> ndi;
00056   for (int d=0; d<Dim; d++) 
00057     ndi[d] = Index(mesh.gridSizes[d] - 1);
00058   cfl.initialize(ndi, edt, vnodes);
00059 }
00060 
00061 //------------------Vert centering---------------------------------------------
00062 template<unsigned Dim, class Mesh>
00063 inline void
00064 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Vert> & cfl,
00065                    const Mesh& mesh, 
00066                    e_dim_tag* edt, 
00067                    int vnodes)
00068 {
00069   NDIndex<Dim> ndi;
00070   for (int d=0; d<Dim; d++) 
00071     ndi[d] = Index(mesh.gridSizes[d]);
00072   cfl.initialize(ndi, edt, vnodes);
00073 }
00074 
00075 //------------------CartesianCentering centering-------------------------------
00076 template<const CenteringEnum* CE, unsigned Dim, class Mesh,
00077          unsigned NComponents>
00078 inline void
00079 centeredInitialize(CenteredFieldLayout<Dim,Mesh,
00080                    CartesianCentering<CE,Dim,NComponents> > & cfl,
00081                    const Mesh& mesh, 
00082                    e_dim_tag* edt, 
00083                    int vnodes)
00084 {
00085   NDIndex<Dim> ndi;
00086   // For componentwise layout of Field of multicomponent object, like 
00087   // Field<Vektor...>, allow for maximal number of objects needed per
00088   // dimension (the number for the object component requiring the maximal
00089   // number):
00090   unsigned npts[Dim], nGridPts;
00091   int d, c;
00092   for (d=0; d<Dim; d++) {
00093     nGridPts = mesh.gridSizes[d];
00094     npts[d] = 0;
00095     for (c=0; c<NComponents; c++) {
00096       if (CE[c + d*NComponents] == CELL) {
00097         npts[d] = max(npts[d], (nGridPts - 1));
00098       } else {
00099         npts[d] = max(npts[d], nGridPts);
00100       }
00101     }
00102   }
00103   for (d=0; d<Dim; d++) ndi[d] = Index(npts[d]);
00104   cfl.initialize(ndi, edt, vnodes);
00105 }
00106 
00107 //-----------------------------------------------------------------------------
00108 
00109 //-----------------------------------------------------------------------------
00110 // These specify both the total number of vnodes and the numbers of vnodes
00111 // along each dimension for the partitioning of the index space. Obviously this
00112 // restricts the number of vnodes to be a product of the numbers along each
00113 // dimension (the constructor implementation checks this):
00114 
00115 //------------------Cell centering---------------------------------------------
00116 template<unsigned Dim, class Mesh>
00117 inline void
00118 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Cell> & cfl,
00119                    const Mesh& mesh, 
00120                    e_dim_tag* edt, 
00121                    unsigned* vnodesAlongDirection, 
00122                    bool recurse,
00123                    int vnodes)
00124 {
00125   NDIndex<Dim> ndi;
00126   for (int d=0; d<Dim; d++) ndi[d] = Index(mesh.gridSizes[d] - 1);
00127   cfl.initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
00128 }
00129 
00130 //------------------Vert centering---------------------------------------------
00131 template<unsigned Dim, class Mesh>
00132 inline void
00133 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Vert> & cfl,
00134                    const Mesh& mesh, 
00135                    e_dim_tag* edt, 
00136                    unsigned* vnodesAlongDirection, 
00137                    bool recurse,
00138                    int vnodes)
00139 {
00140   NDIndex<Dim> ndi;
00141   for (int d=0; d<Dim; d++) ndi[d] = Index(mesh.gridSizes[d]);
00142   cfl.initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
00143 }
00144 
00145 //------------------CartesianCentering centering-------------------------------
00146 template<const CenteringEnum* CE, unsigned Dim, class Mesh,
00147          unsigned NComponents>
00148 inline void
00149 centeredInitialize(CenteredFieldLayout<Dim,Mesh,
00150                    CartesianCentering<CE,Dim,NComponents> > & cfl,
00151                    const Mesh& mesh, 
00152                    e_dim_tag* edt, 
00153                    unsigned* vnodesAlongDirection, 
00154                    bool recurse,
00155                    int vnodes)
00156 {
00157   NDIndex<Dim> ndi;
00158   // For componentwise layout of Field of multicomponent object, like 
00159   // Field<Vektor...>, allow for maximal number of objects needed per
00160   // dimension (the number for the object component requiring the maximal
00161   // number):
00162   unsigned npts[Dim], nGridPts;
00163   int d, c;
00164   for (d=0; d<Dim; d++) {
00165     nGridPts = mesh.gridSizes[d];
00166     npts[d] = 0;
00167     for (c=0; c<NComponents; c++) {
00168       if (CE[c + d*NComponents] == CELL) {
00169         npts[d] = max(npts[d], (nGridPts - 1));
00170       } else {
00171         npts[d] = max(npts[d], nGridPts);
00172       }
00173     }
00174   }
00175   for (d=0; d<Dim; d++) ndi[d] = Index(npts[d]);
00176   cfl.initialize(ndi, edt, vnodesAlongDirection, recurse, vnodes);
00177 }
00178 
00179 //-----------------------------------------------------------------------------
00180 // This initializer just specifies a completely user-provided partitioning.
00181 
00182 //------------------Cell centering---------------------------------------------
00183 template<unsigned Dim, class Mesh>
00184 inline void
00185 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Cell> & cfl,
00186                    const Mesh& mesh, 
00187                    const NDIndex<Dim> *dombegin,
00188                    const NDIndex<Dim> *domend,
00189                    const int *nbegin,
00190                    const int *nend)
00191 {
00192   NDIndex<Dim> ndi;
00193   for (int d=0; d<Dim; d++) ndi[d] = Index(mesh.gridSizes[d] - 1);
00194   cfl.initialize(ndi, dombegin, domend, nbegin, nend);
00195 }
00196 
00197 //------------------Vert centering---------------------------------------------
00198 template<unsigned Dim, class Mesh>
00199 inline void
00200 centeredInitialize(CenteredFieldLayout<Dim,Mesh,Vert> & cfl,
00201                    const Mesh& mesh, 
00202                    const NDIndex<Dim> *dombegin,
00203                    const NDIndex<Dim> *domend,
00204                    const int *nbegin,
00205                    const int *nend)
00206 {
00207   NDIndex<Dim> ndi;
00208   for (int d=0; d<Dim; d++) ndi[d] = Index(mesh.gridSizes[d]);
00209   cfl.initialize(ndi, dombegin, domend, nbegin, nend);
00210 }
00211 
00212 //------------------CartesianCentering centering-------------------------------
00213 template<const CenteringEnum* CE, unsigned Dim, class Mesh,
00214          unsigned NComponents>
00215 inline void
00216 centeredInitialize(CenteredFieldLayout<Dim,Mesh,
00217                    CartesianCentering<CE,Dim,NComponents> > & cfl,
00218                    const Mesh& mesh, 
00219                    const NDIndex<Dim> *dombegin,
00220                    const NDIndex<Dim> *domend,
00221                    const int *nbegin,
00222                    const int *nend)
00223 {
00224   // For componentwise layout of Field of multicomponent object, like 
00225   // Field<Vektor...>, allow for maximal number of objects needed per
00226   // dimension (the number for the object component requiring the maximal
00227   // number):
00228   unsigned npts[Dim], nGridPts;
00229   int d, c;
00230   for (d=0; d<Dim; d++) {
00231     nGridPts = mesh.gridSizes[d];
00232     npts[d] = 0;
00233     for (c=0; c<NComponents; c++) {
00234       if (CE[c + d*NComponents] == CELL) {
00235         npts[d] = max(npts[d], (nGridPts - 1));
00236       } else {
00237         npts[d] = max(npts[d], nGridPts);
00238       }
00239     }
00240   }
00241 
00242   NDIndex<Dim> ndi;
00243   for (d=0; d<Dim; d++) ndi[d] = Index(npts[d]);
00244   cfl.initialize(ndi, dombegin, domend, nbegin, nend);
00245 }
00246 
00247 
00248 //=============================================================================
00249 // General ctor calls specializations of global function (workaround for lack
00250 // of partial specialization:
00251 //=============================================================================
00252 
00253 //-----------------------------------------------------------------------------
00254 // These specify only a total number of vnodes, allowing the constructor
00255 // complete control on how to do the vnode partitioning of the index space:
00256 // Constructor for arbitrary dimension with parallel/serial specifier array:
00257 
00258 // Constructor for arbitrary dimension with parallel/serial specifier array:
00259 // This one also works if nothing except mesh is specified:
00260 template<unsigned Dim, class Mesh, class Centering>
00261 CenteredFieldLayout<Dim,Mesh,Centering>::
00262 CenteredFieldLayout(Mesh& mesh, 
00263                     e_dim_tag *p, 
00264                     int vnodes)
00265 {
00266   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00267                   + CT(mesh) + ", e_dim_tag *, int)");
00268   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00269               , TAU_LAYOUT);
00270 
00271   PInsist(Dim<=Mesh::Dimension,
00272     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00273   centeredInitialize(*this, mesh, p, vnodes);
00274 }
00275 
00276 
00277 // Constructors for 1 ... 6 dimensions with parallel/serial specifiers:
00278 template<unsigned Dim, class Mesh, class Centering>
00279 CenteredFieldLayout<Dim,Mesh,Centering>::
00280 CenteredFieldLayout(Mesh& mesh, 
00281                     e_dim_tag p1, 
00282                     int vnodes)
00283 {
00284   TAU_TYPE_STRING(taustr, CT(*this) + " void (" 
00285                   + CT(mesh) + ", e_dim_tag, int)");
00286   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00287               , TAU_LAYOUT);
00288 
00289   PInsist(Dim==1,
00290     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00291   PInsist(Dim<=Mesh::Dimension,
00292     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00293   centeredInitialize(*this, mesh, &p1, vnodes);
00294 }
00295 template<unsigned Dim, class Mesh, class Centering>
00296 CenteredFieldLayout<Dim,Mesh,Centering>::
00297 CenteredFieldLayout(Mesh& mesh, 
00298                     e_dim_tag p1, e_dim_tag p2, 
00299                     int vnodes)
00300 {
00301   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00302                   + CT(mesh) + ", e_dim_tag, e_dim_tag, int)");
00303   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00304               , TAU_LAYOUT);
00305 
00306   PInsist(Dim==2,
00307     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00308   PInsist(Dim<=Mesh::Dimension,
00309     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00310   e_dim_tag edt[2];
00311   edt[0] = p1; edt[1] = p2;
00312   centeredInitialize(*this, mesh, edt, vnodes);
00313 }
00314 template<unsigned Dim, class Mesh, class Centering>
00315 CenteredFieldLayout<Dim,Mesh,Centering>::
00316 CenteredFieldLayout(Mesh& mesh, 
00317                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, 
00318                     int vnodes)
00319 {
00320   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00321                   + CT(mesh) + ", e_dim_tag, e_dim_tag, e_dim_tag, int)");
00322   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00323               , TAU_LAYOUT);
00324 
00325   PInsist(Dim==3,
00326     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00327   PInsist(Dim<=Mesh::Dimension,
00328     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00329   e_dim_tag edt[3];
00330   edt[0] = p1; edt[1] = p2; edt[2] = p3;
00331   centeredInitialize(*this, mesh, edt, vnodes);
00332 }
00333 template<unsigned Dim, class Mesh, class Centering>
00334 CenteredFieldLayout<Dim,Mesh,Centering>::
00335 CenteredFieldLayout(Mesh& mesh, 
00336                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00337                     int vnodes)
00338 {
00339   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00340                   + CT(mesh) + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00341                   + "int)");
00342   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00343               , TAU_LAYOUT);
00344 
00345   PInsist(Dim==4,
00346     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00347   PInsist(Dim<=Mesh::Dimension,
00348     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00349   e_dim_tag edt[4];
00350   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4;
00351   centeredInitialize(*this, mesh, edt, vnodes);
00352 }
00353 template<unsigned Dim, class Mesh, class Centering>
00354 CenteredFieldLayout<Dim,Mesh,Centering>::
00355 CenteredFieldLayout(Mesh& mesh, 
00356                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00357                     e_dim_tag p5,
00358                     int vnodes)
00359 {
00360   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" + CT(mesh) 
00361                   + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00362                   + "int)");
00363   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00364               , TAU_LAYOUT);
00365 
00366   PInsist(Dim==5,
00367     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00368   PInsist(Dim<=Mesh::Dimension,
00369     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00370   e_dim_tag edt[5];
00371   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5;
00372   centeredInitialize(*this, mesh, edt, vnodes);
00373 }
00374 template<unsigned Dim, class Mesh, class Centering>
00375 CenteredFieldLayout<Dim,Mesh,Centering>::
00376 CenteredFieldLayout(Mesh& mesh, 
00377                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00378                     e_dim_tag p5, e_dim_tag p6,
00379                     int vnodes)
00380 {
00381   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00382                   + CT(mesh) 
00383                   + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00384                   + "e_dim_tag, int)");
00385   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr, 
00386               TAU_LAYOUT);
00387 
00388   PInsist(Dim==6,
00389     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00390   PInsist(Dim<=Mesh::Dimension,
00391     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00392   e_dim_tag edt[6];
00393   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5; edt[5] = p6;
00394   centeredInitialize(*this, mesh, edt, vnodes);
00395 }
00396 //-----------------------------------------------------------------------------
00397 
00398 //-----------------------------------------------------------------------------
00399 // These specify both the total number of vnodes and the numbers of vnodes
00400 // along each dimension for the partitioning of the index space. Obviously this
00401 // restricts the number of vnodes to be a product of the numbers along each
00402 // dimension (the constructor implementation checks this):
00403 
00404 // Constructor for arbitrary dimension with parallel/serial specifier array:
00405 template<unsigned Dim, class Mesh, class Centering>
00406 CenteredFieldLayout<Dim,Mesh,Centering>::
00407 CenteredFieldLayout(Mesh& mesh, 
00408                     e_dim_tag *p, 
00409                     unsigned* vnodesAlongDirection, 
00410                     bool recurse,
00411                     int vnodes)
00412 {
00413   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00414                   + CT(mesh) + ", e_dim_tag *, unsigned *, int)");
00415   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00416               , TAU_LAYOUT);
00417 
00418   PInsist(Dim<=Mesh::Dimension,
00419     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00420   centeredInitialize(*this, mesh, p, vnodesAlongDirection, recurse, vnodes);
00421 }
00422 // Constructors for 1 ... 6 dimensions with parallel/serial specifiers:
00423 template<unsigned Dim, class Mesh, class Centering>
00424 CenteredFieldLayout<Dim,Mesh,Centering>::
00425 CenteredFieldLayout(Mesh& mesh, 
00426                     e_dim_tag p1, 
00427                     unsigned vnodes1,
00428                     bool recurse,
00429                     int vnodes)
00430 {
00431   TAU_TYPE_STRING(taustr, CT(*this) + " void (" 
00432                   + CT(mesh) + ", e_dim_tag, unsigned, int)");
00433   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00434               , TAU_LAYOUT);
00435 
00436   PInsist(Dim==1,
00437     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00438   PInsist(Dim<=Mesh::Dimension,
00439     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00440   centeredInitialize(*this, mesh, &p1, &vnodes1, recurse, vnodes);
00441 }
00442 template<unsigned Dim, class Mesh, class Centering>
00443 CenteredFieldLayout<Dim,Mesh,Centering>::
00444 CenteredFieldLayout(Mesh& mesh, 
00445                     e_dim_tag p1, e_dim_tag p2, 
00446                     unsigned vnodes1, unsigned vnodes2,
00447                     bool recurse,
00448                     int vnodes)
00449 {
00450   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00451                   + CT(mesh) + ", e_dim_tag, e_dim_tag, unsigned, unsigned, "
00452                   + "int)");
00453   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00454               , TAU_LAYOUT);
00455 
00456   PInsist(Dim==2,
00457     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00458   PInsist(Dim<=Mesh::Dimension,
00459     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00460   e_dim_tag edt[2];
00461   edt[0] = p1; edt[1] = p2;
00462   unsigned vad[2];
00463   vad[0] = vnodes1; vad[1] = vnodes2;
00464   centeredInitialize(*this, mesh, edt, vad, recurse, vnodes);
00465 }
00466 template<unsigned Dim, class Mesh, class Centering>
00467 CenteredFieldLayout<Dim,Mesh,Centering>::
00468 CenteredFieldLayout(Mesh& mesh, 
00469                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, 
00470                     unsigned vnodes1, unsigned vnodes2, unsigned vnodes3,
00471                     bool recurse,
00472                     int vnodes)
00473 {
00474   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00475                   + CT(mesh) 
00476                   + ", e_dim_tag, e_dim_tag, e_dim_tag, "
00477                   + "unsigned, unsigned, int)");
00478   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00479               , TAU_LAYOUT);
00480 
00481   PInsist(Dim==3,
00482     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00483   PInsist(Dim<=Mesh::Dimension,
00484     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00485   e_dim_tag edt[3];
00486   edt[0] = p1; edt[1] = p2; edt[2] = p3;
00487   unsigned vad[3];
00488   vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3; 
00489   centeredInitialize(*this, mesh, edt, vad, recurse, vnodes);
00490 }
00491 template<unsigned Dim, class Mesh, class Centering>
00492 CenteredFieldLayout<Dim,Mesh,Centering>::
00493 CenteredFieldLayout(Mesh& mesh, 
00494                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00495                     unsigned vnodes1, unsigned vnodes2, unsigned vnodes3,
00496                     unsigned vnodes4,
00497                     bool recurse,
00498                     int vnodes)
00499 {
00500   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00501                   + CT(mesh) + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00502                   + "unsigned, unsigned, unsigned, unsigned, int)");
00503   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00504               , TAU_LAYOUT);
00505 
00506   PInsist(Dim==4,
00507     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00508   PInsist(Dim<=Mesh::Dimension,
00509     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00510   e_dim_tag edt[4];
00511   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4;
00512   unsigned vad[4];
00513   vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3; 
00514   vad[3] = vnodes4;
00515   centeredInitialize(*this, mesh, edt, vad, recurse, vnodes);
00516 }
00517 template<unsigned Dim, class Mesh, class Centering>
00518 CenteredFieldLayout<Dim,Mesh,Centering>::
00519 CenteredFieldLayout(Mesh& mesh, 
00520                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00521                     e_dim_tag p5,
00522                     unsigned vnodes1, unsigned vnodes2, unsigned vnodes3,
00523                     unsigned vnodes4, unsigned vnodes5,
00524                     bool recurse,
00525                     int vnodes)
00526 {
00527   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00528                   + CT(mesh) 
00529                   + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00530                   + "unsigned, unsigned, unsigned, unsigned, unsigned, int)");
00531   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr
00532               , TAU_LAYOUT);
00533 
00534   PInsist(Dim==5,
00535     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00536   PInsist(Dim<=Mesh::Dimension,
00537     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00538   e_dim_tag edt[5];
00539   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5;
00540   unsigned vad[5];
00541   vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3; 
00542   vad[3] = vnodes4; vad[4] = vnodes5;
00543   centeredInitialize(*this, mesh, edt, vad, recurse, vnodes);
00544 }
00545 template<unsigned Dim, class Mesh, class Centering>
00546 CenteredFieldLayout<Dim,Mesh,Centering>::
00547 CenteredFieldLayout(Mesh& mesh, 
00548                     e_dim_tag p1, e_dim_tag p2, e_dim_tag p3, e_dim_tag p4,
00549                     e_dim_tag p5, e_dim_tag p6,
00550                     unsigned vnodes1, unsigned vnodes2, unsigned vnodes3,
00551                     unsigned vnodes4, unsigned vnodes5, unsigned vnodes6,
00552                     bool recurse,
00553                     int vnodes)
00554 {
00555   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00556                   + CT(mesh) 
00557                   + ", e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, e_dim_tag, "
00558                   + "e_dim_tag, "
00559                   + "unsigned, unsigned, unsigned, unsigned, unsigned, "
00560                   + "unsigned, int)");
00561   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr, 
00562               TAU_LAYOUT);
00563 
00564   PInsist(Dim==6,
00565     "Number of arguments does not match dimension of CenteredFieldLayout!!");
00566   PInsist(Dim<=Mesh::Dimension,
00567     "CenteredFieldLayout dimension cannot be greater than Mesh dimension!!");
00568   e_dim_tag edt[6];
00569   edt[0] = p1; edt[1] = p2; edt[2] = p3; edt[3] = p4; edt[4] = p5; edt[5] = p6;
00570   unsigned vad[6];
00571   vad[0] = vnodes1; vad[1] = vnodes2; vad[2] = vnodes3; 
00572   vad[3] = vnodes4; vad[4] = vnodes5; vad[5] = vnodes6;
00573   centeredInitialize(*this, mesh, edt, vad, recurse, vnodes);
00574 }
00575 
00576 //-----------------------------------------------------------------------------
00577 // A constructor for a completely user-specified partitioning of the
00578 // mesh space.
00579 
00580 template<unsigned Dim, class Mesh, class Centering>
00581 CenteredFieldLayout<Dim,Mesh,Centering>::
00582 CenteredFieldLayout(Mesh& mesh,
00583                     const NDIndex<Dim> *dombegin,
00584                     const NDIndex<Dim> *domend,
00585                     const int *nbegin,
00586                     const int *nend)
00587 {
00588   TAU_TYPE_STRING(taustr, CT(*this) +  "void (" 
00589                   + CT(mesh) + ", NDIndex *, NDIndex *, int *, int *)");
00590   TAU_PROFILE("CenteredFieldLayout::CenteredFieldLayout()", taustr, 
00591               TAU_LAYOUT);
00592 
00593   centeredInitialize(*this, mesh, dombegin, domend, nbegin, nend);
00594 }
00595 
00596 
00597 /***************************************************************************
00598  * $RCSfile: CenteredFieldLayout.cpp,v $   $Author: adelmann $
00599  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:27 $
00600  * IPPL_VERSION_ID: $Id: CenteredFieldLayout.cpp,v 1.1.1.1 2003/01/23 07:40:27 adelmann Exp $ 
00601  ***************************************************************************/

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