39 const word& fieldName,
46 auto& mtx = tmtx.ref();
50 const label fieldi =
source.applyToField(fieldName);
58 const bool ok =
source.isActive();
71 <<
" for field " << fieldName <<
endl;
76 source.addSup(mtx, fieldi);
122 const word& fieldName
133 auto& mtx = tmtx.ref();
158 <<
" for field " << fieldName <<
endl;
190 const word& fieldName
202 auto& mtx = tmtx.ref();
227 <<
" for field " << fieldName <<
endl;
266 this->mesh_.time().timeName(),
306 const word& fieldName
338 Info<<
"(Inactive constrain)";
353template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
356 GeometricField<Type, PatchField, GeoMesh>&
field
359 const word& fieldName =
field.name();
361 for (fv::option& source : *
this)
363 const label fieldi = source.applyToField(fieldName);
367 addProfiling(fvopt,
"fvOption::correct.", source.name());
369 source.setApplied(fieldi);
371 const bool ok = source.isActive();
381 Info<<
"(Inactive correct)";
383 Info<<
" source " << source.name()
384 <<
" for field " << fieldName <<
endl;
389 source.correct(
field);
399 Field<Type>& sensField,
400 const word& fieldName,
401 const word& designVariablesName
404 for (fv::option& source : *
this)
406 const label fieldi = source.applyToField(fieldName);
410 addProfiling(fvopt,
"fvOption::postProcessSens.", source.name());
412 const bool ok = source.isActive();
416 Info<<
"Post processing sensitivity source "
417 << source.name() <<
" for field " << fieldName <<
endl;
422 source.postProcessSens
434template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
437 const GeometricField<Type, PatchField, GeoMesh>& primal,
438 const GeometricField<Type, PatchField, GeoMesh>& adjoint,
440 const word& fieldName
443 for (fv::option& source : *
this)
445 const label fieldi = source.applyToField(fieldName);
452 "fvOption::postProcessAuxSens.", source.name()
455 const bool ok = source.isActive();
459 Info<<
"Post processing sensitivity source "
460 << source.name() <<
" for field " << fieldName <<
endl;
465 source.postProcessAuxSens
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
const fvMesh & mesh_
Reference to the mesh database.
void checkApplied() const
Check that all sources have been applied.
tmp< faMatrix< Type > > source(GeometricField< Type, faPatchField, areaMesh > &field, const areaScalarField &h, const word &fieldName, const dimensionSet &ds)
Return source for equation with specified name and dimensions.
tmp< faMatrix< Type > > d2dt2(GeometricField< Type, faPatchField, areaMesh > &field)
Return source for equation with second time derivative.
tmp< faMatrix< Type > > operator()(const areaScalarField &h, GeometricField< Type, faPatchField, areaMesh > &field)
Return source for equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
void correct(GeometricField< Type, PatchField, GeoMesh > &field)
Apply correction to field.
void checkApplied() const
Check that all sources have been applied.
tmp< fvMatrix< Type > > d2dt2(GeometricField< Type, fvPatchField, volMesh > &field)
Return source for equation with second time derivative.
void postProcessAuxSens(const GeometricField< Type, PatchField, GeoMesh > &primal, const GeometricField< Type, PatchField, GeoMesh > &adjoint, scalarField &sensField, const word &fieldName=word::null)
Post process auxiliary sensitivity field related to the fvOption.
void constrain(fvMatrix< Type > &eqn)
Apply constraints to equation.
void postProcessSens(Field< Type > &sensField, const word &fieldName=word::null, const word &designVariablesName=word::null)
Post process sensitivity field related to the fvOption.
tmp< fvMatrix< Type > > source(GeometricField< Type, fvPatchField, volMesh > &field, const word &fieldName, const dimensionSet &ds)
Return source for equation with specified name and dimensions.
Base abstract class for handling finite volume options (i.e. fvOption).
const word & name() const noexcept
Return const access to the source name.
void setApplied(const label fieldi)
Set the applied flag to true for field index fieldi.
virtual label applyToField(const word &fieldName) const
Return index of field name if found in fieldNames list.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
virtual void constrain(fvMatrix< scalar > &eqn, const label fieldi)
virtual bool isActive()
Is the source active?
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Namespace for handling debugging switches.
int debug
Static debugging option.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...