29#ifndef OPTI_CASE_DUAL_H
30#define OPTI_CASE_DUAL_H
58 template<
typename,SolverMode>
typename SOLVER,
59 typename C = std::vector<S>>
64 using descriptor =
typename SOLVER<S,SolverMode::Reference>::AdjointLbSolverBase::DESCRIPTOR;
65 static constexpr int dim = descriptor::d;
124 const C&
control, C& derivatives,
unsigned optiStep=0)
override;
135 void initializeFields();
137 void derivativesFromDualSolution(C& derivatives);
class for marking output with some text
Conversion between physical and lattice units, as well as discretization.
This class implements the evaluation of the goal functional and its derivatives by using adjoint LBM.
std::size_t _dimCtrl
upper limit for the number of control variables (#voxels * field-dimension)
int _controlMaterial
Material number of design domain.
OptiCaseDual(XMLreader const &xml)
std::shared_ptr< SOLVER< S, SolverMode::Primal > > _primalSolver
S evaluateObjective(const C &control, unsigned optiStep=0) override
Solve primal problem and evaluate objective.
std::shared_ptr< SOLVER< S, SolverMode::Reference > > _referenceSolver
void computeDerivatives(const C &control, C &derivatives, unsigned optiStep=0) override
Compute derivatives via adjoint problem.
std::shared_ptr< GeometrySerializer< S, dim > > _serializer
UnitConverter< S, descriptor > * _converter
std::string _projectionName
ControlType _controlType
Either force or porosity field.
std::shared_ptr< SuperLatticeF< S, descriptor > > _projectedControl
maps the control to a lattice functor
std::shared_ptr< SuperGeometry< S, dim > > _referenceGeometry
int _fieldDim
Spatial dimension of controlled field.
S _regAlpha
Regulatory term in objective functional (so far unused)
std::shared_ptr< SOLVER< S, SolverMode::Dual > > _dualSolver
std::shared_ptr< projection::Base< S > > _projection
std::shared_ptr< SuperLattice< S, descriptor > > _referenceLattice
StartValueType _startValueType
std::shared_ptr< SuperLatticeF< S, descriptor > > _dProjectionDcontrol
derivative of _projectionControl
Controller< S > * _controller
Manages the array of control variables.
C getReferenceControl() const
Abstract base class for optimization tasks.
The description of a Controller – header file.
Top level namespace for all of OpenLB.
Input/Output in XML format – header file.