18 #ifndef _FUELCELLSHOP__GEOMETRY_H
19 #define _FUELCELLSHOP__GEOMETRY_H
30 #include <grid/tria.h>
31 #include <grid/tria_accessor.h>
32 #include <grid/tria_iterator.h>
33 #include <grid/tria_boundary_lib.h>
34 #include <grid/grid_generator.h>
35 #include <grid/grid_in.h>
36 #include <grid/grid_out.h>
37 #include <base/parameter_handler.h>
38 #include <base/exceptions.h>
41 using namespace dealii;
43 namespace FuelCellShop
182 static void declare_GridGenerator_parameters (ParameterHandler ¶m);
187 static boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> >
create_GridGenerator (ParameterHandler ¶m)
189 boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > pointer;
190 std::string concrete_name;
192 param.enter_subsection(
"Grid generation");
194 concrete_name = param.get(
"Type of mesh");
198 param.leave_subsection();
204 if (iterator->second)
220 pointer->initialize(param);
231 const std::type_info& info =
typeid ( *this );
233 <<
" called in Class "
234 << info.name() << std::endl;
243 const types::boundary_id& bdry_id,
244 boost::shared_ptr< Boundary<dim> > boundary)
const
251 grid_in.attach_triangulation(triangulation);
252 std::ifstream input_file( this->mesh_name.c_str() );
253 grid_in.read( input_file , grid_in.parse_format( this->mesh_type ) );
256 triangulation.set_boundary(bdry_id,
259 triangulation.refine_global(this->num_refine);
267 std::vector<unsigned int> get_material_id (
const std::string )
const;
270 unsigned int get_boundary_id ( ParameterHandler& param,
271 const std::string boundary )
const;
274 unsigned int get_boundary_id (
const std::string )
const;
277 void output_grid (
const Triangulation<dim> &triangulation,
const std::string filename )
const;
282 void refine_area (
Triangulation<dim> &triangulation,
const unsigned int material_id );
291 return mesh_type_name;
310 inline std::vector<double>
L_cat_c(){
return l_cat_c;}
321 inline double L_mem(){
return l_mem;}
364 void initialize(ParameterHandler& param);
395 virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> >
create_replica ()
397 const std::type_info& info =
typeid(*this);
399 <<
" called in Class "
400 << info.name() << std::endl;
406 void print_material_id_and_boundary_id (
const Triangulation<dim> &triangulation )
const;
unsigned int c_CL_Membrane_bid
Boundary id cathode CL and membrane.
Definition: geometry.h:589
unsigned int c_Ch_GDL_bid
Boundary id cathode channel and GDL.
Definition: geometry.h:577
std::string get_mesh_type()
Return the type of mesh that is being used.
Definition: geometry.h:289
unsigned int num_c_GDL
Number of cells wide cathode gas diffusion layer.
Definition: geometry.h:488
double l_land_c
Width of the cathode current collector.
Definition: geometry.h:434
unsigned int a_Membrane_CL_bid
Boundary id anode membrane and CL.
Definition: geometry.h:603
double L_gdl_c()
Return the Thickness of the cathode gas diffusion layer.
Definition: geometry.h:306
unsigned int c_GDL_CL_bid
Boundary id cathode GDL and CL.
Definition: geometry.h:585
unsigned int c_GDL_mid
Material id cathode GDL.
Definition: geometry.h:535
unsigned int a_GDL_Ch_bid
Boundary id anode GDL and channel.
Definition: geometry.h:615
double l_land_a
Width of the anode current collector.
Definition: geometry.h:471
unsigned int c_BPP_GDL_bid
Boundary id cathode BPP and GDL.
Definition: geometry.h:581
unsigned int c_MPL_CL_bid
Boundary id cathode MPL and CL.
Definition: geometry.h:598
double L_channel_c()
Return the Width of the cathode gas channel.
Definition: geometry.h:298
std::vector< double > L_cat_c()
Return the thickness of the cathode catalyst layer.
Definition: geometry.h:310
double r_agg
Agglomerate radius.
Definition: geometry.h:630
unsigned int a_MPL_GDL_bid
Boundary id anode GDL and MPL.
Definition: geometry.h:620
unsigned int membrane_mid
Material id membrane.
Definition: geometry.h:547
double l_cube
Cube edge for HyperCube mesh.
Definition: geometry.h:474
double L_mpl_c()
Return the Thickness of the cathode microporous layer.
Definition: geometry.h:315
static _mapFactory * get_mapFactory()
Definition: geometry.h:382
double l_gdl_a
Thickness of the anode gas diffusion layer.
Definition: geometry.h:463
static boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_GridGenerator(ParameterHandler ¶m)
Generate the appropriate mesh generator object based on the parameters in the input file...
Definition: geometry.h:187
void generate_grid_with_curved_boundaries(Triangulation< dim > &triangulation, const types::boundary_id &bdry_id, boost::shared_ptr< Boundary< dim > > boundary) const
This function is like the previous one generate_grid() but allows to assign a curved boundary boundar...
Definition: geometry.h:242
std::string mesh_type_name
Specify if you would like to load a mesh from file or if you would like a module from the mesh genera...
Definition: geometry.h:415
bool read_from_file
Definition: geometry.h:345
unsigned int a_CL_MPL_bid
Boundary id anode MPL and CL.
Definition: geometry.h:624
std::string mesh_type
Specify if it is a UNV file, MSH file, etc.
Definition: geometry.h:419
double l_channel_a
Width of the anode gas channel.
Definition: geometry.h:467
double L_land_a()
Return the Width of the anode current collector.
Definition: geometry.h:342
unsigned int num_c_MPL
Number of cells wide cathode microporous layer.
Definition: geometry.h:492
unsigned int num_refine
Initial number of refinements.
Definition: geometry.h:421
double L_channel_a()
Return the Width of the anode gas channel.
Definition: geometry.h:338
double L_mem()
Return the Thickness of the membrane.
Definition: geometry.h:321
virtual void generate_grid(Triangulation< dim > &) const
Function is empty and must be reimplemented in derived classes.
Definition: geometry.h:229
unsigned int a_CC_mid
Material id anode current collector.
Definition: geometry.h:563
double l_gdl_c
Thickness of the cathode gas diffusion layer.
Definition: geometry.h:438
unsigned int a_CL_GDL_bid
Boundary id anode CL and GDL.
Definition: geometry.h:607
Point< dim > center
Centre point of the circular/spherical domain.
Definition: geometry.h:648
double L_mpl_a()
Return the Thickness of the anode microporous layer.
Definition: geometry.h:330
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
unsigned int test_mid
Material id for test cell (GridTest app)
Definition: geometry.h:523
unsigned int c_GDL_MPL_bid
Boundary id cathode GDL and MPL.
Definition: geometry.h:594
unsigned int num_a_MPL
Number of cells wide anode microporous layer.
Definition: geometry.h:509
std::map< std::string, GridBase< dim > * > _mapFactory
This object is used to store all objects of type GasDiffusionLayer.
Definition: geometry.h:374
unsigned int num_c_CL
Number of cells wide cathode catalyst layer.
Definition: geometry.h:496
std::string mesh_name
Name of the mesh file.
Definition: geometry.h:417
unsigned int delta_agg_mid
Electrolyte Thin Film Material ID.
Definition: geometry.h:639
double l_mpl_c
Thickness of the cathode microporous layer.
Definition: geometry.h:442
double L_land_c()
Return the Width of the cathode current collector.
Definition: geometry.h:302
double l_cat_a
Thickness of the anode catalyst layer.
Definition: geometry.h:455
unsigned int a_GDL_BPP_bid
Boundary id anode GDL and BPP.
Definition: geometry.h:611
double l_channel_c
Width of the cathode gas channel.
Definition: geometry.h:430
unsigned int c_MPL_mid
Material id cathode MPL.
Definition: geometry.h:539
unsigned int a_GC_mid
Material id anode gas channel.
Definition: geometry.h:567
double l_mpl_a
Thickness of the anode microporous layer.
Definition: geometry.h:459
double L_cat_a()
Return the Thickness of the anode catalyst layer.
Definition: geometry.h:326
std::vector< unsigned int > c_CL_mid
Material id cathode catalyst layer.
Definition: geometry.h:543
unsigned int num_a_CL
Number of cells wide anode catalyst layer.
Definition: geometry.h:505
FuelCell Geometry information class.
Definition: geometry.h:91
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type gas diffusion layer.
Definition: geometry.h:395
unsigned int num_a_GDL
Number of cells wide anode gas diffusion layer.
Definition: geometry.h:513
unsigned int num_vert
Number of cells tall the initial grid.
Definition: geometry.h:483
unsigned int c_CC_mid
Material id cathode current collector.
Definition: geometry.h:527
double l_mem
Thickness of the membrane.
Definition: geometry.h:451
double L_gdl_a()
Return the Thickness of the anode gas diffusion layer.
Definition: geometry.h:334
std::vector< double > l_cat_c
Thickness of the cathode catalyst layer.
Definition: geometry.h:447
unsigned int a_GDL_mid
Material id anode GDL.
Definition: geometry.h:559
double delta_agg
Electrolyte thin film thickness.
Definition: geometry.h:633
unsigned int r_delta_bid
Boundary ID for agglomerate/thin film boundary.
Definition: geometry.h:642
unsigned int r_agg_mid
Porous Agglomerate Material ID.
Definition: geometry.h:636
unsigned int a_CL_mid
Material id anode catalyst layer.
Definition: geometry.h:551
unsigned int c_GC_mid
Material id cathode gas channel.
Definition: geometry.h:531
unsigned int a_MPL_mid
Material id anode MPL.
Definition: geometry.h:555
unsigned int delta_bid
Boundary ID for thin film external boundary.
Definition: geometry.h:645
unsigned int num_membrane
Number of cells wide membrane layer.
Definition: geometry.h:501