32 #ifndef generateInterfacialModels_H
33 #define generateInterfacialModels_H
49 template<
class ModelType>
66 if (
name(
name.size() - 5, 5) ==
"Model")
87 if (ignoreKeys.found(iter().keyword()))
continue;
98 template<
class ModelType>
101 if (subDicts.
empty())
104 <<
"No many matching entries for construction of a "
109 if (subDicts.
size() > 1)
114 toc.
append(subDicts[i].dictName());
118 <<
"Too many matching entries for construction of a "
123 return subDicts.
first();
127 template<
class ModelType,
typename =
void>
130 public std::false_type
145 template<
class ModelType>
148 public std::true_type
155 typename ModelType::modelType
157 typename ModelType::requiredPhaseInterfaces
165 typename ModelType::modelType
167 typename ModelType::allowedPhaseInterfaces
179 template<
class ModelType>
188 template<
class InterfaceTypeSet>
191 template<
class InterfaceType,
class ... InterfaceTypes>
199 string type(InterfaceType::typeName_());
200 type.removeTrailing(
"PhaseInterface");
203 type +
" (i.e., contains '_" + InterfaceType::separator() +
"_')";
206 sizeof ... (InterfaceTypes) == 0
208 :
sizeof ... (InterfaceTypes) == 1
209 ?
s +
' ' + andOr +
' ' + subS
224 template<
class ModelType>
236 if (ignoreKeys.found(
modelName))
continue;
243 if (!isModelPhaseInterfaceType<ModelType>(modelInterfacePtr()))
247 <<
" is not of suitable type for construction of a "
250 const string requiredInfo =
256 if (requiredInfo.size())
259 <<
" The interface must be of type "
260 << requiredInfo.c_str() <<
'.';
263 const string prohibitedInfo =
269 if (prohibitedInfo.size())
272 <<
" The interface must NOT be of type "
273 << prohibitedInfo.c_str() <<
'.';
283 template<
class ModelType,
class ... InterfaceTypes,
class ... Args>
298 forAll(subDicts, subDicti)
301 const dictionary& modelDict = subDicts[subDicti];
313 && !isModelPhaseInterfaceType<ModelType>(modelInterfacePtr())
319 if (!interfacePtr.
valid())
323 <<
" is not of suitable type for construction of a "
337 const word name = interfacePtr->name();
358 template<
class ModelType,
class ... Args>
369 const bool ignoreNonModelPhaseInterfaceTypes,
374 if (!ignoreNonModelPhaseInterfaceTypes)
376 checkInterfacialModelsDict<ModelType>(fluid,
dict, ignoreKeys);
382 generateInterfacialModels<ModelType, phaseInterface>
389 NullObjectRef<phaseInterface>(),
397 models.
insert(listInterfaces[i], listModels.
set(i,
nullptr).ptr());
404 template<
class ModelType>
417 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.
void append(const T &)
Append an element at the end of the list.
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.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
T & first()
Return reference to the first element of the list.
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the UPtrList.
void resize(const label)
Reset size of UPtrList. This can only be used to set the size.
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
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 word dictName() const
Return the local dictionary name (final part of scoped name)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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))
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isModelPhaseInterfaceType(const phaseInterface &interface)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
UPtrList< const dictionary > modelSubDicts(const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
void generateInterfacialModels(PtrList< phaseInterface > &interfaces, PtrList< ModelType > &models, const phaseSystem &fluid, const UPtrList< const dictionary > &subDicts, const wordHashSet &ignoreKeys, const phaseInterface &interface, const Args &... args)
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.
const dictionary & modelSubDict(const UPtrList< const dictionary > &subDicts)
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.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
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.