73 const word& fieldSourceType,
77 typename nullConstructorTable::iterator cstrIter =
78 nullConstructorTablePtr_->find(fieldSourceType);
80 if (cstrIter == nullConstructorTablePtr_->end())
83 <<
"Unknown null-constructable fieldSource type " << fieldSourceType
84 <<
nl <<
nl <<
"Valid fieldSource types are :" <<
endl
85 << nullConstructorTablePtr_->sortedToc()
89 return cstrIter()(iF);
103 libs.
open(
dict,
"libs", dictionaryConstructorTablePtr_);
105 typename dictionaryConstructorTable::iterator cstrIter =
106 dictionaryConstructorTablePtr_->find(fieldSourceType);
108 if (cstrIter == dictionaryConstructorTablePtr_->end())
110 if (!disallowGenericFvFieldSource)
112 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
115 if (cstrIter == dictionaryConstructorTablePtr_->end())
118 <<
"Unknown fieldSource type " << fieldSourceType
120 <<
"Valid fieldSource types are :" <<
endl
121 << dictionaryConstructorTablePtr_->sortedToc()
126 return cstrIter()(iF,
dict);
142 return internalField_.mesh();
149 return internalField_.mesh().
time();
157 return internalField_;
170 <<
"Condition of type " <<
type() <<
" cannot be used for source "
171 << model.
name() <<
" of field " << internalField().name()
172 <<
" in file " << internalField().objectPath() <<
" as it is not "
173 <<
"defined for cell sets. It can only be used for sources that "
189 <<
"Condition of type " <<
type() <<
" cannot be used for source "
190 << model.
name() <<
" of field " << internalField().name()
191 <<
" in file " << internalField().objectPath() <<
" as it is not "
192 <<
"defined for cell sets. It can only be used for sources that "
208 (1 - internalCoeff(model, source))
209 *sourceValue(model, source);
222 (1 - internalCoeff(model, source,
cells))
223 *sourceValue(model, source,
cells);
236 sourceCoeff(model, source)
237 + internalCoeff(model, source)*internalField();
250 sourceCoeff(model, source,
cells)
256 template<
class OtherType>
264 db().template lookupObject<VolField<OtherType>>(
name);
271 template<
class OtherType>
280 return fieldSource<OtherType>(
name, model).value(model, source);
285 template<
class OtherType>
294 return fieldSource<OtherType>(
name, model).value(model, source,
cells);
317 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,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
const DimensionedField< Type, fvMesh > & internalField() const
Return the internal field reference.
virtual tmp< DimensionedField< Type, fvMesh > > sourceCoeff(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const
Return the source coefficient.
static autoPtr< fvFieldSource< Type > > New(const word &fieldSourceType, const DimensionedField< Type, fvMesh > &)
Return a pointer to a new field source.
const Time & time() const
Return time.
virtual void write(Ostream &) const
Write.
fvFieldSource(const DimensionedField< Type, fvMesh > &)
Construct from internal field.
virtual tmp< DimensionedField< Type, fvMesh > > sourceValue(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const =0
Return the source value.
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.
tmp< DimensionedField< Type, fvMesh > > value(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const
Return the value.
virtual ~fvFieldSource()
Destructor.
virtual tmp< DimensionedField< scalar, fvMesh > > internalCoeff(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const =0
Return the internal coefficient.
const word & name() const
Return const access to the source name.
Base class for finite volume sources.
Registry of regIOobjects.
const Time & time() const
Return time.
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.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.