OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
A more sophisticated residual class that splits jobs between the two kinds of residual needed for ThetaTimestepping. More...
#include <timestepping.h>
Public Member Functions | |
ThetaResidual (ApplicationBase &application) | |
virtual double | operator() (FEVector &dst, const FEVectors &src) const |
This function returns the residual in dst , using the vectors from src . | |
Public Member Functions inherited from AppFrame::Residual | |
virtual | ~Residual () |
Private Attributes | |
SmartPointer< ApplicationBase > | app |
The Application class providing the function Application::residual(). | |
A more sophisticated residual class that splits jobs between the two kinds of residual needed for ThetaTimestepping.
In each step of ThetaTimestepping, knowing the solution of the previous step up, the following system is solved for the solution at the new timestep u:
\begin{eqnarray*} \left(\frac1{\delta t} u + \vartheta A(u) \right) &= r_p \\ r_p &= \frac1{\delta t} u_p + (\vartheta-1) A(u_p). \end{eqnarray*}
The vector r1 is computed using a Residual. If A is a nonlinear operator, a Newton scheme is used to solve the first line. This Newton scheme will use a Residual as well, computing the residual of the first equation.
Although both residuals are different, they have the same structure. in particular, the form A computed by a LocalIntegrator is the same, just scaled differently.
This class now allows you to use the same LocalIntegrator for both residuals. Just use the value named scaling
instead of theta
when computing local forms. The subtraction of r1 is done by this class and thus no concern anymore.
For an example how to use this class, refer to Tests::RotatingCone2.
AppFrame::ThetaResidual::ThetaResidual | ( | ApplicationBase & | application | ) |
|
virtual |
This function returns the residual in dst
, using the vectors from src
.
Implements AppFrame::Residual.
|
private |
The Application class providing the function Application::residual().