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);
96 if (!this->mesh().changing() && this->mesh().
solution().cache(
name))
100 !mesh().objectRegistry::template
104 solution::cachePrintMessage(
"Calculating and caching",
name, vsf);
106 regIOobject::store(tgGrad.
ptr());
109 solution::cachePrintMessage(
"Retrieving",
name, vsf);
111 mesh().objectRegistry::template lookupObjectRef<VolField<GradType>>
122 solution::cachePrintMessage(
"Deleting",
name, vsf);
126 solution::cachePrintMessage(
"Recalculating",
name, vsf);
127 tmp<VolField<GradType>> tgGrad = calcGrad(vsf,
name);
129 solution::cachePrintMessage(
"Storing",
name, vsf);
130 regIOobject::store(tgGrad.ptr());
131 VolField<GradType>& gGrad =
132 mesh().objectRegistry::template
133 lookupObjectRef<VolField<GradType>>
145 mesh().objectRegistry::template
146 foundObject<VolField<GradType>>(
name)
149 VolField<GradType>& gGrad =
150 mesh().objectRegistry::template
151 lookupObjectRef<VolField<GradType>>
156 if (gGrad.ownedByRegistry())
158 solution::cachePrintMessage(
"Deleting",
name, vsf);
164 solution::cachePrintMessage(
"Calculating",
name, vsf);
165 return calcGrad(vsf,
name);
177 const VolField<Type>& vsf
180 return grad(vsf,
"grad(" + vsf.name() +
')');
191 const tmp<VolField<Type>>& tvsf
196 tmp<VolField<GradType>> tgrad =
grad(tvsf());
Generic GeometricField class.
bool eof() const
Return true if end of input seen.
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.
virtual ~gradScheme()
Destructor.
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const VolField< Type > &, const word &name) const
Calculate and return the grad of the given field.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
void release()
Release ownership of this object from its registry.
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
Selector class for relaxation factors, solver type and solution.
A class for managing temporary objects.
T * ptr() const
Return tmp pointer for reuse.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define InfoInFunction
Report an information message using Foam::Info.
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.