OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_read_mesh.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_read_mesh.cc
11 // - Description:
12 // - Developers: ?????????
13 // - $Id: app_read_mesh.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELL__APP_READ_MESH__H
18 #define _FUELCELL__APP_READ_MESH__H
19 
20 // Include deal.II classes
21 #include "base/parameter_handler.h"
22 #include "base/function_lib.h"
23 #include "base/function.h"
24 #include "base/quadrature_lib.h"
25 
26 #include "lac/block_vector.h"
27 #include "lac/solver_cg.h"
28 #include "lac/solver_gmres.h"
29 #include "lac/precondition.h"
30 #include "lac/precondition_block.h"
31 #include "lac/block_matrix_array.h"
32 #include "lac/sparse_ilu.h"
33 #include "lac/sparse_direct.h"
34 
35 #include "grid/grid_generator.h"
36 #include "grid/tria_accessor.h"
37 #include "grid/tria_iterator.h"
38 #include "grid/tria_boundary_lib.h"
39 
40 #include "fe/fe_values.h"
41 
42 #include "numerics/vector_tools.h"
43 #include "numerics/matrix_tools.h"
44 #include "numerics/error_estimator.h"
45 #include "base/data_out_base.h"
46 #include "numerics/data_out.h"
47 #include "boost/shared_ptr.hpp"
48 
49 // Include appframe classes
51 
52 // Include FuelCell classes
54 #include "geometries.h"
55 
56 //Include STL
57 #include "fstream"
58 #include "iostream"
59 #include "sstream"
60 #include <algorithm>
61 
62 // Use namespace of deal.II
63 using namespace dealii;
64 
65 namespace FuelCell
66 {
73 namespace InitialSolution
74 {
80 template <int dim>
81 //class InitialSolution
83  :
84  public Function<dim>
85 {
86 public:
90  AppReadMeshIC (std::vector<std::string> );
94  ~AppReadMeshIC ();
99  void vector_value ( const Point<dim> &p,
100  Vector<double> &v ) const;
101 
102  double value (const Point<dim> &/*p*/, const unsigned int) const;
103 
107  void set_solution_names ( std::vector<std::string> names )
108  {
109  component_names = names;
110  }
111 
112 private:
113 
117  std::vector<std::string> component_names;
118 };
119 } //end namespace InitialSolution
120 
121 
122 namespace Application
123 {
124 //---------------------------------------------------------------------------
125 //---------------------------------------------------------------------------
126 //---------------------------------------------------------------------------
133 template <int dim>
135  :
137 {
138 public:
139 
146  AppReadMesh ( boost::shared_ptr<FuelCell::ApplicationCore::ApplicationData> data =
147  boost::shared_ptr<FuelCell::ApplicationCore::ApplicationData> () );
148 
152  ~AppReadMesh();
159  virtual void declare_parameters ( ParameterHandler& param );
160 
165  void _initialize ( ParameterHandler& param );
166 
170  virtual void initialize ( ParameterHandler& param );
171 
175  virtual void initialize_solution (FuelCell::ApplicationCore::FEVector& initial_guess,
176  std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
177 
188  const typename DoFApplication<dim>::CellInfo& )
189  {}
190 
194  void cell_responses ( std::vector<double>& ,
195  const typename DoFApplication<dim>::CellInfo&,
197  {}
198 
203  void global_responses ( std::vector<double>&,
205  {}
206 
207 
212  virtual void data_out ( const std::string &basename,
214 
220  virtual void solve(FEVector& dst, const FEVectors& src){
221  //Do nothing
222  }
223 
224 protected:
231  std::vector<std::string> equation_names;
237  std::vector<std::string> component_names;
238 
240  std::vector<std::string> design_var;
241 
243  std::vector<double> design_var_value;
244 
245 };
246 
247 }
248 }
249 
250 #endif
WHAT DOES THIS APPLICATION DO?
Definition: app_read_mesh.h:134
std::vector< std::string > design_var
Stores the design variable names so that the name can be appended to the .vtk file name...
Definition: app_read_mesh.h:240
std::vector< std::string > component_names
List of solution variables.
Definition: app_read_mesh.h:117
virtual void solve(FEVector &dst, const FEVectors &src)
Reimplementation of the pure virtual solve function.
Definition: app_read_mesh.h:220
void set_solution_names(std::vector< std::string > names)
Function to set the component names of the initial solution.
Definition: app_read_mesh.h:107
void cell_residual(FuelCell::ApplicationCore::FEVector &, const typename DoFApplication< dim >::CellInfo &)
Integration of the rhs of the equations.
Definition: app_read_mesh.h:187
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:625
std::vector< std::string > equation_names
Structure where we store the problem we want to solve.
Definition: app_read_mesh.h:231
std::vector< std::string > component_names
Structure where we store the name of each component in our problem.
Definition: app_read_mesh.h:237
This class is used when solving the problem using Newton&#39;s method to provide an initial solution...
Definition: app_read_mesh.h:82
void cell_responses(std::vector< double > &, const typename DoFApplication< dim >::CellInfo &, const FuelCell::ApplicationCore::FEVector &)
Compute the value of all objective function and constraints.
Definition: app_read_mesh.h:194
void global_responses(std::vector< double > &, const FuelCell::ApplicationCore::FEVector &)
This class is used to evaluate all responses that do not require looping over cells.
Definition: app_read_mesh.h:203
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:39
The data type used in function calls of Application.
Definition: fe_vectors.h:59
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:62
std::vector< double > design_var_value
Stores the values of the design variables so that the number can be appended to the ...
Definition: app_read_mesh.h:243