59 const word& adjointSolverName,
60 const word& primalSolverName
63 objectiveGeometric(
mesh,
dict, adjointSolverName, primalSolverName),
80 const auto&
beta = *betap;
85 - targetPercentage_->value(
time);
88 J_ /= targetPercentage_->value(
time);
94 <<
"Beta field not yet registered in database. OK for start-up"
105 dJdbPtr_().primitiveFieldRef() = scalar(1)/
gSum(
mesh_.
V());
108 dJdbPtr_().primitiveFieldRef() /= targetPercentage_->value(
time);
Istream and Ostream manipulators taking arguments.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
scalar timeOutputValue() const
Return the current user-time value. (ie, after applying any timeToUserTime() conversion).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
Mesh data needed to do the Finite Volume discretisation.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const Time & time() const
Return the top-level database.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Abstract base class for objective functions that contain only geometric quantities.
static autoPtr< objectiveGeometric > New(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Return a reference to the selected turbulence model.
autoPtr< OFstream > objFunctionFilePtr_
File to keep the objective values after the end of the primal solver.
unsigned int width_
Default width of entries when writing in the objective files.
scalar J_
Objective function value and weight.
const dictionary & dict() const
Return objective dictionary.
Objective quantifying the difference between the volume occupied by solid in topology optimisation an...
virtual void update_dJdb()
Contribution to field sensitivities.
virtual void addHeaderColumns() const
Write headers for additional columns.
objectiveTopOSolidVolume(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
virtual scalar J()
Return the objective function value.
virtual void addColumnValues() const
Write information to additional columns.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Type gSum(const FieldField< Field, Type > &f)
const dimensionSet dimless
Dimensionless.
Type gWeightedAverage(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted average of a field, using the mag() of the weights.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
autoPtr< GeometricField< Type, fvPatchField, volMesh > > createZeroFieldPtr(const fvMesh &mesh, const word &name, const dimensionSet dims, bool printAllocation=false)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)