www.cemf.ir
boundarySphereParticles.cpp
Go to the documentation of this file.
2 #include "boundaryBase.hpp"
3 #include "sphereParticles.hpp"
4 
5 
7  const boundaryBase &boundary,
8  sphereParticles &prtcls
9 )
10 :
11  generalBoundary(boundary, prtcls.pStruct(), "", ""),
12  particles_(prtcls)
13 {
14 
15 }
16 
18 {
19  return particles_;
20 }
21 
23 {
24  return particles_;
25 }
26 
28  const boundaryBase &boundary,
29  sphereParticles &prtcls
30 )
31 {
32 
33  word bType = angleBracketsNames2(
34  "boundarySphereParticles",
35  pFlowProcessors().localRunTypeName(),
36  boundary.type());
37 
38  word altBType{"boundarySphereParticles<none>"};
39 
40  if( boundaryBasevCtorSelector_.search(bType) )
41  {
42  pOutput.space(4)<<"Creating boundary "<< Green_Text(bType)<<
43  " for "<<boundary.name()<<endl;
44  return boundaryBasevCtorSelector_[bType](boundary, prtcls);
45  }
46  else if(boundaryBasevCtorSelector_.search(altBType))
47  {
48  pOutput.space(4)<<"Creating boundary "<< Green_Text(altBType)<<
49  " for "<<boundary.name()<<endl;
50  return boundaryBasevCtorSelector_[altBType](boundary, prtcls);
51  }
52  else
53  {
54  printKeys(
55  fatalError << "Ctor Selector "<< bType<<
56  " and "<< altBType << " do not exist. \n"
57  <<"Avaiable ones are: \n",
58  boundaryBasevCtorSelector_
59  );
60  fatalExit;
61  }
62 
63  return nullptr;
64 }
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::pOutput
processorOstream pOutput
pFlow::boundarySphereParticles::boundarySphereParticles
boundarySphereParticles(const boundaryBase &boundary, sphereParticles &prtcls)
Definition: boundarySphereParticles.cpp:6
pFlow::boundarySphereParticles::create
static uniquePtr< boundarySphereParticles > create(const boundaryBase &boundary, sphereParticles &prtcls)
Definition: boundarySphereParticles.cpp:27
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
boundarySphereParticles.hpp
boundaryBase.hpp
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
pFlow::boundaryBase::name
const word & name() const
Definition: boundaryBase.hpp:258
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::boundaryBase::type
const word & type() const
Definition: boundaryBase.hpp:252
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:42
pFlow::angleBracketsNames2
word angleBracketsNames2(const word &base, const word &w1, const word &w2)
Output base<w1,w2>
Definition: bTypesFunctions.cpp:162
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
pFlow::boundarySphereParticles::Particles
sphereParticles & Particles()
Definition: boundarySphereParticles.cpp:17
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::pFlowProcessors
localProcessors & pFlowProcessors()
Definition: pFlowProcessors.cpp:5
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
sphereParticles.hpp
pFlow::iOstream::space
virtual iOstream & space(int32 n=1)
Write space to stream.
Definition: iOstream.cpp:119
pFlow::generalBoundary
Definition: generalBoundary.hpp:38