HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute the explicitly-treated part of the right-hand side for IMEX time integration. More...
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <mpivars_cpp.h>
#include <simulation_object.h>
#include <petscinterface.h>
Go to the source code of this file.
Macros | |
#define | __FUNCT__ "PetscRHSFunctionIMEX" |
Functions | |
PetscErrorCode | PetscRHSFunctionIMEX (TS ts, PetscReal t, Vec Y, Vec F, void *ctxt) |
Compute the explicitly-treated part of the right-hand side for IMEX time integration.
Definition in file PetscRHSFunctionIMEX.cpp.
#define __FUNCT__ "PetscRHSFunctionIMEX" |
Definition at line 16 of file PetscRHSFunctionIMEX.cpp.
PetscErrorCode PetscRHSFunctionIMEX | ( | TS | ts, |
PetscReal | t, | ||
Vec | Y, | ||
Vec | F, | ||
void * | ctxt | ||
) |
Compute the explicitly-treated right-hand-side (RHS) for the implicit-explicit (IMEX) time integration of the governing equations: The ODE, obtained after discretizing the governing PDE in space, is expressed as follows (for the purpose of IMEX time integration):
\begin{eqnarray} \frac {d{\bf U}}{dt} &=& {\bf F}\left({\bf U}\right) + {\bf G}\left({\bf U}\right), \\ \Rightarrow \dot{\bf U} - {\bf G}\left({\bf U}\right) &=& {\bf F}\left({\bf U}\right), \end{eqnarray}
where \({\bf F}\) is non-stiff and integrated in time explicitly, and \({\bf G}\) is stiff and integrated in time implicitly, and \({\bf U}\) represents the entire solution vector (state vector).
Note that \({\bf F}\left({\bf U}\right)\) represents all terms that the user has indicated to be integrated in time explicitly (PETScContext::flag_hyperbolic_f, PETScContext::flag_hyperbolic_df, PETScContext::flag_hyperbolic, PETScContext::flag_parabolic, and PETScContext::flag_source).
This function computes \({\bf F}\left({\bf U}\right)\), given \({\bf U}\).
Note:
ts | Time integration object |
t | Current simulation time |
Y | State vector (input) |
F | The computed right-hand-side vector |
ctxt | Object of type PETScContext |
Definition at line 49 of file PetscRHSFunctionIMEX.cpp.