OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
theta_scheme.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2009-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: theta_scheme.h
11 // - Description: Time loop with theta scheme transient discretization.
12 // - Developers: A. Kosakian, University of Alberta
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef __theta_scheme_h
17 #define __theta_scheme_h
18 
19 #include <solvers/transient_base.h>
20 
21 namespace FuelCell
22 {
23 namespace ApplicationCore
24 {
89  class ThetaScheme : public TransientBase
90  {
91  public:
92 
97 
105  virtual void declare_parameters (ParameterHandler& param);
106 
108  virtual void initialize (ParameterHandler& param);
109 
118  const FuelCell::ApplicationCore::FEVectors& in_vectors);
119 
124 
125  private:
132  double theta;
133 
137  void solve_operations(FuelCell::ApplicationCore::FEVector& u, const FuelCell::ApplicationCore::FEVectors& in_vectors, bool print_solution);
138 
139  /*
140  * Variable that contains current time (i.e. time that has passed from the initial time layer till the current layer).
141  */
142  double current_time;
143 
150 
151  /*
152  * The order of the given time discretization scheme.
153  */
154  unsigned short int scheme_order;
155  };
156 }
157 }
158 
159 #endif
float current_layer
Variable that contains current time layer.
Definition: theta_scheme.h:149
virtual void declare_parameters(ParameterHandler &param)
Declare input parameters.
Definition: theta_scheme.h:89
virtual void initialize(ParameterHandler &param)
Read parameters.
double current_time
Definition: theta_scheme.h:142
SmartPointer< ApplicationBase > app
Pointer to the application this one depends upon.
Definition: application_wrapper.h:106
unsigned short int scheme_order
Definition: theta_scheme.h:154
virtual void solve(FuelCell::ApplicationCore::FEVector &u, const FuelCell::ApplicationCore::FEVectors &in_vectors)
Actual transient solver.
void solve_operations(FuelCell::ApplicationCore::FEVector &u, const FuelCell::ApplicationCore::FEVectors &in_vectors, bool print_solution)
Performs one transient iteration with the given time step tau.
Base class for applications.
Definition: application_base.h:113
static const FuelCell::ApplicationCore::Event new_assembly
Event used to make application reassemble its system matrix and rhs.
Definition: theta_scheme.h:123
This is a base class for transient solvers.
Definition: transient_base.h:53
Objects of this kind are used to notify interior applications of changes provoked by an outer loop...
Definition: event.h:51
double theta
Parameter .
Definition: theta_scheme.h:132
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
ThetaScheme(ApplicationBase &app)
Constructor, receiving an application with transient model and a data object.