# PhasicFlow: src/phasicFlow/structuredData/pointStructure/selectors/pStructSelector/pStructSelector.cpp Source File

pStructSelector.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "pStructSelector.hpp"
#include "pointStructure.hpp"
#include "dictionary.hpp"
pFlow::pStructSelector::pStructSelector
(
const pointStructure& pStruct,
const dictionary& UNUSED(dict)
)
:
pStruct_(pStruct)
{}
const pFlow::pointStructure& pFlow::pStructSelector::pStruct()const
{
return pStruct_;
}
pFlow::uniquePtr<pFlow::pStructSelector>
pFlow::pStructSelector::create(const pointStructure& pStruct, const dictionary& dict)
{
word selectorMethod = dict.getVal<word>("selector");
if( dictionaryvCtorSelector_.search(selectorMethod) )
{
return dictionaryvCtorSelector_[selectorMethod] (pStruct, dict);
}
else
{
printKeys
(
fatalError << "Ctor Selector "<< selectorMethod << " dose not exist. \n"
<<"Avaiable ones are: \n\n"
,
dictionaryvCtorSelector_
);
fatalExit;
}
return nullptr;
}
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