OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
This class is initialized with an application that describes the linearization of the problem that we would like to solve and the nonlinear solved that drives the process (usually a Newton loop). More...
#include <adaptive_refinement.h>
Public Member Functions | |
AdaptiveRefinement (AppFrame::OptimizationBlockMatrixApplication< dim > &app_lin, AppFrame::ApplicationCopy &app, const AppFrame::FEVector &solution=AppFrame::FEVector()) | |
Constructor. | |
~AdaptiveRefinement () | |
void | declare_parameters (ParameterHandler ¶m) const |
Declare all parameters that are needed for: | |
void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Reset the parameters used to compute the linear solver equations. | |
void | initialize (ParameterHandler ¶m) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data. | |
void | solve (const std::string param_file, ParameterHandler ¶m) |
Solve the nonlinear problem. | |
void | test_derivatives (const std::string input_file, const std::string dvar, const double value, std::vector< double > &resp, std::vector< std::vector< double > > &dresp, const bool gradient=true) |
Member function used to test the derivatives. | |
void | print_parameters () const |
Print parameters: | |
void | run_Newton () |
Run Newton application. | |
void | run_Newton (std::vector< double > &resp) |
Run Newton application. | |
void | run_Newton (std::vector< double > &resp, std::vector< std::vector< double > > &dresp_dl) |
Run Newton application. | |
const AppFrame::FEVector & | get_solution () const |
This function returns solution . | |
Private Attributes | |
bool | output_initial_mesh |
Flag to output the initial grid to be solved. | |
bool | output_initial_sol |
Flag to output the initial grid to be solved. | |
std::string | filename_initial_mesh |
Filename where to output the initial grid. | |
std::string | filename_initial_sol |
Filename where to output the initial grid. | |
bool | output_intermediate_sol |
bool | output_final_sol |
bool | output_intermediate_resp |
bool | output_coarse_solution |
bool | read_in_initial_solution |
unsigned int | n_ref |
Number of initial refinements for the original mesh. | |
bool | gradients |
Compute the gradients? | |
AppFrame::OptimizationBlockMatrixApplication < dim > * | app_linear |
Pointer to application. | |
AppFrame::ApplicationCopy * | app |
Poiner to nonlinear application. | |
AppFrame::FEVector | solution |
Global FE solution at the support points of the computational domain. | |
This class is initialized with an application that describes the linearization of the problem that we would like to solve and the nonlinear solved that drives the process (usually a Newton loop).
Then, this class implements the adaptive refinement loop for the application.
This class needs two inputs:
AppFrame::AdaptiveRefinement< dim >::AdaptiveRefinement | ( | AppFrame::OptimizationBlockMatrixApplication< dim > & | app_lin, |
AppFrame::ApplicationCopy & | app, | ||
const AppFrame::FEVector & | solution = AppFrame::FEVector() |
||
) |
Constructor.
AppFrame::AdaptiveRefinement< dim >::~AdaptiveRefinement | ( | ) |
void AppFrame::AdaptiveRefinement< dim >::declare_parameters | ( | ParameterHandler & | param | ) | const |
Declare all parameters that are needed for:
Currently the options implemented are:
|
inline |
This function returns solution
.
References AppFrame::AdaptiveRefinement< dim >::solution.
void AppFrame::AdaptiveRefinement< dim >::initialize | ( | ParameterHandler & | param | ) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data.
void AppFrame::AdaptiveRefinement< dim >::print_parameters | ( | ) | const |
Print parameters:
void AppFrame::AdaptiveRefinement< dim >::run_Newton | ( | ) |
Run Newton application.
void AppFrame::AdaptiveRefinement< dim >::run_Newton | ( | std::vector< double > & | resp | ) |
Run Newton application.
void AppFrame::AdaptiveRefinement< dim >::run_Newton | ( | std::vector< double > & | resp, |
std::vector< std::vector< double > > & | dresp_dl | ||
) |
Run Newton application.
void AppFrame::AdaptiveRefinement< dim >::set_parameters | ( | const std::vector< std::string > & | name_dvar, |
const std::vector< double > & | value_dvar, | ||
ParameterHandler & | param | ||
) |
Reset the parameters used to compute the linear solver equations.
void AppFrame::AdaptiveRefinement< dim >::solve | ( | const std::string | param_file, |
ParameterHandler & | param | ||
) |
Solve the nonlinear problem.
void AppFrame::AdaptiveRefinement< dim >::test_derivatives | ( | const std::string | input_file, |
const std::string | dvar, | ||
const double | value, | ||
std::vector< double > & | resp, | ||
std::vector< std::vector< double > > & | dresp, | ||
const bool | gradient = true |
||
) |
Member function used to test the derivatives.
|
private |
Poiner to nonlinear application.
|
private |
Pointer to application.
|
private |
Filename where to output the initial grid.
|
private |
Filename where to output the initial grid.
|
private |
Compute the gradients?
|
private |
Number of initial refinements for the original mesh.
|
private |
|
private |
|
private |
Flag to output the initial grid to be solved.
|
private |
Flag to output the initial grid to be solved.
|
private |
|
private |
|
private |
|
private |
Global FE solution at the support points of the computational domain.
Referenced by AppFrame::AdaptiveRefinement< dim >::get_solution().