File coordinates.hxx¶
-
class
Coordinates
¶ - #include <coordinates.hxx>
Represents a coordinate system, and associated operators
This is a container for a collection of metric tensor components
Public Functions
-
Coordinates
(Mesh *mesh, Options *options, const CELL_LOC loc, const Coordinates *coords_in, bool force_interpolate_from_centre = false)¶ Constructor interpolating from another Coordinates object By default attempts to read staggered Coordinates from grid data source, interpolating from CELL_CENTRE if not present. Set force_interpolate_from_centre argument to true to always interpolate (useful if CELL_CENTRE Coordinates have been changed, so reading from file would not be correct).
-
Coordinates
(Mesh *mesh, Field2D dx, Field2D dy, BoutReal dz, Field2D J, Field2D Bxy, Field2D g11, Field2D g22, Field2D g33, Field2D g12, Field2D g13, Field2D g23, Field2D g_11, Field2D g_22, Field2D g_33, Field2D g_12, Field2D g_13, Field2D g_23, Field2D ShiftTorsion, Field2D IntShiftTorsion, bool calculate_geometry = true)¶ A constructor useful for testing purposes. To use it, inherit from Coordinates. If
calculate_geometry
is true (default), calculate the non-uniform variables, Christoffel symbols
-
Coordinates &
operator=
(Coordinates&&)¶
-
~Coordinates
()¶
-
void
outputVars
(Datafile &file)¶ Adds variables to the output file, for post-processing
Must be a better way so that Coordinates doesn’t depend on Datafile
-
int
geometry
(bool recalculate_staggered = true, bool force_interpolate_from_centre = false)¶ Calculate differential geometry quantities from the metric tensor.
-
int
calcCovariant
(const std::string ®ion = "RGN_ALL")¶ Invert contravatiant metric to get covariant components.
-
int
calcContravariant
(const std::string ®ion = "RGN_ALL")¶ Invert covariant metric to get contravariant components.
-
int
jacobian
()¶ Calculate J and Bxy.
-
void
setParallelTransform
(std::unique_ptr<ParallelTransform> pt)¶ Set the parallel (y) transform for this mesh. Mostly useful for tests.
-
ParallelTransform &
getParallelTransform
()¶ Return the parallel transform.
-
Field2D
DDX
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string ®ion = "RGN_NOBNDRY")¶
-
Field2D
DDX
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method, REGION region = RGN_NOBNDRY)¶
-
Field2D
DDY
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string ®ion = "RGN_NOBNDRY")¶
-
Field2D
DDY
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method, REGION region = RGN_NOBNDRY)¶
-
Field2D
DDZ
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string ®ion = "RGN_NOBNDRY")¶
-
Field2D
DDZ
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method, REGION region = RGN_NOBNDRY)¶
-
Field2D
Grad_par
(const Field2D &var, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶ Gradient along magnetic field b.Grad(f)
-
Field2D
Grad_par
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field3D
Grad_par
(const Field3D &var, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶
-
Field3D
Grad_par
(const Field3D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field2D
Vpar_Grad_par
(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶ Advection along magnetic field V*b.Grad(f)
-
Field3D
Vpar_Grad_par
(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶
-
Field2D
Div_par
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶ Divergence along magnetic field Div(b*f) = B.Grad(f/B)
-
Field2D
Div_par
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field3D
Div_par
(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶
-
Field3D
Div_par
(const Field3D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field2D
Grad2_par2
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶
-
Field2D
Grad2_par2
(const Field2D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field3D
Grad2_par2
(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT")¶
-
Field3D
Grad2_par2
(const Field3D &f, CELL_LOC outloc, DIFF_METHOD method)¶
-
Field2D
Delp2
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, bool useFFT = true)¶
-
Field3D
Delp2
(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, bool useFFT = true)¶
-
FieldPerp
Delp2
(const FieldPerp &f, CELL_LOC outloc = CELL_DEFAULT, bool useFFT = true)¶
-
Field2D
Laplace_par
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT)¶
-
Field3D
Laplace_par
(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT)¶
-
Field2D
Laplace
(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT)¶
-
Field3D
Laplace
(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT)¶
Public Members
-
bool
non_uniform
¶ True if corrections for non-uniform mesh spacing should be included in operators.
Private Functions
-