OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
equation_auxiliaries.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2015 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: equation_auxiliaries.h
11 // - Description: This is a base class for all auxiliary openFCST equation functions.
12 // - Developers: Aslan Kosakian, University of Alberta
13 //
14 // ----------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_EQUATION_AUXILIARIES_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_EQUATION_AUXILIARIES_H_
18 
19 #include <boost/shared_ptr.hpp>
20 
24 #include <layers/base_layer.h>
25 #include <utils/fem_extras.h>
26 #include <utils/fcst_utilities.h>
27 #include <utils/fcst_constants.h>
29 
30 using namespace dealii;
31 using namespace FuelCell::ApplicationCore;
32 
33 namespace FuelCellShop
34 {
35  namespace Equation
36  {
51  struct VariableInfo
52  {
56  unsigned int solution_index;
57 
61  unsigned int block_index;
62 
67  unsigned int fetype_index;
68 
75  };
76 
77  namespace DebugTools
78  {
79 
80  template<int dim>
81  class DebugOutput : public Subscriptor
82  {
83  public:
84 
88  DebugOutput(FuelCell::SystemManagement& sys_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data);
89 
93  void output_matrix(FuelCell::ApplicationCore::MatrixVector cell_matrices,
96  );
97 
101  void output_vector(FuelCell::ApplicationCore::FEVector& cell_res);
102 
106  virtual ~DebugOutput();
107 
108  private:
109 
111 
112 
115  int cell_number=0;
116 
120  int cell_number_m=0;
121 
125  std::string fname="";
126 
130  std::ofstream filestream;
131 
136 
142 
144 
145 
149 
153  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data;
155  };
156  }
157 
158  }
159 }
160 
161 #endif
unsigned int solution_index
Index of the user-defined solution variable, retrieved from #SystemManagement.
Definition: equation_auxiliaries.h:56
FEVector matrix_by_rows
Contains system matrix written row by row as column.
Definition: equation_auxiliaries.h:140
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data object for the application data to be passed to the equation classes.
Definition: equation_auxiliaries.h:153
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
FEVectors out
FEVectors object used for output.
Definition: equation_auxiliaries.h:135
unsigned int block_index
Block index of the matrix relating to the variable corresponding to an equation, retrieved from #Syst...
Definition: equation_auxiliaries.h:61
Definition: equation_auxiliaries.h:81
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
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
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_auxiliaries.h:148
bool indices_exist
Boolean storing whether indices exist or not.
Definition: equation_auxiliaries.h:74
unsigned int fetype_index
Index corresponding to type of fevalue object used for this variable.
Definition: equation_auxiliaries.h:67
std::ofstream filestream
Variable used for streaming to file.
Definition: equation_auxiliaries.h:130