81 const word& fieldSourceType,
85 typename nullConstructorTable::iterator cstrIter =
86 nullConstructorTablePtr_->find(fieldSourceType);
88 if (cstrIter == nullConstructorTablePtr_->end())
91 <<
"Unknown null-constructable fieldSource type " << fieldSourceType
92 <<
nl <<
nl <<
"Valid fieldSource types are :" <<
endl
93 << nullConstructorTablePtr_->sortedToc()
97 return cstrIter()(iF);
111 libs.
open(
dict,
"libs", dictionaryConstructorTablePtr_);
113 typename dictionaryConstructorTable::iterator cstrIter =
114 dictionaryConstructorTablePtr_->find(fieldSourceType);
116 if (cstrIter == dictionaryConstructorTablePtr_->end())
118 if (!disallowGenericFvFieldSource)
120 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
123 if (cstrIter == dictionaryConstructorTablePtr_->end())
126 <<
"Unknown fieldSource type " << fieldSourceType
128 <<
"Valid fieldSource types are :" <<
endl
129 << dictionaryConstructorTablePtr_->sortedToc()
134 return cstrIter()(iF,
dict);
150 return internalField_.mesh();
158 return internalField_;
171 <<
"Condition of type " <<
type() <<
" cannot be used for source "
172 << model.
name() <<
" of field " << internalField().name()
173 <<
" in file " << internalField().objectPath() <<
" as it is not "
174 <<
"defined for cell sets. It can only be used for sources that "
190 <<
"Condition of type " <<
type() <<
" cannot be used for source "
191 << model.
name() <<
" of field " << internalField().name()
192 <<
" in file " << internalField().objectPath() <<
" as it is not "
193 <<
"defined for cell sets. It can only be used for sources that "
209 (1 - internalCoeff(model, source))
210 *sourceValue(model, source);
223 (1 - internalCoeff(model, source,
cells))
224 *sourceValue(model, source,
cells);
237 sourceCoeff(model, source)
238 + internalCoeff(model, source)*internalField();
251 sourceCoeff(model, source,
cells)
257 template<
class OtherType>
265 db().template lookupObject<VolField<OtherType>>(
name);
272 template<
class OtherType>
281 return fieldSource<OtherType>(
name, model).value(model, source);
286 template<
class OtherType>
295 return fieldSource<OtherType>(
name, model).value(model, source,
cells);
318 os.
check(
"Ostream& operator<<(Ostream&, const fvFieldSource<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.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
Base class for finite-volume field sources.
virtual tmp< DimensionedField< scalar, volMesh > > internalCoeff(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const =0
Return the internal coefficient.
virtual tmp< DimensionedField< Type, volMesh > > sourceValue(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const =0
Return the source value.
virtual void write(Ostream &) const
Write.
fvFieldSource(const DimensionedField< Type, volMesh > &)
Construct from internal field.
const objectRegistry & db() const
Return the local object registry.
const fvFieldSource< OtherType > & fieldSource(const word &name, const fvSource &model) const
Lookup and return another field source.
static autoPtr< fvFieldSource< Type > > New(const word &fieldSourceType, const DimensionedField< Type, volMesh > &)
Return a pointer to a new field source.
virtual tmp< DimensionedField< Type, volMesh > > sourceCoeff(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the source coefficient.
virtual ~fvFieldSource()
Destructor.
tmp< DimensionedField< Type, volMesh > > value(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the value.
const DimensionedField< Type, volMesh > & internalField() const
Return the internal field reference.
const word & name() const
Return const access to the source name.
Base class for finite volume sources.
Registry of regIOobjects.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.