LORENE
Lorene::Grille_val Class Referenceabstract

Base class for Godunov-type grids. More...

#include <grille_val.h>

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

Public Member Functions

void operator= (const Grille_val &)
 Assignment to another Grille_val. 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...
 
virtual void sauve (FILE *) const
 Save in a file. More...
 
virtual bool compatible (const Map *mp, const int lmax, const int lmin=0) const =0
 Checks if the spectral grid and mapping are compatible with the Grille_val caracteristics for the interpolation to be done. More...
 
Tbl interpol1 (const Tbl &rdep, const Tbl &rarr, const Tbl &fdep, int flag, const int type_inter) const
 Performs 1D interpolation. More...
 
virtual Tbl interpol2 (const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const =0
 Performs 2D interpolation. More...
 
virtual Tbl interpol3 (const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const Tbl &phiarr, const int type_inter) const =0
 Performs 3D interpolation. More...
 
virtual bool contenue_dans (const Map &mp, const int lmax, const int lmin=0) const =0
 Checks if Grille_val 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...
 

Public Attributes

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

Tblfait_grille1D (const double rmin, const double rmax, const int n)
 Auxilliary function used to allocate memory and construct 1D grid. More...
 
 Grille_val (const double, const double, const int n1, const int fantome=2)
 Standard 1D constructor (the size is to be given without hidden cells) More...
 
 Grille_val (const double, const double, const int n2, const int n1, const int itype_t, const int fantome=2)
 Standard 2D constructor (the sizes are to be given without hidden cells) More...
 
 Grille_val (const double, const double, const int n3, const int n2, const int n1, const int itype_t, const int itype_p, const int fantome=2)
 Standard 3D constructor (the sizes are to be given without hidden cells) More...
 
 Grille_val (const Grille_val &)
 Copy constructor. More...
 
 Grille_val (FILE *)
 Constructor from a file (see sauve(FILE*) ) More...
 
virtual ~Grille_val ()
 Destructor. More...
 
virtual ostream & operator>> (ostream &) const
 Operator >> (virtual function called by the operator <<). 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...
 
virtual void somme_spectrale2 (const Scalar &meudon, double *t, int taille) const =0
 Same as before but for the 2D case. More...
 
virtual void somme_spectrale3 (const Scalar &meudon, double *t, int taille) const =0
 Same as before but for the 3D case. 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...
 
ostream & operator<< (ostream &, const Grille_val &)
 Display. More...
 

Detailed Description

Base class for Godunov-type grids.

()

Takes into account hidden cells and interfaces between cells, in 1,2 or 3D. The derived classes stand for spherical and cartesian grids. this base class settles quantities for 1D grid, which is minimal and independent from the geometry (cartesian or spherical). Therefore, the coordinates z and r are identified.

This is an abstract class (cannot be instanciated).

Definition at line 94 of file grille_val.h.

Constructor & Destructor Documentation

◆ Grille_val() [1/5]

Lorene::Grille_val::Grille_val ( const double  izrmin,
const double  izrmax,
const int  n1,
const int  fantome = 2 
)
protected

Standard 1D constructor (the size is to be given without hidden cells)

Definition at line 90 of file grille_val.C.

◆ Grille_val() [2/5]

Lorene::Grille_val::Grille_val ( const double  izrmin,
const double  izrmax,
const int  n2,
const int  n1,
const int  itype_t,
const int  fantome = 2 
)
protected

Standard 2D constructor (the sizes are to be given without hidden cells)

Definition at line 108 of file grille_val.C.

◆ Grille_val() [3/5]

Lorene::Grille_val::Grille_val ( const double  izrmin,
const double  izrmax,
const int  n3,
const int  n2,
const int  n1,
const int  itype_t,
const int  itype_p,
const int  fantome = 2 
)
protected

Standard 3D constructor (the sizes are to be given without hidden cells)

Definition at line 128 of file grille_val.C.

References fait_grille1D(), nfantome, zr, zri, zrmax, and zrmin.

◆ Grille_val() [4/5]

Lorene::Grille_val::Grille_val ( const Grille_val titi)
protected

Copy constructor.

Definition at line 148 of file grille_val.C.

References zr, zri, zrmax, and zrmin.

◆ Grille_val() [5/5]

Lorene::Grille_val::Grille_val ( FILE *  fd)
protected

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

Definition at line 163 of file grille_val.C.

References Lorene::fread_be(), nfantome, type_p, type_t, zr, zri, zrmax, and zrmin.

◆ ~Grille_val()

Lorene::Grille_val::~Grille_val ( )
protectedvirtual

Destructor.

Definition at line 184 of file grille_val.C.

References zr, zri, zrmax, and zrmin.

Member Function Documentation

◆ compatible()

virtual bool Lorene::Grille_val::compatible ( const Map mp,
const int  lmax,
const int  lmin = 0 
) const
pure 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 ).

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

◆ contenue_dans()

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

Checks if Grille_val 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.

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

◆ fait_grille1D()

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

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
inline

Returns the size (without hidden cells)

Definition at line 188 of file grille_val.h.

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

◆ get_dim_tbl()

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

Returns the Dim_tbl associated with the grid.

Definition at line 194 of file grille_val.h.

References dim.

◆ get_fantome()

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

Returns the number of hidden cells.

Definition at line 168 of file grille_val.h.

References nfantome.

◆ get_ndim()

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

Returns the number of dimensions.

Definition at line 183 of file grille_val.h.

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

◆ get_type_p()

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

Returns the type of symmetry in $\phi$.

Definition at line 178 of file grille_val.h.

References type_p.

◆ get_type_t()

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

Returns the type of symmetry in $\theta$.

Definition at line 173 of file grille_val.h.

References type_t.

◆ get_zr()

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

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 dim, Lorene::Dim_tbl::dim, nfantome, Lorene::Tbl::t, and zr.

◆ get_zri()

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

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 dim, Lorene::Dim_tbl::dim, nfantome, Lorene::Tbl::t, and zri.

◆ interpol1()

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

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

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

Performs 2D 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
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.

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

◆ interpol3()

virtual Tbl Lorene::Grille_val::interpol3 ( const Tbl fdep,
const Tbl rarr,
const Tbl tetarr,
const Tbl phiarr,
const int  type_inter 
) const
pure 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.

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

◆ operator=()

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

Assignment to another Grille_val.

Definition at line 202 of file grille_val.C.

References dim, Lorene::Dim_tbl::dim, nfantome, Lorene::Tbl::t, type_p, type_t, zr, zri, zrmax, and zrmin.

◆ operator>>()

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

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

Reimplemented in Lorene::Gval_spher, and Lorene::Gval_cart.

Definition at line 251 of file grille_val.C.

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

◆ sauve()

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

Save in a file.

Reimplemented in Lorene::Gval_spher, and Lorene::Gval_cart.

Definition at line 227 of file grille_val.C.

References dim, Lorene::fwrite_be(), nfantome, Lorene::Dim_tbl::sauve(), Lorene::Tbl::sauve(), type_p, type_t, zr, zri, zrmax, and zrmin.

◆ somme_spectrale1()

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

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 dim, Lorene::Dim_tbl::dim, Lorene::Tensor::get_mp(), Lorene::Scalar::get_spectral_va(), nfantome, Lorene::Tbl::t, Lorene::Map::val_lx(), Lorene::Valeur::val_point_jk(), and zr.

◆ somme_spectrale2()

virtual void Lorene::Grille_val::somme_spectrale2 ( const Scalar meudon,
double *  t,
int  taille 
) const
protectedpure virtual

Same as before but for the 2D case.

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

◆ somme_spectrale3()

virtual void Lorene::Grille_val::somme_spectrale3 ( const Scalar meudon,
double *  t,
int  taille 
) const
protectedpure virtual

Same as before but for the 3D case.

Implemented in Lorene::Gval_spher, and Lorene::Gval_cart.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  o,
const Grille_val titi 
)
friend

Display.

Definition at line 246 of file grille_val.C.

◆ Tbl_val

friend class Tbl_val
friend

Arrays defined on Godunov-type grids.

Definition at line 96 of file grille_val.h.

Member Data Documentation

◆ dim

Dim_tbl Lorene::Grille_val::dim
protected

The dimensions of the grid.

Definition at line 102 of file grille_val.h.

◆ nfantome

int Lorene::Grille_val::nfantome
protected

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
protected

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
protected

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

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

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
protected

Higher boundary for z (or r ) direction.

Definition at line 120 of file grille_val.h.

◆ zrmin

double* Lorene::Grille_val::zrmin
protected

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: