OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geometries.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2009-13 by Energy Systems Design Laboratory, University of Alberta
6 //
7 // This software is distributed under the MIT License.
8 // For more information, see the README file in /doc/LICENSE
9 //
10 // - Class: geometries.h
11 // - Description: Geometry definition for several fuel cell elements.
12 // - Developers: L. Birkett, P. Dobson, M. Secanell and V. Zingan
13 // - $Id: geometries.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 
18 #ifndef dimension
19 #if deal_II_dimension == 1
20 #define _1D_
21 #elif deal_II_dimension == 2
22 #define _2D_
23 #elif deal_II_dimension == 3
24 #define _3D_
25 #endif
26 #endif
27 
28 #ifndef _FUELCELLSHOP__GEOMETRIES_H
29 #define _FUELCELLSHOP__GEOMETRIES_H
30 
31 #include <grid/geometry.h>
32 
33 // STD:
34 #include <numeric>
35 
36 namespace FuelCellShop
37 {
38  namespace Geometry
39  {
40 
56  template <int dim>
58  : public GridBase<dim>
59  {
60  public:
62  GridExternal(const std::string &name)
63  : GridBase<dim>()
64  {}
65 
72  {
73  this->get_mapFactory()->insert(std::pair<std::string, GridExternal<dim>* > (this->concrete_name, this) );
74  }
75 
79  virtual void generate_grid(Triangulation<dim> &triangulation);
80 
81  static const std::string concrete_name;
82 
83  protected:
84 
86 
87 
92  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
93  {
94  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridExternal<dim> (name));
95  }
97 
99 
100 
105 
106  };
107 
113  template <int dim>
114  class HyperCube
115  : public GridBase<dim>
116  {
117  public:
119  HyperCube(const std::string &name)
120  : GridBase<dim>()
121  {}
122 
129  {
130  this->get_mapFactory()->insert(std::pair<std::string, HyperCube<dim>* > (this->concrete_name, this) );
131  }
132 
136  virtual void generate_grid(Triangulation<dim> &triangulation);
137 
138  static const std::string concrete_name;
139 
140  protected:
141 
143 
144 
149  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
150  {
151  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::HyperCube<dim> (name));
152  }
154 
156 
157 
160  static HyperCube<dim> const* PROTOTYPE;
162 
163  };
164 
171  template <int dim>
173  : public GridBase<dim>
174  {
175  public:
182  : GridBase<dim>()
183  {
184  this->get_mapFactory()->insert(std::pair<std::string, CathodeMPL<dim>* > (this->concrete_name, this) );
185  }
186 
231  virtual void generate_grid(Triangulation<dim> &triangulation);
232 
233 
234 
235  static const std::string concrete_name;
236 
237  protected:
239  CathodeMPL(const std::string &name)
240  : GridBase<dim>()
241  {}
243 
244 
249  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
250  {
251  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::CathodeMPL<dim> (name));
252  }
254 
256 
257 
260  static CathodeMPL<dim> const* PROTOTYPE;
262  };
263 
325  template <int dim>
326  class PemfcMPL
327  : public GridBase<dim>
328  {
329  public:
336  : GridBase<dim> ()
337  {
338  this->get_mapFactory()->insert(std::pair<std::string, PemfcMPL<dim>* > (this->concrete_name, this) );
339  }
392  virtual void generate_grid(Triangulation<dim> &triangulation);
393 
394  static const std::string concrete_name;
395 
396  protected:
398  PemfcMPL(const std::string &name)
399  : GridBase<dim> ()
400  {}
402 
403 
408  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
409  {
410  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::PemfcMPL<dim> (name));
411  }
413 
415 
416 
419  static PemfcMPL<dim> const* PROTOTYPE;
421 
422  };
423 
424 
431  template <int dim>
433  : public GridBase<dim>
434  {
435  public:
437  Agglomerate(const std::string &name)
438  : GridBase<dim> ()
439  {}
440 
447  : GridBase<dim> ()
448  {
449  this->get_mapFactory()->insert(std::pair<std::string, Agglomerate<dim>* > (this->concrete_name, this) );
450  }
451 
459  virtual void generate_grid(Triangulation<dim> &triangulation);
460 
461  void reset_material_ids(Triangulation<dim> &triangulation) const;
462 
463  static const std::string concrete_name;
464 
465  protected:
466 
468 
469 
474  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
475  {
476  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Agglomerate<dim> (name));
477  }
479 
481 
482 
487 
488  };
495  template <int dim>
496  class GridTest
497  : public GridBase<dim>
498  {
499  public:
506  {
507  this->get_mapFactory()->insert(std::pair<std::string, GridTest<dim>* > (this->concrete_name, this) );
508  }
509 
510 
512  GridTest(const std::string &name)
513  : GridBase<dim>()
514  {}
515 
516 
520  virtual void generate_grid(Triangulation<dim> &triangulation);
521 
522  static const std::string concrete_name;
523 
524  protected:
525 
527 
528 
533  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica (const std::string &name)
534  {
535  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridTest<dim> (name));
536  }
538 
540 
541 
544  static GridTest<dim> const* PROTOTYPE;
546 
547  };
548  }
549 }
550 #endif
static GridExternal< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:103
Agglomerate(const std::string &name)
Default constructor.
Definition: geometries.h:437
This class treates a test mesh with one element.
Definition: geometries.h:496
CathodeMPL(const std::string &name)
Default constructor.
Definition: geometries.h:239
const unsigned int dim
Definition: fcst_constants.h:23
static HyperCube< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:160
This function generates a PEMFC grid including a membrane, gas diffusion, microporous, and catalyst layers.
Definition: geometries.h:326
virtual void generate_grid(Triangulation< dim > &triangulation)
This function generates the cathode side of the PEMFC grid including gas diffusion, microporous and catalyst layer.
static GridTest< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:544
static const std::string concrete_name
Definition: geometries.h:394
virtual void generate_grid(Triangulation< dim > &triangulation)
This function generates an agglomerate grid with a core and thin film subdomain The grid contains all...
GridTest(const std::string &name)
Default constructor.
Definition: geometries.h:512
static CathodeMPL< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:260
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:474
HyperCube()
PROTOTYPE constructor.
Definition: geometries.h:128
static _mapFactory * get_mapFactory()
Definition: geometry.h:405
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:249
static const std::string concrete_name
Definition: geometries.h:81
This class imports meshes from dealii supported file types.
Definition: geometries.h:57
This function generates a grid for a cathode including gas diffusion, microporous, and catalyst layers.
Definition: geometries.h:172
static PemfcMPL< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:419
This function generates a square or cubic mesh.
Definition: geometries.h:114
static const std::string concrete_name
Definition: geometries.h:522
static const std::string concrete_name
Definition: geometries.h:235
void reset_material_ids(Triangulation< dim > &triangulation) const
static const std::string concrete_name
Definition: geometries.h:138
virtual void generate_grid(Triangulation< dim > &triangulation)
Generate deal.ii triangulation object from a file.
GridExternal()
PROTOTYPE constructor.
Definition: geometries.h:71
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:408
virtual void generate_grid(Triangulation< dim > &triangulation)
This function generates a full PEMFC grid including gas diffusion, microporous and catalyst layers...
This function generates an agglomerate with a core and a thin film subdomain.
Definition: geometries.h:432
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:149
virtual void generate_grid(Triangulation< dim > &triangulation)
Generate deal.ii triangulation object from a file.
virtual void generate_grid(Triangulation< dim > &triangulation)
Generate deal.ii triangulation object from a file.
CathodeMPL()
PROTOTYPE constructor.
Definition: geometries.h:181
static const std::string concrete_name
Definition: geometries.h:463
GridExternal(const std::string &name)
Default constructor.
Definition: geometries.h:62
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:533
FuelCell Geometry information class.
Definition: geometry.h:92
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:92
Agglomerate()
PROTOTYPE constructor.
Definition: geometries.h:446
PemfcMPL(const std::string &name)
Default constructor.
Definition: geometries.h:398
PemfcMPL()
PROTOTYPE constructor.
Definition: geometries.h:335
static Agglomerate< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:485
HyperCube(const std::string &name)
Default constructor.
Definition: geometries.h:119
GridTest()
PROTOTYPE constructor.
Definition: geometries.h:505