OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
WHAT DOES THIS APPLICATION DO? More...
#include <app_read_mesh.h>
Public Member Functions | |
AppReadMesh (boost::shared_ptr< AppFrame::ApplicationData > data=boost::shared_ptr< AppFrame::ApplicationData >()) | |
Constructor. | |
~AppReadMesh () | |
Destructor. | |
virtual void | declare_parameters (ParameterHandler ¶m) |
Declare all parameters that are needed for: | |
void | _initialize (ParameterHandler ¶m) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data. | |
virtual void | initialize (ParameterHandler ¶m) |
Call the other initialize routines from the inherited classes. | |
void | initialize_grid (ParameterHandler ¶m) |
Initilize and create the grid Determines whether reading from a grid file or creating new. | |
void | init_solution (AppFrame::FEVector &src) |
Initialize nonlinear solution. | |
void | cell_residual (AppFrame::FEVector &, const typename DoFApplication< dim >::CellInfo &) |
Integration of the rhs of the equations. | |
void | cell_responses (std::vector< double > &, const typename DoFApplication< dim >::CellInfo &, const AppFrame::FEVector &) |
Compute the value of all objective function and constraints. | |
void | global_responses (std::vector< double > &, const AppFrame::FEVector &) |
This class is used to evaluate all responses that do not require looping over cells. | |
virtual void | data_out (const std::string &basename, const AppFrame::FEVectors &src) |
Reimplementation of the routine in the base class BaseApplication in namespace AppFrame so that the right labels are outputed and so that I can compute and output the source term. | |
Public Member Functions inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
OptimizationBlockMatrixApplication (boost::shared_ptr< AppFrame::ApplicationData > data=boost::shared_ptr< AppFrame::ApplicationData >()) | |
Constructor for an object, owning its own mesh and dof handler. | |
OptimizationBlockMatrixApplication (AppFrame::DoFApplication< dim > &, bool triangulation_only) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
~OptimizationBlockMatrixApplication () | |
Destructor. | |
virtual void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Function called by optimization loop in order to set the values in the ParameterHandler to the new design parameters. | |
virtual void | responses (std::vector< double > &f, const AppFrame::FEVectors &vectors) |
Post-processing. | |
virtual void | check_responses () |
This class is called by responses to make sure that all responses requested are implemented in either cell_responses, global_responses or face_responses. | |
virtual void | print_responses (std::vector< double > &resp) |
This function is used to print the responses to screen (deallog) | |
virtual void | dresponses_dl (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVectors &src) |
Post-processing. | |
virtual void | cell_dresponses_dl (std::vector< std::vector< double > > &cell_df_dl, const typename DoFApplication< dim >::CellInfo &info, const AppFrame::FEVector &src) |
This class is used to evaluate the derivative of all the functionals that require looping over cells with respect to the design variables. | |
virtual void | global_dresponses_dl (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVector &src) |
This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respect of the design variables. | |
virtual void | dresponses_du (std::vector< AppFrame::FEVector > &dst, const AppFrame::FEVectors &src) |
Loop over all cells and assemble the vector
\[ \frac{\partial f_m}{\partial u_i} \] that is used to solve the sensitivity equations by using the local matrix integration functions cell_dfunctional_du(), bdry_dfunctional_dlu() and edge_dfunctinal_du() provided by the derived class. | |
virtual void | cell_dresponses_du (std::vector< AppFrame::FEVector > &df_du, const typename DoFApplication< dim >::CellInfo &info, std::vector< std::vector< double > > &src) |
Integration of local bilinear form. | |
virtual void | global_dresponses_du (std::vector< AppFrame::FEVector > &df_du, const AppFrame::FEVector &src) |
This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respect of the design variables. | |
virtual void | dresidual_dlambda (std::vector< AppFrame::FEVector > &dst, const AppFrame::FEVectors &src) |
Loop over all cells and assemble the vector
\[ \frac{\partial R_n}{\partial \lambda_k} \] that is used to solve the sensitivity equations by using the local matrix integration functions cell_dresidual_dlambda(), bdry_dresidual_dlambda() and edge_dresidual_dlambda() provided by the derived class. | |
virtual void | cell_dresidual_dlambda (std::vector< AppFrame::FEVector > &cell_vector, const typename DoFApplication< dim >::CellInfo &cell, std::vector< std::vector< double > > &src) |
Integration of local bilinear form. | |
void | solve_direct (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVectors &sol) |
Solver in order to obtain the analytical sensitivities for the given objective and constraints using the direct method. | |
void | solve_adjoint (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVector &sol) |
Solver in order to obtain the analytical sensitivities for the given objective and constraints using the adjoint method. | |
unsigned int | get_n_resp () const |
Member function that returns the number of responses. | |
unsigned int | get_n_dvar () const |
Member function that returns the number of design variables. | |
std::vector< std::string > | get_name_dvar () const |
Member function that returns the name of the design variables. | |
std::vector< std::string > | get_name_responses () const |
Member function that returns the name of the responses. | |
void | print_default_parameter_file () |
Print the default parameter handler file. | |
bool | get_bool_transfer_solution () |
Function to see if we are transferring a solution on a refined grid to the initial coarse grid. | |
virtual void | set_read_initial_solution (bool &read) |
void | set_optimization_parameters (unsigned int &n_dvar, unsigned int &n_resp, std::vector< std::string > &name_design_var, std::vector< std::string > &name_responses) |
This routine assigns the value of n_dvar, n_resp, name_design_var and name_responses to the internal variables n_dvar, n_resp, name_design_var and name_response. | |
void | set_output_variables (std::vector< std::string > &dakota_name_responses) |
Public Member Functions inherited from AppFrame::BlockMatrixApplication< dim > | |
void | do_assemble (const FEVectors &, typename DoFHandler< dim >::active_cell_iterator begin, typename DoFHandler< dim >::active_cell_iterator end, Threads::Mutex &mutex) |
Multithreaded assemble function called by assemble(). | |
virtual void | post_cell_assemble () |
A call back function for assemble(), called after all cell matrices have been entered, but before the face matrices are computed. | |
BlockMatrixApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >()) | |
Constructor for an object, owning its own mesh and dof handler. | |
BlockMatrixApplication (DoFApplication< dim > &, bool triangulation_only) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
void | _initialize (ParameterHandler ¶m) |
Initialize data of this class. | |
void | add_vector_for_cell_matrix (std::string name, unsigned int block, unsigned int components, bool values, bool derivatives) |
Add a named vector from data to be handed to the cell_matrix() function via CellInfo::values and CellInfo::derivatives. | |
void | add_vector_for_flux_matrix (std::string name, unsigned int block, unsigned int components, bool values, bool derivatives) |
Add a named vector from data to be handed to the bdry_matrix() and face_matrix() functions via FaceInfo::values and FaceInfo::derivatives. | |
void | remesh_matrices () |
Initialize sparsity patterns and matrices for the new mesh. | |
virtual void | remesh () |
Refine grid accordingly to the Refinement options under "Grid Generation" in the parameter file. | |
void | assemble (const FEVectors &) |
Loop over all cells and assemble the system #matrices by using the local matrix integration functions cell_matrix(), bdry_matrix() and face_matrix() provided by the derived class. | |
void | assemble_numerically (const FEVectors &src, const double delta=1e-6) |
Compute the Jacobian of the system of equations,
\[ J(i,j) = \frac{\partial R_i}{\partial u_j} \] | |
void | residual_constraints (FEVector &dst) const |
Redefinition of residual_constraints() in DoFHandler. | |
virtual void | cell_matrix (MatrixVector &cell_matrices, const typename DoFApplication< dim >::CellInfo &cell) |
Integration of local bilinear form. | |
virtual void | bdry_matrix (MatrixVector &face_matrices, const typename DoFApplication< dim >::FaceInfo &face) |
Integration of local bilinear form. | |
virtual void | face_matrix (MatrixVector &matrices11, MatrixVector &matrices12, MatrixVector &matrices21, MatrixVector &matrices22, const typename DoFApplication< dim >::FaceInfo &face1, const typename DoFApplication< dim >::FaceInfo &face2) |
Integration of local bilinear form. | |
virtual void | dirichlet_bc (std::map< unsigned int, double > &boundary_values) const |
Public Member Functions inherited from AppFrame::DoFApplication< dim > | |
DoFApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >(), bool multigrid=false) | |
Constructor for an object, owning its own mesh and dof handler. | |
DoFApplication (bool multigrid) | |
Constructor for an object owning its own mesh and dof handler and creating new ApplicationData. | |
DoFApplication (DoFApplication< dim > &, bool triangulation_only, bool multigrid=false) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
~DoFApplication () | |
Destructor which deletes owned objects. | |
void | _initialize (ParameterHandler ¶m) |
Initialize from parameter values. | |
void | add_vector_for_transfer (FEVector *) |
Add the vector to be transfered from one mesh to the next. | |
void | delete_vector_for_transfer () |
Delete the vector to be transfered from one mesh to the next. | |
virtual void | remesh_dofs () |
Initialize dof handler, count the dofs in each block and renumber the dofs. | |
virtual void | init_vector (FEVector &dst) const |
Reinitialize the BlockVector dst such that it contains block_size.size() blocks. | |
virtual double | evaluate (const FEVectors &) |
Evaluate a functional during postprocessing such as drag or lift on an aerodynamics problem. | |
virtual double | estimate (const FEVectors &src) |
Estimate the error. | |
virtual double | residual (FEVector &dst, const FEVectors &src, bool apply_boundaries=true) |
Loop over all cells to compute the residual. | |
unsigned int | memory_consumption () const |
Compute the amount of memory needed by this object. | |
virtual double | cell_estimate (const CellInfo &) |
Integration of estimate inside a cell. | |
virtual double | bdry_estimate (const FaceInfo &) |
Integration of estimate on a boundary face. | |
virtual double | face_estimate (const FaceInfo &, const FaceInfo &) |
Integration of estimate on an interior face. | |
virtual void | cell_residual (FEVector &cell_vector, const CellInfo &cell) |
Integration of local linear form. | |
virtual void | bdry_residual (FEVector &face_vector, const FaceInfo &face) |
Integration of local linear form. | |
virtual void | face_residual (FEVector &face_vector1, FEVector &face_vector2, const FaceInfo &face1, const FaceInfo &face2) |
Integration of local linear form. | |
template<class BOX , class WORKER > | |
void | integrate_1form (BOX &box, WORKER &local_forms, FEVector &dst, const FEVectors &src) |
The function integrating 1-forms as for instance used by residual(). | |
void | integrate_functional (LocalEstimate< dim > &local_forms, FEVectors &dst, const FEVectors &src) |
The function integrating functionals using local integrators. | |
void | store_triangulation (Triangulation< dim > &new_tr) |
Function to copy a triangulation object for use after refinement. | |
void | transfer_solution_to_coarse_mesh (Triangulation< dim > &tr_coarse, AppFrame::FEVector &coarse_solution, AppFrame::FEVector &refined_solution) |
Function to perform the transfer of a solution on a refined grid to the initial coarse grid. | |
void | read_init_solution (AppFrame::FEVector &dst, bool &good_solution) const |
Function to transfer a solution on a refined grid to the initial coarse grid. | |
template<class INFO , typename TYPE > | |
void | fill_local_data (const INFO &info, const std::vector< VectorSelector > &data_vector, std::vector< std::vector< std::vector< TYPE > > > &data) const |
Fill local data vector with values of the stored finite element function vectors. | |
virtual void | grid_out (const std::string &basename) |
Output the grid used to solve the problem. | |
virtual void | data_out (const std::string &basename, const FEVectors &src, const std::vector< std::string > &solution_names) |
virtual void | data_out (const std::string &basename, const FEVector &solution, const std::vector< std::string > &solution_names, const FEVector &postprocessing=FEVector(), const std::vector< std::string > &postprocessing_names=std::vector< std::string >()) |
This function outputs the results of a computation. | |
Public Member Functions inherited from AppFrame::ApplicationBase | |
ApplicationBase (boost::shared_ptr< ApplicationData > ex_data=boost::shared_ptr< ApplicationData >()) | |
Constructor for an application. | |
ApplicationBase (const ApplicationBase &other) | |
Copy constructor. | |
virtual | ~ApplicationBase () |
Virtual destructor. | |
void | print_parameters_to_file (ParameterHandler ¶m, const std::string &file_name, const ParameterHandler::OutputStyle &style) |
Print default parameters for the application to a file. | |
virtual void | start_vector (FEVector &dst, std::string caller) const |
Initialize vector to problem size. | |
virtual void | solve (FEVector &start, const FEVectors &rhs) |
Solve the system assembled with right hand side rhs and return the result in start . | |
virtual void | Tsolve (FEVector &start, const FEVectors &rhs) |
Solve the dual system assembled with right hand side rhs and return the result in start . | |
virtual void | grid_out (const std::string &filename) const |
Write the mesh in the format specified by the ParameterHandler. | |
virtual void | data_out (const std::string &filename, const FEVectors &src, const std::vector< std::string >) |
boost::shared_ptr < ApplicationData > | get_data () |
Get access to the protected variable data. | |
const boost::shared_ptr < ApplicationData > | get_data () const |
Get read-only access to the protected variable data. | |
virtual std::string | id () const |
Return a unique identification string for this application. | |
virtual void | notify (const Event &reason) |
Add a reason for assembling. | |
virtual void | clear () |
Reset the application class such that a call to initialize() is possible again and will produce the same result as if the object was fresh. | |
void | clear_events () |
Clear all notifications. | |
Protected Attributes | |
boost::shared_ptr < FuelCellShop::Geometry::GridBase < dim > > | grid |
Create an object to generate the mesh. | |
std::vector< std::string > | equation_names |
Structure where we store the problem we want to solve. | |
std::vector< std::string > | component_names |
Structure where we store the name of each component in our problem. | |
std::vector< std::string > | design_var |
Stores the design variable names so that the name can be appended to the .vtk file name. | |
std::vector< double > | design_var_value |
Stores the values of the design variables so that the number can be appended to the .vtk file name. | |
Protected Attributes inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
unsigned int | n_dvar |
Number of design variables. | |
unsigned int | n_obj |
Number of objective functions. | |
unsigned int | n_resp |
Number of responses = n_obj + n_con. | |
std::vector< std::string > | name_design_var |
Member that stores the name of the design variables. | |
std::vector< std::string > | name_responses |
Member that stores the name of the responses, i.e. | |
std::vector< std::string > | name_output_var |
Member that stores the name of the output variables, These names will be written to name_responses if optimization is not being used and ignored otherwise. | |
bool | output_coarse_solution |
Decision variable for whether the solution is to be output for transfer. | |
bool | read_in_initial_solution |
Decision variable for whether the initial solution should be read from file. | |
bool | optimization |
Decision variable for whether the application is being used for optimization. | |
Protected Attributes inherited from AppFrame::BlockMatrixApplication< dim > | |
Table< 2, DoFTools::Coupling > | cell_couplings |
Couplings through cell bilinear forms. | |
Table< 2, DoFTools::Coupling > | flux_couplings |
Couplings through flux bilinear forms. | |
boost::shared_ptr< Quadrature < dim > > | quadrature_assemble_cell |
Quadrature rule for matrix assembling on cells. | |
boost::shared_ptr< Quadrature < dim-1 > > | quadrature_assemble_face |
Quadrature rule for matrix assembling on faces. | |
BlockSparseMatrix< double > | matrix |
Storage for the actual matrix. | |
FilteredMatrix< BlockVector < double > > | filtered_matrix |
Wrapper for the actual matrix that contains all the boundary conditions. | |
Protected Attributes inherited from AppFrame::DoFApplication< dim > | |
std::map< unsigned int, double > | boundary_constraints |
List of all nodes constrained by a strong boundary condition, together with a value to be assigned. | |
ConstraintMatrix | hanging_node_constraints |
Constraint Matrix object. | |
boost::shared_ptr< Mapping< dim > > | mapping |
The mapping used for the transformation of mesh cells. | |
unsigned int | mapping_degree |
Degree used for polynomial mapping of arbitrary order. | |
boost::shared_ptr < Triangulation< dim > > | tr |
Pointer to the Triangulation object. | |
boost::shared_ptr < FiniteElement< dim > > | element |
The finite element used in dof. | |
boost::shared_ptr< DoFHandler < dim > > | dof |
Pointer to the DoFHandler object. | |
boost::shared_ptr < MGDoFHandler< dim > > | mg_dof |
Pointer to the MGDoFHandler object. | |
MeshWorker::BlockInfo | block_info |
Vector< float > | cell_errors |
The result of error estimation by cell. | |
Vector< float > | face_errors |
The result of error estimation by face. | |
GridOut | g_out |
The object for writing grids. | |
DataOut< dim, DoFHandler< dim > > | d_out |
The object for writing data. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | data_interpretation |
Vector for adjusting output to vector data. | |
std::string | refinement |
Refinement parameter from parameter file. | |
unsigned int | initial_refinement |
Initial refinement from parameter file. | |
double | refinement_threshold |
Refinement threshold for adaptive method from parameter file. | |
double | coarsening_threshold |
Coarsening threshold for adaptive method from parameter file. | |
bool | sort_cuthill |
Flag for sorting with Cuthill McKee algorithm. | |
Point< dim > | sort_direction |
Direction for downstream sorting. | |
std::vector< FEVector * > | transfer_vectors |
List of vector names to be transfered from one grid to the next. | |
Quadrature< dim > | quadrature_residual_cell |
Quadrature rule for residual computation on cells. | |
Quadrature< dim-1 > | quadrature_residual_bdry |
Quadrature rule for residual computation on boundary faces. | |
Quadrature< dim-1 > | quadrature_residual_face |
Quadrature rule for residual computation on faces. | |
bool | boundary_fluxes |
Extend the integration loops in assemble() and residual() also to boundary faces. | |
bool | interior_fluxes |
Extend the integration loops in assemble() and residual() also to interior faces. | |
Protected Attributes inherited from AppFrame::ApplicationBase | |
boost::shared_ptr < ApplicationData > | data |
Object for auxiliary data. | |
Event | notifications |
Accumulate reasons for reassembling here. | |
Additional Inherited Members | |
Public Types inherited from AppFrame::DoFApplication< dim > | |
typedef MeshWorker::InfoObjects::IntegrationInfo < dim, FEValuesBase< dim > > | CellInfo |
This is a redefinition of CellInfo in order to call MeshWorker objects instead of the previous implementation in AppFrame. | |
typedef MeshWorker::InfoObjects::IntegrationInfo < dim, FEFaceValuesBase< dim > > | FaceInfo |
This is a redefinition of CellInfo in order to call MeshWorker objects instead of the previous implementation in AppFrame. | |
Public Attributes inherited from AppFrame::DoFApplication< dim > | |
unsigned int | verbosity |
Controls verbosity of certain functions. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | solution_interpretations |
solution_interpretations identifies whether some solution_names are scalars or parts of a vector. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | postprocessing_interpretations |
postprocessing_interpretations identifies whether some postprocessing_names are scalars or parts of a vector. | |
bool | output_materials_and_levels |
output_materials_and_levels if true then visualized, otherwise suppressed. | |
Vector< double > | output_materials |
Vector that will be used by data_out to store the material ids. | |
Vector< double > | output_levels |
Vector that will be used by data_out to store the refinement levels at each cell. | |
Static Public Attributes inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
static const AppFrame::Event | sensitivity_analysis |
The Event set by OptimizationMatrixApplication if if we want to compute the sensitivities and a new matrix should be assembled. | |
Protected Types inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
typedef void(* | CELL_Dvalues )(std::vector< AppFrame::FEVector > &, const typename DoFApplication< dim >::CellInfo &, std::vector< std::vector< double > > &) |
Definition of a pointer to a function that is called in a loop over cells to compute the derivatives of either residual or responses with respect to design variables. | |
Protected Member Functions inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
void | print_dresponses_dl (std::vector< std::vector< double > > pdf_pdl) |
Auxiliary routine to print the values df_dl This routine should be called once df_df is assembled. | |
void | print_dresponses_du (std::vector< AppFrame::FEVector > df_du) |
Auxiliary routine to print the values of df_du This routine should be called once df_du is assembled. | |
void | dfunction (std::vector< AppFrame::FEVector > &dst, const AppFrame::FEVectors &src, bool dfunctional_du, bool dresidual_dlambda) |
This is an auxiliary function called by dresidual_dlambda and dfunctional_du. | |
WHAT DOES THIS APPLICATION DO?
FuelCell::Application::AppReadMesh< dim >::AppReadMesh | ( | boost::shared_ptr< AppFrame::ApplicationData > | data = boost::shared_ptr< AppFrame::ApplicationData >() | ) |
Constructor.
FuelCell::Application::AppReadMesh< dim >::~AppReadMesh | ( | ) |
Destructor.
void FuelCell::Application::AppReadMesh< dim >::_initialize | ( | ParameterHandler & | param | ) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data.
|
inline |
Integration of the rhs of the equations.
Here we loop over the quadrature points and over degrees of freedom in order to compute the right hand side for each cell This routine depends on the problem at hand and is called by residual() in DoF_Handler class
|
inlinevirtual |
Compute the value of all objective function and constraints.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Reimplementation of the routine in the base class BaseApplication in namespace AppFrame so that the right labels are outputed and so that I can compute and output the source term.
Reimplemented from AppFrame::DoFApplication< dim >.
|
virtual |
Declare all parameters that are needed for:
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
inlinevirtual |
This class is used to evaluate all responses that do not require looping over cells.
An example of one of this types of constraints is the solid volume fraction.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Initialize nonlinear solution.
Implements AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Call the other initialize routines from the inherited classes.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
void FuelCell::Application::AppReadMesh< dim >::initialize_grid | ( | ParameterHandler & | param | ) |
Initilize and create the grid Determines whether reading from a grid file or creating new.
|
protected |
Structure where we store the name of each component in our problem.
The component names are stored in the same way as they are stored in the solution.
|
protected |
Stores the design variable names so that the name can be appended to the .vtk file name.
|
protected |
Stores the values of the design variables so that the number can be appended to the .vtk file name.
|
protected |
Structure where we store the problem we want to solve.
Each vector component contains a string with the name of the equation we want to solve Then, the number of components is equation_names.size()
|
protected |
Create an object to generate the mesh.