119 psiInterpolation(
mesh).interpolate
121 subMesh.
sub(
mesh.coordinates()),
129 if (useOldTime(
mesh))
132 psi0Interpolation(
mesh).interpolate
134 subMesh.
sub(
mesh.coordinates()),
145 LagrangianMesh::fractionName
153 return tmp<LagrangianSubField<Type>>
155 new LagrangianSubField<Type>
159 subMesh.
sub(this->name_),
179 typename Foam::CarrierFieldGradBase<Type>::GradType
184 const LagrangianModelRef&,
185 const LagrangianSubMesh& subMesh
188 const LagrangianMesh&
mesh = subMesh.mesh();
191 tmp<Field<GradType>> tpsic =
192 this->psiInterpolation(
mesh).interpolateGrad
194 subMesh.sub(
mesh.coordinates()),
195 subMesh.sub(
mesh.celli()),
196 subMesh.sub(
mesh.facei()),
197 subMesh.sub(
mesh.faceTrii())
202 if (this->useOldTime(
mesh))
204 tmp<Field<GradType>> tpsi0c =
205 this->psi0Interpolation(
mesh).interpolateGrad
207 subMesh.sub(
mesh.coordinates()),
208 subMesh.sub(
mesh.celli()),
209 subMesh.sub(
mesh.facei()),
210 subMesh.sub(
mesh.faceTrii())
217 .lookupObject<LagrangianInternalScalarDynamicField>
219 LagrangianMesh::fractionName
227 return tmp<LagrangianSubField<GradType>>
229 new LagrangianSubField<GradType>
233 subMesh.sub(
"grad(" + this->name_ +
')'),
254 psi().hasStoredOldTimes()
255 &&
psi().nOldTimes(
false)
258 LagrangianMesh::fractionName
269 if (!psiInterpolationPtr_.valid())
271 psiInterpolationPtr_ =
279 return psiInterpolationPtr_();
289 if (!psi0InterpolationPtr_.valid())
291 psi0InterpolationPtr_ =
299 return psi0InterpolationPtr_();
310 clouds::carried::nameToCarrierName(
psi.
name()),
314 functorPtr_(nullptr),
316 psiInterpolationPtr_(nullptr),
317 psi0InterpolationPtr_(nullptr)
329 functorPtr_(nullptr),
331 psiInterpolationPtr_(nullptr),
332 psi0InterpolationPtr_(nullptr)
343 psiInterpolationPtr_(nullptr),
344 psi0InterpolationPtr_(nullptr)
349 template<
class ... Args>
364 tpsi_ = functorPtr_->operator()();
376 if (tpsi_.valid() && tpsi_.isTmp())
380 tpsi_.ref().nullOldestTime();
384 tpsi_.ref().oldTime();
385 tpsi_.ref() = functorPtr_->operator()();
389 psiInterpolationPtr_.clear();
390 psi0InterpolationPtr_.clear();
Class to store an evaluation function.
Function(const word &name, const F &f)
Construct from a name and a function.
virtual tmp< VolField< Type > > operator()() const
Evaluate the field.
virtual ~Function()
Destructor.
virtual ~Functor()
Destructor.
virtual tmp< VolField< Type > > operator()() const =0
Evaluate the field.
const VolField< Type > & psi() const
Access the carrier field.
bool useOldTime(const LagrangianMesh &) const
Return whether or not to interpolate in time as well as space.
const interpolation< Type > & psi0Interpolation(const LagrangianMesh &) const
Return the old-time interpolation engine.
void reset(const bool initial)
Reset.
CarrierFieldBase(const VolField< Type > &)
Construct from a reference to a carrier field.
const interpolation< Type > & psiInterpolation(const LagrangianMesh &) const
Return the interpolation engine.
void reset(const bool initial)
Reset.
CarrierFieldGradBase(const Args &... args)
Construct from arguments passed to the base class.
A field derived from other state fields of the cloud. Stores and virtualises a function or a method w...
void clear(const bool final)
Clear.
const word & name() const
Field name.
const word name_
The name. May be word::null, in which case the name is.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const PrimitiveField< Type > & primitiveField() const
Return a const-reference to the primitive field.
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Class containing Lagrangian geometry and topology.
Simple wrapper to provide an optional reference to a Lagrangian model.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
const LagrangianMesh & mesh() const
Return the mesh.
word sub(const word &fieldName) const
Return the name of a field corresponding to this sub-mesh.
Pre-declare related SubField type.
const word & name() const
Return const reference to name.
const Time & time() const
Return the top-level database.
const fvSchemes & schemes() const
Return the fvSchemes.
ITstream & interpolation(const word &name) const
Abstract base class for interpolation.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
bool foundObject(const word &name) const
Is the named Type in registry.
A class for managing temporary objects.
bool isTmp() const
Return true if this is really a temporary object.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const volScalarField & psi
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
const dimensionSet & dimLength
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
Foam::argList args(argc, argv)