File imex-bdf2.cxx

2nd order IMEX-BDF scheme

Scheme taken from this paper: http://homepages.cwi.nl/~willem/DOCART/JCP07.pdf

W.Hundsdorfer, S.J.Ruuth “IMEX extensions of linear multistep methods with general

monotonicity and boundedness properties” JCP 225 (2007) 2016-2042

Uses PETSc for the SNES interface

Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu

Contact: Ben Dudson, bd512@york.ac.uk

This file is part of BOUT++.

BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.

Defines

__FUNCT__

PETSc callback function, which evaluates the nonlinear function to be solved by SNES.

This function assumes the context void pointer is a pointer to an IMEXBDF2 object.

PETSc callback function for forming Jacobian

This function can be a linearised form of FormFunction

SNES callback for forming Jacobian with coloring

This can be a linearised and simplified form of FormFunction

__FUNCT__

PETSc callback function, which evaluates the nonlinear function to be solved by SNES.

This function assumes the context void pointer is a pointer to an IMEXBDF2 object.

PETSc callback function for forming Jacobian

This function can be a linearised form of FormFunction

SNES callback for forming Jacobian with coloring

This can be a linearised and simplified form of FormFunction

__FUNCT__

PETSc callback function, which evaluates the nonlinear function to be solved by SNES.

This function assumes the context void pointer is a pointer to an IMEXBDF2 object.

PETSc callback function for forming Jacobian

This function can be a linearised form of FormFunction

SNES callback for forming Jacobian with coloring

This can be a linearised and simplified form of FormFunction

__FUNCT__

PETSc callback function, which evaluates the nonlinear function to be solved by SNES.

This function assumes the context void pointer is a pointer to an IMEXBDF2 object.

PETSc callback function for forming Jacobian

This function can be a linearised form of FormFunction

SNES callback for forming Jacobian with coloring

This can be a linearised and simplified form of FormFunction

Functions

static PetscErrorCode FormFunction(SNES snes, Vec x, Vec f, void *ctx)
static PetscErrorCode FormFunctionForDifferencing(void *ctx, Vec x, Vec f)
static PetscErrorCode FormFunctionForColoring(SNES snes, Vec x, Vec f, void *ctx)
static PetscErrorCode imexbdf2PCapply(PC pc, Vec x, Vec y)
class SaveVarOp

Public Functions

SaveVarOp(Field2D *var, Field2D *F_var)
SaveVarOp(Field3D *var, Field3D *F_var)
void run(int jx, int jy, BoutReal *u)
void run(int jx, int jy, int jz, BoutReal *u)

Private Members

Field2D *var2D
Field3D *var3D
class LoadVarOp

Public Functions

LoadVarOp(Field2D *var, Field2D *F_var)
LoadVarOp(Field3D *var, Field3D *F_var)
void run(int jx, int jy, BoutReal *u)
void run(int jx, int jy, int jz, BoutReal *u)

Private Members

Field2D *var2D
Field3D *var3D
class SaveDerivsOp

Public Functions

SaveDerivsOp(Field2D *var, Field2D *F_var)
SaveDerivsOp(Field3D *var, Field3D *F_var)
void run(int jx, int jy, BoutReal *u)
void run(int jx, int jy, int jz, BoutReal *u)

Private Members

Field2D *F_var2D
Field3D *F_var3D