OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
base_material.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2011-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: base_material.h
11 // - Description: Base material class
12 // - Developers: M. Secanell, Madhur Bhaiya, Valentin N. Zingan
13 // - $Id: base_material.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__BASE_MATERIAL__H
18 #define _FUELCELLSHOP__BASE_MATERIAL__H
19 
20 // Include deal.II classes
21 #include <base/parameter_handler.h>
22 #include <base/point.h>
23 #include <base/function.h>
24 #include <lac/vector.h>
25 #include <fe/fe_values.h>
26 #include <deal.II/base/subscriptor.h>
27 
28 // Include STL
29 #include<cmath>
30 #include<iostream>
31 
32 // Include OpenFCST routines:
35 
36 using namespace dealii;
37 
38 namespace FuelCellShop
39 {
40  namespace Material
41  {
54  class BaseMaterial : public dealii::Subscriptor
55  {
56  public:
57 
59 
60 
65  void set_derivative_flags(const std::vector<VariableNames>& flags)
66  {
67  derivative_flags = flags;
68  }
69 
71 
73 
74 
77  inline const std::string& name_material() const
78  {
79  return name;
80  }
81 
86  virtual void print_material_properties() const
87  {
88  const std::type_info& info = typeid(*this);
89  FcstUtilities::log << "Pure function " << __FUNCTION__
90  << " called in Class "
91  << info.name() << std::endl;
92  }
94  protected:
95 
97 
98 
102  :
103  name("no_name")
104  { }
105 
112  BaseMaterial(const std::string& name)
113  : name(name)
114  { }
115 
119  virtual ~BaseMaterial()
120  { }
121 
127  virtual void declare_parameters(ParameterHandler&) const
128  {
129  const std::type_info& info = typeid(*this);
130  FcstUtilities::log << "Pure function " << __FUNCTION__
131  << " called in Class "
132  << info.name() << std::endl;
133  }
134 
142  virtual void initialize(ParameterHandler&)
143  {
144  const std::type_info& info = typeid(*this);
145  FcstUtilities::log << "Pure function " << __FUNCTION__
146  << " called in Class "
147  << info.name() << std::endl;
148  }
150 
152 
153 
155  const std::string name;
156 
158  std::vector<VariableNames> derivative_flags;
160  };
161 
162  } // Material
163 
164 } // FuelCellShop
165 
166  #endif
virtual void declare_parameters(ParameterHandler &) const
Declare parameters for a parameter file.
Definition: base_material.h:127
const std::string name
Name of the layer.
Definition: base_material.h:155
BaseMaterial(const std::string &name)
Constructor.
Definition: base_material.h:112
virtual ~BaseMaterial()
Destructor.
Definition: base_material.h:119
virtual void initialize(ParameterHandler &)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Definition: base_material.h:142
virtual void print_material_properties() const
This function prints out the material properties.
Definition: base_material.h:86
void set_derivative_flags(const std::vector< VariableNames > &flags)
Set the names of FCST solution variables with respect to which you would like to compute the derivati...
Definition: base_material.h:65
BaseMaterial()
Constructor.
Definition: base_material.h:101
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
const std::string & name_material() const
Return the name of the layer.
Definition: base_material.h:77
std::vector< VariableNames > derivative_flags
Flags for derivatives: These flags are used to request derivatives of material properties.
Definition: base_material.h:158
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54