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 "geometry.h"
32 
33 // STD:
34 #include <numeric>
35 
36 
37 
38 
39 namespace FuelCellShop
40 {
41  namespace Geometry
42  {
43 
59  template <int dim>
61  : public GridBase<dim>
62  {
63  public:
66  : GridBase<dim>()
67  {}
68 
75  {
76  if (create_replica)
77  this->get_mapFactory()->insert(std::pair<std::string, GridExternal<dim>* > (this->concrete_name, this) );
78 
79  }
80 
84  virtual void generate_grid(Triangulation<dim> &triangulation) const;
85 
86  static const std::string concrete_name;
87 
88  protected:
89 
91 
92 
97  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
98  {
99  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridExternal<dim> ());
100  }
102 
104 
105 
110 
111  };
112 
118  template <int dim>
119  class HyperCube
120  : public GridBase<dim>
121  {
122  public:
125  : GridBase<dim>()
126  {}
127 
134  {
135  if (create_replica)
136  this->get_mapFactory()->insert(std::pair<std::string, HyperCube<dim>* > (this->concrete_name, this) );
137  }
138 
142  virtual void generate_grid(Triangulation<dim> &triangulation) const;
143 
144  static const std::string concrete_name;
145 
146  protected:
147 
149 
150 
155  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
156  {
157  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::HyperCube<dim> ());
158  }
160 
162 
163 
166  static HyperCube<dim> const* PROTOTYPE;
168 
169  };
170 
177  template <int dim>
178  class Cathode
179  : public GridBase<dim>
180  {
181  public:
182 
189  : GridBase<dim>()
190  {
191  if (create_replica)
192  this->get_mapFactory()->insert(std::pair<std::string, Cathode<dim>* > (this->concrete_name, this) );
193 
194  }
195 
233  virtual void generate_grid(Triangulation<dim> &triangulation) const;
234 
236  static const std::string concrete_name;
237 
238  protected:
241  : GridBase<dim>()
242  {}
243 
245 
246 
251  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
252  {
253  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Cathode<dim> ());
254  }
256 
258 
259 
262  static Cathode<dim> const* PROTOTYPE;
264  };
265 
266 
273  template <int dim>
275  : public GridBase<dim>
276  {
277  public:
284  : GridBase<dim>()
285  {
286  if (create_replica)
287  this->get_mapFactory()->insert(std::pair<std::string, CathodeMPL<dim>* > (this->concrete_name, this) );
288 
289  }
290 
335  virtual void generate_grid(Triangulation<dim> &triangulation) const;
336 
337 
338 
339  static const std::string concrete_name;
340 
341  protected:
344  : GridBase<dim>()
345  {}
347 
348 
353  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
354  {
355  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::CathodeMPL<dim> ());
356  }
358 
360 
361 
364  static CathodeMPL<dim> const* PROTOTYPE;
366  };
367 
368 
375  template <int dim>
376  class Anode
377  : public GridBase<dim>
378  {
379  public:
380 
386  Anode(const bool create_replica)
387  : GridBase<dim>()
388  {
389  if (create_replica)
390  this->get_mapFactory()->insert(std::pair<std::string, Anode<dim>* > (this->concrete_name, this) );
391 
392  }
393 
429  virtual void generate_grid(Triangulation<dim> &triangulation) const;
430 
431 
432 
433  static const std::string concrete_name;
434 
435  protected:
438  : GridBase<dim> ()
439  {}
441 
442 
447  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
448  {
449  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Anode<dim> ());
450  }
452 
454 
455 
458  static Anode<dim> const* PROTOTYPE;
460 
461 
462 
463 
464 
465 
466  };
467 
468 
475  template <int dim>
476  class AnodeMPL
477  : public GridBase<dim>
478  {
479  public:
480 
487  : GridBase<dim> ()
488  {
489  if (create_replica)
490  this->get_mapFactory()->insert(std::pair<std::string, AnodeMPL<dim>* > (this->concrete_name, this) );
491 
492  }
493 
525  virtual void generate_grid(Triangulation<dim> &triangulation) const;
526 
527 
528 
529  static const std::string concrete_name;
530 
531  protected:
534  : GridBase<dim> ()
535  {}
537 
538 
543  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
544  {
545  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::AnodeMPL<dim> ());
546  }
548 
550 
551 
554  static AnodeMPL<dim> const* PROTOTYPE;
556 
557  };
558 
559 
566  template <int dim>
567  class Pemfc
568  : public GridBase<dim>
569  {
570  public:
571 
577  Pemfc(const bool create_replica)
578  : GridBase<dim>()
579  {
580  if (create_replica)
581  this->get_mapFactory()->insert(std::pair<std::string, Pemfc<dim>* > (this->concrete_name, this) );
582 
583  }
584 
632  virtual void generate_grid(Triangulation<dim> &triangulation) const;
633 
634 
635  static const std::string concrete_name;
636 
637  protected:
640  : GridBase<dim> ()
641  {}
643 
644 
649  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
650  {
651  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Pemfc<dim> ());
652  }
654 
656 
657 
660  static Pemfc<dim> const* PROTOTYPE;
662 
663 
664  };
665 
666 
673  template <int dim>
674  class PemfcMPL
675  : public GridBase<dim>
676  {
677  public:
684  : GridBase<dim> ()
685  {
686  if (create_replica)
687  this->get_mapFactory()->insert(std::pair<std::string, PemfcMPL<dim>* > (this->concrete_name, this) );
688 
689  }
742  virtual void generate_grid(Triangulation<dim> &triangulation) const;
743 
744  static const std::string concrete_name;
745 
746  protected:
749  : GridBase<dim> ()
750  {}
752 
753 
758  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
759  {
760  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::PemfcMPL<dim> ());
761  }
763 
765 
766 
769  static PemfcMPL<dim> const* PROTOTYPE;
771 
772  };
773 
774 
781  template <int dim>
783  : public GridBase<dim>
784  {
785  public:
788  : GridBase<dim> ()
789  {}
790 
797  : GridBase<dim> ()
798  {
799  if (create_replica)
800  this->get_mapFactory()->insert(std::pair<std::string, Agglomerate<dim>* > (this->concrete_name, this) );
801 
802  }
803 
811  virtual void generate_grid(Triangulation<dim> &triangulation) const;
812 
813  void reset_material_ids(Triangulation<dim> &triangulation) const;
814 
815  static const std::string concrete_name;
816 
817  protected:
818 
820 
821 
826  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
827  {
828  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Agglomerate<dim> ());
829  }
831 
833 
834 
839 
840  };
847  template <int dim>
848  class GridTest
849  : public GridBase<dim>
850  {
851  public:
854  : GridBase<dim>()
855  {}
856 
863  {
864  if (create_replica)
865  this->get_mapFactory()->insert(std::pair<std::string, GridTest<dim>* > (this->concrete_name, this) );
866 
867  }
868 
872  virtual void generate_grid(Triangulation<dim> &triangulation) const;
873 
874  static const std::string concrete_name;
875 
876  protected:
877 
879 
880 
885  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
886  {
887  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridTest<dim> ());
888  }
890 
892 
893 
896  static GridTest<dim> const* PROTOTYPE;
898 
899  };
900  }
901 }
902 #endif
static GridExternal< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:108
AnodeMPL(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:486
This class treates a test mesh with one element.
Definition: geometries.h:848
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates the cathode side of the PEMFC grid including gas diffusion, microporous and catalyst layer.
static AnodeMPL< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:554
GridExternal(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:74
GridTest(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:862
const unsigned int dim
Definition: fcst_constants.h:24
static HyperCube< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:166
This function generates a PEMFC grid including a membrane, gas diffusion, microporous, and catalyst layers.
Definition: geometries.h:674
This function generates a grid for a cathode including gas diffusion and catalyst layers...
Definition: geometries.h:178
static Anode< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:458
Cathode()
Default constructor.
Definition: geometries.h:240
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:826
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates a full PEMFC grid including gas diffusion, microporous and catalyst layers...
static const std::string concrete_name
Definition: geometries.h:635
static GridTest< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:896
static const std::string concrete_name
Definition: geometries.h:744
This function generates a grid for an anode including gas diffusion, microporous, and catalyst layers...
Definition: geometries.h:476
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:353
static CathodeMPL< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:364
HyperCube()
Default constructor.
Definition: geometries.h:124
static _mapFactory * get_mapFactory()
Definition: geometry.h:382
static const std::string concrete_name
Definition: geometries.h:86
static const std::string concrete_name
Concrete name of object.
Definition: geometries.h:236
This class imports meshes from dealii supported file types.
Definition: geometries.h:60
This function generates a grid for a cathode including gas diffusion, microporous, and catalyst layers.
Definition: geometries.h:274
static PemfcMPL< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:769
This function generates a square or cubic mesh.
Definition: geometries.h:119
static const std::string concrete_name
Definition: geometries.h:874
static const std::string concrete_name
Definition: geometries.h:339
void reset_material_ids(Triangulation< dim > &triangulation) const
static const std::string concrete_name
Definition: geometries.h:144
virtual void generate_grid(Triangulation< dim > &triangulation) const
Generate deal.ii triangulation object from a file.
virtual void generate_grid(Triangulation< dim > &triangulation) const
Generate deal.ii triangulation object from a file.
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:251
GridExternal()
Default constructor.
Definition: geometries.h:65
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:97
Anode(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:386
Agglomerate(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:796
Cathode(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:188
static const std::string concrete_name
Definition: geometries.h:529
This function generates an agglomerate with a core and a thin film subdomain.
Definition: geometries.h:782
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates an agglomerate grid with a core and thin film subdomain The grid contains all...
PemfcMPL(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:683
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:885
static Pemfc< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:660
Anode()
Default constructor.
Definition: geometries.h:437
This function generates a PEMFC grid including gas diffusion and catalyst layers. ...
Definition: geometries.h:567
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:155
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function builds a grid for a standard PEMFC with gas diffusion layers (GDL) and catalyst layers ...
CathodeMPL()
Default constructor.
Definition: geometries.h:343
static const std::string concrete_name
Definition: geometries.h:815
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates the anode side of the PEMFC grid including gas diffusion, microporous...
HyperCube(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:133
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:447
FuelCell Geometry information class.
Definition: geometry.h:91
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates the cathode side of the PEMFC grid including gas diffusion and catalyst layer...
Pemfc()
Default constructor.
Definition: geometries.h:639
AnodeMPL()
Default constructor.
Definition: geometries.h:533
static const std::string concrete_name
Definition: geometries.h:433
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:758
CathodeMPL(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:283
virtual void generate_grid(Triangulation< dim > &triangulation) const
This function generates the anode side of the PEMFC grid including gas diffusion and catalyst layers...
Pemfc(const bool create_replica)
PROTOTYPE constructor.
Definition: geometries.h:577
Agglomerate()
Default constructor.
Definition: geometries.h:787
This function generates a grid for an anode including gas diffusion and catalyst layers.
Definition: geometries.h:376
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:543
static Cathode< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:262
PemfcMPL()
Default constructor.
Definition: geometries.h:748
static Agglomerate< dim > const * PROTOTYPE
Create prototype for the layer.
Definition: geometries.h:837
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica()
This member function is used to create an object of type micro porous layer.
Definition: geometries.h:649
GridTest()
Default constructor.
Definition: geometries.h:853
virtual void generate_grid(Triangulation< dim > &triangulation) const
Generate deal.ii triangulation object from a file.