LORENE
Lorene::Gval_spher Class Reference

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

#include <grille_val.h>

Inheritance diagram for Lorene::Gval_spher:
Lorene::Grille_val

Public Member Functions

 Gval_spher (const double irmin, const double irmax, const int nr, const int fantome=2)
 Standard 1D constructor. More...
 
 Gval_spher (const double irmin, const double irmax, const int nt, const int nr, const int type_t, const int fantome=2)
 Standard 2D constructor. More...
 
 Gval_spher (const double irmin, const double irmax, const int np, const int nt, const int nr, const int itype_t, const int itype_p, const int fantome=2)
 Standard 3D constructor. More...
 
 Gval_spher (const Gval_spher &)
 Copy constructor. More...
 
 Gval_spher (FILE *)
 Constructor from a file (see sauve(FILE*) ) More...
 
virtual ~Gval_spher ()
 Destructor. More...
 
void operator= (const Gval_spher &)
 Assignment to another Gval_spher. More...
 
double get_tet (const int i) const
 Read-only of a particular value of the coordinate $\theta$ at the nodes. More...
 
double get_phi (const int i) const
 Read-only of a particular value of the coordinate $\phi$ at the nodes. More...
 
double get_teti (const int i) const
 Read-only of a particular value of coordinate $\theta$ at the interfaces. More...
 
double get_phii (const int i) const
 Read-only of a particular value of coordinate $\phi$ at the interfaces. 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...
 
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_spher 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

Tbltet
 Arrays containing the values of coordinate $\theta$ on the nodes. More...
 
Tblteti
 Arrays containing the values of coordinate $\theta$ on the interfaces. More...
 
Tblphi
 Arrays containing the values of coordinate $\phi$ on the nodes. More...
 
Tblphii
 Arrays containing the values of coordinate $\phi$ 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...
 
double * somme_spectrale2ri (const Scalar &meudon) const
 Same as before but at radial grid interfaces. More...
 
double * somme_spectrale2ti (const Scalar &meudon) const
 Same as before but at angular grid interfaces. More...
 
virtual void somme_spectrale3 (const Scalar &meudon, double *t, int taille) const
 Same as before but for the 3D case. More...
 
void initialize_spectral_r (const Map &mp, const Base_val &base, int *&idom, double *&chebnri) const
 
void initialize_spectral_theta (const Map &mp, const Base_val &base, double *&tetlj) const
 
void initialize_spectral_phi (const Map &mp, const Base_val &base, double *&expmk) const
 
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

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 spherical Godunov-type grids.

()


Can be used for 1D (only r-coordinate), 2D ( $\theta$ and r ) or 3D ( $\phi$, $\theta$ and r ) grids. The coordinates of the nodes are stored in Tbl 's zr (derived from Grille_val ),tet and phi. The coordinates of the interfaces are stored in Tbl 's zri (derived from Grille_val ),teti and phii. The standard constructors only allow for equally-spaced nodes.

Definition at line 579 of file grille_val.h.

Constructor & Destructor Documentation

◆ Gval_spher() [1/5]

Lorene::Gval_spher::Gval_spher ( const double  irmin,
const double  irmax,
const int  nr,
const int  fantome = 2 
)

Standard 1D constructor.

Parameters
irmin[input] lower r boundary
irmax[input] higher r boundary
nr[input] the number of cells (without the hidden ones)
fantome[input] the number of hidden cells on each side

Definition at line 535 of file grille_val.C.

◆ Gval_spher() [2/5]

Lorene::Gval_spher::Gval_spher ( const double  irmin,
const double  irmax,
const int  nt,
const int  nr,
const int  type_t,
const int  fantome = 2 
)

Standard 2D constructor.

Parameters
irmin[input] lower r boundary
irmax[input] higher r boundary
nt[input] the number of cells in $\theta$ (without hidden ones)
nr[input] the number of cells in r(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 544 of file grille_val.C.

References Lorene::Grille_val::type_t.

◆ Gval_spher() [3/5]

Lorene::Gval_spher::Gval_spher ( const double  irmin,
const double  irmax,
const int  np,
const int  nt,
const int  nr,
const int  itype_t,
const int  itype_p,
const int  fantome = 2 
)

Standard 3D constructor.

Parameters
irmin[input] lower r boundary
irmax[input] higher r boundary
np[input] the number of cells in $\phi$ (without the hidden ones)
nt[input] the number of cells in $\theta$ (without hidden ones)
nr[input] the number of cells in r(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 565 of file grille_val.C.

References Lorene::Grille_val::type_t.

◆ Gval_spher() [4/5]

Lorene::Gval_spher::Gval_spher ( const Gval_spher titi)

Copy constructor.

Definition at line 598 of file grille_val.C.

References phi, phii, tet, and teti.

◆ Gval_spher() [5/5]

Lorene::Gval_spher::Gval_spher ( FILE *  fd)

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

Definition at line 609 of file grille_val.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::ndim, phi, phii, tet, and teti.

◆ ~Gval_spher()

Lorene::Gval_spher::~Gval_spher ( )
virtual

Destructor.

Definition at line 627 of file grille_val.C.

References phi, phii, tet, and teti.

Member Function Documentation

◆ compatible()

bool Lorene::Gval_spher::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 174 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::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::Grille_val::get_zr(), Lorene::Dim_tbl::ndim, Lorene::Grille_val::nfantome, Lorene::Map::r, Lorene::Grille_val::type_p, and Lorene::Grille_val::type_t.

◆ contenue_dans()

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

Checks if Gval_spher 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 280 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::dim, Lorene::Map::get_mg(), Lorene::Mg3d::get_nr(), Lorene::Mg3d::get_type_p(), Lorene::Mg3d::get_type_t(), Lorene::Grille_val::get_zr(), Lorene::Map::r, Lorene::Grille_val::type_p, and Lorene::Grille_val::type_t.

◆ 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_phi()

double Lorene::Gval_spher::get_phi ( const int  i) const
inline

Read-only of a particular value of the coordinate $\phi$ at the nodes.

Definition at line 668 of file grille_val.h.

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

◆ get_phii()

double Lorene::Gval_spher::get_phii ( const int  i) const
inline

Read-only of a particular value of coordinate $\phi$ at the interfaces.

Definition at line 686 of file grille_val.h.

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

◆ get_tet()

double Lorene::Gval_spher::get_tet ( const int  i) const
inline

Read-only of a particular value of the coordinate $\theta$ at the nodes.

Definition at line 659 of file grille_val.h.

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

◆ get_teti()

double Lorene::Gval_spher::get_teti ( const int  i) const
inline

Read-only of a particular value of coordinate $\theta$ at the interfaces.

Definition at line 677 of file grille_val.h.

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

◆ 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_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_spher::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 479 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Tbl::get_dim(), Lorene::Tbl::get_ndim(), Lorene::Grille_val::interpol1(), Lorene::Dim_tbl::ndim, Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), Lorene::Tbl::t, tet, and Lorene::Grille_val::zr.

◆ interpol3()

Tbl Lorene::Gval_spher::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 defined as the nodes of the Godunov grid this
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 706 of file grille_val_interp.C.

References Lorene::Grille_val::dim, Lorene::Tbl::get_dim(), Lorene::Tbl::get_ndim(), Lorene::Grille_val::interpol1(), interpol2(), Lorene::Dim_tbl::ndim, phi, Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), Lorene::Tbl::t, tet, and Lorene::Grille_val::zr.

◆ operator=()

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

Assignment to another Gval_spher.

Definition at line 641 of file grille_val.C.

References Lorene::Grille_val::operator=(), phi, phii, tet, and teti.

◆ operator>>()

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

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

Reimplemented from Lorene::Grille_val.

Definition at line 712 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>>(), phi, Lorene::Tbl::set(), tet, and Lorene::Grille_val::zr.

◆ sauve()

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

Save in a file.

Reimplemented from Lorene::Grille_val.

Definition at line 692 of file grille_val.C.

References Lorene::Grille_val::dim, Lorene::Dim_tbl::ndim, phi, phii, Lorene::Grille_val::sauve(), Lorene::Tbl::sauve(), tet, and teti.

◆ 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_spher::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 232 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::Dim_tbl::ndim, Lorene::Grille_val::nfantome, Lorene::Tbl::t, tet, Lorene::Map::val_lx(), Lorene::Valeur::val_point(), and Lorene::Grille_val::zr.

◆ somme_spectrale2ri()

double * Lorene::Gval_spher::somme_spectrale2ri ( const Scalar meudon) const
protected

◆ somme_spectrale2ti()

double * Lorene::Gval_spher::somme_spectrale2ti ( const Scalar meudon) const
protected

◆ somme_spectrale3()

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

Same as before but for the 3D case.

Implements Lorene::Grille_val.

Definition at line 369 of file gval_from_spectral.C.

References Lorene::Scalar::get_etat().

Friends And Related Function Documentation

◆ Tbl_val

friend class Tbl_val
friend

Arrays defined on Godunov-type grids.

Definition at line 581 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.

◆ phi

Tbl* Lorene::Gval_spher::phi

Arrays containing the values of coordinate $\phi$ on the nodes.

Definition at line 591 of file grille_val.h.

◆ phii

Tbl* Lorene::Gval_spher::phii

Arrays containing the values of coordinate $\phi$ on the interfaces.

Definition at line 593 of file grille_val.h.

◆ tet

Tbl* Lorene::Gval_spher::tet

Arrays containing the values of coordinate $\theta$ on the nodes.

Definition at line 587 of file grille_val.h.

◆ teti

Tbl* Lorene::Gval_spher::teti

Arrays containing the values of coordinate $\theta$ on the interfaces.

Definition at line 589 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.

◆ 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: