19 #ifndef _FUELCELLSHOP__BASE__LAYER_H
20 #define _FUELCELLSHOP__BASE__LAYER_H
23 #include <deal.II/base/parameter_handler.h>
24 #include <deal.II/base/point.h>
25 #include <deal.II/base/function.h>
26 #include <deal.II/lac/vector.h>
27 #include <deal.II/fe/fe_values.h>
38 using namespace dealii;
40 namespace FuelCellShop
69 this->derivative_flags = flags;
87 AssertThrow(std::find(std::begin(material_ids), std::end(material_ids),
id) != std::end(material_ids), ExcMessage(
"Material id not found in layer."));
88 local_material_id_ = id;
99 local_material_id_ = std::numeric_limits<int>::max();
115 constant_solutions[name] = value;
129 const std::type_info& info =
typeid(*this);
131 <<
" called in Class "
132 << info.name() << std::endl;
144 bool belongs_to_material(
const unsigned int material_id);
179 const std::type_info& info =
typeid(*this);
181 <<
" called in Class "
182 << info.name() << std::endl;
189 virtual void print_layer_properties()
const;
196 const std::type_info& info =
typeid(*this);
198 <<
" called in Class "
199 << info.name() << std::endl;
217 AssertThrow(std::find(std::begin(material_ids), std::end(material_ids), local_material_id_) != std::end(material_ids),
218 ExcMessage(
"The material id for layer " + name +
" has not been set."));
220 return local_material_id_;
250 param.enter_subsection(
"Fuel cell data");
252 param.enter_subsection(object_name);
254 param.declare_entry(
"Material id",
256 Patterns::List(Patterns::Integer(0, 255)),
257 "Id number used to identify this layer");
259 param.leave_subsection();
261 param.leave_subsection();
271 this->declare_parameters(this->name,param);
285 const std::vector<std::string>& name_dvar,
286 const std::vector<double>& value_dvar,
287 ParameterHandler ¶m)
289 param.enter_subsection(
"Fuel cell data");
291 param.enter_subsection(object_name);
296 param.leave_subsection();
298 param.leave_subsection();
307 const std::vector<double>& value_dvar,
308 ParameterHandler ¶m)
310 param.enter_subsection(
"Fuel cell data");
312 param.enter_subsection(this->name);
317 param.leave_subsection();
319 param.leave_subsection();
326 virtual void initialize (ParameterHandler ¶m);
372 #endif // _FUELCELLSHOP__GENERIC__LAYER_H
const std::string & name_layer() const
Return the name of the layer.
Definition: base_layer.h:150
void set_position(const std::vector< Point< dim > > &p)
Member function used by some applications such as dummyGDL in order to know which value to return...
Definition: base_layer.h:76
virtual void declare_parameters(const std::string &object_name, ParameterHandler ¶m) const
Declare parameters for a parameter file.
Definition: base_layer.h:248
virtual void declare_parameters(ParameterHandler ¶m) const
Declare parameters for a parameter file.
Definition: base_layer.h:269
std::vector< Point< dim > > point
Coordinates of the point where we would like to compute the effective properties. ...
Definition: base_layer.h:344
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
std::vector< unsigned int > material_ids
List of material IDs that belong to the layer.
Definition: base_layer.h:340
virtual void set_constant_solution(const double &value, const VariableNames &name)
Set those solution variables which are constant in the particular application.
Definition: base_layer.h:113
const std::string name
Name of the layer.
Definition: base_layer.h:336
unsigned int local_material_id_
Local material ID to select the appropriate properties.
Definition: base_layer.h:363
virtual void set_parameters(const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m)
Set parameters in parameter file.
Definition: base_layer.h:306
std::map< VariableNames, double > constant_solutions
Map storing values of solution variables constant in a particular application.
Definition: base_layer.h:352
virtual const std::type_info & get_base_type() const
This member function return the name of the type of layer, i.e.
Definition: base_layer.h:177
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
virtual void set_parameters(const std::string &object_name, const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m)
Member function used to change the values in the parameter file for a given list of parameters...
Definition: base_layer.h:284
virtual void set_solution(const std::vector< SolutionVariable > &)
If the effective properties in the layer depend on the solution, the solution for a given cell should...
Definition: base_layer.h:127
virtual void set_local_material_id(const unsigned int &id)
Function for setting local material id, for unit testing purposes.
Definition: base_layer.h:85
virtual void set_derivative_flags(const std::vector< VariableNames > &flags)
Set the variables for which you would like to compute the derivatives.
Definition: base_layer.h:67
virtual bool test_layer()
This virtual class should be used for any derived class to be able to test the functionality of the c...
Definition: base_layer.h:194
BaseLayer()
Constructor.
Definition: base_layer.h:232
std::vector< unsigned int > get_material_ids()
Return the local material id of the layer.
Definition: base_layer.h:207
unsigned int local_material_id() const
Return the local material id of the layer, performs a check.
Definition: base_layer.h:215
std::vector< VariableNames > derivative_flags
Flags for derivatives: These flags are used to request derivatives.
Definition: base_layer.h:348
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
void unset_local_material_id()
Function for unsetting local material id, so that it isn't incorrectly used later Once the key is "un...
Definition: base_layer.h:97