PlasCom2  1.0
XPACC Multi-physics simluation application
GridGenerator.C
Go to the documentation of this file.
1 #include "Testing.H"
2 #include "Simulation.H"
3 #include "OperatorKernels.H"
4 #include "Stencil.H"
5 #include "PCPPCommUtil.H"
6 #include "PCPPReport.H"
7 #include "PCPPIntervalUtils.H"
8 #include "PCPPHDF5.H"
9 #include "Report.H"
10 #include "PC2IO.H"
11 
12 namespace gridgen {
13 
14  template<int numDim>
15  int RectilinearGrid1(const std::vector<size_t> &ijk,const std::vector<double> &scale,std::vector<double> &xyz)
16  {
17  // double scale[] = {101,51,21};
18  for(int iDim = 0;iDim < numDim;iDim++){
19  double iVar = ((double)(ijk[iDim]+1))/scale[iDim];
20  xyz[iDim] = (iDim+1)*std::pow(iVar,2.0);
21  }
22  return(0);
23  };
24 
25  template<int numDim>
26  int RectilinearMetric1(const std::vector<size_t> &ijk,
27  const std::vector<double> &scale,
28  std::vector<double> &xyz,double &jacm1)
29  {
30  // double scale[] = {101,51,21};
31  double dxDXi = 2.0*(ijk[0]+1)/(scale[0]*scale[0]);
32  double dyDEta = 4.0*(ijk[1]+1)/(scale[1]*scale[1]);
33  xyz[0] = dyDEta;
34  xyz[1] = dxDXi;
35  jacm1 = xyz[0]*xyz[1];
36  if (numDim == 3){
37  double dzDZeta = 6.0*(ijk[2]+1)/(scale[2]*scale[2]);
38  xyz[0] = dyDEta*dzDZeta;
39  xyz[1] = dxDXi*dzDZeta;
40  xyz[2] = dxDXi*dyDEta;
41  jacm1 = xyz[0]*xyz[1]*xyz[2];
42  }
43  return(0);
44  };
45 
46 }
int RectilinearMetric1(const std::vector< size_t > &ijk, const std::vector< double > &scale, std::vector< double > &xyz, double &jacm1)
Definition: GridGenerator.C:26
Testing constructs for unit testing.
int RectilinearGrid1(const std::vector< size_t > &ijk, std::vector< double > &xyz)
Definition: GridGenerator.H:52