-
Notifications
You must be signed in to change notification settings - Fork 9
Solver methods
The multigrid elliptic solver we use aims to solve a set of coupled elliptic equations, each of the form
Here
Any equation given to the solver has to be linearised to cast it in the form above, if not already linear, since the coefficients and source cannot depend on the solver variables themselves. Once linearised, we start with a guess for the linearised variable, say
For example, in the Hybrid CTTK method, the equation for update_psi0 in Source/Core/Grids.cpp.
All the current methods require some non linear iterations, because although the individual equations are linear, they are coupled such that updates of the Hamiltonian constraint affect the momentum constraint at the next step and vice versa.
Please refer to the CTTK article for more detailed explanations of these points.
The current version of the solver supports the use of two different methods for solving the constraint equations: CTTK and Hybrid CTTK. See this article for full details of each approach.
The basic difference between the two methods is that in the Hybrid approach the conformal factor
The desired method is chosen in the GNUMakefile, by leaving the line with the desired method uncommented and commenting out the other options. For example, for using the Hybrid CTTK method, this line should be used:
cxxcppflags = -DUSE_CTTKHybrid
Then, the command make realclean should be used on the terminal after which the whole solver should be recompiled so that the desired method is implemented in the compilation.
To create a new solver method, one needs to create a class that provides methods for calculating the rhs, aCoef and bCoef values throughout the grid. These need to be defined for each of the variables to be solved for. Probably the easiest way to do this is to copy and amend one of the existing example methods (e.g., CTTK.hpp/CTTK.impl.hpp).
The methods themselves are coded in the Source/Method folder. Each method defines a class, with five corresponding functions. The functions and the variables defined through them are listed below:
-
read_params: reads the appropriate parameters from the params.txt file -
solve_analytic: computes$K$ , $\bar{A}{ij}$, and the ADM components of the EM tensor, $\rho$ $S_i$ and $S{ij}$. -
set_elliptic_terms: sets the RHS of the constraint equations and the aCoef (multiplying the constraint variable in the equation) -
initialise_method_vars: initialises the multigrid variables to 0 or values from params file -
initialise_constraint_vars: initialises the constraint variables to 0
In order to introduce a new method, the corresponding files should be added into the Source/Method folder (e.g. MyNewMethod.impl.hpp, MyNewMethod.hpp). In addition, the option has to be added to solver_main.cpp and the GNUMakefile, following the code for the existing examples (e.g., introduce USE_MYNEWMETHOD).
If new variables are added, they will need to be introduced in the rest of the code (for example, in MultigridUserVariables.hpp and BoundaryConditions.cpp), but the solver can solve any number of equations, provided that rhs, aCoef and bCoef are defined for all the variables to be solved.
Copyright GRTL Collaboration 2024