Mg3d Class Reference
[Spectral representation.]

Multi-domain grid. More...

#include <grilles.h>

List of all members.

Public Member Functions

 Mg3d (int nz, int nbr[], int typr[], int nbt[], int typt, int nbp[], int typp, int *base_r=0x0)
 General constructor.
 Mg3d (int nz, int nbr, int nbt, int nbp, int typt, int typp, bool compact, bool legendre=false)
 Simplified constructor for a standard multi-grid.
 Mg3d (int nz, int nbr, int nbt, int nbp, int typt, int typp)
 Simplified constructor for a standard multi-grid only with shells and Chebyshev.
 Mg3d (FILE *fd, bool read_base=false)
 Constructor from a file (see sauve(FILE*)).
 Mg3d (const Mg3d &)
 Copy constructor (private and not implemented to make Mg3d a non-copyable class).
 ~Mg3d ()
 Destructor.
int get_nzone () const
 Returns the number of domains.
int get_nr (int l) const
 Returns the number of points in the radial direction ($\xi$) in domain no. l.
int get_nt (int l) const
 Returns the number of points in the co-latitude direction ($\theta$) in domain no. l.
int get_np (int l) const
 Returns the number of points in the azimuthal direction ($\phi$) in domain no. l.
int get_type_r (int l) const
 Returns the type of sampling in the radial direction in domain no.
int get_type_t () const
 Returns the type of sampling in the $\theta$ direction:
SYM : $\theta\in[0,\pi/2]$ : symmetry with respect to the equatorial plane
NONSYM : $\theta\in[0,\pi]$ : no symmetry with respect to the equatorial plane.
int get_type_p () const
 Returns the type of sampling in the $\phi$ direction:
SYM : $\phi\in[0,\pi[$ : symmetry with respect to the transformation $ \phi \mapsto \phi + \pi$
NONSYM : $\phi\in[0,2\pi[$ : no symmetry with respect to the transformation $ \phi \mapsto \phi + \pi$.
const Grille3dget_grille3d (int l) const
 Returns a pointer on the 3D mono-grid for domain no. l.
int get_colloc_r (int l) const
 Returns the type of collocation points used in domain no.
const Mg3dget_angu () const
 Returns the pointer on the associated angular grid.
const Mg3dget_angu_1dom () const
 Returns the pointer on the associated mono-domain angular grid.
const Mg3dget_radial () const
 Returns the pointer on the associated radial grid.
const Mg3dget_twice () const
 Returns the pointer on the grid which has twice the number of points in each dimension (for desaliasing).
const Mg3dplus_half () const
 Returns the pointer on the grid which has 50% more points in r dimension (for desaliasing).
const Mg3dget_non_axi () const
 Returns the pointer on the grid which has at least 4 points in the $\phi$ direction and at least 5 in the $\theta$ direction (for tensor rotations).
bool operator== (const Mg3d &) const
 Comparison operator (egality).
void sauve (FILE *fd, bool save_base=false) const
 Saves into a file.
bool operator!= (const Mg3d &) const
 Operator !=.
Base_val std_base_scal () const
 Returns the standard spectral bases for a scalar.
Base_val std_base_scal_odd () const
 Returns the standard odd spectral bases for a scalar.
Base_val ** std_base_vect_cart () const
 Returns the standard spectral bases for the Cartesian components of a vector.
Base_val ** std_base_vect_spher () const
 Returns the standard spectral bases for the spherical components of a vector.
Base_val ** pseudo_base_vect_cart () const
 Returns the standard spectral bases for the Cartesian components of a pseudo-vector.
Base_val ** pseudo_base_vect_spher () const
 Returns the standard spectral bases for the spherical components of a pseudo-vector.

Protected Member Functions

void del_deriv () const
 Deletes all the derived quantities (g_radial , g_angu, g_twice, .
void set_deriv_0x0 () const
 Sets to 0x0 all the pointers on derived quantities (g_radial , g_angu, g_twice, .

Protected Attributes

int nzone
 Number of domains (zones).
int * nr
 Array (size: nzone) of nb. of points in r ($\xi$).
int * nt
 Array (size: nzone) of nb. of points in $\theta$.
int * np
 Array (size: nzone) of nb. of points in $\phi$.
int * type_r
 Array (size: nzone) of type of sampling in r ($\xi$) (RARE,FIN, c UNSURR).
int type_t
 Type of sampling in $\theta$ (SYM, NONSYM).
int type_p
 Type of sampling in $\phi$ (SYM, NONSYM).
int * colloc_r
 Array (size: nzone) of type of collocation points in r ($\xi$) and related decompoisition bases (BASE_CHEB, BASE_LEG, BASE_JAC02 ).
Grille3d ** g
 Array (size: nzone) of pointers on the Grille3d's.
Mg3dg_angu
 Pointer on the associated angular grid.
Mg3dg_angu_1dom
 Pointer on the associated angular grid with only one domain.
Mg3dg_radial
 Pointer on the associated radial grid.
Mg3dg_twice
 Pointer on the grid which has twice the number of points in each dimension (for desaliasing).
Mg3dg_plus_half
 Pointer on the grid which has 50% more points in r dimension (for desaliasing).
Mg3dg_non_axi
 Pointer on the grid which has at least 4 points in the $\phi$ direction and at least 5 in the $\theta$ direction (for tensor rotations).

Private Member Functions

void operator= (const Mg3d &)
 Assignement operator (private and not implemented to make Mg3d a non-copyable class).

Friends

ostream & operator<< (ostream &, const Mg3d &)
 Display.

Detailed Description

Multi-domain grid.

()

A multi-domain grid is a set of 3D grids for the implementation of the multi-domain spectral method described in Bonazzola, Gourgoulhon & Marck, Phys. Rev. D 58, 104020 (1998). Each domain is represented by a 3D mono grid (Grille3d) and is called a zone. For each direction, the Number of Degrees of Freedom (NDF) is a priori independent of the zone. However, some methods or routines may refuse to work if the NDF of some $(\theta, \phi)$ direction is not identical in all the zones. This holds for the type of sampling (symmetry) too.

Version:
$Id: grilles.h,v 1.22 2014/10/06 15:09:39 j_novak Exp $#

Definition at line 269 of file grilles.h.


Constructor & Destructor Documentation

Mg3d::Mg3d ( int  nz,
int  nbr[],
int  typr[],
int  nbt[],
int  typt,
int  nbp[],
int  typp,
int *  base_r = 0x0 
)

General constructor.

Parameters:
nz [input] Number of domains (zones).
nbr[] [input] Array (size: nz ) of number of degree of freedom (NDF) in r-direction
typr[] [input] Array (size: nz ) of type of sampling in r -direction
nbt[] [input] Array (size: nz ) of NDF in $\theta$-direction
typt [input] Type of sampling in $\theta$-direction
nbp[] [input] Array (size: nz) of NDF in $\phi$-direction
typp [input] Type of sampling in $\phi$-direction
base_r [input] Types of r bases in each domain, to define the collocation points: BASE_CHEB , BASE_LEG or BASE_JAC02. If the pointer is null, BASE_CHEB is set.

Definition at line 154 of file mg3d.C.

References colloc_r, g, np, nr, nt, set_deriv_0x0(), type_p, type_r, and type_t.

Mg3d::Mg3d ( int  nz,
int  nbr,
int  nbt,
int  nbp,
int  typt,
int  typp,
bool  compact,
bool  legendre = false 
)

Simplified constructor for a standard multi-grid.

This provides a multi-grid with the same number of degrees of freedom in all the domains.
The domain of index l = 0 will be a nucleus: $\xi\in [0,1]$, rarefied sampling (type RARE) near the origin;
domains of indices $ 1 \le {\tt l} \le {\tt nz}-2$ will be shells: $\xi\in [-1,1]$, dense sampling (type FIN) near -1 and 1;
if compact == true, the domains of index l = nz-1 will be the outermost compactified shell: $\xi\in [-1,1]$, dense sampling (type UNSURR) near -1 and 1 for a 1/r discretization.

Parameters:
nz [input] Number of domains (zones).
nbr [input] Number of degree of freedom (NDF) in r -direction in each domain
nbt [input] Number of degree of freedom (NDF) in $\theta$-direction in each domain
nbp [input] Number of degree of freedom (NDF) in $\phi$-direction in each domain
typt [input] Type of sampling in $\theta$-direction:
SYM for a sampling in $[0,\pi/2]$ (symmetry with respect to the equatorial plane),
NONSYM for a sampling in $[0,\pi]$
typp [input] Type of sampling in $\phi$-direction:
SYM for a sampling in $[0,\pi[$ (symmetry with respect to a $\pi$ translation in $\phi$)
NONSYM for a sampling in $[0,2\pi[$
compact [input] true for the last domain to have a 1/r sampling (UNSURR ) instead of a r sampling (FIN ).
legendre [input] true if the nucleus and shells have Legendre-type collocation points. If false, Chebyshev ones shall be used.

Definition at line 200 of file mg3d.C.

References colloc_r, g, np, nr, nt, set_deriv_0x0(), type_p, type_r, and type_t.

Mg3d::Mg3d ( int  nz,
int  nbr,
int  nbt,
int  nbp,
int  typt,
int  typp 
)

Simplified constructor for a standard multi-grid only with shells and Chebyshev.

This provides a multi-grid with the same number of degrees of freedom in all the domains.
ALL DOMAINS ARE TREATED AS SHELLS $\xi\in [-1,1]$, dense sampling (type FIN) near -1 and 1;
and only Chebyshev bases are considered.

Parameters:
nz [input] Number of domains (zones).
nbr [input] Number of degree of freedom (NDF) in r -direction in each domain
nbt [input] Number of degree of freedom (NDF) in $\theta$-direction in each domain
nbp [input] Number of degree of freedom (NDF) in $\phi$-direction in each domain
typt [input] Type of sampling in $\theta$-direction:
SYM for a sampling in $[0,\pi/2]$ (symmetry with respect to the equatorial plane),
NONSYM for a sampling in $[0,\pi]$
typp [input] Type of sampling in $\phi$-direction:
SYM for a sampling in $[0,\pi[$ (symmetry with respect to a $\pi$ translation in $\phi$)
NONSYM for a sampling in $[0,2\pi[$

Definition at line 258 of file mg3d.C.

References colloc_r, g, np, nr, nt, set_deriv_0x0(), type_p, type_r, and type_t.

Mg3d::Mg3d ( FILE *  fd,
bool  read_base = false 
)

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

If the boolean flag read_base is false (default) the spectral basis is not saved, for compatibility with older versions. If it is set to true , the basis is saved.

Definition at line 309 of file mg3d.C.

References colloc_r, fread_be(), g, np, nr, nt, nzone, set_deriv_0x0(), type_p, type_r, and type_t.

Mg3d::Mg3d ( const Mg3d  ) 

Copy constructor (private and not implemented to make Mg3d a non-copyable class).

Mg3d::~Mg3d (  ) 

Destructor.

Definition at line 347 of file mg3d.C.

References colloc_r, del_deriv(), g, np, nr, nt, nzone, and type_r.


Member Function Documentation

void Mg3d::del_deriv (  )  const [protected]

Deletes all the derived quantities (g_radial , g_angu, g_twice, .

..)

Definition at line 441 of file mg3d.C.

References g_angu, g_angu_1dom, g_non_axi, g_plus_half, g_radial, g_twice, and set_deriv_0x0().

const Mg3d * Mg3d::get_angu (  )  const

Returns the pointer on the associated angular grid.

Definition at line 469 of file mg3d.C.

References colloc_r, g_angu, Mg3d(), np, nt, nzone, type_p, type_r, and type_t.

const Mg3d * Mg3d::get_angu_1dom (  )  const

Returns the pointer on the associated mono-domain angular grid.

This angular grid corresponds to the first domain (index 0).

Definition at line 490 of file mg3d.C.

References g_angu_1dom, Mg3d(), np, nt, type_p, and type_t.

int Mg3d::get_colloc_r ( int  l  )  const [inline]

Returns the type of collocation points used in domain no.

l. This type depends on the spectral decomposition basis:

  • BASE_CHEB : Chebyshev basis and collocation points
  • BASE_LEG : Legendre basis and collocation points
  • BASE_JAC02 : Jacobi (0,2) polynomials

Definition at line 507 of file grilles.h.

References colloc_r, and nzone.

const Grille3d* Mg3d::get_grille3d ( int  l  )  const [inline]

Returns a pointer on the 3D mono-grid for domain no. l.

Definition at line 496 of file grilles.h.

References g, and nzone.

const Mg3d * Mg3d::get_non_axi (  )  const

Returns the pointer on the grid which has at least 4 points in the $\phi$ direction and at least 5 in the $\theta$ direction (for tensor rotations).

Definition at line 611 of file mg3d.C.

References colloc_r, g_non_axi, Mg3d(), np, nr, nt, nzone, type_p, type_r, and type_t.

int Mg3d::get_np ( int  l  )  const [inline]

Returns the number of points in the azimuthal direction ($\phi$) in domain no. l.

Definition at line 458 of file grilles.h.

References np, and nzone.

int Mg3d::get_nr ( int  l  )  const [inline]

Returns the number of points in the radial direction ($\xi$) in domain no. l.

Definition at line 448 of file grilles.h.

References nr, and nzone.

int Mg3d::get_nt ( int  l  )  const [inline]

Returns the number of points in the co-latitude direction ($\theta$) in domain no. l.

Definition at line 453 of file grilles.h.

References nt, and nzone.

int Mg3d::get_nzone (  )  const [inline]

Returns the number of domains.

Definition at line 444 of file grilles.h.

References nzone.

const Mg3d * Mg3d::get_radial (  )  const

Returns the pointer on the associated radial grid.

Definition at line 514 of file mg3d.C.

References colloc_r, g_radial, Mg3d(), nr, nzone, and type_r.

const Mg3d * Mg3d::get_twice (  )  const

Returns the pointer on the grid which has twice the number of points in each dimension (for desaliasing).

Definition at line 535 of file mg3d.C.

References colloc_r, g_twice, Mg3d(), np, nr, nt, nzone, type_p, type_r, and type_t.

int Mg3d::get_type_p (  )  const [inline]

Returns the type of sampling in the $\phi$ direction:
SYM : $\phi\in[0,\pi[$ : symmetry with respect to the transformation $ \phi \mapsto \phi + \pi$
NONSYM : $\phi\in[0,2\pi[$ : no symmetry with respect to the transformation $ \phi \mapsto \phi + \pi$.

Definition at line 491 of file grilles.h.

References type_p.

int Mg3d::get_type_r ( int  l  )  const [inline]

Returns the type of sampling in the radial direction in domain no.

l :
RARE : $\xi\in[0,1]$ : rarefied at the origin
FIN : $\xi\in[-1,1]$ : dense at the two extremities
UNSURR : $\xi\in[-1,1]$ : dense at the two extremities, in view of using $u=1/r$ as radial variable

Definition at line 470 of file grilles.h.

References nzone, and type_r.

int Mg3d::get_type_t (  )  const [inline]

Returns the type of sampling in the $\theta$ direction:
SYM : $\theta\in[0,\pi/2]$ : symmetry with respect to the equatorial plane
NONSYM : $\theta\in[0,\pi]$ : no symmetry with respect to the equatorial plane.

Definition at line 481 of file grilles.h.

References type_t.

bool Mg3d::operator!= ( const Mg3d titi  )  const

Operator !=.

Definition at line 416 of file mg3d.C.

References colloc_r, np, nr, nt, nzone, type_p, type_r, and type_t.

void Mg3d::operator= ( const Mg3d  )  [private]

Assignement operator (private and not implemented to make Mg3d a non-copyable class).

bool Mg3d::operator== ( const Mg3d mgi  )  const

Comparison operator (egality).

Definition at line 642 of file mg3d.C.

References colloc_r, get_colloc_r(), get_np(), get_nr(), get_nt(), get_nzone(), get_type_p(), get_type_r(), get_type_t(), np, nr, nt, nzone, type_p, type_r, and type_t.

const Mg3d * Mg3d::plus_half (  )  const

Returns the pointer on the grid which has 50% more points in r dimension (for desaliasing).

Definition at line 583 of file mg3d.C.

References colloc_r, g_plus_half, Mg3d(), np, nr, nt, nzone, type_p, type_r, and type_t.

Base_val ** Mg3d::pseudo_base_vect_cart (  )  const

Returns the standard spectral bases for the Cartesian components of a pseudo-vector.

Definition at line 790 of file mg3d_std_base.C.

References Base_val::b, colloc_r, get_nzone(), get_type_r(), nzone, P_COSSIN, P_COSSIN_I, P_COSSIN_P, R_CHEB, R_CHEBP, R_CHEBPI_P, R_CHEBPIM_I, R_CHEBPIM_P, R_CHEBU, T_COS, T_COS_P, T_COSSIN_C, T_COSSIN_CI, T_COSSIN_CP, T_SIN, T_SIN_P, type_p, and type_t.

Base_val ** Mg3d::pseudo_base_vect_spher (  )  const

Returns the standard spectral bases for the spherical components of a pseudo-vector.

Definition at line 1110 of file mg3d_std_base.C.

References Base_val::b, colloc_r, get_nzone(), get_type_r(), nzone, P_COSSIN, P_COSSIN_P, R_CHEB, R_CHEBP, R_CHEBPI_I, R_CHEBPI_P, R_CHEBPIM_P, R_CHEBU, T_COS, T_COS_I, T_COSSIN_C, T_COSSIN_CI, T_COSSIN_S, T_COSSIN_SI, T_COSSIN_SP, T_SIN, T_SIN_I, T_SIN_P, type_p, and type_t.

void Mg3d::sauve ( FILE *  fd,
bool  save_base = false 
) const

Saves into a file.

By default, if save_base is false, the spectral decomposition basis colloc_r is not saved (for compatibility reasons). If save_base is true, then colloc_r is save, too. The same value for the flag read_base must be given in the contructor reading the file.

Definition at line 367 of file mg3d.C.

References arrete(), colloc_r, fwrite_be(), np, nr, nt, nzone, type_p, type_r, and type_t.

void Mg3d::set_deriv_0x0 (  )  const [protected]

Sets to 0x0 all the pointers on derived quantities (g_radial , g_angu, g_twice, .

.. )

Definition at line 454 of file mg3d.C.

References g_angu, g_angu_1dom, g_non_axi, g_plus_half, g_radial, and g_twice.

Base_val Mg3d::std_base_scal (  )  const

Returns the standard spectral bases for a scalar.

Definition at line 97 of file mg3d_std_base.C.

References Base_val::b, colloc_r, nzone, type_p, type_r, and type_t.

Base_val Mg3d::std_base_scal_odd (  )  const

Returns the standard odd spectral bases for a scalar.

Definition at line 127 of file mg3d_std_base.C.

References Base_val::b, colloc_r, nzone, type_p, type_r, and type_t.

Base_val ** Mg3d::std_base_vect_cart (  )  const

Returns the standard spectral bases for the Cartesian components of a vector.

Definition at line 173 of file mg3d_std_base.C.

References Base_val::b, colloc_r, get_nzone(), get_type_r(), nzone, P_COSSIN, P_COSSIN_I, P_COSSIN_P, R_CHEB, R_CHEBI, R_CHEBPI_P, R_CHEBPIM_I, R_CHEBPIM_P, R_CHEBU, T_COS, T_COS_I, T_COSSIN_C, T_COSSIN_CI, T_COSSIN_CP, T_SIN, T_SIN_I, type_p, and type_t.

Base_val ** Mg3d::std_base_vect_spher (  )  const

Returns the standard spectral bases for the spherical components of a vector.

Definition at line 495 of file mg3d_std_base.C.

References Base_val::b, colloc_r, get_nzone(), get_type_r(), nzone, P_COSSIN, P_COSSIN_P, R_CHEB, R_CHEBI, R_CHEBPI_I, R_CHEBPI_P, R_CHEBPIM_I, R_CHEBU, T_COS, T_COS_P, T_COSSIN_C, T_COSSIN_CP, T_COSSIN_S, T_COSSIN_SI, T_COSSIN_SP, T_SIN, T_SIN_I, T_SIN_P, type_p, and type_t.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  ,
const Mg3d  
) [friend]

Display.


Member Data Documentation

int* Mg3d::colloc_r [protected]

Array (size: nzone) of type of collocation points in r ($\xi$) and related decompoisition bases (BASE_CHEB, BASE_LEG, BASE_JAC02 ).

Definition at line 295 of file grilles.h.

Grille3d** Mg3d::g [protected]

Array (size: nzone) of pointers on the Grille3d's.

Definition at line 298 of file grilles.h.

Mg3d* Mg3d::g_angu [mutable, protected]

Pointer on the associated angular grid.

Definition at line 300 of file grilles.h.

Mg3d* Mg3d::g_angu_1dom [mutable, protected]

Pointer on the associated angular grid with only one domain.

Definition at line 302 of file grilles.h.

Mg3d* Mg3d::g_non_axi [mutable, protected]

Pointer on the grid which has at least 4 points in the $\phi$ direction and at least 5 in the $\theta$ direction (for tensor rotations).

Definition at line 319 of file grilles.h.

Mg3d* Mg3d::g_plus_half [mutable, protected]

Pointer on the grid which has 50% more points in r dimension (for desaliasing).

Definition at line 313 of file grilles.h.

Mg3d* Mg3d::g_radial [mutable, protected]

Pointer on the associated radial grid.

Definition at line 303 of file grilles.h.

Mg3d* Mg3d::g_twice [mutable, protected]

Pointer on the grid which has twice the number of points in each dimension (for desaliasing).

Definition at line 308 of file grilles.h.

int* Mg3d::np [protected]

Array (size: nzone) of nb. of points in $\phi$.

Definition at line 278 of file grilles.h.

int* Mg3d::nr [protected]

Array (size: nzone) of nb. of points in r ($\xi$).

Definition at line 276 of file grilles.h.

int* Mg3d::nt [protected]

Array (size: nzone) of nb. of points in $\theta$.

Definition at line 277 of file grilles.h.

int Mg3d::nzone [protected]

Number of domains (zones).

Definition at line 274 of file grilles.h.

int Mg3d::type_p [protected]

Type of sampling in $\phi$ (SYM, NONSYM).

Definition at line 289 of file grilles.h.

int* Mg3d::type_r [protected]

Array (size: nzone) of type of sampling in r ($\xi$) (RARE,FIN, c UNSURR).

Definition at line 283 of file grilles.h.

int Mg3d::type_t [protected]

Type of sampling in $\theta$ (SYM, NONSYM).

Definition at line 286 of file grilles.h.


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

Generated on 7 Oct 2014 for LORENE by  doxygen 1.6.1