OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
picard_base.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2009-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: picard_base.h
11 // - Description: Base class for all variants of the Picard solver
12 // - Developers: Mayank Sabharwal
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef __deal2__appframe__picard_base_h
17 #define __deal2__appframe__Picard_base_h
18 
19 #include <deal.II/lac/solver_control.h>
20 
22 
23 using namespace dealii;
24 using namespace FuelCell::ApplicationCore;
25 
26 namespace FuelCell
27 {
28 namespace ApplicationCore
29 {
54  {
55  public:
56 
62 
70  virtual void declare_parameters (ParameterHandler& param);
71 
75  virtual void initialize (ParameterHandler& param);
76 
80  void initialize_initial_guess(BlockVector<double>& dst){};
81 
87  virtual void assemble();
88 
97  virtual double residual(FuelCell::ApplicationCore::FEVector& dst,
99 
108  virtual void solve(FuelCell::ApplicationCore::FEVector& u,
109  const FuelCell::ApplicationCore::FEVectors& in_vectors) = 0;
110 
111 
112 
113 
114  protected:
119  void debug_output(const FEVector& sol,
120  const FEVector& update,
121  const FEVector& residual) const;
122 
129 
134 
139 
143  int maxsteps;
148 
158  unsigned int debug;
162  unsigned int step;
163 
167  double numIter;
168 
176  std::vector<unsigned int> blocks;
177 
181  unsigned int n_blocks;
182  };
183 }
184 }
185 
186 #endif
std::vector< unsigned int > blocks
This vector specifies the blocks of the global solution which are supposed to be treated specially...
Definition: picard_base.h:176
bool assemble_now
This flag is set by the function assemble(), indicating that the matrix must be assembled anew upon s...
Definition: picard_base.h:128
int maxsteps
Maximu no.
Definition: picard_base.h:143
unsigned int debug
Write debug output to FcstUtilities::log; the higher the number, the more output. ...
Definition: picard_base.h:158
bool debug_solution
Print updated solution after each step into file.
Definition: picard_base.h:147
double numIter
Number of Iterations;.
Definition: picard_base.h:167
unsigned int n_blocks
The total number of blocks.
Definition: picard_base.h:181
double abs_tolerance
Absolute tolerance for the Picard convergence loop.
Definition: picard_base.h:133
double rel_tolerance
Relative tolerance for the Picard convergence loop.
Definition: picard_base.h:138
Base class for all classes performing Picard iterations.
Definition: picard_base.h:53
Base class for applications.
Definition: application_base.h:113
bool debug_residual
Print Picard residual after each step into file Picard_rNNN?
Definition: picard_base.h:153
This class implements either iterative or time-stepping wrapper of applications.
Definition: application_wrapper.h:39
unsigned int step
The number of a basic Picard iteration.
Definition: picard_base.h:162
void initialize_initial_guess(BlockVector< double > &dst)
Control object for the Picard iteration.
Definition: picard_base.h:80
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