Extension: Geometries
#include "dg/geometries/geometries.h"
dg::geo::Hector< IMatrix, Matrix, container > Struct Template Reference

The High PrEcision Conformal grid generaTOR. More...

Inheritance diagram for dg::geo::Hector< IMatrix, Matrix, container >:
[legend]

Public Member Functions

 Hector (const CylindricalFunctorsLvl2 &psi, double psi0, double psi1, double X0, double Y0, unsigned n=13, unsigned Nx=2, unsigned Ny=10, double eps_u=1e-10, bool verbose=false)
 Construct a conformal grid. More...
 
 Hector (const CylindricalFunctorsLvl2 &psi, const CylindricalFunctorsLvl1 &chi, double psi0, double psi1, double X0, double Y0, unsigned n=13, unsigned Nx=2, unsigned Ny=10, double eps_u=1e-10, bool verbose=false)
 Construct an orthogonal grid with adaption. More...
 
 Hector (const CylindricalFunctorsLvl2 &psi, const CylindricalSymmTensorLvl1 &chi, double psi0, double psi1, double X0, double Y0, unsigned n=13, unsigned Nx=2, unsigned Ny=10, double eps_u=1e-10, bool verbose=false)
 Construct a curvilinear grid with monitor metric. More...
 
const dg::geo::CurvilinearGrid2dinternal_grid () const
 Return the internally used orthogonal grid. More...
 
virtual Hectorclone () const override final
 Abstract clone method that returns a copy on the heap. More...
 
bool isConformal () const
 
- Public Member Functions inherited from dg::geo::aRealGenerator2d< real_type >
real_type width () const
 length in \( \zeta\) of the computational space More...
 
real_type height () const
 length in \( \eta\) of the computational space More...
 
bool isOrthogonal () const
 sparsity pattern for metric More...
 
void generate (const thrust::host_vector< real_type > &zeta1d, const thrust::host_vector< real_type > &eta1d, thrust::host_vector< real_type > &x, thrust::host_vector< real_type > &y, thrust::host_vector< real_type > &zetaX, thrust::host_vector< real_type > &zetaY, thrust::host_vector< real_type > &etaX, thrust::host_vector< real_type > &etaY) const
 Generate grid points and elements of the Jacobian. More...
 
virtual aRealGenerator2dclone () const =0
 Abstract clone method that returns a copy on the heap. More...
 
virtual ~aRealGenerator2d ()
 

Additional Inherited Members

- Protected Member Functions inherited from dg::geo::aRealGenerator2d< real_type >
 aRealGenerator2d ()
 empty More...
 
 aRealGenerator2d (const aRealGenerator2d &)
 empty More...
 
aRealGenerator2doperator= (const aRealGenerator2d &)
 return *this More...
 

Detailed Description

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
struct dg::geo::Hector< IMatrix, Matrix, container >

The High PrEcision Conformal grid generaTOR.

Note
implements the algorithm described in M. Wiesenberger, M. Held, L. Einkemmer Streamline integration as a method for two-dimensional elliptic grid generation Journal of Computational Physics 340, 435-450 (2017)
unsigned nGrid = js["grid"]["generator"]["initial"]["n"].asUInt();
unsigned NxGrid = js["grid"]["generator"]["initial"]["Nx"].asUInt();
unsigned NyGrid = js["grid"]["generator"]["initial"]["Ny"].asUInt();
double epsHector = js["grid"]["generator"]["eps"].asDouble();
if( mode == 0)
{
std::cout << " ... of type conformal ...\n";
generator = std::make_unique< dg::geo::Hector<dg::IDMatrix,
dg::DMatrix, dg::DVec>>( mag.get_psip(), psi_0, psi_1,
mag.R0(), 0., nGrid, NxGrid, NyGrid, epsHector,
true);
}
else if( mode == 1)
{
std::cout << " ... of type adaption ...\n";
generator = std::make_unique< dg::geo::Hector<dg::IDMatrix,
dg::DMatrix, dg::DVec>>( mag.get_psip(), nc, psi_0,
psi_1, mag.R0(), 0., nGrid, NxGrid, NyGrid,
epsHector, true);
}
else
{
std::cout << " ... of type monitor metric ...\n";
dg::geo::make_LiseikinCollective( mag.get_psip(), 0.1, 0.001);
generator = std::make_unique< dg::geo::Hector<dg::IDMatrix,
dg::DMatrix, dg::DVec>>( mag.get_psip(), lc, psi_0,
psi_1, mag.R0(), 0., nGrid, NxGrid, NyGrid,
epsHector, true);
}
static CylindricalFunctorsLvl1 make_NablaPsiInvCollective(const CylindricalFunctorsLvl2 &psi)
A container class that contains all NablaPsiInv functors.
Definition: adaption.h:123
static CylindricalSymmTensorLvl1 make_LiseikinCollective(const CylindricalFunctorsLvl2 &psi, double k, double eps)
Definition: adaption.h:254
thrust::device_vector< double > DVec
IDMatrix_t< double > IDMatrix
EllSparseBlockMatDevice< double > DMatrix
This struct bundles a function and its first derivatives.
Definition: fluxfunctions.h:182
Definition: fluxfunctions.h:361
The High PrEcision Conformal grid generaTOR.
Definition: hector.h:221
Template Parameters
IMatrixThe interpolation matrix type
MatrixA class for which the blas2 functions are callable in connection with the container class. The Matrix type can be one of:
containerA data container class for which the blas1 functionality is overloaded. We assume that container is copyable/assignable and has a swap member function. Currently this is one of

Constructor & Destructor Documentation

◆ Hector() [1/3]

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
dg::geo::Hector< IMatrix, Matrix, container >::Hector ( const CylindricalFunctorsLvl2 psi,
double  psi0,
double  psi1,
double  X0,
double  Y0,
unsigned  n = 13,
unsigned  Nx = 2,
unsigned  Ny = 10,
double  eps_u = 1e-10,
bool  verbose = false 
)
inline

Construct a conformal grid.

Parameters
psi\( \psi(x,y)\) the flux function and its derivatives in Cartesian coordinates (x,y)
psi0first boundary
psi1second boundary
X0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
Y0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
nnumber of polynomials used for the internal grid
Nxinitial number of points in zeta for the internal grid
Nyinitial number of points in eta for the internal grid
eps_uthe accuracy of u
verboseIf true convergence details are printed to std::cout

◆ Hector() [2/3]

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
dg::geo::Hector< IMatrix, Matrix, container >::Hector ( const CylindricalFunctorsLvl2 psi,
const CylindricalFunctorsLvl1 chi,
double  psi0,
double  psi1,
double  X0,
double  Y0,
unsigned  n = 13,
unsigned  Nx = 2,
unsigned  Ny = 10,
double  eps_u = 1e-10,
bool  verbose = false 
)
inline

Construct an orthogonal grid with adaption.

Parameters
psi\( \psi(x,y)\) the flux function and its derivatives in Cartesian coordinates (x,y)
chi\( \chi(x,y)\) the adaption function and its derivatives in Cartesian coordinates (x,y)
psi0first boundary
psi1second boundary
X0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
Y0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
nnumber of polynomials used for the internal grid
Nxinitial number of points in zeta for the internal grid
Nyinitial number of points in eta for the internal grid
eps_uthe accuracy of u
verboseIf true convergence details are printed to std::cout

◆ Hector() [3/3]

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
dg::geo::Hector< IMatrix, Matrix, container >::Hector ( const CylindricalFunctorsLvl2 psi,
const CylindricalSymmTensorLvl1 chi,
double  psi0,
double  psi1,
double  X0,
double  Y0,
unsigned  n = 13,
unsigned  Nx = 2,
unsigned  Ny = 10,
double  eps_u = 1e-10,
bool  verbose = false 
)
inline

Construct a curvilinear grid with monitor metric.

Parameters
psithe flux function \( \psi(x,y)\) and its derivatives in Cartesian coordinates (x,y)
chithe symmetric adaption tensor \(\chi(x,y)\) and its divergence in Cartesian coordinates (x,y)
psi0first boundary
psi1second boundary
X0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
Y0a point in the inside of the ring bounded by psi0 (shouldn't be the O-point)
nnumber of polynomials used for the internal grid
Nxinitial number of points in zeta for the internal grid
Nyinitial number of points in eta for the internal grid
eps_uthe accuracy of u
verboseIf true convergence details are printed to std::cout

Member Function Documentation

◆ clone()

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
virtual Hector * dg::geo::Hector< IMatrix, Matrix, container >::clone ( ) const
inlinefinaloverridevirtual

Abstract clone method that returns a copy on the heap.

Returns
a copy of *this on the heap

Implements dg::geo::aRealGenerator2d< real_type >.

◆ internal_grid()

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
const dg::geo::CurvilinearGrid2d & dg::geo::Hector< IMatrix, Matrix, container >::internal_grid ( ) const
inline

Return the internally used orthogonal grid.

Returns
orthogonal zeta, eta grid

◆ isConformal()

template<class IMatrix = dg::IHMatrix, class Matrix = dg::HMatrix, class container = dg::HVec>
bool dg::geo::Hector< IMatrix, Matrix, container >::isConformal ( ) const
inline

The documentation for this struct was generated from the following file: