www.cemf.ir
rectangleMesh.cpp
Go to the documentation of this file.
1 #include "rectangleMesh.hpp"
2 
3 
5 (
6  const box& mshBox,
7  int32 nx,
8  int32 ny,
9  int32 nz,
10  repository* rep
11 )
12 :
13  IOobject(
15  (
16  "rectMesh",
17  "",
18  objectFile::READ_NEVER,
19  objectFile::WRITE_NEVER
20  ),
21  IOPattern::MasterProcessorOnly,
22  rep
23  ),
24  meshBox_(mshBox),
25  numCells_(nx, ny, nz)
26 {
27  if(mshBox.minPoint()>= mshBox.maxPoint())
28  {
29  fatalErrorInFunction<<"Lower corner point of mesh "<<mshBox.minPoint()<<
30  " confilicts with upper corner point of mesh "<<mshBox.maxPoint()<<endl;
31  fatalExit;
32  }
33 
34  numCells_ = max( numCells_ , int32x3(1) );
35 
36  dx_ = (mshBox.maxPoint() - mshBox.minPoint())/
37  realx3(numCells_.x_, numCells_.y_, numCells_.z_);
38 
39 }
40 
42 :
44  box(dict),
45  dict.getVal<int32>("nx"),
46  dict.getVal<int32>("ny"),
47  dict.getVal<int32>("nz"),
48  rep
49  )
50 {
51 
52 }
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::algorithms::KOKKOS::max
INLINE_FUNCTION_H Type max(const Type *first, uint32 numElems)
Definition: kokkosAlgorithms.hpp:104
pFlow::rectangleMesh::rectangleMesh
rectangleMesh(const box &mshBox, int32 nx, int32 ny, int32 nz, repository *rep)
Definition: rectangleMesh.cpp:5
rectangleMesh.hpp
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::box::maxPoint
const INLINE_FUNCTION_HD realx3 & maxPoint() const
Definition: box.hpp:97
pFlow::realx3
triple< real > realx3
Definition: types.hpp:43
pFlow::rectangleMesh
Definition: rectangleMesh.hpp:34
pFlow::IOobject
Definition: IOobject.hpp:35
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::int32x3
triple< int32 > int32x3
Definition: types.hpp:38
pFlow::objectFile
Definition: objectFile.hpp:30
pFlow::box::minPoint
const INLINE_FUNCTION_HD realx3 & minPoint() const
Definition: box.hpp:91
pFlow::box
Definition: box.hpp:32
pFlow::repository
Definition: repository.hpp:34
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67