19 #ifndef _FCST_FUELCELLSHOP_EQUATION_EQUATION_BASE_H_
20 #define _FCST_FUELCELLSHOP_EQUATION_EQUATION_BASE_H_
21 #include <boost/shared_ptr.hpp>
33 using namespace dealii;
34 using namespace FuelCell::ApplicationCore;
36 namespace FuelCellShop
130 <<
"The user-defined variable with name \"" << arg1 <<
"\" should be one of the solution variables for equation with name \"" << arg2 <<
"\"");
140 <<
"The index of variable \"" << arg1 <<
"\" do not match with the index of equation \"" << arg2 <<
"\"");
211 print_caller_name(__FUNCTION__);
230 print_caller_name(__FUNCTION__);
244 AssertThrow( !internal_cell_couplings.empty() , ExcInternalError() );
245 return internal_cell_couplings;
254 AssertThrow( !internal_flux_couplings.empty() , ExcInternalError() );
255 return internal_flux_couplings;
264 AssertThrow( !component_materialID_value.empty() , ExcInternalError() );
265 return component_materialID_value;
274 AssertThrow( !component_boundaryID_value.empty() , ExcInternalError() );
275 return component_boundaryID_value;
284 return boundary_types;
293 return multi_boundary_types;
311 return multi_output_types;
321 return equation_name;
331 return matrix_block_indices;
341 return residual_indices;
351 print_caller_name(__FUNCTION__);
389 boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
399 virtual void declare_parameters(ParameterHandler& param)
const;
404 virtual void initialize(ParameterHandler& param);
410 const std::vector<double>& value_dvar,
411 ParameterHandler& param) {
412 print_caller_name(__FUNCTION__);
431 print_caller_name(__FUNCTION__);
443 print_caller_name(__FUNCTION__);
451 print_caller_name(__FUNCTION__);
464 print_caller_name(__FUNCTION__);
473 print_caller_name(__FUNCTION__);
486 if ( assemble_flags.assemble_generic_data )
488 make_assemblers_generic_constant_data();
489 assemble_flags.assemble_generic_data =
false;
492 if ( assemble_flags.assemble_cell_constant_data )
494 make_assemblers_cell_constant_data(cell_info);
495 assemble_flags.assemble_cell_constant_data =
false;
498 make_assemblers_cell_variable_data(cell_info, layer);
508 print_caller_name(__FUNCTION__);
516 print_caller_name(__FUNCTION__);
523 print_caller_name(__FUNCTION__);
530 print_caller_name(__FUNCTION__);
537 print_caller_name(__FUNCTION__);
544 print_caller_name(__FUNCTION__);
551 print_caller_name(__FUNCTION__);
558 print_caller_name(__FUNCTION__);
568 print_caller_name(__FUNCTION__);
578 print_caller_name(__FUNCTION__);
592 print_caller_name(__FUNCTION__);
604 print_caller_name(__FUNCTION__);
616 print_caller_name(__FUNCTION__);
627 print_caller_name(__FUNCTION__);
638 print_caller_name(__FUNCTION__);
647 print_caller_name(__FUNCTION__);
656 print_caller_name(__FUNCTION__);
665 void standard_to_block_wise(FullMatrix<double>& target)
const;
670 void standard_to_block_wise(Vector<double>& target)
const;
680 const FullMatrix<double>& src,
681 const std::vector<unsigned int>& matrix_block_indices)
const;
690 const Vector<double>& src,
691 const std::vector<unsigned int>& residual_indices)
const;
701 const unsigned int& param_boundary_id)
const
703 return tria_boundary_id == param_boundary_id;
714 void print_caller_name(
const std::string& caller_name)
const;
890 boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >
data;
This structure describes an output type of a derived equation class.
Definition: equation_base.h:101
virtual void set_parameters(const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m)
Set parameters using the parameter file, in order to run parametric/optimization studies.
Definition: equation_base.h:409
std::vector< double > JxW_cell
Jacobian of mapping by Weight in the quadrature points of a cell.
Definition: equation_base.h:764
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data object for the application data to be passed to the equation classes.
Definition: equation_base.h:890
bool variable_initial_data
true, if variable initial data is prescribed on a part of the domain.
Definition: equation_base.h:359
const std::string & get_equation_name() const
This function returns equation_name of a derived equation class.
Definition: equation_base.h:319
bool assemble_generic_data
Flag used to let equation clases know that generic data has already been initialized.
Definition: equation_base.h:54
virtual void make_component_materialID_value()
This function fills out component_materialID_value of a derived equation class.
Definition: equation_base.h:522
std::vector< std::vector< OutputType > > multi_output_types
The list of multiple output types of a derived equation class.
Definition: equation_base.h:850
virtual void print_equation_info() const
This function prints out the equations info of a derived equation class.
Definition: equation_base.h:349
bool assemble_cell_constant_data
Flag used to let equation class know that cell_constant data has already been initialized.
Definition: equation_base.h:58
bool belongs_to_boundary(const unsigned int &tria_boundary_id, const unsigned int ¶m_boundary_id) const
This function returns true if a boundary indicator of an external face on the triangulation coincides...
Definition: equation_base.h:700
std::vector< BoundaryType > boundary_types
The list of boundary types of a derived equation class.
Definition: equation_base.h:835
void select_cell_assemblers(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This routine is used to select the make_assembly routines that need to be called inside assemble_cell...
Definition: equation_base.h:483
unsigned int boundary_id
Boundary indicator.
Definition: equation_base.h:90
virtual void assemble_cell_linear_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble the local cell matrix for Linear problems.
Definition: equation_base.h:613
virtual void make_assemblers_bdry_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info)
Definition: equation_base.h:450
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication<dim>::system_management object.
Definition: equation_base.h:798
const component_boundaryID_value_map & get_component_boundaryID_value() const
This function returns component_boundaryID_value of a derived equation class.
Definition: equation_base.h:272
const std::vector< OutputType > & get_output_types() const
This function returns output_types of a derived equation class.
Definition: equation_base.h:300
unsigned int dofs_per_cell
Number of degrees of freedom per cell.
Definition: equation_base.h:723
const std::vector< std::vector< OutputType > > & get_multi_output_types() const
This function returns multi_output_types of a derived equation class.
Definition: equation_base.h:309
std::vector< OutputType > output_types
The list of output types of a derived equation class.
Definition: equation_base.h:845
Enumeration for flags used in equation classes to control assembly.
Definition: equation_base.h:49
virtual void make_boundary_types()
This function fills out boundary_types of a derived equation class.
Definition: equation_base.h:536
virtual void assemble_bdry_linear_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary matrix for linear problems.
Definition: equation_base.h:644
virtual void make_assemblers_cell_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info)
Function used to initialize cell speciific information that remains constant regardless of the cell b...
Definition: equation_base.h:442
std::vector< unsigned int > residual_indices
The residual indices (a derived equation class) drawn from the global structure (a derived equation c...
Definition: equation_base.h:872
std::map< std::string, std::map< std::string, DoFTools::Coupling > > couplings_map
The typedef for the map of cell or flux (DG FEM only) couplings stored in the actual equation classes...
Definition: system_management.h:41
std::map< std::string, std::map< types::material_id, double > > component_materialID_value_map
The typedef for the std::map that reflects the following structure:
Definition: initial_and_boundary_data.h:74
std::string name_base_variable
Const std::string member storing name of the base solution variable corresponding to the equation rep...
Definition: equation_base.h:861
virtual void make_multi_boundary_types()
This function fills out multi_boundary_types of a derived equation class.
Definition: equation_base.h:543
std::map< std::string, std::map< types::boundary_id, double > > component_boundaryID_value_map
The typedef for the std::map that reflects the following structure:
Definition: initial_and_boundary_data.h:85
std::string boundary_condition
Type of boundary condition.
Definition: equation_base.h:93
virtual void assemble_cell_Jacobian_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble the local Jacobian Matrix for Non-Linear problems.
Definition: equation_base.h:589
bool variable_boundary_data
true, if variable Dirichlet boundary conditions are prescribed on a part of the boundary.
Definition: equation_base.h:365
virtual void make_component_boundaryID_value()
This function fills out component_boundaryID_value of a derived equation class.
Definition: equation_base.h:529
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
virtual void assemble_bdry_Jacobian_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local Jacobian boundary matrix for Non-Linear problems.
Definition: equation_base.h:601
const std::vector< unsigned int > & get_residual_indices() const
This function returns residual_indices of a derived equation class.
Definition: equation_base.h:339
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
const std::vector< unsigned int > & get_matrix_block_indices() const
This function returns matrix_block_indices of a derived equation class.
Definition: equation_base.h:329
virtual void assemble_cell_linear_rhs(FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell RHS for Linear problems.
Definition: equation_base.h:635
DoFHandler< dim >::active_face_iterator bdry
Currently active DoFHandler<dim> active boundary iterator.
Definition: equation_base.h:747
component_materialID_value_map component_materialID_value
This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): ...
Definition: equation_base.h:820
EquationFlags assemble_flags
This vector contains a collection of internal flags to tell derived equation classes what needs to be...
Definition: equation_base.h:885
DeclException2(VariableShouldExistForEquation, std::string, std::string,<< "The user-defined variable with name \""<< arg1<< "\" should be one of the solution variables for equation with name \""<< arg2<< "\"")
Exception thrown when a particular variable required by the equation class, does not exist in the use...
virtual void assemble_bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary residual.
Definition: equation_base.h:226
std::string residual_vector_name
The name of the residual vector name in FEVectors.
Definition: equation_base.h:900
unsigned int n_q_points_bdry
Number of quadrature points per boundary.
Definition: equation_base.h:736
virtual void make_assemblers_cell_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Function used to compute cell specific information such as shape functions, shape function gradients...
Definition: equation_base.h:461
bool assemble_cell_variable_data_matrix
Flag used to let assemble_cell_variable_data know that derivatives do not need to computed as only th...
Definition: equation_base.h:62
couplings_map internal_flux_couplings
This object contains the info on how the "X" and "Y" of a derived equation class are coupled (DG FEM ...
Definition: equation_base.h:810
virtual void make_residual_indices()
This function is only needed to provide the last argument to dealII_to_appframe.
Definition: equation_base.h:577
std::string variable_name
Variable name.
Definition: equation_base.h:104
virtual void make_assemblers_generic_constant_data()
Function used to initialize variable information that will be needed to assemble matrix and residual ...
Definition: equation_base.h:430
const couplings_map & get_internal_cell_couplings() const
This function returns internal_cell_couplings of a derived equation class.
Definition: equation_base.h:242
std::vector< Point< dim > > normal_vectors
Normal vectors in the quadrature points of a boundary.
Definition: equation_base.h:785
std::vector< unsigned int > matrix_block_indices
The system matrix block indices (a derived equation class) drawn from the global structure (a derived...
Definition: equation_base.h:867
virtual void assemble_bdry_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary matrix.
Definition: equation_base.h:207
const component_materialID_value_map & get_component_materialID_value() const
This function returns component_materialID_value of a derived equation class.
Definition: equation_base.h:262
std::vector< std::vector< Point< dim > > > tangential_vectors
Tangential vectors in the quadrature points of a boundary.
Definition: equation_base.h:788
virtual void make_output_types()
This function fills out output_types of a derived equation class.
Definition: equation_base.h:550
std::string variable_interpretation
Variable interpretation.
Definition: equation_base.h:113
This is the base class used for all Equation classes.
Definition: equation_base.h:160
virtual void make_matrix_block_indices()
This function is only needed to provide the last argument to dealII_to_appframe.
Definition: equation_base.h:567
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings of a derived equation class.
Definition: equation_base.h:507
virtual void assemble_bdry_linear_rhs(FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary RHS for linear problems.
Definition: equation_base.h:653
component_boundaryID_value_map component_boundaryID_value
This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): ...
Definition: equation_base.h:830
virtual void assemble_cell_residual_rhs(FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell RHS for nonlinear problems.
Definition: equation_base.h:624
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
couplings_map internal_cell_couplings
This object contains the info on how the equations and solution variables of a derived equation class...
Definition: equation_base.h:804
const std::vector< BoundaryType > & get_boundary_types() const
This function returns boundary_types of a derived equation class.
Definition: equation_base.h:282
virtual void make_assemblers_bdry_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Definition: equation_base.h:470
This structure describes a boundary type of a derived equation class.
Definition: equation_base.h:84
Definition: dof_application.h:70
virtual void make_internal_flux_couplings()
This function fills out internal_flux_couplings (DG FEM only) of a derived equation class...
Definition: equation_base.h:514
std::string boundary_name
Boundary name.
Definition: equation_base.h:87
std::vector< double > JxW_bdry
Jacobian of mapping by Weight in the quadrature points of a boundary.
Definition: equation_base.h:782
DoFHandler< dim >::active_cell_iterator cell
Currently active DoFHandler<dim> active cell iterator.
Definition: equation_base.h:744
const std::vector< std::vector< BoundaryType > > & get_multi_boundary_types() const
This function returns multi_boundary_types of a derived equation class.
Definition: equation_base.h:291
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
const couplings_map & get_internal_flux_couplings() const
This function returns internal_flux_couplings (DG FEM only) of a derived equation class...
Definition: equation_base.h:252
std::vector< bool > counter
This vector contains the collection of internal "counters" used by the derived equation classes...
Definition: equation_base.h:878
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
std::string solution_vector_name
The name of the solution vector in FEVectors.
Definition: equation_base.h:895
unsigned int n_q_points_cell
Number of quadrature points per cell.
Definition: equation_base.h:729
std::vector< std::vector< BoundaryType > > multi_boundary_types
The list of multiple boundary types of a derived equation class.
Definition: equation_base.h:840
std::string equation_name
The name of a derived equation class.
Definition: equation_base.h:855
virtual void make_multi_output_types()
This function fills out multi_output_types of a derived equation class.
Definition: equation_base.h:557