LORENE
Lorene::Gval_cart Class Reference

Class for cartesian Godunov-type grids. More...

#include <grille_val.h>

Inheritance diagram for Lorene::Gval_cart:
Lorene::Grille_val

Public Member Functions

 Gval_cart (const double izmin, const double izmax, const int n1, const int fantome=2)
 Standard 1D constructor. More...
 
 Gval_cart (const double ixmin, const double ixmax, const double izmin, const double izmax, const int nx, const int nz, const int type_t, const int fantome=2)
 Standard 2D constructor. More...
 
 Gval_cart (const double iymin, const double iymax, const double ixmin, const double ixmax, const double izmin, const double izmax, const int ny, const int nx, const int nz, const int itype_t, const int itype_p, const int fantome=2)
 Standard 3D constructor. More...
 
 Gval_cart (const Gval_cart &)
 Copy constructor. More...
 
 Gval_cart (FILE *)
 Constructor from a file (see sauve(FILE*) ) More...
 
virtual ~Gval_cart ()
 Destructor. More...
 
void operator= (const Gval_cart &)
 Assignment to another Gval_cart. More...
 
double get_x (const int i) const
 Read-only of a particular value of the coordinate x at the nodes. More...
 
double get_y (const int i) const
 Read-only of a particular value of the coordinate y at the nodes. More...
 
double get_xi (const int i) const
 Read-only of a particular value of the coordinate x at the interfaces. More...
 
double get_yi (const int i) const
 Read-only of a particular value of the coordinate y at the interfaces. More...
 
double get_xmin () const
 Returns the lower boundary for x. More...
 
double get_xmax () const
 Returns the higher boundary for x. More...
 
double get_ymin () const
 Returns the lower boundary for y. More...
 
double get_ymax () const
 Returns the higher boundary for x. More...
 
virtual void sauve (FILE *) const
 Save in a file. More...
 
virtual bool compatible (const Map *mp, const int lmax, const int lmin=0) const
 Checks if the spectral grid and mapping are compatible with the Grille_val caracteristics for the interpolation to be done. More...
 
virtual Tbl interpol2 (const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const
 
Performs 2D interpolation. More...
 
Tbl interpol2c (const Tbl &xdep, const Tbl &zdep, const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const
 Same as before, but the coordinates of source points are passed explicitly (xdep, zdep). More...
 
virtual Tbl interpol3 (const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const Tbl &phiarr, const int type_inter) const
 Performs 3D interpolation. More...
 
virtual bool contenue_dans (const Map &mp, const int lmax, const int lmin=0) const
 Checks if Gval_cart is contained inside the spectral grid/mapping within the domains [lmin, lmax[, if the numbers of dimensions are the same (1,2 or 3D), and if the symmetries are compatible. More...
 
int get_fantome () const
 Returns the number of hidden cells. More...
 
int get_type_t () const
 Returns the type of symmetry in $\theta$. More...
 
int get_type_p () const
 Returns the type of symmetry in $\phi$. More...
 
int get_ndim () const
 Returns the number of dimensions. More...
 
int get_dim (const int i) const
 Returns the size (without hidden cells) More...
 
const Dim_tblget_dim_tbl () const
 Returns the Dim_tbl associated with the grid. More...
 
double get_zr (const int i) const
 Read-only of a particular value of the coordinate z (or r ) at the nodes. More...
 
double get_zri (const int i) const
 Read-only of a particular value of the coordinate z (or r ) at the interfaces. More...
 
Tbl interpol1 (const Tbl &rdep, const Tbl &rarr, const Tbl &fdep, int flag, const int type_inter) const
 Performs 1D interpolation. More...
 

Public Attributes

Tblx
 Arrays containing the values of coordinate x on the nodes. More...
 
Tblxi
 Arrays containing the values of coordinate x on the interfaces. More...
 
Tbly
 Arrays containing the values of coordinate y on the nodes. More...
 
Tblyi
 Arrays containing the values of coordinate y on the interfaces. More...
 
Tblzr
 Arrays containing the values of coordinate z (or r) on the nodes. More...
 
Tblzri
 Arrays containing the values of coordinate z (or r) on the interfaces. More...
 

Protected Member Functions

virtual ostream & operator>> (ostream &) const
 Operator >> (virtual function called by the operator <<). More...
 
virtual void somme_spectrale2 (const Scalar &meudon, double *t, int taille) const
 Makes the sommation of the spectral basis functions to know the values of the function described by the Scalar meudon at the points of the 2D Godunov grid this . More...
 
virtual void somme_spectrale3 (const Scalar &meudon, double *t, int taille) const
 Same as before but for the 3D case. More...
 
Tblfait_grille1D (const double rmin, const double rmax, const int n)
 Auxilliary function used to allocate memory and construct 1D grid. More...
 
void somme_spectrale1 (const Scalar &meudon, double *t, int taille) const
 Makes the sommation of the spectral basis functions to know the values of the function described by the Scalar meudon at the points of the 1D Godunov grid this . More...
 

Protected Attributes

double * xmin
 Lower boundary for x dimension. More...
 
double * xmax
 Higher boundary for x dimension. More...
 
double * ymin
 Lower boundary for y dimension. More...
 
double * ymax
 Higher boundary for y dimension. More...
 
Dim_tbl dim
 The dimensions of the grid. More...
 
int nfantome
 The number of hidden cells (same on each side) More...
 
int type_t
 Type of symmetry in $\theta$: More...
 
int type_p
 Type of symmetry in $\phi$: More...
 
double * zrmin
 Lower boundary for z (or r ) direction. More...
 
double * zrmax
 Higher boundary for z (or r ) direction. More...
 

Friends

class Tbl_val
 Arrays defined on Godunov-type grids. More...
 

Detailed Description

Class for cartesian Godunov-type grids.

()


Can be used for 1D (only z-coordinate), 2D (x and z) or 3D (y,x and z) grids. The coordinates of the nodes are stored in Tbl 's zr (derived from Grille_val ),x and y. The coordinates of the interfaces are stored in Tbl 's zri (derived from Grille_val ),xi and yi. The standard constructors only allow for equally-spaced nodes.

Definition at line 325 of file grille_val.h.

Constructor & Destructor Documentation

◆ Gval_cart() [1/5]

Lorene::Gval_cart::Gval_cart ( const double  izmin,
const double  izmax,
const int  n1,
const int  fantome = 2 
)

Standard 1D constructor.

Parameters
izmin[input] lower z boundary
izmax[input] higher z boundary
n1[input] the number of cells (without the hidden ones)
fantome[input] the number of hidden cells on each side

Definition at line 282 of file grille_val.C.

◆ Gval_cart() [2/5]

Lorene::Gval_cart::Gval_cart ( const double  ixmin,
const double  ixmax,
const double  izmin,
const double  izmax,
const int  nx,
const int  nz,
const int  type_t,
const int  fantome = 2 
)

Standard 2D constructor.

Parameters
ixmin[input] lower x boundary
ixmax[input] higher x boundary
izmin[input] lower z boundary
izmax[input] higher z boundary
nx[input] the number of cells in x direction (without the hidden ones)
nz[input] the number of cells in z direction (without the hidden ones)
type_t[input] the type of symmetry in $\theta$ (SYM, NONSYM, see base class documentation)
fantome[input] the number of hidden cells on each side

Definition at line 292 of file grille_val.C.

References Lorene::Grille_val::type_t.

◆ Gval_cart() [3/5]

Lorene::Gval_cart::Gval_cart ( const double  iymin,
const double  iymax,
const double  ixmin,
const double  ixmax,
const double  izmin,
const double  izmax,
const int  ny,
const int  nx,
const int  nz,
const int  itype_t,
const int  itype_p,
const int  fantome = 2 
)

Standard 3D constructor.

Parameters
iymin[input] lower y boundary
iymax[input] higher y boundary
ixmin[input] lower x boundary
ixmax[input] higher x boundary
izmin[input] lower z boundary
izmax[input] higher z boundary
ny[input] the number of cells in y direction (without the hidden ones)
nx[input] the number of cells in x direction (without the hidden ones)
nz[input] the number of cells in z direction (without the hidden ones)
type_t[input] the type of symmetry in $\theta$ (SYM, NONSYM, see base class documentation)
type_p[input] the type of symmetry in $\phi$ (SYM, NONSYM, see base class documentation)
fantome[input] the number of hidden cells on each side

Definition at line 315 of file grille_val.C.

References Lorene::Grille_val::type_t.

◆ Gval_cart() [4/5]

Lorene::Gval_cart::Gval_cart ( const Gval_cart titi)

Copy constructor.

Definition at line 350 of file grille_val.C.

References x, xi, xmax, xmin, y, yi, ymax, and ymin.

◆ Gval_cart() [5/5]

Lorene::Gval_cart::Gval_cart ( FILE *  fd)

Constructor from a file (see sauve(FILE*) )

Definition at line 365 of file grille_val.C.

References Lorene::Grille_val::dim, Lorene::fread_be(), Lorene::Dim_tbl::ndim, x, xi, xmax, xmin, y, yi, ymax, and ymin.

◆ ~Gval_cart()

Lorene::Gval_cart::~Gval_cart ( )
virtual

Destructor.

Definition at line 393 of file grille_val.C.

References x, xi, xmax, xmin, y, yi, ymax, and ymin.

Member Function Documentation

◆ compatible()

bool Lorene::Gval_cart::compatible ( const Map mp,
const int  lmax,
const int  lmin = 0 
) const
virtual

Checks if the spectral grid and mapping are compatible with the Grille_val caracteristics for the interpolation to be done.

It checks wether the spectral grid is included in the Godunov one, if the numbers of dimensions are the same (1,2 or 3D), and if the spectral collocation points in $\theta$ and $\phi$ are well defined across all the domains (see the documentation of Tbl_val .

Implements Lorene::Grille_val.

Definition at line 103 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Map::get_mg(), Lorene::Mg3d::get_np(), Lorene::Mg3d::get_nr(), Lorene::Mg3d::get_nt(), Lorene::Mg3d::get_type_p(), Lorene::Mg3d::get_type_t(), Lorene::Dim_tbl::ndim, Lorene::Map::r, Lorene::Grille_val::type_p, Lorene::Grille_val::type_t, Lorene::Grille_val::zrmax, and Lorene::Grille_val::zrmin.

◆ contenue_dans()

bool Lorene::Gval_cart::contenue_dans ( const Map mp,
const int  lmax,
const int  lmin = 0 
) const
virtual

Checks if Gval_cart is contained inside the spectral grid/mapping within the domains [lmin, lmax[, if the numbers of dimensions are the same (1,2 or 3D), and if the symmetries are compatible.

Implements Lorene::Grille_val.

Definition at line 220 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Map::get_mg(), Lorene::Mg3d::get_np(), Lorene::Mg3d::get_nr(), Lorene::Mg3d::get_nt(), Lorene::Mg3d::get_type_p(), Lorene::Mg3d::get_type_t(), Lorene::Dim_tbl::ndim, Lorene::Map::r, Lorene::Grille_val::type_p, Lorene::Grille_val::type_t, xmin, Lorene::Grille_val::zrmax, and Lorene::Grille_val::zrmin.

◆ fait_grille1D()

Tbl * Lorene::Grille_val::fait_grille1D ( const double  rmin,
const double  rmax,
const int  n 
)
protectedinherited

Auxilliary function used to allocate memory and construct 1D grid.

Definition at line 78 of file grille_val.C.

References Lorene::Tbl::set(), and Lorene::Tbl::set_etat_qcq().

◆ get_dim()

int Lorene::Grille_val::get_dim ( const int  i) const
inlineinherited

Returns the size (without hidden cells)

Definition at line 188 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, and Lorene::Dim_tbl::ndim.

◆ get_dim_tbl()

const Dim_tbl* Lorene::Grille_val::get_dim_tbl ( ) const
inlineinherited

Returns the Dim_tbl associated with the grid.

Definition at line 194 of file grille_val.h.

References Lorene::Grille_val::dim.

◆ get_fantome()

int Lorene::Grille_val::get_fantome ( ) const
inlineinherited

Returns the number of hidden cells.

Definition at line 168 of file grille_val.h.

References Lorene::Grille_val::nfantome.

◆ get_ndim()

int Lorene::Grille_val::get_ndim ( ) const
inlineinherited

Returns the number of dimensions.

Definition at line 183 of file grille_val.h.

References Lorene::Grille_val::dim, and Lorene::Dim_tbl::ndim.

◆ get_type_p()

int Lorene::Grille_val::get_type_p ( ) const
inlineinherited

Returns the type of symmetry in $\phi$.

Definition at line 178 of file grille_val.h.

References Lorene::Grille_val::type_p.

◆ get_type_t()

int Lorene::Grille_val::get_type_t ( ) const
inlineinherited

Returns the type of symmetry in $\theta$.

Definition at line 173 of file grille_val.h.

References Lorene::Grille_val::type_t.

◆ get_x()

double Lorene::Gval_cart::get_x ( const int  i) const
inline

Read-only of a particular value of the coordinate x at the nodes.

Definition at line 427 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, and x.

◆ get_xi()

double Lorene::Gval_cart::get_xi ( const int  i) const
inline

Read-only of a particular value of the coordinate x at the interfaces.

Definition at line 445 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, and xi.

◆ get_xmax()

double Lorene::Gval_cart::get_xmax ( ) const
inline

Returns the higher boundary for x.

Definition at line 468 of file grille_val.h.

References xmax.

◆ get_xmin()

double Lorene::Gval_cart::get_xmin ( ) const
inline

Returns the lower boundary for x.

Definition at line 463 of file grille_val.h.

References xmin.

◆ get_y()

double Lorene::Gval_cart::get_y ( const int  i) const
inline

Read-only of a particular value of the coordinate y at the nodes.

Definition at line 436 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, and y.

◆ get_yi()

double Lorene::Gval_cart::get_yi ( const int  i) const
inline

Read-only of a particular value of the coordinate y at the interfaces.

Definition at line 454 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, and yi.

◆ get_ymax()

double Lorene::Gval_cart::get_ymax ( ) const
inline

Returns the higher boundary for x.

Definition at line 478 of file grille_val.h.

References ymax.

◆ get_ymin()

double Lorene::Gval_cart::get_ymin ( ) const
inline

Returns the lower boundary for y.

Definition at line 473 of file grille_val.h.

References ymin.

◆ get_zr()

double Lorene::Grille_val::get_zr ( const int  i) const
inlineinherited

Read-only of a particular value of the coordinate z (or r ) at the nodes.

Definition at line 199 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Grille_val::nfantome, Lorene::Tbl::t, and Lorene::Grille_val::zr.

◆ get_zri()

double Lorene::Grille_val::get_zri ( const int  i) const
inlineinherited

Read-only of a particular value of the coordinate z (or r ) at the interfaces.

Definition at line 207 of file grille_val.h.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Grille_val::nfantome, Lorene::Tbl::t, and Lorene::Grille_val::zri.

◆ interpol1()

Tbl Lorene::Grille_val::interpol1 ( const Tbl rdep,
const Tbl rarr,
const Tbl fdep,
int  flag,
const int  type_inter 
) const
inherited

Performs 1D interpolation.

Parameters
rdep[input] the coordinates r of the source points
rarr[input] the coordinates r of the destination points
fdep[input] values of the function at the source points
flag[input] = 1 used for INSMTS – ought to disappear
type_inter[input] type of interpolation (see Tbl_val )
Returns
Tbl 1D of the same size as rarr, containing the values of the function at destination points

Definition at line 318 of file grille_val_interp.C.

References Lorene::Tbl::dim, Lorene::Tbl::get_dim(), Lorene::Tbl::get_ndim(), Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), and Lorene::Tbl::t.

◆ interpol2()

Tbl Lorene::Gval_cart::interpol2 ( const Tbl fdep,
const Tbl rarr,
const Tbl tetarr,
const int  type_inter 
) const
virtual


Performs 2D interpolation.

Parameters
fdep[input] values of the function at the source points, defined as the nodes of the Godunov grid
rarr[input] the coordinates r of the destination points
tetarr[input] the coordinates $\theta$ of the destination points
type_inter[input] type of interpolation (see Tbl_val )
Returns
Tbl 2D size1:that of rarr, size2: that of tetarr, containing the values of the function at destination points.

Implements Lorene::Grille_val.

Definition at line 538 of file grille_val_interp.C.

References interpol2c(), x, and Lorene::Grille_val::zr.

◆ interpol2c()

Tbl Lorene::Gval_cart::interpol2c ( const Tbl xdep,
const Tbl zdep,
const Tbl fdep,
const Tbl rarr,
const Tbl tetarr,
const int  type_inter 
) const

Same as before, but the coordinates of source points are passed explicitly (xdep, zdep).

Definition at line 544 of file grille_val_interp.C.

References Lorene::cos(), Lorene::Tbl::get_dim(), Lorene::Tbl::get_ndim(), Lorene::Grille_val::interpol1(), Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), Lorene::sin(), and x.

◆ interpol3()

Tbl Lorene::Gval_cart::interpol3 ( const Tbl fdep,
const Tbl rarr,
const Tbl tetarr,
const Tbl phiarr,
const int  type_inter 
) const
virtual

Performs 3D interpolation.

Parameters
fdep[input] values of the function at the source points
rarr[input] the coordinates r of the destination points
tetarr[input] the coordinates $\theta$ of the destination points
phiarr[input] the coordinates $\phi$ of the destination points
type_inter[input] type of interpolation (see Tbl_val )
Returns
Tbl 3D size1:that of rarr, size2: that of tetarr, size3: that of phiarr, containing the values of the function at destination points.

Implements Lorene::Grille_val.

Definition at line 753 of file grille_val_interp.C.

References Lorene::Tbl::get_dim(), Lorene::Tbl::get_ndim(), interpol2c(), Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), x, y, and Lorene::Grille_val::zr.

◆ operator=()

void Lorene::Gval_cart::operator= ( const Gval_cart titi)

Assignment to another Gval_cart.

Definition at line 411 of file grille_val.C.

References Lorene::Grille_val::operator=(), x, xi, xmax, xmin, y, yi, ymax, and ymin.

◆ operator>>()

ostream & Lorene::Gval_cart::operator>> ( ostream &  o) const
protectedvirtual

Operator >> (virtual function called by the operator <<).

Reimplemented from Lorene::Grille_val.

Definition at line 453 of file grille_val.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, Lorene::Grille_val::operator>>(), Lorene::Tbl::set(), x, y, and Lorene::Grille_val::zr.

◆ sauve()

void Lorene::Gval_cart::sauve ( FILE *  fd) const
virtual

◆ somme_spectrale1()

void Lorene::Grille_val::somme_spectrale1 ( const Scalar meudon,
double *  t,
int  taille 
) const
protectedinherited

Makes the sommation of the spectral basis functions to know the values of the function described by the Scalar meudon at the points of the 1D Godunov grid this .

The result is an array t of size taille of all the values of the function at this grid points.

Definition at line 93 of file gval_from_spectral.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Tensor::get_mp(), Lorene::Scalar::get_spectral_va(), Lorene::Grille_val::nfantome, Lorene::Tbl::t, Lorene::Map::val_lx(), Lorene::Valeur::val_point_jk(), and Lorene::Grille_val::zr.

◆ somme_spectrale2()

void Lorene::Gval_cart::somme_spectrale2 ( const Scalar meudon,
double *  t,
int  taille 
) const
protectedvirtual

Makes the sommation of the spectral basis functions to know the values of the function described by the Scalar meudon at the points of the 2D Godunov grid this .

The result is an array t of size taille of all the values of the function at this grid points.

Implements Lorene::Grille_val.

Definition at line 113 of file gval_from_spectral.C.

References Lorene::acos(), Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Tensor::get_mp(), Lorene::Scalar::get_spectral_va(), Lorene::Grille_val::nfantome, Lorene::sqrt(), Lorene::Tbl::t, Lorene::Map::val_lx(), Lorene::Valeur::val_point(), x, and Lorene::Grille_val::zr.

◆ somme_spectrale3()

void Lorene::Gval_cart::somme_spectrale3 ( const Scalar meudon,
double *  t,
int  taille 
) const
protectedvirtual

Friends And Related Function Documentation

◆ Tbl_val

friend class Tbl_val
friend

Arrays defined on Godunov-type grids.

Definition at line 327 of file grille_val.h.

Member Data Documentation

◆ dim

Dim_tbl Lorene::Grille_val::dim
protectedinherited

The dimensions of the grid.

Definition at line 102 of file grille_val.h.

◆ nfantome

int Lorene::Grille_val::nfantome
protectedinherited

The number of hidden cells (same on each side)

Definition at line 104 of file grille_val.h.

◆ type_p

int Lorene::Grille_val::type_p
protectedinherited

Type of symmetry in $\phi$:

  • SYM -> $(x,y) \to (-x,-y)$
  • NONSYM no symmetry

Definition at line 114 of file grille_val.h.

◆ type_t

int Lorene::Grille_val::type_t
protectedinherited

Type of symmetry in $\theta$:

  • SYM -> $\theta \to -\theta$
  • NONSYM no symmetry

Definition at line 109 of file grille_val.h.

◆ x

Tbl* Lorene::Gval_cart::x

Arrays containing the values of coordinate x on the nodes.

Definition at line 343 of file grille_val.h.

◆ xi

Tbl* Lorene::Gval_cart::xi

Arrays containing the values of coordinate x on the interfaces.

Definition at line 345 of file grille_val.h.

◆ xmax

double* Lorene::Gval_cart::xmax
protected

Higher boundary for x dimension.

Definition at line 335 of file grille_val.h.

◆ xmin

double* Lorene::Gval_cart::xmin
protected

Lower boundary for x dimension.

Definition at line 333 of file grille_val.h.

◆ y

Tbl* Lorene::Gval_cart::y

Arrays containing the values of coordinate y on the nodes.

Definition at line 347 of file grille_val.h.

◆ yi

Tbl* Lorene::Gval_cart::yi

Arrays containing the values of coordinate y on the interfaces.

Definition at line 349 of file grille_val.h.

◆ ymax

double* Lorene::Gval_cart::ymax
protected

Higher boundary for y dimension.

Definition at line 339 of file grille_val.h.

◆ ymin

double* Lorene::Gval_cart::ymin
protected

Lower boundary for y dimension.

Definition at line 337 of file grille_val.h.

◆ zr

Tbl* Lorene::Grille_val::zr
inherited

Arrays containing the values of coordinate z (or r) on the nodes.

Definition at line 124 of file grille_val.h.

◆ zri

Tbl* Lorene::Grille_val::zri
inherited

Arrays containing the values of coordinate z (or r) on the interfaces.

Definition at line 126 of file grille_val.h.

◆ zrmax

double* Lorene::Grille_val::zrmax
protectedinherited

Higher boundary for z (or r ) direction.

Definition at line 120 of file grille_val.h.

◆ zrmin

double* Lorene::Grille_val::zrmin
protectedinherited

Lower boundary for z (or r ) direction.

Definition at line 117 of file grille_val.h.


The documentation for this class was generated from the following files: