27 #ifndef _FUEL_CELL_APPLICATION_CORE_DOF_APPLICATION_H_
28 #define _FUEL_CELL_APPLICATION_CORE_DOF_APPLICATION_H_
30 #include <deal.II/base/data_out_base.h>
31 #include <deal.II/lac/constraint_matrix.h>
32 #include <deal.II/lac/petsc_parallel_vector.h>
33 #include <deal.II/lac/petsc_vector.h>
34 #include <deal.II/grid/tria.h>
35 #include <deal.II/grid/tria_iterator.h>
36 #include <deal.II/grid/tria_accessor.h>
37 #include <deal.II/grid/grid_refinement.h>
38 #include <deal.II/grid/grid_tools.h>
39 #include <deal.II/grid/grid_out.h>
40 #include <deal.II/dofs/dof_handler.h>
41 #include <deal.II/dofs/dof_renumbering.h>
42 #include <deal.II/numerics/data_out.h>
43 #include <deal.II/numerics/solution_transfer.h>
44 #include <deal.II/numerics/error_estimator.h>
45 #include <deal.II/distributed/solution_transfer.h>
62 using namespace dealii;
63 using namespace FuelCell::ApplicationCore;
75 namespace ApplicationCore
130 DoFApplication(boost::shared_ptr<ApplicationData> data = boost::shared_ptr<ApplicationData>());
147 bool triangulation_only);
173 virtual void declare_parameters(ParameterHandler& param);
179 virtual void initialize(ParameterHandler& param);
189 virtual void remesh_dofs();
195 virtual void remesh();
209 virtual void init_vector(
FEVector& dst)
const;
288 virtual void initialize_solution (
FEVector& initial_guess,
289 std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
305 virtual double estimate(
const FEVectors& src);
310 virtual double evaluate(
const FEVectors& src);
319 virtual double residual(
FEVector& dst,
321 bool apply_boundaries =
true);
336 virtual void residual_constraints(
FEVector& dst)
const;
338 #ifdef OPENFCST_WITH_PETSC
339 virtual void residual_constraints(PETScWrappers::MPI::Vector& dst,
const std::vector<unsigned int>&)
const;
350 void add_vector_for_transfer(
FEVector* src);
355 void delete_vector_for_transfer();
367 unsigned int memory_consumption()
const;
433 virtual void grid_out(
const std::string& basename);
438 virtual void data_out(
const std::string& basename,
448 void print(
const std::string& basename,
450 const std::vector<unsigned int>& src_indices = std::vector<unsigned int>())
const;
571 void _initialize(ParameterHandler& param);
582 virtual void initialize_triangulation(ParameterHandler& param);
605 void read_init_solution(
FEVector& dst,
606 bool& good_solution)
const;
614 virtual void cell_residual(
FEVector& cell_vector,
620 virtual void bdry_residual(
FEVector& face_vector,
626 virtual void face_residual(
FEVector& face_vector1,
634 virtual double cell_estimate(
const CellInfo& src);
639 virtual double bdry_estimate(
const FaceInfo& src);
644 virtual double face_estimate(
const FaceInfo& src1,
682 boost::shared_ptr<Triangulation<dim> >
tr;
693 DataOut<dim, DoFHandler<dim> >
d_out;
744 virtual void data_out(
const std::string& basename,
746 const std::vector<std::string>& solution_names,
747 const std::vector< DataPostprocessor<dim>* >& PostProcessing);
763 virtual void data_out(
const std::string& basename,
766 const std::vector<std::string>& solution_names,
769 const std::vector<std::string>& postprocessing_names = std::vector<std::string>());
775 void constrain_boundary(
FEVector& v,
776 bool homogeneous)
const;
849 boost::shared_ptr<FiniteElement<dim> >
element;
854 boost::shared_ptr<DoFHandler<dim> >
dof;
998 virtual void distribute_face_to_cell_errors();
1013 virtual double global_from_local_errors()
const;
GridOut g_out
The object for writing grids.
Definition: dof_application.h:688
Definition: dof_application.h:67
FuelCell::ApplicationCore::IntegrationInfo< dim, FEFaceValuesBase< dim > > FaceInfo
Shortcut.
Definition: dof_application.h:119
boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > mesh_generator
Grid.
Definition: dof_application.h:676
const unsigned int dim
Definition: fcst_constants.h:23
unsigned int mapping_degree
Degree used for polynomial mapping of arbitrary order.
Definition: dof_application.h:844
Vector< double > output_materials
Vector that will be used by data_out to store the material ids.
Definition: dof_application.h:482
DataOut< dim, DoFHandler< dim > > d_out
The object for writing data.
Definition: dof_application.h:693
ConstraintMatrix hanging_node_constraints
Constraint Matrix object.
Definition: dof_application.h:809
bool output_initial_sol
Flag to output the initial solution used to start the solving process.
Definition: dof_application.h:396
Definition: dof_application.h:68
BlockInfo block_info
Definition: dof_application.h:856
std::vector< component_boundaryID_value_map > component_boundaryID_value_maps
Each entry of this std::vector reflects the following structure (see FuelCell::InitialAndBoundaryData...
Definition: dof_application.h:668
A small structure collecting the different BlockIndices of FEVector vectors (for instance, solution) involved in the computations.
Definition: mesh_loop_info_objects.h:173
bool output_coarse_solution
Bool flag used to specify if the final solution should be stored in the coarse mesh in order to be us...
Definition: dof_application.h:424
Quadrature< dim-1 > quadrature_residual_face
Quadrature rule for residual computation on faces.
Definition: dof_application.h:922
std::vector< FEVector * > transfer_vectors
List of vector names to be transfered from one grid to the next.
Definition: dof_application.h:906
Vector< double > output_levels
Vector that will be used by data_out to store the refinement levels at each cell. ...
Definition: dof_application.h:488
bool output_actual_degree
true, if you want to output solution and postprocessing data using actual finite element fields Q_n w...
Definition: dof_application.h:499
bool print_solution
true, if you want to print FEVector solution to a text file.
Definition: dof_application.h:507
std::vector< unsigned int > postprocessing_printing_indices
The indices of the FEVector postprocessing to be printed to a text file.
Definition: dof_application.h:533
bool sort_cuthill
Flag for sorting with Cuthill McKee algorithm.
Definition: dof_application.h:893
Definition: dof_application.h:69
std::string refinement
Refinement parameter from parameter file.
Definition: dof_application.h:871
std::vector< DataComponentInterpretation::DataComponentInterpretation > data_interpretation
Definition: dof_application.h:470
FuelCell::SystemManagement system_management
This object knows everything about FCST equations, variables, couplings, etc.
Definition: dof_application.h:782
Vector< float > cell_errors
The result of error estimation by cell.
Definition: dof_application.h:861
bool interior_fluxes
Extend the integration loops in assemble() and residual() also to interior faces. ...
Definition: dof_application.h:971
std::vector< component_materialID_value_map > component_materialID_value_maps
Each entry of this std::vector reflects the following structure (see FuelCell::InitialAndBoundaryData...
Definition: dof_application.h:658
std::string filename_initial_sol
Filename where to output the initial grid.
Definition: dof_application.h:382
boost::shared_ptr< Boundary< dim > > curved_boundary
Curved boundary.
Definition: dof_application.h:556
types::boundary_id curved_bdry_id
Curved boundary ID.
Definition: dof_application.h:561
bool use_predefined_solution
Use user pre-defined initial solution.
Definition: dof_application.h:411
FuelCell::ApplicationCore::IntegrationInfo< dim, FEValuesBase< dim > > CellInfo
Shortcut.
Definition: dof_application.h:114
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
Vector< float > face_errors
The result of error estimation by face.
Definition: dof_application.h:866
double coarsening_threshold
Coarsening threshold for adaptive method from parameter file.
Definition: dof_application.h:886
boost::shared_ptr< Triangulation< dim > > tr
Pointer to the Triangulation object.
Definition: dof_application.h:682
Quadrature< dim > quadrature_residual_cell
Quadrature rule for residual computation on cells.
Definition: dof_application.h:911
bool output_materials_and_levels
output_materials_and_levels if true then visualized, otherwise suppressed.
Definition: dof_application.h:476
bool print_blocks_instead_of_indices
true, if the whole blocks of FEVector solution or FEVector postprocessing to be printed to a text fil...
Definition: dof_application.h:541
Base class for applications.
Definition: application_base.h:113
bool output_matrices_and_rhs
If true, all cell matrices and right hand sides will be output.
Definition: dof_application.h:550
unsigned int initial_refinement
Initial refinement from parameter file.
Definition: dof_application.h:876
std::vector< DataComponentInterpretation::DataComponentInterpretation > postprocessing_interpretations
postprocessing_interpretations identifies whether some postprocessing_names are scalars or parts of a...
Definition: dof_application.h:465
boost::shared_ptr< DoFHandler< dim > > dof
Pointer to the DoFHandler object.
Definition: dof_application.h:854
bool read_in_initial_solution
Bool flag used to specify if the initial solution to the problem, specially important for non-linear ...
Definition: dof_application.h:406
std::vector< unsigned int > solution_printing_indices
The indices of the FEVector solution to be printed to a text file.
Definition: dof_application.h:524
Point< dim > sort_direction
Direction for downstream sorting.
Definition: dof_application.h:901
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
boost::shared_ptr< FiniteElement< dim > > element
The finite element used in dof.
Definition: dof_application.h:849
Quadrature< dim-1 > quadrature_residual_bdry
Quadrature rule for residual computation on boundary faces.
Definition: dof_application.h:916
Table< 2, DoFTools::Coupling > flux_couplings
Couplings through flux bilinear forms.
Definition: dof_application.h:959
unsigned int verbosity
Controls verbosity of certain functions.
Definition: dof_application.h:977
Definition: dof_application.h:70
bool boundary_fluxes
Extend the integration loops in assemble() and residual() also to boundary faces. ...
Definition: dof_application.h:965
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
Table< 2, DoFTools::Coupling > cell_couplings
Couplings through cell bilinear forms.
Definition: dof_application.h:953
The data type used in function calls of Application.
Definition: fe_vectors.h:59
boost::shared_ptr< Mapping< dim > > mapping
The mapping used for the transformation of mesh cells.
Definition: dof_application.h:821
double refinement_threshold
Refinement threshold for adaptive method from parameter file.
Definition: dof_application.h:881
Base class for all linear applications, i.e., all applications requiring Triangulation and DoFHandler...
Definition: dof_application.h:107
bool print_postprocessing
true, if you want to print FEVector postprocessing to a text file.
Definition: dof_application.h:515
std::vector< DataComponentInterpretation::DataComponentInterpretation > solution_interpretations
solution_interpretations identifies whether some solution_names are scalars or parts of a vector...
Definition: dof_application.h:459
std::map< unsigned int, double > boundary_constraints
List of all nodes constrained by a strong boundary condition, together with a value to be assigned...
Definition: dof_application.h:791
unsigned int n_ref
Number of refinements.
Definition: dof_application.h:1023