49 ) <<
"Grad scheme not specified" <<
endl <<
endl 50 <<
"Valid grad schemes are :" <<
endl 51 << IstreamConstructorTablePtr_->sortedToc()
55 const word schemeName(schemeData);
57 typename IstreamConstructorTable::iterator cstrIter =
58 IstreamConstructorTablePtr_->find(schemeName);
60 if (cstrIter == IstreamConstructorTablePtr_->end())
65 ) <<
"Unknown grad scheme " << schemeName <<
nl <<
nl 66 <<
"Valid grad schemes are :" <<
endl 67 << IstreamConstructorTablePtr_->sortedToc()
71 return cstrIter()(
mesh, schemeData);
88 typename Foam::outerProduct<Foam::vector, Type>::type,
104 if (!
mesh().objectRegistry::template foundObject<GradFieldType>(name))
106 solution::cachePrintMessage(
"Calculating and caching", name, vsf);
108 regIOobject::store(tgGrad.
ptr());
111 solution::cachePrintMessage(
"Retrieving", name, vsf);
112 GradFieldType& gGrad =
113 mesh().objectRegistry::template lookupObjectRef<GradFieldType>
118 if (gGrad.upToDate(vsf))
124 solution::cachePrintMessage(
"Deleting", name, vsf);
128 solution::cachePrintMessage(
"Recalculating", name, vsf);
131 solution::cachePrintMessage(
"Storing", name, vsf);
132 regIOobject::store(tgGrad.
ptr());
133 GradFieldType& gGrad =
134 mesh().objectRegistry::template lookupObjectRef<GradFieldType>
144 if (
mesh().objectRegistry::template foundObject<GradFieldType>(
name))
146 GradFieldType& gGrad =
147 mesh().objectRegistry::template lookupObjectRef<GradFieldType>
152 if (gGrad.ownedByRegistry())
154 solution::cachePrintMessage(
"Deleting", name, vsf);
160 solution::cachePrintMessage(
"Calculating", name, vsf);
161 return calcGrad(vsf, name);
171 typename Foam::outerProduct<Foam::vector, Type>::type,
181 return grad(vsf,
"grad(" + vsf.
name() +
')');
190 typename Foam::outerProduct<Foam::vector, Type>::type,
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Generic GeometricField class.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from string.
virtual ~gradScheme()
Destructor.
bool eof() const
Return true if end of input seen.
word name(const complex &)
Return a string representation of a complex.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Mesh data needed to do the Finite Volume discretisation.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
Selector class for relaxation factors, solver type and solution.
T * ptr() const
Return tmp pointer for reuse.
A class for managing temporary objects.
#define InfoInFunction
Report an information message using Foam::Info.
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.