Go to the documentation of this file.
41 Info<<
"gradScheme<Type>::New"
42 "(const fvMesh& mesh, Istream& schemeData) : "
43 "constructing gradScheme<Type>"
52 ) <<
"Grad scheme not specified" <<
endl <<
endl
53 <<
"Valid grad schemes are :" <<
endl
54 << IstreamConstructorTablePtr_->sortedToc()
58 const word schemeName(schemeData);
60 typename IstreamConstructorTable::iterator cstrIter =
61 IstreamConstructorTablePtr_->find(schemeName);
63 if (cstrIter == IstreamConstructorTablePtr_->end())
68 ) <<
"Unknown grad scheme " << schemeName <<
nl <<
nl
69 <<
"Valid grad schemes are :" <<
endl
70 << IstreamConstructorTablePtr_->sortedToc()
74 return cstrIter()(
mesh, schemeData);
105 if (!this->
mesh().changing() && this->
mesh().cache(
name))
107 if (!
mesh().objectRegistry::template foundObject<GradFieldType>(
name))
109 solution::cachePrintMessage(
"Calculating and caching",
name, vsf);
111 regIOobject::store(tgGrad.
ptr());
114 solution::cachePrintMessage(
"Retrieving",
name, vsf);
115 GradFieldType& gGrad =
const_cast<GradFieldType&
>
117 mesh().objectRegistry::template lookupObject<GradFieldType>(
name)
120 if (gGrad.upToDate(vsf))
126 solution::cachePrintMessage(
"Deleting",
name, vsf);
130 solution::cachePrintMessage(
"Recalculating",
name, vsf);
131 tmp<GradFieldType> tgGrad = calcGrad(vsf,
name);
133 solution::cachePrintMessage(
"Storing",
name, vsf);
134 regIOobject::store(tgGrad.ptr());
135 GradFieldType& gGrad =
const_cast<GradFieldType&
>
137 mesh().objectRegistry::template lookupObject<GradFieldType>
148 if (
mesh().objectRegistry::template foundObject<GradFieldType>(
name))
150 GradFieldType& gGrad =
const_cast<GradFieldType&
>
152 mesh().objectRegistry::template lookupObject<GradFieldType>
158 if (gGrad.ownedByRegistry())
160 solution::cachePrintMessage(
"Deleting",
name, vsf);
166 solution::cachePrintMessage(
"Calculating",
name, vsf);
167 return calcGrad(vsf,
name);
184 const GeometricField<Type, fvPatchField, volMesh>& vsf
187 return grad(vsf,
"grad(" + vsf.name() +
')');
203 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvsf
207 typedef GeometricField<GradType, fvPatchField, volMesh> GradFieldType;
209 tmp<GradFieldType> tgrad =
grad(tvsf());
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual ~gradScheme()
Destructor.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
A class for handling words, derived from string.
A class for managing temporary objects.
bool eof() const
Return true if end of input seen.
Mesh data needed to do the Finite Volume discretisation.
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
Ostream & endl(Ostream &os)
Add newline and flush stream.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Mesh data needed to do the Finite Volume discretisation.
T * ptr() const
Return tmp pointer for reuse.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Generic GeometricField class.
word name(const complex &)
Return a string representation of a complex.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvPatchField, volMesh > &, const word &name) const
Calculate and return the grad of the given field.