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 1385 2013-08-24 00:20:25Z madhur $
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 namespace FuelCellShop
34 {
35  namespace Geometry
36  {
37 
53  template <int dim>
55  : public GridBase<dim>
56  {
57  public:
60  : GridBase<dim>()
61  {}
62 
69  {
70  if (create_replica)
71  this->get_mapFactory()->insert(std::pair<std::string, GridExternal<dim>* > (this->concrete_name, this) );
72 
73  }
74 
78  virtual void generate_grid(Triangulation<dim> &triangulation) const;
79 
80  static const std::string concrete_name;
81 
82  protected:
83 
85 
86 
91  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
92  {
93  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridExternal<dim> ());
94  }
96 
98 
99 
104 
105  };
106 
113  template <int dim>
114  class Cathode
115  : public GridBase<dim>
116  {
117  public:
118 
125  : GridBase<dim>()
126  {
127  if (create_replica)
128  this->get_mapFactory()->insert(std::pair<std::string, Cathode<dim>* > (this->concrete_name, this) );
129 
130  }
131 
169  virtual void generate_grid(Triangulation<dim> &triangulation) const;
170 
172  virtual unsigned int get_material_id (const std::string ) const;
173 
175  static const std::string concrete_name;
176 
177  protected:
180  : GridBase<dim>()
181  {}
182 
184 
185 
190  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
191  {
192  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Cathode<dim> ());
193  }
195 
197 
198 
201  static Cathode<dim> const* PROTOTYPE;
203  };
204 
205 
212  template <int dim>
214  : public GridBase<dim>
215  {
216  public:
223  : GridBase<dim>()
224  {
225  if (create_replica)
226  this->get_mapFactory()->insert(std::pair<std::string, CathodeMPL<dim>* > (this->concrete_name, this) );
227 
228  }
229 
274  virtual void generate_grid(Triangulation<dim> &triangulation) const;
275 
276 
277 
278  static const std::string concrete_name;
279 
280  protected:
283  : GridBase<dim>()
284  {}
286 
287 
292  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
293  {
294  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::CathodeMPL<dim> ());
295  }
297 
299 
300 
303  static CathodeMPL<dim> const* PROTOTYPE;
305  };
306 
307 
314  template <int dim>
315  class Anode
316  : public GridBase<dim>
317  {
318  public:
319 
325  Anode(const bool create_replica)
326  : GridBase<dim>()
327  {
328  if (create_replica)
329  this->get_mapFactory()->insert(std::pair<std::string, Anode<dim>* > (this->concrete_name, this) );
330 
331  }
332 
368  virtual void generate_grid(Triangulation<dim> &triangulation) const;
369 
370 
371 
372  static const std::string concrete_name;
373 
374  protected:
377  : GridBase<dim> ()
378  {}
380 
381 
386  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
387  {
388  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Anode<dim> ());
389  }
391 
393 
394 
397  static Anode<dim> const* PROTOTYPE;
399 
400 
401 
402 
403 
404 
405  };
406 
407 
414  template <int dim>
415  class AnodeMPL
416  : public GridBase<dim>
417  {
418  public:
419 
426  : GridBase<dim> ()
427  {
428  if (create_replica)
429  this->get_mapFactory()->insert(std::pair<std::string, AnodeMPL<dim>* > (this->concrete_name, this) );
430 
431  }
432 
464  virtual void generate_grid(Triangulation<dim> &triangulation) const;
465 
466 
467 
468  static const std::string concrete_name;
469 
470  protected:
473  : GridBase<dim> ()
474  {}
476 
477 
482  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
483  {
484  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::AnodeMPL<dim> ());
485  }
487 
489 
490 
493  static AnodeMPL<dim> const* PROTOTYPE;
495 
496  };
497 
498 
505  template <int dim>
506  class Pemfc
507  : public GridBase<dim>
508  {
509  public:
510 
516  Pemfc(const bool create_replica)
517  : GridBase<dim>()
518  {
519  if (create_replica)
520  this->get_mapFactory()->insert(std::pair<std::string, Pemfc<dim>* > (this->concrete_name, this) );
521 
522  }
523 
571  virtual void generate_grid(Triangulation<dim> &triangulation) const;
572 
573 
574  static const std::string concrete_name;
575 
576  protected:
579  : GridBase<dim> ()
580  {}
582 
583 
588  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
589  {
590  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Pemfc<dim> ());
591  }
593 
595 
596 
599  static Pemfc<dim> const* PROTOTYPE;
601 
602 
603  };
604 
605 
612  template <int dim>
613  class PemfcMPL
614  : public GridBase<dim>
615  {
616  public:
623  : GridBase<dim> ()
624  {
625  if (create_replica)
626  this->get_mapFactory()->insert(std::pair<std::string, PemfcMPL<dim>* > (this->concrete_name, this) );
627 
628  }
681  virtual void generate_grid(Triangulation<dim> &triangulation) const;
682 
683  static const std::string concrete_name;
684 
685  protected:
688  : GridBase<dim> ()
689  {}
691 
692 
697  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
698  {
699  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::PemfcMPL<dim> ());
700  }
702 
704 
705 
708  static PemfcMPL<dim> const* PROTOTYPE;
710 
711  };
712 
713 
720  template <int dim>
722  : public GridBase<dim>
723  {
724  public:
727  : GridBase<dim> ()
728  {}
729 
736  : GridBase<dim> ()
737  {
738  if (create_replica)
739  this->get_mapFactory()->insert(std::pair<std::string, Agglomerate<dim>* > (this->concrete_name, this) );
740 
741  }
742 
750  virtual void generate_grid(Triangulation<dim> &triangulation) const;
751 
752  void reset_material_ids(Triangulation<dim> &triangulation) const;
753 
754  static const std::string concrete_name;
755 
756  protected:
757 
759 
760 
765  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
766  {
767  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::Agglomerate<dim> ());
768  }
770 
772 
773 
778 
779  };
786  template <int dim>
787  class GridTest
788  : public GridBase<dim>
789  {
790  public:
793  : GridBase<dim>()
794  {}
795 
802  {
803  if (create_replica)
804  this->get_mapFactory()->insert(std::pair<std::string, GridTest<dim>* > (this->concrete_name, this) );
805 
806  }
807 
811  virtual void generate_grid(Triangulation<dim> &triangulation) const;
812 
813  static const std::string concrete_name;
814 
815  protected:
816 
818 
819 
824  virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > create_replica ()
825  {
826  return boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > (new FuelCellShop::Geometry::GridTest<dim> ());
827  }
829 
831 
832 
835  static GridTest<dim> const* PROTOTYPE;
837 
838  };
839  }
840 }
841 #endif