32 #ifndef generateInterfacialModels_H
33 #define generateInterfacialModels_H
49 template<
class ModelType>
66 if (
name(
name.size() - 5, 5) ==
"Model")
75 template<
class ModelType>
81 <<
"Too many matching entries for construction of a "
82 << ModelType::typeName <<
nl <<
dict.
toc()
89 <<
"Non-sub-dictionary entries found for specification of a "
90 << ModelType::typeName
98 template<
class ModelType,
typename =
void>
101 public std::false_type
116 template<
class ModelType>
119 public std::true_type
126 typename ModelType::modelType
128 typename ModelType::requiredPhaseInterfaces
136 typename ModelType::modelType
138 typename ModelType::allowedPhaseInterfaces
150 template<
class ModelType>
159 template<
class InterfaceTypeSet>
162 template<
class InterfaceType,
class ... InterfaceTypes>
170 string type(InterfaceType::typeName_());
171 type.removeTrailing(
"PhaseInterface");
174 type +
" (i.e., contains '_" + InterfaceType::separator() +
"_')";
177 sizeof ... (InterfaceTypes) == 0
179 :
sizeof ... (InterfaceTypes) == 1
180 ?
s +
' ' + andOr +
' ' + subS
195 template<
class ModelType>
207 if (ignoreKeys.found(
modelName))
continue;
214 if (!isModelPhaseInterfaceType<ModelType>(modelInterfacePtr()))
218 <<
" is not of suitable type for construction of a "
219 << ModelType::typeName <<
'.';
221 const string requiredInfo =
227 if (requiredInfo.size())
230 <<
" The interface must be of type "
231 << requiredInfo.c_str() <<
'.';
234 const string prohibitedInfo =
240 if (prohibitedInfo.size())
243 <<
" The interface must NOT be of type "
244 << prohibitedInfo.c_str() <<
'.';
254 template<
class ModelType,
class ... InterfaceTypes,
class ... Args>
284 && !isModelPhaseInterfaceType<ModelType>(modelInterfacePtr())
290 if (!interfacePtr.
valid())
294 <<
" is not of suitable type for construction of a "
295 << ModelType::typeName
308 const word name = interfacePtr->name();
329 template<
class ModelType,
class ... Args>
340 const bool ignoreNonModelPhaseInterfaceTypes,
345 if (!ignoreNonModelPhaseInterfaceTypes)
347 checkInterfacialModelsDict<ModelType>(fluid,
dict, ignoreKeys);
353 generateInterfacialModels<ModelType, phaseInterface>
360 NullObjectRef<phaseInterface>(),
368 models.
insert(listInterfaces[i], listModels.
set(i,
nullptr).ptr());
375 template<
class ModelType>
388 generateInterfacialModels<ModelType>
graph_traits< Graph >::vertices_size_type size_type
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable specialisation for hashing pointers.
A HashTable with keys but without contents.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void append(T *)
Append an element at the end of the list.
T * first()
Return the first entry.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
T * ptr()
Return object pointer for reuse.
const fileName & name() const
Return the dictionary name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
wordList toc() const
Return the table of contents.
Class to represent a interface between phases where one phase is considered dispersed within the othe...
Class to represent an interface between phases which has been displaced to some extent by a third pha...
A wordList with hashed indices for faster lookup by name.
bool found(const word &) const
Does the list contain the specified name.
void append(const word &)
Append an element at the end of the list.
Word-pair based class used for keying interface models in hash tables.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
static autoPtr< phaseInterface > New(const phaseSystem &fluid, const word &name)
Select given fluid and name.
Class to represent a system of phases.
Class to represent a interface between phases where the two phases are considered to be segregated; t...
Class to represent a certain side of an interface between phases.
A class for handling character strings derived from std::string.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
void generateInterfacialModels(PtrList< phaseInterface > &interfaces, PtrList< ModelType > &models, const phaseSystem &fluid, const dictionary &dict, const wordHashSet &ignoreKeys, const phaseInterface &interface, const Args &... args)
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isModelPhaseInterfaceType(const phaseInterface &interface)
void checkInterfacialModelsDict(const phaseSystem &fluid, const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
HashSet wordHashSet
A HashSet with word keys.
const dictionary & modelSubDict(const dictionary &dict)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Foam::argList args(argc, argv)
TypeSetRemove< typename ModelPhaseInterfaceTypes< void >::prohibited, allowed >::type prohibited
TypeSetConcatenate< typename ModelPhaseInterfaceTypes< typename ModelType::modelType >::allowed, typename ModelType::allowedPhaseInterfaces >::type allowed
TypeSetConcatenate< typename ModelPhaseInterfaceTypes< typename ModelType::modelType >::required, typename ModelType::requiredPhaseInterfaces >::type required
TypeSet< dispersedPhaseInterface, segregatedPhaseInterface, displacedPhaseInterface, sidedPhaseInterface > prohibited
string operator()(const char *andOr) const
string operator()(const char *andOr) const
Template meta-programming for operations involving sets of types.