|
template<typename INTEGRATORDATACONT > |
| InstatReducedProblem (PROBLEM *OP, DOpEtypes::VectorStorageType state_behavior, ParameterReader ¶m_reader, INTEGRATORDATACONT &idc, int base_priority=0) |
|
template<typename STATEINTEGRATORDATACONT , typename CONTROLINTEGRATORCONT > |
| InstatReducedProblem (PROBLEM *OP, DOpEtypes::VectorStorageType state_behavior, ParameterReader ¶m_reader, CONTROLINTEGRATORCONT &c_idc, STATEINTEGRATORDATACONT &s_idc, int base_priority=0) |
|
virtual | ~InstatReducedProblem () |
|
void | ReInit () |
|
bool | ComputeReducedConstraints (const ControlVector< VECTOR > &q, ConstraintVector< VECTOR > &g) |
|
void | GetControlBoxConstraints (ControlVector< VECTOR > &lb, ControlVector< VECTOR > &ub) |
|
void | ComputeReducedGradient (const ControlVector< VECTOR > &q, ControlVector< VECTOR > &gradient, ControlVector< VECTOR > &gradient_transposed) |
|
double | ComputeReducedCostFunctional (const ControlVector< VECTOR > &q) |
|
void | ComputeReducedFunctionals (const ControlVector< VECTOR > &q) |
|
void | ComputeReducedHessianVector (const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &direction, ControlVector< VECTOR > &hessian_direction, ControlVector< VECTOR > &hessian_direction_transposed) |
|
template<class DWRC > |
void | ComputeRefinementIndicators (DWRC &) |
|
void | StateSizeInfo (std::stringstream &out) |
|
void | WriteToFile (const VECTOR &v, std::string name, std::string outfile, std::string dof_type, std::string filetype) |
|
void | WriteToFile (const ControlVector< VECTOR > &v, std::string name, std::string dof_type) |
|
void | WriteToFile (const std::vector< double > &v, std::string outfile) |
|
| ReducedProblemInterface (PROBLEM *OP, int base_priority=0) |
|
| ~ReducedProblemInterface () |
|
virtual void | ComputeReducedHessianInverseVector (const ControlVector< VECTOR > &, const ControlVector< VECTOR > &, ControlVector< VECTOR > &) |
|
virtual void | ComputeReducedGradientOfGlobalConstraints (unsigned int, const ControlVector< VECTOR > &, const ConstraintVector< VECTOR > &, ControlVector< VECTOR > &, ControlVector< VECTOR > &) |
|
void | SetProblemType (std::string type, unsigned int num=0) |
|
PROBLEM * | GetProblem () |
|
const PROBLEM * | GetProblem () const |
|
template<class DWRC > |
void | InitializeDWRC (DWRC &dwrc) |
|
| ReducedProblemInterface_Base () |
|
virtual | ~ReducedProblemInterface_Base () |
|
virtual void | WriteToFileElementwise (const Vector< double > &, std::string, std::string, std::string, std::string) |
|
void | RegisterOutputHandler (DOpEOutputHandler< VECTOR > *OH) |
|
void | RegisterExceptionHandler (DOpEExceptionHandler< VECTOR > *OH) |
|
DOpEExceptionHandler< VECTOR > * | GetExceptionHandler () |
|
DOpEOutputHandler< VECTOR > * | GetOutputHandler () |
|
double | GetFunctionalValue (std::string name) const |
|
const std::vector< double > & | GetTimeFunctionalValue (std::string name) const |
|
void | AddUserDomainData (std::string name, const VECTOR *new_data) |
|
void | DeleteUserDomainData (std::string name) |
|
|
const StateVector< VECTOR > & | GetU () const |
|
StateVector< VECTOR > & | GetU () |
|
StateVector< VECTOR > & | GetZ () |
|
StateVector< VECTOR > & | GetDU () |
|
StateVector< VECTOR > & | GetDZ () |
|
NONLINEARSOLVER & | GetNonlinearSolver (std::string type) |
|
CONTROLNONLINEARSOLVER & | GetControlNonlinearSolver () |
|
INTEGRATOR & | GetIntegrator () |
|
CONTROLINTEGRATOR & | GetControlIntegrator () |
|
void | ComputeTimeFunctionals (unsigned int step, unsigned int num_steps) |
|
void | ComputeReducedState (const ControlVector< VECTOR > &q) |
|
void | ComputeReducedAdjoint (const ControlVector< VECTOR > &q, ControlVector< VECTOR > &temp_q, ControlVector< VECTOR > &temp_q_trans) |
|
template<typename PDE > |
void | ForwardTimeLoop (PDE &problem, StateVector< VECTOR > &sol, std::string outname, bool eval_funcs) |
|
template<typename PDE > |
void | BackwardTimeLoop (PDE &problem, StateVector< VECTOR > &sol, ControlVector< VECTOR > &temp_q, ControlVector< VECTOR > &temp_q_trans, std::string outname, bool eval_grads) |
|
virtual const std::map
< std::string, unsigned int > & | GetFunctionalPosition () const |
|
std::string | GetPostIndex () const |
|
int | GetBasePriority () const |
|
void | InitializeFunctionalValues (unsigned int N) |
|
std::vector< std::vector
< double > > & | GetFunctionalValues () |
|
const std::vector< std::vector
< double > > & | GetFunctionalValues () const |
|
const std::map< std::string,
const VECTOR * > & | GetUserDomainData () const |
|
template<typename CONTROLNONLINEARSOLVER, typename NONLINEARSOLVER, typename CONTROLINTEGRATOR, typename INTEGRATOR, typename PROBLEM, typename VECTOR, int dopedim, int dealdim>
class DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >
Basic class to solve time dependent PDE- and optimization problems.
- Template Parameters
-
<CONTROLNONLINEARSOLVER> | Newton solver for the control variables. |
<NONLINEARSOLVER> | Newton solver for the state variables. |
<CONTROLINTEGRATOR> | An integrator for the control variables, e.g, Integrator or IntegratorMixedDimensions.. |
<INTEGRATOR> | An integrator for the state variables, e.g, Integrator or IntegratorMixedDimensions.. |
<PROBLEM> | PDE- or optimization problem under consideration including ts-scheme. |
<VECTOR> | Class in which we want to store the spatial vector (i.e. dealii::Vector<double> or dealii::BlockVector<double>) |
<dopedim> | The dimension for the control variable. |
<dealdim> | The dimension for the state variable. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename INTEGRATORDATACONT >
DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::InstatReducedProblem |
( |
PROBLEM * |
OP, |
|
|
DOpEtypes::VectorStorageType |
state_behavior, |
|
|
ParameterReader & |
param_reader, |
|
|
INTEGRATORDATACONT & |
idc, |
|
|
int |
base_priority = 0 |
|
) |
| |
Constructor for the InstatPDEProblem.
- Template Parameters
-
- Parameters
-
OP | Problem is given to the stationary solver. |
state_behavior | Indicates the behavior of the StateVector. |
param_reader | An object which has run time data. |
idc | An INTETGRATORDATACONT which has all the data needed by the integrator. |
base_priority | An offset for the priority of the output written to the OutputHandler |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename STATEINTEGRATORDATACONT , typename CONTROLINTEGRATORCONT >
DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::InstatReducedProblem |
( |
PROBLEM * |
OP, |
|
|
DOpEtypes::VectorStorageType |
state_behavior, |
|
|
ParameterReader & |
param_reader, |
|
|
CONTROLINTEGRATORCONT & |
c_idc, |
|
|
STATEINTEGRATORDATACONT & |
s_idc, |
|
|
int |
base_priority = 0 |
|
) |
| |
Constructor for the StatReducedProblem.
- Template Parameters
-
- Parameters
-
OP | Problem is given to the stationary solver. |
state_behavior | Indicates the behavior of the StateVector. |
param_reader | An object which has run time data. |
c_idc | The InegratorDataContainer for control integration |
s_idc | The InegratorDataContainer for state integration |
base_priority | An offset for the priority of the output written to the OutputHandler |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename PDE >
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::BackwardTimeLoop |
( |
PDE & |
problem, |
|
|
StateVector< VECTOR > & |
sol, |
|
|
ControlVector< VECTOR > & |
temp_q, |
|
|
ControlVector< VECTOR > & |
temp_q_trans, |
|
|
std::string |
outname, |
|
|
bool |
eval_grads |
|
) |
| |
|
protected |
This function does the loop over time but in direction -t.
- Parameters
-
problem | Describes the nonstationary pde to be solved |
q | The given control vector |
outname | The name prefix given to the solution vectors if they are written to files, e.g., Adjoint, Hessian, ... |
eval_grads | Decide wether to evaluate the gradients of the functionals or not. Should be true for the adjoint and dual_hessian-problem but false for auxilliary backward pdes. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
This function computes the adjoint, i.e., the Lagrange multiplier to constraint given by the state equation. It is assumed that the state u(q) corresponding to the argument q is already calculated.
- Parameters
-
q | The control vector is given to this function. |
temp_q | A storage vector to hold precomputed values for the gradient of the cost functional. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
double DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeReducedCostFunctional |
( |
const ControlVector< VECTOR > & |
q | ) |
|
|
virtual |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeReducedFunctionals |
( |
const ControlVector< VECTOR > & |
q | ) |
|
|
virtual |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeReducedHessianVector |
( |
const ControlVector< VECTOR > & |
q, |
|
|
const ControlVector< VECTOR > & |
direction, |
|
|
ControlVector< VECTOR > & |
hessian_direction, |
|
|
ControlVector< VECTOR > & |
hessian_direction_transposed |
|
) |
| |
|
virtual |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeReducedState |
( |
const ControlVector< VECTOR > & |
q | ) |
|
|
protected |
This function is running the time dependent problem for the state variable. There is a loop over all time steps, and in each time step the nonlinear solver is called. The nonlinear solver is even called for linear problems where the solution is computed within one iteration step.
- Parameters
-
q | The control vector is given to this function. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<class DWRC >
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeRefinementIndicators |
( |
DWRC & |
| ) |
|
|
inline |
Computes the error indicators for the error of a previosly specified functional. Assumes that the primal state solution is already computed and the functional is specified (see problem::SetFunctionalForErrorEstimation).
Everything else is determined by the DWRDataContainer you use (represented by the template parameter DWRC).
- Template Parameters
-
<DWRC> | A container for the refinement indicators See, e.g., DWRDataContainer |
<PDE> | The problem contrainer |
- Parameters
-
q | The ControlVector at which the indicators are to be evaluated. |
dwrc | The data container |
pde | The problem |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ComputeTimeFunctionals |
( |
unsigned int |
step, |
|
|
unsigned int |
num_steps |
|
) |
| |
|
protected |
This function computes functionals of interest within a time dependent computation. For instance, drag- and lift values can be computed, as well as deflections, stresses, etc.
- Parameters
-
step | The actual time step. |
num_steps | The total number of time steps. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
Static member function for run time parameters.
- Parameters
-
param_reader | An object which has run time data. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename PDE >
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ForwardTimeLoop |
( |
PDE & |
problem, |
|
|
StateVector< VECTOR > & |
sol, |
|
|
std::string |
outname, |
|
|
bool |
eval_funcs |
|
) |
| |
|
protected |
This function does the loop over time.
- Parameters
-
problem | Describes the nonstationary pde to be solved |
q | The given control vector |
outname | The name prefix given to the solution vectors if they are written to files, e.g., State, Tangent, ... |
eval_funcs | Decide wether to evaluate the functionals or not. Should be true for the primal-problem but false for auxilliary forward pdes, like the tangent one. |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::ReInit |
( |
| ) |
|
|
virtual |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::StateSizeInfo |
( |
std::stringstream & |
out | ) |
|
|
inlinevirtual |
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::WriteToFile |
( |
const VECTOR & |
v, |
|
|
std::string |
name, |
|
|
std::string |
outfile, |
|
|
std::string |
dof_type, |
|
|
std::string |
filetype |
|
) |
| |
|
virtual |
Here, the given BlockVector<double> v is printed to a file of *.vtk or *.gpl format. However, in later implementations other file formats will be available.
- Parameters
-
v | The BlockVector to write to a file. |
name | The names of the variables, e.g., in a fluid problem: v1, v2, p. |
outfile | The basic name for the output file to print. |
dof_type | Has the DoF type: state or control. |
filetype | The filetype. Actually, *.vtk and *.gpl outputs are possible. |
Implements DOpE::ReducedProblemInterface_Base< VECTOR >.
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::WriteToFile |
( |
const ControlVector< VECTOR > & |
v, |
|
|
std::string |
name, |
|
|
std::string |
dof_type |
|
) |
| |
|
virtual |
Here, the given ControlVector<VECTOR> v is printed to a file of *.vtk or *.gpl format. However, in later implementations other file formats will be available.
- Parameters
-
v | The Control vector to write to a file. |
name | The names of the variables, e.g., in a fluid problem: v1, v2, p. |
dof_type | Has the DoF type: state or control. |
Implements DOpE::ReducedProblemInterface_Base< VECTOR >.
template<typename CONTROLNONLINEARSOLVER , typename NONLINEARSOLVER , typename CONTROLINTEGRATOR , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dopedim, int dealdim>
void DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >::WriteToFile |
( |
const std::vector< double > & |
v, |
|
|
std::string |
outfile |
|
) |
| |
|
virtual |
A std::vector v is printed to a text file. Note that this assumes that the vector is one entry per time step.
- Parameters
-
v | A std::vector to write to a file. |
outfile | The basic name for the output file to print. |
Implements DOpE::ReducedProblemInterface_Base< VECTOR >.