Go to the documentation of this file.
48 objectiveIncompressible,
49 objectivePartialVolume,
60 const word& adjointSolverName,
61 const word& primalSolverName
68 mesh_.boundaryMesh().patchSet
75 if (!
dict.readIfPresent(
"initialVolume", initVol_))
78 for (
const label patchi : objectivePatches_)
85 bdxdbDirectMultPtr_.reset(createZeroBoundaryPtr<vector>(mesh_));
86 bdSdbMultPtr_.reset(createZeroBoundaryPtr<vector>(mesh_));
97 for (
const label patchi : objectivePatches_)
111 for (
const label patchi : objectivePatches_)
116 bdxdbDirectMultPtr_()[patchi] = -
oneThird*nf/initVol_;
124 for (
const label patchi : objectivePatches_)
140 if (objFunctionFilePtr_.empty())
142 setObjectiveFilePtr();
143 objFunctionFilePtr_() <<
setw(4) <<
"#" <<
" ";
144 objFunctionFilePtr_() <<
setw(width) <<
"(V - VInit)/VInit" <<
" ";
145 objFunctionFilePtr_() <<
setw(width) <<
"VInit" <<
endl;
149 objFunctionFilePtr_() <<
setw(width) <<
J_ <<
" ";
150 objFunctionFilePtr_() <<
setw(width) << initVol_ <<
endl;
scalar J()
Return the objective function value.
static constexpr scalar oneThird
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
objectivePartialVolume(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
static constexpr const zero Zero
Global zero (0)
addToRunTimeSelectionTable(objectiveIncompressible, objectiveForce, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
Type gSum(const FieldField< Field, Type > &f)
defineTypeNameAndDebug(objectiveForce, 0)
scalar J_
Objective function value and weight.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Istream and Ostream manipulators taking arguments.
virtual bool write(const bool valid=true) const
Write objective function history.
Abstract base class for objective functions in incompressible flows.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void update_dSdbMultiplier()
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
Omanip< int > setw(const int i)
static bool master(const label communicator=0)
Am I the master process.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void update_dxdbDirectMultiplier()
static unsigned int defaultPrecision()
Return the default precision.
const std::string patch
OpenFOAM patch number as a std::string.
A List of wordRe with additional matching capabilities.
const Time & time() const
Return the top-level database.