pStructSelector.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #include "pStructSelector.hpp"
23 #include "pointStructure.hpp"
24 #include "dictionary.hpp"
25 
27 (
28  const pointStructure& pStruct,
29  const dictionary& UNUSED(dict)
30 )
31 :
32  pStruct_(pStruct)
33 {}
34 
36 {
37  return pStruct_;
38 }
39 
40 
43 {
44  word selectorMethod = dict.getVal<word>("selector");
45 
46  if( dictionaryvCtorSelector_.search(selectorMethod) )
47  {
48  return dictionaryvCtorSelector_[selectorMethod] (pStruct, dict);
49  }
50  else
51  {
52  printKeys
53  (
54  fatalError << "Ctor Selector "<< selectorMethod << " dose not exist. \n"
55  <<"Avaiable ones are: \n\n"
56  ,
57  dictionaryvCtorSelector_
58  );
59  fatalExit;
60  }
61  return nullptr;
62 }
pFlow::pStructSelector::create
static uniquePtr< pStructSelector > create(const pointStructure &pStruct, const dictionary &dict)
Definition: pStructSelector.cpp:42
fatalExit
#define fatalExit
Definition: error.hpp:57
UNUSED
#define UNUSED(x)
Definition: pFlowMacros.hpp:35
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
pStructSelector.hpp
pFlow::pointStructure
Definition: pointStructure.hpp:44
pFlow::pStructSelector::pStruct_
const pointStructure & pStruct_
Definition: pStructSelector.hpp:40
dictionary.hpp
pFlow::pStructSelector::pStruct
const pointStructure & pStruct() const
Definition: pStructSelector.cpp:35
fatalError
#define fatalError
Definition: error.hpp:36
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::dictionary::getVal
T getVal(const word &keyword) const
Definition: dictionary.hpp:309
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pointStructure.hpp
pFlow::pStructSelector::pStructSelector
pStructSelector(const pointStructure &pStruct, const dictionary &UNUSED(dict))
Definition: pStructSelector.cpp:27
pFlow::dictionary
Definition: dictionary.hpp:38