Go to the documentation of this file.
43 Foam::adjointSolver::adjointSolver
46 const word& managerType,
48 const word& primalSolverName
52 primalSolverName_(primalSolverName),
58 dict.subDict(
"objectives"),
63 sensitivities_(
nullptr),
66 dict.getOrDefault<
bool>(
"computeSensitivities",
true)
68 isConstraint_(
dict.getOrDefault<
bool>(
"isConstraint",
false))
72 objectiveManagerPtr_().update();
81 const word& managerType,
83 const word& primalSolverName
88 auto cstrIter = adjointSolverConstructorTablePtr_->cfind(solverType);
90 if (!cstrIter.found())
97 *adjointSolverConstructorTablePtr_
103 cstrIter()(
mesh, managerType,
dict, primalSolverName)
130 computeSensitivities_ =
133 objectiveManagerPtr_->readDict(
dict.
subDict(
"objectives"));
144 return objectiveManagerPtr_();
150 return objectiveManagerPtr_();
156 return isConstraint_;
162 sensitivities_.clear();
class for managing incompressible objective functions.
const word primalSolverName_
Name of primal solver.
A class for handling words, derived from Foam::string.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual bool isConstraint()
Is the solving referring to a constraint.
fvMesh & mesh_
Reference to the mesh database.
virtual void updatePrimalBasedQuantities()
virtual bool readDict(const dictionary &dict)
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Base class for solution control classes.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
const Type & lookupObject(const word &name, const bool recursive=false) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual void clearSensitivities()
Clears the sensitivity field known by the adjoint solver.
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const objectiveManager & getObjectiveManager() const
Return a const reference to the objective manager.
Base class for primal solvers.
virtual bool readDict(const dictionary &dict)
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)
const primalSolver & getPrimalSolver() const
static autoPtr< adjointSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &primalSolverName)
Return a reference to the selected turbulence model.