|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
#include <poisson.h>
Data Fields | |
| scalar | a |
| scalar | b |
| const vector | alpha |
| const scalar | lambda |
| double | tolerance |
| int | nrelax |
| int | minlevel |
| scalar * | res |
We now apply the generic multigrid solver to the Poisson–Helmholtz equation
\[ \nabla\cdot (\alpha\nabla a) + \lambda a = b \]
We first setup the data structure required to pass the extra parameters \(\alpha\) and \(\lambda\). We define \(\alpha\) as a face vector field because we need values at the face locations corresponding to the face gradients of field \(a\).
alpha* and lambda are declared as *(const)* to indicate that the function works also when alpha and lambda are constant vector (resp. scalar) fields. If tolerance is set, it supersedes the default TOLERANCE of the multigrid solver, nrelax controls the initial number of relaxations (default is one), minlevel controls the minimum level of the hierarchy (default is one) and res is an optional list of fields used to store the final residual (which can be useful to monitor convergence).
| scalar* Poisson::res |
Definition at line 262 of file poisson.h.
Referenced by residual().