OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_thermal_test.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2013 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: app_thermal_test.h 21-05-2013
11 // - Description: Class designed to test thermal transport equation.
12 // - Developers: Madhur Bhaiya
13 // - Id: $Id: app_thermal_test.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELL__APP_THERMAL_TEST__H
18 #define _FUELCELL__APP_THERMAL_TEST__H
19 
20 //-- OpenFCST
24 
25 namespace FuelCell
26 {
27  namespace InitialSolution
28  {
34  template <int dim>
36  :
37  public Function<dim>
38  {
39  public:
43  AppThermalTestIC (const std::string& type);
47  virtual ~AppThermalTestIC (){};
48 
53  virtual double value (const Point<dim> &p,
54  const unsigned int component = 0) const;
55 
56  private:
57 
58  std::string case_type;
59  };
60  } //end namespace InitialSolution
61 
62 
63  namespace Application
64  {
65  //---------------------------------------------------------------------------
66  //---------------------------------------------------------------------------
67  //---------------------------------------------------------------------------
75  template <int dim>
77  :
79  {
80  public:
81 
83 
84 
91  AppThermalTest (boost::shared_ptr<FuelCell::ApplicationCore::ApplicationData> data = boost::shared_ptr<FuelCell::ApplicationCore::ApplicationData> ());
92 
96  virtual ~AppThermalTest (){};
103  virtual void declare_parameters(ParameterHandler& param);
104 
111  virtual void set_parameters(const std::vector<std::string>& name_dvar,
112  const std::vector<double>& value_dvar,
113  ParameterHandler& param){};
114 
119  void initialize_triangulation(ParameterHandler& param);
120 
124  virtual void initialize(ParameterHandler& param);
125 
129  virtual void initialize_solution (FuelCell::ApplicationCore::FEVector& initial_guess,
130  std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
132 
134 
135 
141  virtual void cell_matrix(FuelCell::ApplicationCore::MatrixVector& cell_matrices,
142  const typename DoFApplication<dim>::CellInfo& cell);
152  virtual void cell_residual(FuelCell::ApplicationCore::FEVector& cell_vector,
153  const typename DoFApplication<dim>::CellInfo& cell);
154 
158  virtual void bdry_matrix(FuelCell::ApplicationCore::MatrixVector& bdry_matrices,
159  const typename DoFApplication<dim>::FaceInfo& bdry_info);
160 
164  virtual void bdry_residual(FuelCell::ApplicationCore::FEVector& bdry_vector,
165  const typename DoFApplication<dim>::FaceInfo& bdry_info);
167 
174  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
175 
179  virtual double estimate(const FuelCell::ApplicationCore::FEVectors& sol);
180 
181 
186  virtual void data_out(const std::string& basename,
187  const FuelCell::ApplicationCore::FEVectors& vectors);
188 
192  virtual void cell_responses (std::vector<double>& resp,
193  const typename DoFApplication<dim>::CellInfo& info,
199  virtual void global_responses (std::vector<double>& resp,
201 
202 
203  protected:
204 
205 
207 
208  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > test_layer;
210 
212 
213 
218 
220  std::string case_type;
221 
222 
223  };
224  }
225 }
226 
227 #endif //_FUELCELL__AppThermalTest_H
virtual void set_parameters(const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
Function called by optimization loop in order to set the values in the ParameterHandler to the new de...
Definition: app_thermal_test.h:111
virtual void bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_vector, const typename DoFApplication< dim >::FaceInfo &bdry_info)
Assemble local boundary residual.
virtual void data_out(const std::string &basename, const FuelCell::ApplicationCore::FEVectors &vectors)
Reimplementation of the routine in the base class BaseApplication in namespace AppFrame so that the r...
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > test_layer
Definition: app_thermal_test.h:208
virtual void cell_residual(FuelCell::ApplicationCore::FEVector &cell_vector, const typename DoFApplication< dim >::CellInfo &cell)
Integration of the rhs of the equations.
virtual void initialize_solution(FuelCell::ApplicationCore::FEVector &initial_guess, std::shared_ptr< Function< dim > > initial_function=std::shared_ptr< Function< dim > >())
Initialize nonlinear solution.
This class is used when solving the problem using Newton&#39;s method to provide an initial solution...
Definition: app_thermal_test.h:35
virtual void declare_parameters(ParameterHandler &param)
Declare all parameters that are needed for:
virtual double estimate(const FuelCell::ApplicationCore::FEVectors &sol)
Estimate error per cell.
This class deals with Thermal Transport Equation.
Definition: thermal_transport_equation.h:187
AppThermalTest(boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
virtual void initialize(ParameterHandler &param)
Call the other initialize routines from the inherited classes.
virtual double value(const Point< dim > &p, const unsigned int component=0) const
This is the member function that computes the value of the initial solution for a given point...
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
std::string case_type
Definition: app_thermal_test.h:58
virtual ~AppThermalTestIC()
Destructor.
Definition: app_thermal_test.h:47
virtual ~AppThermalTest()
Destructor.
Definition: app_thermal_test.h:96
AppThermalTestIC(const std::string &type)
Constructor.
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
std::map< unsigned int, double > boundary_values
Variable to store boundary values, so they only need to be computed once per mesh refinement...
Definition: block_matrix_application.h:321
std::string case_type
String to determine the case type.
Definition: app_thermal_test.h:220
This class is used to test thermal transport equation (fourier equation) against analytical solutions...
Definition: app_thermal_test.h:76
virtual void global_responses(std::vector< double > &resp, const FuelCell::ApplicationCore::FEVector &sol)
This class is used to evaluate all responses that do not require looping over cells.
Definition: app_thermal_test.h:199
virtual void bdry_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename DoFApplication< dim >::FaceInfo &bdry_info)
Assemble local boundary matrix.
virtual void dirichlet_bc(std::map< unsigned int, double > &boundary_values) const
Member function used to set dirichlet boundary conditions.
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
The data type used in function calls of Application.
Definition: fe_vectors.h:59
virtual void cell_responses(std::vector< double > &resp, const typename DoFApplication< dim >::CellInfo &info, const FuelCell::ApplicationCore::FEVector &sol)
Compute the value of all objective function and constraints.
Definition: app_thermal_test.h:192
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:49
virtual void cell_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename DoFApplication< dim >::CellInfo &cell)
Integration of local bilinear form.
FuelCellShop::Equation::ThermalTransportEquation< dim > thermal_transport
ThermalTransportEquation object.
Definition: app_thermal_test.h:216
boost::shared_ptr< ApplicationData > data
Object for auxiliary data.
Definition: application_base.h:348
void initialize_triangulation(ParameterHandler &param)
Initilize and create the grid Determines whether reading from a grid file or creating new...