In this format, equations consists of series of commands that build the numerical system.
In order to write oscillation equations with this format, one need to write them projected onto the spherical harmonics basis.
Equation example: | |
---|---|
In order to write such an equation in TOP, one need to split it into terms and add them incrementally in the numerical system. The purpose of TOP, in particular top-build is to ease writing such equations. Several commands can help inserting such terms in the numerical system, see section Commands for a list of commands available in TOP’s language.
Few other features can help understanding how to write equations in TOP: for a description of the type of terms TOP can handle, see section Type of Terms. And see section String pre-processing for a description of string pre-processing and special variables.
For each term to be added in the numerical system, one need to provide TOP with its type. The type of a term specify whether it depends on nothing (scalar), the radial coordinate \(r\), \(l\) or \(l'\).
The type of terms currently supported by TOP are:
s: | scalar term |
---|---|
r: | term only depending on \(r\) (or \(\zeta\)) (only available for 1D equations) |
tt: | term depending on \(l\) and \(l'\) (only available in 2D equations) |
rt: | term depending on \(r\) (or \(\zeta\)) and \(l\) (only in 2D equations) |
rtt: | term depending on \(r\) (or \(\zeta\)), \(l\) and \(l'\) (only available in 2D equations) |
$a: | stands for the current coupling matrix. This variable can only be used in a term definition |
---|---|
$prev: | the previous coupling matrix. It correspond to variable $a of the last term definition. |
$leq: | the array containing \(l\) values of the current equation. |
$lvar: | the array containing \(l\) values of the current variable. |
$leq(x): | is the \(x^{th}\) \(l\) value of the current equation. |
$lvar(x): | is the \(x^{th}\) \(l\) value of the current variable. |
$eq: | index of the current equation. |
$var: | index of the current variable. |
$nr: | radial resolution of the problem. |
$i: | indices of the radial coordinate (this will result in the generation of a FORTRAN loop over all radial points). |
$j1: | indices of the horizontal coordinate \(l\) (this will result in the generation of a FORTRAN loop over all values of \(l\)). |
$j2: | indices of the horizontal coordinate \(l'\) (this will result in the generation of a FORTRAN loop over all values of \(l'\)). |
This command allow the user to define a parameter for the set of equation to be written.
Syntax: | input parameter format |
---|---|
Arguments: |
|
Example: | input mass 0pf5.2 |
Used to define a string to appear in the output files.
Syntax: | stamp string |
---|---|
Arguments: |
|
Example: | stamp eq_ESTER_all_lagrange |
Used to define named constants.
Syntax: | definition type name value |
---|---|
Arguments: |
|
Example: | definition double_precision gamma_p 1d0 + 1d0/pindex will define gamma_p with a value of \(1+\frac{1}{pindex}\) (where \(pindex\) has to be another variable (definition or input) |
Defines the name of equation to be defined in the equation file.
Syntax: | eqlist eq1 eq2 eq3 ... # and so on |
---|---|
Arguments: |
|
Example: | eqlist eqEr eqdP eqPhi eqPhiP defines 4 equations named eqEr, eqdP, eqPhi and epPhiP |
Defines variables of the equation set.
Syntax: | varlist var1 var2 var3 ... # and so on |
---|---|
Arguments: |
|
Example: | varlist Er dP Phi PhiP defines 4 variables named Er, dP, Phi and PhiP |
In TOP equation are projected into the spherical harmonic basis. This command is use to define the starting \(l\) for this projection.
Syntax: | leq eqName value |
---|---|
Arguments: |
|
Example: | leq eqEr abs(m)+iparity |
In TOP variables are projected into the spherical harmonic basis. This command is use to define the starting \(l\) for this projection.
Syntax: | lvar varName value |
---|---|
Arguments: |
|
Example: | lvar Er abs(m)+iparity |
This command is used to start defining an equation. This means that further command in the equation file will apply to the current equation.
Syntax: | equation eqName |
---|---|
Arguments: |
|
Example: | equation eqEr |
This is use to insert a term in the current equation: this term will be computed by calling a FORTRAN subroutine.
Syntax: | sub type power routine variable |
---|---|
Arguments: |
|
Example: | sub rtt w1 Illm(sint/roz, $a, $leq, $lvar) u: this basically add the term \(\omega \iint(\frac{sin(\theta)}{roz}) * u\) in the current equation, where \(\omega\) is the eigenvalue. |
This is use to insert a boundary condition term in the current equation: this term will be computed by calling a FORTRAN subroutine.
Syntax: | subbc type location power routine variable(index) |
---|---|
Arguments: |
|
Example: | subbc tt nr w0 Illmbc(hhz(1, :), $a, $leq, $lvar) v(1), here we can see that location and index are different: the boundary condition is imposed at the center (v(1) stands for \(v\) at \(r=0\)), but in the numerical system, the condition is imposed on the last line of the matrix. |
Used to insert a term in the equation.
Syntax: | term type power expression variable |
---|---|
Arguments: |
|
Example: | term s w0 -2d0 Pi'': this would insert the term \(-2\frac{\partial^2 Pi}{\partial r^2}\) in the current equation. |
Used to insert a term in a boundary condition of the system.
Syntax: | termbc type location power expression variable(index) |
---|---|
Arguments: |
|
Example: | termbc t $nr w0 1d0 Phi($nr)': this would insert the term \(\Phi(r=surf)\) in the boundary condition. (The last line of the matrix would be replaced with this boundary condition). |
Used to add ad-hoc FORTRAN instruction in the module responsible for computing coupling integrals.
Syntax: | instruction fortran |
---|---|
Arguments: |
|
Example: | instruction call modify_l0($prev, $nr, abs(m)+iparity): will insert the code call modify_l0(dm(1)%artt(:, :, :), grd(1)%nr, abs(m)+iparity). See String pre-processing. |