48 internalNonDynamicField_
68 internalNonDynamicField_
88 internalNonDynamicField_
101 const word& fieldSourceType,
105 typename nullConstructorTable::iterator cstrIter =
106 nullConstructorTablePtr_->find(fieldSourceType);
108 if (cstrIter == nullConstructorTablePtr_->end())
111 <<
"Unknown null-constructable fieldSource type " << fieldSourceType
112 <<
nl <<
nl <<
"Valid fieldSource types are :" <<
endl
113 << nullConstructorTablePtr_->sortedToc()
117 return cstrIter()(iIo);
131 libs.
open(
dict,
"libs", dictionaryConstructorTablePtr_);
133 typename dictionaryConstructorTable::iterator cstrIter =
134 dictionaryConstructorTablePtr_->find(fieldSourceType);
136 if (cstrIter == dictionaryConstructorTablePtr_->end())
138 if (!disallowGenericLagrangianFieldSource)
140 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
143 if (cstrIter == dictionaryConstructorTablePtr_->end())
146 <<
"Unknown fieldSource type " << fieldSourceType
148 <<
"Valid fieldSource types are :" <<
endl
149 << dictionaryConstructorTablePtr_->sortedToc()
154 return cstrIter()(iIo,
dict);
170 return internalIo_.
db();
180 return internalField_.dimensions();
183 if (
notNull(internalNonDynamicField_))
185 return internalNonDynamicField_.dimensions();
189 <<
"Dimensions of internal object " << internalIo_.name()
190 <<
" could not be determined"
193 return NullObjectRef<dimensionSet>();
203 return internalField_;
207 <<
"Internal field " << internalIo_.name() <<
" is not of type "
211 return NullObjectRef<LagrangianInternalDynamicField<Type>>();
224 <<
"The " << typeName <<
" " << source.
name()
225 <<
" does not define a value for a continuous source "
241 <<
"The " << typeName <<
" " << source.
name()
242 <<
" does not define a value for a continuous source"
257 return (1 - internalCoeff(source, subMesh))*sourceValue(source, subMesh);
270 sourceCoeff(source, subMesh)
271 + internalCoeff(source, subMesh)*subMesh.
sub(internalField());
284 <<
"The " << typeName <<
" " << injection.
name()
285 <<
" does not define a value for an instantaneous injection"
300 if (isA<LagrangianSource>(model))
302 return value(refCast<const LagrangianSource>(model), subMesh);
305 if (isA<LagrangianInjection>(model))
307 return value(refCast<const LagrangianInjection>(model), subMesh);
311 <<
"The " << LagrangianModel::typeName <<
" " << model.
name()
312 <<
" is neither a " << LagrangianSource::typeName <<
" nor a "
313 << LagrangianInjection::typeName <<
" so source values cannot "
314 <<
"be generated for it"
322 template<
class OtherType>
331 db().template lookupObject<LagrangianDynamicField<OtherType>>(
name);
338 template<
class OtherType,
class OtherFieldSourceType>
346 fieldSource<OtherType>(
name, model);
348 if (!isA<OtherFieldSourceType>(lfs))
351 <<
"The '" <<
type() <<
"' source of field '"
352 << (db().dbDir()/internalIo_.name()).c_str()
353 <<
"' for the '" << model.type() <<
"' Lagrangian model '"
354 << model.
name() <<
"' requires the corresponding source of field '"
355 << (db().dbDir()/
name).c_str()
356 <<
"' to be of type '" << OtherFieldSourceType::typeName
357 <<
"' (or a derivation thereof), rather than '" << lfs.type()
361 return refCast<const OtherFieldSourceType>(lfs);
366 template<
class OtherModelType>
372 if (!isA<OtherModelType>(model))
375 <<
"The '" <<
type() <<
"' source of field '"
376 << (db().dbDir()/internalIo_.name()).c_str()
377 <<
"' for the Lagrangian model '" << model.
name()
378 <<
"' requires a model of type '" << OtherModelType::typeName
379 <<
"' (or a derivation thereof), rather than '" << model.type()
383 return refCast<const OtherModelType>(model);
388 template<
class OtherType>
397 return fieldSource<OtherType>(
name, source).value(source, subMesh);
402 template<
class OtherType>
411 return fieldSource<OtherType>(
name, injection).value(injection, subMesh);
435 "Ostream& operator<<(Ostream&, const LagrangianFieldSource<Type>&)"
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
const Sources & sources() const
Return const-reference to the sources.
const objectRegistry & db() const
Return the local objectRegistry.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Base class for Lagrangian source conditions.
const OtherFieldSourceType & fieldSourceCast(const word &name, const LagrangianModel &) const
Lookup and return another field source and then cast to a.
const dimensionSet & internalDimensions() const
Return internal dimensions reference.
virtual void write(Ostream &) const
Write.
static autoPtr< LagrangianFieldSource< Type > > New(const word &fieldSourceType, const regIOobject &)
Return a pointer to a new field source.
const objectRegistry & db() const
Return local objectRegistry.
tmp< LagrangianSubField< Type > > value(const LagrangianSource &, const LagrangianSubMesh &) const
Return the value for a continuous source.
const OtherModelType & modelCast(const LagrangianModel &) const
Cast a model to the given type. Handle errors.
tmp< LagrangianSubField< Type > > sourceCoeff(const LagrangianSource &, const LagrangianSubMesh &) const
Return the source coefficient.
virtual tmp< LagrangianSubField< Type > > sourceValue(const LagrangianSource &, const LagrangianSubMesh &) const
Return the source value.
virtual ~LagrangianFieldSource()
Destructor.
virtual tmp< LagrangianSubScalarField > internalCoeff(const LagrangianSource &, const LagrangianSubMesh &) const
Return the internal coefficient.
LagrangianFieldSource(const regIOobject &)
Construct from internal field.
const LagrangianFieldSource< OtherType > & fieldSource(const word &name, const LagrangianModel &) const
Lookup and return another field source.
const LagrangianInternalDynamicField< Type > & internalField() const
Return internal field reference.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Base class for Lagrangian models.
const word & name() const
The source name.
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
SubList< Type > sub(const List< Type > &list) const
Return a sub-list corresponding to this sub-mesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Dimension set for the base types.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
Registry of regIOobjects.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dlLibraryTable libs
Table of loaded dynamic libraries.
To & refCastNull(From &r)
Reference type cast template function,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
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.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.