Extension: Geometries
#include "dg/geometries/geometries.h"
|
Create and manage interpolation matrices from fieldline integration. More...
Public Member Functions | |
Fieldaligned () | |
do not allocate memory; no member call except construct is valid More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::TokamakMagneticField &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=12, unsigned my=12, double deltaPhi=-1, std::string interpolation_method="linear-nearest", bool benchmark=true) | |
Construct from a magnetic field and a grid. More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::CylindricalVectorLvl1 &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=12, unsigned my=12, double deltaPhi=-1, std::string interpolation_method="linear-nearest", bool benchmark=true) | |
Construct from a vector field and a grid. More... | |
template<class ... Params> | |
void | construct (Params &&...ps) |
Perfect forward parameters to one of the constructors. More... | |
dg::bc | bcx () const |
dg::bc | bcy () const |
void | set_boundaries (dg::bc bcz, double left, double right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &left, const container &right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &global, double scal_left, double scal_right) |
Set boundary conditions in the limiter region. More... | |
void | operator() (enum whichMatrix which, const container &in, container &out) |
Apply the interpolation to three-dimensional vectors. More... | |
double | deltaPhi () const |
const container & | hbm () const |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \). More... | |
const container & | hbp () const |
Distance between the planes \( (s_b^+-s_{k}) \). More... | |
const container & | sqrtG () const |
Volume form (including weights) \( \sqrt{G}_{k} \). More... | |
const container & | sqrtGm () const |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \). More... | |
const container & | sqrtGp () const |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \). More... | |
const container & | bphi () const |
bphi More... | |
const container & | bphiM () const |
bphi on minus plane More... | |
const container & | bphiP () const |
bphi on plus plane More... | |
const container & | bbm () const |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else. More... | |
const container & | bbo () const |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else. More... | |
const container & | bbp () const |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else. More... | |
const ProductGeometry & | grid () const |
Grid used for construction. More... | |
container | interpolate_from_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse) |
Interpolate along fieldlines from a coarse to a fine grid in phi. More... | |
void | integrate_between_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse, container &out) |
Integrate a 2d function on the fine grid. More... | |
template<class BinaryOp , class UnaryOp > | |
container | evaluate (BinaryOp binary, UnaryOp unary, unsigned p0, unsigned rounds) const |
Evaluate a 2d functor and transform to all planes along the fieldline More... | |
std::string | method () const |
Return the interpolation_method string given in the constructor. More... | |
Fieldaligned () | |
do not allocate memory; no member call except construct is valid More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::TokamakMagneticField &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=10, unsigned my=10, double deltaPhi=-1, std::string interpolation_method="dg", bool benchmark=true) | |
Construct from a magnetic field and a grid. More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::CylindricalVectorLvl1 &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=10, unsigned my=10, double deltaPhi=-1, std::string interpolation_method="dg", bool benchmark=true) | |
Construct from a vector field and a grid. More... | |
template<class ... Params> | |
void | construct (Params &&...ps) |
Perfect forward parameters to one of the constructors. More... | |
dg::bc | bcx () const |
dg::bc | bcy () const |
void | set_boundaries (dg::bc bcz, double left, double right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &left, const container &right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &global, double scal_left, double scal_right) |
Set boundary conditions in the limiter region. More... | |
void | operator() (enum whichMatrix which, const container &in, container &out) |
Apply the interpolation to three-dimensional vectors. More... | |
double | deltaPhi () const |
const container & | hbm () const |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \). More... | |
const container & | hbp () const |
Distance between the planes \( (s_b^+-s_{k}) \). More... | |
const container & | sqrtG () const |
Volume form (including weights) \( \sqrt{G}_{k} \). More... | |
const container & | sqrtGm () const |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \). More... | |
const container & | sqrtGp () const |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \). More... | |
const container & | bphi () const |
bphi More... | |
const container & | bphiM () const |
bphi on minus plane More... | |
const container & | bphiP () const |
bphi on plus plane More... | |
const container & | bbm () const |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else. More... | |
const container & | bbo () const |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else. More... | |
const container & | bbp () const |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else. More... | |
const ProductGeometry & | grid () const |
Grid used for construction. More... | |
container | interpolate_from_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse) |
Interpolate along fieldlines from a coarse to a fine grid in phi. More... | |
void | integrate_between_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse, container &out) |
Integrate a 2d function on the fine grid. More... | |
template<class BinaryOp , class UnaryOp > | |
container | evaluate (BinaryOp binary, UnaryOp unary, unsigned p0, unsigned rounds) const |
Evaluate a 2d functor and transform to all planes along the fieldline More... | |
std::string | method () const |
Fieldaligned () | |
do not allocate memory; no member call except construct is valid More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::TokamakMagneticField &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=10, unsigned my=10, double deltaPhi=-1, std::string interpolation_method="dg", bool benchmark=true) | |
Construct from a magnetic field and a grid. More... | |
template<class Limiter > | |
Fieldaligned (const dg::geo::CylindricalVectorLvl1 &vec, const ProductGeometry &grid, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, Limiter limit=FullLimiter(), double eps=1e-5, unsigned mx=10, unsigned my=10, double deltaPhi=-1, std::string interpolation_method="dg", bool benchmark=true) | |
Construct from a vector field and a grid. More... | |
template<class ... Params> | |
void | construct (Params &&...ps) |
Perfect forward parameters to one of the constructors. More... | |
dg::bc | bcx () const |
dg::bc | bcy () const |
void | set_boundaries (dg::bc bcz, double left, double right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &left, const container &right) |
Set boundary conditions in the limiter region. More... | |
void | set_boundaries (dg::bc bcz, const container &global, double scal_left, double scal_right) |
Set boundary conditions in the limiter region. More... | |
void | operator() (enum whichMatrix which, const container &in, container &out) |
Apply the interpolation to three-dimensional vectors. More... | |
double | deltaPhi () const |
const container & | hbm () const |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \). More... | |
const container & | hbp () const |
Distance between the planes \( (s_b^+-s_{k}) \). More... | |
const container & | sqrtG () const |
Volume form (including weights) \( \sqrt{G}_{k} \). More... | |
const container & | sqrtGm () const |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \). More... | |
const container & | sqrtGp () const |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \). More... | |
const container & | bphi () const |
bphi More... | |
const container & | bphiM () const |
bphi on minus plane More... | |
const container & | bphiP () const |
bphi on plus plane More... | |
const container & | bbm () const |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else. More... | |
const container & | bbo () const |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else. More... | |
const container & | bbp () const |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else. More... | |
const ProductGeometry & | grid () const |
Grid used for construction. More... | |
container | interpolate_from_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse) |
Interpolate along fieldlines from a coarse to a fine grid in phi. More... | |
void | integrate_between_coarse_grid (const ProductGeometry &grid_coarse, const container &coarse, container &out) |
Integrate a 2d function on the fine grid. More... | |
template<class BinaryOp , class UnaryOp > | |
container | evaluate (BinaryOp binary, UnaryOp unary, unsigned p0, unsigned rounds) const |
Evaluate a 2d functor and transform to all planes along the fieldline More... | |
std::string | method () const |
Create and manage interpolation matrices from fieldline integration.
ProductGeometry | must be either dg::aProductGeometry3d or dg::aProductMPIGeometry3d or any derivative |
IMatrix | The type of the interpolation matrix |
container | The container-class on which the interpolation matrix operates on |
|
inline |
do not allocate memory; no member call except construct is valid
|
inline |
Construct from a magnetic field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::Fieldaligned | ( | const dg::geo::CylindricalVectorLvl1 & | vec, |
const ProductGeometry & | grid, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
Limiter | limit = FullLimiter() , |
||
double | eps = 1e-5 , |
||
unsigned | mx = 12 , |
||
unsigned | my = 12 , |
||
double | deltaPhi = -1 , |
||
std::string | interpolation_method = "linear-nearest" , |
||
bool | benchmark = true |
||
) |
Construct from a vector field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
|
inline |
do not allocate memory; no member call except construct is valid
|
inline |
Construct from a magnetic field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::Fieldaligned | ( | const dg::geo::CylindricalVectorLvl1 & | vec, |
const ProductGeometry & | grid, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
Limiter | limit = FullLimiter() , |
||
double | eps = 1e-5 , |
||
unsigned | mx = 10 , |
||
unsigned | my = 10 , |
||
double | deltaPhi = -1 , |
||
std::string | interpolation_method = "dg" , |
||
bool | benchmark = true |
||
) |
Construct from a vector field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
|
inline |
do not allocate memory; no member call except construct is valid
|
inline |
Construct from a magnetic field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::Fieldaligned | ( | const dg::geo::CylindricalVectorLvl1 & | vec, |
const ProductGeometry & | grid, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
Limiter | limit = FullLimiter() , |
||
double | eps = 1e-5 , |
||
unsigned | mx = 10 , |
||
unsigned | my = 10 , |
||
double | deltaPhi = -1 , |
||
std::string | interpolation_method = "dg" , |
||
bool | benchmark = true |
||
) |
Construct from a vector field and a grid.
Limiter | Class that can be evaluated on a 2d grid, returns 1 if there is a limiter and 0 if there isn't. If a field line crosses the limiter in the plane \( \phi=0\) then the limiter boundary conditions apply. |
vec | The vector field to integrate. Note that you can control how the boundary conditions are represented by changing vec outside the grid domain using e.g. the periodify function. |
grid | The grid on which to integrate fieldlines. |
bcx | This parameter is passed on to dg::create::interpolation(const thrust::host_vector<real_type>&,const thrust::host_vector<real_type>&,const aRealTopology2d<real_type>&,dg::bc,dg::bc,std::string) (see there for more details) function and deterimens what happens when the endpoint of the fieldline integration leaves the domain boundaries of grid . Note that bcx and grid.bcx() have to be either both periodic or both not periodic. |
bcy | analogous to bcx , applies to y direction |
limit | Instance of the limiter class (Note that if grid.bcz()==dg::PER this parameter is ignored, Default is a limiter everywhere) |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 12 is a good start) If the projection method (parsed from interpolation_method ) is not "dg" then mx must be a multiple of nx |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | parsed according to |
interpolation_method | interpolation | projection |
---|---|---|
"dg" | "dg" | "dg" |
"linear" | "linear" | "dg" |
"cubic" | "cubic" | "dg" |
"nearest" | "nearest" | "dg" |
"linear-nearest" (##) | "linear" | "nearest" |
"cubic-nearest" | "cubic" | "nearest" |
"nearest-nearest" | "nearest" | "nearest" |
"dg-linear" | "dg" | "linear" |
"linear-linear" | "linear" | "linear" |
"cubic-linear" | "cubic" | "linear" |
"nearest-linear" | "nearest" | "linear" |
(##) Use "linear-nearest" if in doubt. The table yields one parameter passed to create::interpolation
(from the given grid to the fine grid) and one parameter to create::projection
(from the fine grid to the given grid)
benchmark | If true write construction timings to std::cout |
eps | Desired accuracy of the fieldline integrator |
mx | refinement factor in X of the fine grid relative to grid (Set to 1, if the x-component of vec vanishes, else as high as possible, 10 is a good start) |
my | analogous to mx , applies to y direction |
deltaPhi | The angular distance that the fieldline-integrator will integrate. Per default this is the distance between planes, which is chosen automatically if you set it <=0, i.e. if deltaPhi <=0 then it will be overwritten to deltaPhi = grid.hz(). Sometimes however, you may want to set it to a different value from grid.hz() for example for 2d problems or for a staggered grid. |
grid.bcz()
variable and can be changed by the set_boundaries function. If there is no limiter, the boundary condition is periodic. interpolation_method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial |
benchmark | If true write construction timings to std::cout |
|
inline |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else.
|
inline |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else.
|
inline |
Mask minus, 1 if fieldline intersects wall in minus direction but not in plus direction, 0 else.
|
inline |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else.
|
inline |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else.
|
inline |
Mask both, 1 if fieldline intersects wall in plus direction and in minus direction, 0 else.
|
inline |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else.
|
inline |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else.
|
inline |
Mask plus, 1 if fieldline intersects wall in plus direction but not in minus direction, 0 else.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bphi
|
inline |
bphi
|
inline |
bphi
|
inline |
bphi on minus plane
|
inline |
bphi on minus plane
|
inline |
bphi on minus plane
|
inline |
bphi on plus plane
|
inline |
bphi on plus plane
|
inline |
bphi on plus plane
|
inline |
Perfect forward parameters to one of the constructors.
Params | deduced by the compiler |
ps | parameters forwarded to constructors |
|
inline |
Perfect forward parameters to one of the constructors.
Params | deduced by the compiler |
ps | parameters forwarded to constructors |
|
inline |
Perfect forward parameters to one of the constructors.
Params | deduced by the compiler |
ps | parameters forwarded to constructors |
|
inline |
|
inline |
|
inline |
container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::evaluate | ( | BinaryOp | binary, |
UnaryOp | unary, | ||
unsigned | p0, | ||
unsigned | rounds | ||
) | const |
Evaluate a 2d functor and transform to all planes along the fieldline
The algorithm does the equivalent of the following:
BinaryOp
on a 2d planeu
is the given UnarayOp
, i
in [0..r] is the round index and j
in [0. Nz] is the plane index and \(\Delta\varphi\) is the angular distance given in the constructor (can be different from the actual grid distance hz!).j
, where the minus transformations get the inverted index \( N_z - j\).BinaryOp | Binary Functor |
UnaryOp | Unary Functor |
binary | Functor to evaluate in x-y |
unary | Functor to evaluate in z |
unary
is evaluated such that p0
corresponds to z=0, p0+1 corresponds to z=hz, p0-1 to z=-hz, ... p0 | The index of the plane to start |
rounds | The number of rounds r to follow a fieldline; can be zero, then the fieldlines are only followed within the current box ( no periodicity) |
mx>1
and my>1
when this function is used, else there might occur some unfavourable summation effects due to the repeated use of transformations especially for low perpendicular resolution.container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::evaluate | ( | BinaryOp | binary, |
UnaryOp | unary, | ||
unsigned | p0, | ||
unsigned | rounds | ||
) | const |
Evaluate a 2d functor and transform to all planes along the fieldline
The algorithm does the equivalent of the following:
BinaryOp
on a 2d planeu
is the given UnarayOp
, i
in [0..r] is the round index and j
in [0. Nz] is the plane index and \(\Delta\varphi\) is the angular distance given in the constructor (can be different from the actual grid distance hz!).j
, where the minus transformations get the inverted index \( N_z - j\).BinaryOp | Binary Functor |
UnaryOp | Unary Functor |
binary | Functor to evaluate in x-y |
unary | Functor to evaluate in z |
unary
is evaluated such that p0
corresponds to z=0, p0+1 corresponds to z=hz, p0-1 to z=-hz, ... p0 | The index of the plane to start |
rounds | The number of rounds r to follow a fieldline; can be zero, then the fieldlines are only followed within the current box ( no periodicity) |
mx>1
and my>1
when this function is used, else there might occur some unfavourable summation effects due to the repeated use of transformations especially for low perpendicular resolution.container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::evaluate | ( | BinaryOp | binary, |
UnaryOp | unary, | ||
unsigned | p0, | ||
unsigned | rounds | ||
) | const |
Evaluate a 2d functor and transform to all planes along the fieldline
The algorithm does the equivalent of the following:
BinaryOp
on a 2d planeu
is the given UnarayOp
, i
in [0..r] is the round index and j
in [0. Nz] is the plane index and \(\Delta\varphi\) is the angular distance given in the constructor (can be different from the actual grid distance hz!).j
, where the minus transformations get the inverted index \( N_z - j\).BinaryOp | Binary Functor |
UnaryOp | Unary Functor |
binary | Functor to evaluate in x-y |
unary | Functor to evaluate in z |
unary
is evaluated such that p0
corresponds to z=0, p0+1 corresponds to z=hz, p0-1 to z=-hz, ... p0 | The index of the plane to start |
rounds | The number of rounds r to follow a fieldline; can be zero, then the fieldlines are only followed within the current box ( no periodicity) |
mx>1
and my>1
when this function is used, else there might occur some unfavourable summation effects due to the repeated use of transformations especially for low perpendicular resolution.
|
inline |
Grid used for construction.
|
inline |
Grid used for construction.
|
inline |
Grid used for construction.
|
inline |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \).
|
inline |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \).
|
inline |
Distance between the planes and the boundary \( (s_{k}-s_{b}^-) \).
|
inline |
Distance between the planes \( (s_b^+-s_{k}) \).
|
inline |
Distance between the planes \( (s_b^+-s_{k}) \).
|
inline |
Distance between the planes \( (s_b^+-s_{k}) \).
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::integrate_between_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse, | ||
container & | out | ||
) |
Integrate a 2d function on the fine grid.
\[ \frac{1}{\Delta\varphi} \int_{-\Delta\varphi}^{\Delta\varphi}d \varphi w(\varphi) f(R(\varphi), Z(\varphi) \]
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid). The x and y dimensions must be equal to the input grid. |
coarse | the 2d input vector |
out | the integral (2d vector, may alias coarse) |
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::integrate_between_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse, | ||
container & | out | ||
) |
Integrate a 2d function on the fine grid.
\[ \frac{1}{\Delta\varphi} \int_{-\Delta\varphi}^{\Delta\varphi}d \varphi w(\varphi) f(R(\varphi), Z(\varphi) \]
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid). The x and y dimensions must be equal to the input grid. |
coarse | the 2d input vector |
out | the integral (2d vector) |
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::integrate_between_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse, | ||
container & | out | ||
) |
Integrate a 2d function on the fine grid.
\[ \frac{1}{\Delta\varphi} \int_{-\Delta\varphi}^{\Delta\varphi}d \varphi w(\varphi) f(R(\varphi), Z(\varphi) \]
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid). The x and y dimensions must be equal to the input grid. |
coarse | the 2d input vector |
out | the integral (2d vector) |
container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::interpolate_from_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse | ||
) |
Interpolate along fieldlines from a coarse to a fine grid in phi.
In this function we assume that the Fieldaligned object lives on the fine grid and we now want to interpolate values from a vector living on a coarse grid along the fieldlines onto the fine grid. Here, coarse and fine are with respect to the phi direction. The perpendicular directions need to have the same resolution in both input and output, i.e. there is no interpolation in those directions.
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid) The x and y dimensions must be equal |
coarse | the coarse input vector |
container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::interpolate_from_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse | ||
) |
Interpolate along fieldlines from a coarse to a fine grid in phi.
In this function we assume that the Fieldaligned object lives on the fine grid and we now want to interpolate values from a vector living on a coarse grid along the fieldlines onto the fine grid. Here, coarse and fine are with respect to the phi direction. The perpendicular directions need to have the same resolution in both input and output, i.e. there is no interpolation in those directions.
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid) The x and y dimensions must be equal |
coarse | the coarse input vector |
container dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::interpolate_from_coarse_grid | ( | const ProductGeometry & | grid_coarse, |
const container & | coarse | ||
) |
Interpolate along fieldlines from a coarse to a fine grid in phi.
In this function we assume that the Fieldaligned object lives on the fine grid and we now want to interpolate values from a vector living on a coarse grid along the fieldlines onto the fine grid. Here, coarse and fine are with respect to the phi direction. The perpendicular directions need to have the same resolution in both input and output, i.e. there is no interpolation in those directions.
grid_coarse | The coarse grid (coarse_grid.Nz() must integer divide Nz from input grid) The x and y dimensions must be equal |
coarse | the coarse input vector |
|
inline |
Return the interpolation_method
string given in the constructor.
|
inline |
|
inline |
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::operator() | ( | enum whichMatrix | which, |
const container & | in, | ||
container & | out | ||
) |
Apply the interpolation to three-dimensional vectors.
computes \( y = 1^\pm \otimes \mathcal T x\)
which | specify what interpolation should be applied |
in | input |
out | output may not equal input |
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::operator() | ( | enum whichMatrix | which, |
const container & | in, | ||
container & | out | ||
) |
Apply the interpolation to three-dimensional vectors.
computes \( y = 1^\pm \otimes \mathcal T x\)
which | specify what interpolation should be applied |
in | input |
out | output may not equal input |
void dg::geo::Fieldaligned< ProductGeometry, IMatrix, container >::operator() | ( | enum whichMatrix | which, |
const container & | in, | ||
container & | out | ||
) |
Apply the interpolation to three-dimensional vectors.
computes \( y = 1^\pm \otimes \mathcal T x\)
which | specify what interpolation should be applied |
in | input |
out | output may not equal input |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
global | 3D vector containing boundary values |
scal_left | left scaling factor |
scal_right | right scaling factor |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
global | 3D vector containing boundary values |
scal_left | left scaling factor |
scal_right | right scaling factor |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
global | 3D vector containing boundary values |
scal_left | left scaling factor |
scal_right | right scaling factor |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | spatially variable left boundary value (2d size) |
right | spatially variable right boundary value (2d size) |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | spatially variable left boundary value (2d size) |
right | spatially variable right boundary value (2d size) |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | spatially variable left boundary value (2d size) |
right | spatially variable right boundary value (2d size) |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | constant left boundary value |
right | constant right boundary value |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | constant left boundary value |
right | constant right boundary value |
|
inline |
Set boundary conditions in the limiter region.
if Dirichlet boundaries are used the left value is the left function value, if Neumann boundaries are used the left value is the left derivative value
bcz | boundary condition |
left | constant left boundary value |
right | constant right boundary value |
|
inline |
Volume form (including weights) \( \sqrt{G}_{k} \).
|
inline |
Volume form (including weights) \( \sqrt{G}_{k} \).
|
inline |
Volume form (including weights) \( \sqrt{G}_{k} \).
|
inline |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \).
|
inline |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \).
|
inline |
Volume form on minus plane (including weights) \( \sqrt{G}_{k-1} \).
|
inline |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \).
|
inline |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \).
|
inline |
Volume form on plus plane (including weights) \( \sqrt{G}_{k+1} \).