LORENE
|
Multi-domain grid. More...
#include <grilles.h>
Public Member Functions | |
Mg3d (int nz, int nbr[], int typr[], int nbt[], int typt, int nbp[], int typp, int *base_r=0x0) | |
General constructor. More... | |
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. More... | |
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. More... | |
Mg3d (const string &filename) | |
Constructor from a formatted file, given by its name (string). More... | |
Mg3d (FILE *fd, bool read_base=false) | |
Constructor from a file (see sauve(FILE*) ). More... | |
Mg3d (const Mg3d &) | |
Copy constructor (private and not implemented to make Mg3d a non-copyable class) More... | |
~Mg3d () | |
Destructor. More... | |
int | get_nzone () const |
Returns the number of domains. More... | |
int | get_nr (int l) const |
Returns the number of points in the radial direction ( ) in domain no. l. More... | |
int | get_nt (int l) const |
Returns the number of points in the co-latitude direction ( ) in domain no. l. More... | |
int | get_np (int l) const |
Returns the number of points in the azimuthal direction ( ) in domain no. l. More... | |
int | get_type_r (int l) const |
Returns the type of sampling in the radial direction in domain no. More... | |
int | get_type_t () const |
Returns the type of sampling in the direction: SYM : : symmetry with respect to the equatorial plane NONSYM : : no symmetry with respect to the equatorial plane. More... | |
int | get_type_p () const |
Returns the type of sampling in the direction: SYM : : symmetry with respect to the transformation NONSYM : : no symmetry with respect to the transformation More... | |
const Grille3d * | get_grille3d (int l) const |
Returns a pointer on the 3D mono-grid for domain no. l. More... | |
int | get_colloc_r (int l) const |
Returns the type of collocation points used in domain no. More... | |
const Mg3d * | get_angu () const |
Returns the pointer on the associated angular grid. More... | |
const Mg3d * | get_angu_1dom () const |
Returns the pointer on the associated mono-domain angular grid. More... | |
const Mg3d * | get_radial () const |
Returns the pointer on the associated radial grid. More... | |
const Mg3d * | get_twice () const |
Returns the pointer on the grid which has twice the number of points in each dimension (for desaliasing). More... | |
const Mg3d * | plus_half () const |
Returns the pointer on the grid which has 50% more points in r dimension (for desaliasing). More... | |
const Mg3d * | plus_half_angu () const |
Returns the pointer on the grid which has 50% more points in and dimension (for desaliasing). More... | |
const Mg3d * | get_non_axi () const |
Returns the pointer on the grid which has at least 4 points in the direction and at least 5 in the direction (for tensor rotations). More... | |
bool | operator== (const Mg3d &) const |
Comparison operator (egality) More... | |
void | sauve (FILE *fd, bool save_base=false) const |
Saves into a file. More... | |
bool | operator!= (const Mg3d &) const |
Operator !=. More... | |
Base_val | std_base_scal () const |
Returns the standard spectral bases for a scalar. More... | |
Base_val | std_base_scal_odd () const |
Returns the standard odd spectral bases for a scalar. More... | |
Base_val ** | std_base_vect_cart () const |
Returns the standard spectral bases for the Cartesian components of a vector. More... | |
Base_val ** | std_base_vect_spher () const |
Returns the standard spectral bases for the spherical components of a vector. More... | |
Base_val ** | pseudo_base_vect_cart () const |
Returns the standard spectral bases for the Cartesian components of a pseudo-vector. More... | |
Base_val ** | pseudo_base_vect_spher () const |
Returns the standard spectral bases for the spherical components of a pseudo-vector. More... | |
Protected Member Functions | |
void | del_deriv () const |
Deletes all the derived quantities (g_radial , g_angu , g_twice , ...) More... | |
void | set_deriv_0x0 () const |
Sets to 0x0 all the pointers on derived quantities (g_radial , g_angu , g_twice , ... More... | |
Protected Attributes | |
int | nzone |
Number of domains (zones) More... | |
int * | nr |
Array (size: nzone ) of nb. of points in r ( ) More... | |
int * | nt |
Array (size: nzone ) of nb. of points in . More... | |
int * | np |
Array (size: nzone ) of nb. of points in . More... | |
int * | type_r |
Array (size: nzone ) of type of sampling in r ( ) (RARE ,FIN , UNSURR ) More... | |
int | type_t |
Type of sampling in (SYM , NONSYM ) More... | |
int | type_p |
Type of sampling in (SYM , NONSYM ) More... | |
int * | colloc_r |
Array (size: nzone ) of type of collocation points in r ( ) and related decompoisition bases (BASE_CHEB , BASE_LEG , BASE_JAC02 ). More... | |
Grille3d ** | g |
Array (size: nzone ) of pointers on the Grille3d's . More... | |
Mg3d * | g_angu |
Pointer on the associated angular grid. More... | |
Mg3d * | g_angu_1dom |
Pointer on the associated angular grid with only one domain. More... | |
Mg3d * | g_radial |
Pointer on the associated radial grid. More... | |
Mg3d * | g_twice |
Pointer on the grid which has twice the number of points in each dimension (for desaliasing). More... | |
Mg3d * | g_plus_half |
Pointer on the grid which has 50% more points in r dimension (for desaliasing). More... | |
Mg3d * | g_plus_half_angu |
Pointer on the grid which has 50% more points in and dimension (for desaliasing). More... | |
Mg3d * | g_non_axi |
Pointer on the grid which has at least 4 points in the direction and at least 5 in the direction (for tensor rotations). More... | |
Private Member Functions | |
void | operator= (const Mg3d &) |
Assignement operator (private and not implemented to make Mg3d a non-copyable class) More... | |
Friends | |
ostream & | operator<< (ostream &, const Mg3d &) |
Display. More... | |
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 direction is not identical in all the zones. This holds for the type of sampling (symmetry) too.
Lorene::Mg3d::Mg3d | ( | int | nz, |
int | nbr[], | ||
int | typr[], | ||
int | nbt[], | ||
int | typt, | ||
int | nbp[], | ||
int | typp, | ||
int * | base_r = 0x0 |
||
) |
General constructor.
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 -direction |
typt | [input] Type of sampling in -direction |
nbp[] | [input] Array (size: nz ) of NDF in -direction |
typp | [input] Type of sampling in -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. |
Lorene::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: , rarefied sampling (type RARE
) near the origin;
domains of indices will be shells: , dense sampling (type FIN
) near -1 and 1;
if compact
== true, the domains of index l
= nz-1
will be the outermost compactified shell: , dense sampling (type UNSURR
) near -1 and 1 for a 1/r discretization.
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 -direction in each domain |
nbp | [input] Number of degree of freedom (NDF) in -direction in each domain |
typt | [input] Type of sampling in -direction: SYM for a sampling in (symmetry with respect to the equatorial plane), NONSYM for a sampling in |
typp | [input] Type of sampling in -direction: SYM for a sampling in (symmetry with respect to a translation in ) NONSYM for a sampling in |
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. |
Lorene::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 , dense sampling (type FIN
) near -1 and 1;
and only Chebyshev bases are considered.
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 -direction in each domain |
nbp | [input] Number of degree of freedom (NDF) in -direction in each domain |
typt | [input] Type of sampling in -direction: SYM for a sampling in (symmetry with respect to the equatorial plane), NONSYM for a sampling in |
typp | [input] Type of sampling in -direction: SYM for a sampling in (symmetry with respect to a translation in ) NONSYM for a sampling in |
|
explicit |
Constructor from a formatted file, given by its name (string).
Definition at line 324 of file mg3d.C.
References nzone, Lorene::search_file(), and type_t.
Lorene::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 442 of file mg3d.C.
References colloc_r, Lorene::fread_be(), g, np, nr, nt, nzone, type_p, type_r, and type_t.
Lorene::Mg3d::Mg3d | ( | const Mg3d & | ) |
Copy constructor (private and not implemented to make Mg3d
a non-copyable class)
Lorene::Mg3d::~Mg3d | ( | ) |
|
protected |
Deletes all the derived quantities (g_radial
, g_angu
, g_twice
, ...)
Definition at line 574 of file mg3d.C.
References g_angu, g_angu_1dom, g_non_axi, g_plus_half, g_plus_half_angu, g_radial, g_twice, and set_deriv_0x0().
const Mg3d * Lorene::Mg3d::get_angu | ( | ) | const |
const Mg3d * Lorene::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 625 of file mg3d.C.
References g_angu_1dom, np, and nt.
|
inline |
|
inline |
const Mg3d * Lorene::Mg3d::get_non_axi | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
const Mg3d * Lorene::Mg3d::get_radial | ( | ) | const |
const Mg3d * Lorene::Mg3d::get_twice | ( | ) | const |
|
inline |
|
inline |
|
inline |
bool Lorene::Mg3d::operator!= | ( | const Mg3d & | titi | ) | const |
|
private |
Assignement operator (private and not implemented to make Mg3d
a non-copyable class)
bool Lorene::Mg3d::operator== | ( | const Mg3d & | mgi | ) | const |
Comparison operator (egality)
Definition at line 815 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 * Lorene::Mg3d::plus_half | ( | ) | const |
const Mg3d * Lorene::Mg3d::plus_half_angu | ( | ) | const |
Base_val ** Lorene::Mg3d::pseudo_base_vect_cart | ( | ) | const |
Returns the standard spectral bases for the Cartesian components of a pseudo-vector.
Definition at line 797 of file mg3d_std_base.C.
References colloc_r, get_nzone(), and nzone.
Base_val ** Lorene::Mg3d::pseudo_base_vect_spher | ( | ) | const |
Returns the standard spectral bases for the spherical components of a pseudo-vector.
Definition at line 1117 of file mg3d_std_base.C.
References colloc_r, get_nzone(), and nzone.
void Lorene::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 500 of file mg3d.C.
References colloc_r, Lorene::fwrite_be(), np, nr, nt, nzone, type_p, type_r, and type_t.
|
protected |
Sets to 0x0
all the pointers on derived quantities (g_radial
, g_angu
, g_twice
, ...
)
Definition at line 588 of file mg3d.C.
References g_angu, g_angu_1dom, g_non_axi, g_plus_half, g_plus_half_angu, g_radial, and g_twice.
Base_val Lorene::Mg3d::std_base_scal | ( | ) | const |
Returns the standard spectral bases for a scalar.
Definition at line 104 of file mg3d_std_base.C.
Base_val Lorene::Mg3d::std_base_scal_odd | ( | ) | const |
Returns the standard odd spectral bases for a scalar.
Definition at line 134 of file mg3d_std_base.C.
Base_val ** Lorene::Mg3d::std_base_vect_cart | ( | ) | const |
Returns the standard spectral bases for the Cartesian components of a vector.
Definition at line 180 of file mg3d_std_base.C.
References colloc_r, get_nzone(), and nzone.
Base_val ** Lorene::Mg3d::std_base_vect_spher | ( | ) | const |
Returns the standard spectral bases for the spherical components of a vector.
Definition at line 502 of file mg3d_std_base.C.
References colloc_r, get_nzone(), and nzone.
|
friend |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |