base_val.h
/*
* Definition of Lorene class Base_val
*
*/
/*
* Copyright (c) 1999-2000 Jean-Alain Marck
* Copyright (c) 1999-2001 Eric Gourgoulhon
* Copyright (c) 1999-2001 Philippe Grandclement
* Copyright (c) 2001 Jerome Novak
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __BASE_VAL_H_
#define __BASE_VAL_H_
/*
* $Id: base_val.h,v 1.23 2014/10/13 08:52:31 j_novak Exp $
* $Log: base_val.h,v $
* Revision 1.23 2014/10/13 08:52:31 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.22 2014/10/06 15:09:39 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.21 2013/06/05 15:10:41 j_novak
* Suppression of FINJAC sampling in r. This Jacobi(0,2) base is now
* available by setting colloc_r to BASE_JAC02 in the Mg3d constructor.
*
* Revision 1.20 2013/01/11 08:20:10 j_novak
* New radial spectral bases with Legendre polynomials (R_LEG, R_LEGP, R_LEGI).
*
* Revision 1.19 2012/01/17 10:18:17 j_penner
* changed nzone from a private member to a protected member
*
* Revision 1.18 2009/10/23 12:55:46 j_novak
* New base T_LEG_MI
*
* Revision 1.17 2009/10/08 16:19:32 j_novak
* Addition of new bases T_COS and T_SIN.
*
* Revision 1.16 2008/12/03 15:21:20 j_novak
* New method mult_cost.
*
* Revision 1.15 2007/12/11 15:28:05 jl_cornou
* Jacobi(0,2) polynomials partially implemented
*
* Revision 1.14 2005/09/07 13:09:48 j_novak
* New method for determining the highest multipole that can be described on a 3D
* grid.
*
* Revision 1.13 2004/11/23 15:03:14 m_forot
* Corrected error in comments.
*
* Revision 1.12 2004/11/04 15:39:45 e_gourgoulhon
* Modif documentation: added description of bases without any symmetry
* in theta.
*
* Revision 1.11 2004/08/24 09:14:40 p_grandclement
* Addition of some new operators, like Poisson in 2d... It now requieres the
* GSL library to work.
*
* Also, the way a variable change is stored by a Param_elliptic is changed and
* no longer uses Change_var but rather 2 Scalars. The codes using that feature
* will requiere some modification. (It should concern only the ones about monopoles)
*
* Revision 1.10 2004/03/22 13:12:40 j_novak
* Modification of comments to use doxygen instead of doc++
*
* Revision 1.9 2004/01/27 14:31:25 j_novak
* New method Base_val::mult_sint()
*
* Revision 1.8 2004/01/27 14:13:58 j_novak
* Added method Base_val::mult_x()
*
* Revision 1.7 2003/10/20 06:41:43 e_gourgoulhon
* Corrected documentation.
*
* Revision 1.6 2003/10/19 19:42:50 e_gourgoulhon
* -- member nzone now private
* -- introduced new methods get_nzone() and get_b()
* -- introduced new methods name_r, name_theta and name_phi.
*
* Revision 1.5 2003/09/16 08:53:05 j_novak
* Addition of the T_LEG_II base (odd in theta, only for odd m) and the
* transformation functions from and to T_SIN_P.
*
* Revision 1.4 2002/10/16 14:36:28 j_novak
* Reorganization of #include instructions of standard C++, in order to
* use experimental version 3 of gcc.
*
* Revision 1.3 2002/09/13 09:17:31 j_novak
* Modif. commentaires
*
* Revision 1.2 2002/06/17 14:05:15 j_novak
* friend functions are now also declared outside the class definition
*
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
* LORENE
*
* Revision 2.20 2001/10/12 14:56:09 novak
* Ajout des methodes dsdx(), dsdt(), etc...
*
* Revision 2.19 2001/05/29 16:08:45 eric
* Modif commentaires (mise en conformite Doc++ 3.4.7).
*
* Revision 2.18 2000/09/28 10:19:50 eric
* Modif commentaires (nouvelles bases T_LEG_IP et T_LEG_PI).
*
* Revision 2.17 2000/09/08 11:42:55 eric
* *** empty log message ***
*
* Revision 2.16 2000/09/08 10:14:11 eric
* *** empty log message ***
*
* Revision 2.15 2000/09/08 10:11:49 eric
* *** empty log message ***
*
* Revision 2.14 2000/09/08 10:10:24 eric
* *** empty log message ***
*
* Revision 2.13 2000/09/08 10:06:19 eric
* Ajout des methodes set_base_r, etc... et get_base_r, etc...
*
* Revision 2.12 1999/12/29 10:49:12 eric
* theta_functions et phi_functions declarees const.
*
* Revision 2.11 1999/12/29 10:36:58 eric
* Modif commentaires.
*
* Revision 2.10 1999/12/28 12:57:44 eric
* Introduction des methodes theta_functions et phi_functions.
*
* Revision 2.9 1999/11/19 14:53:11 phil
* *** empty log message ***
*
* Revision 2.8 1999/11/18 13:48:35 phil
* *** empty log message ***
*
* Revision 2.7 1999/11/18 12:51:12 phil
* commentaire de operator*
*
* Revision 2.6 1999/10/26 13:23:12 phil
* *** empty log message ***
*
* Revision 2.5 1999/10/26 13:18:06 phil
* ajout de l'operator*
*
* Revision 2.4 1999/10/13 15:49:12 eric
* *** empty log message ***
*
* Revision 2.3 1999/10/12 10:02:17 eric
* Amelioration des commentaires: description de toutes les bases.
*
* Revision 2.2 1999/10/01 15:55:58 eric
* Depoussierage.
* Documentation
*
* Revision 2.1 1999/09/13 14:38:08 phil
* ajout de l'operateur ==
*
* Revision 2.0 1999/02/22 15:17:47 hyc
* *** empty log message ***
*
*
* $Header: /cvsroot/Lorene/C++/Include/base_val.h,v 1.23 2014/10/13 08:52:31 j_novak Exp $
*
*/
#include <cstdio>
#include <cassert>
#include "headcpp.h"
#include "type_parite.h"
namespace Lorene {
class Tbl ;
class Mg3d ;
class Base_val {
// Data
// ----
protected:
int nzone ;
public:
int* b ;
// Constructors - Destructor
// -------------------------
public:
explicit Base_val(int nb_of_domains) ;
Base_val(const Base_val& ) ;
explicit Base_val(FILE* ) ;
~Base_val() ;
// Mutators / assignment
// ---------------------
public:
void set_base_nondef() ;
void set_base_r(int l, int base_r) ;
void set_base_t(int base_t) ;
void set_base_p(int base_p) ;
void operator=(const Base_val& ) ;
// Accessors
// ---------
public:
bool operator==(const Base_val& ) const ;
int get_b(int l) const {
assert( (l>=0) && (l<nzone) ) ;
return b[l] ;
}
int get_base_r(int l) const {
assert( (l>=0) && (l<nzone) ) ;
return b[l] & MSQ_R ;
} ;
int get_base_t(int l) const {
assert( (l>=0) && (l<nzone) ) ;
return b[l] & MSQ_T ;
} ;
int get_base_p(int l) const {
assert( (l>=0) && (l<nzone) ) ;
return b[l] & MSQ_P ;
} ;
void name_r(int l, int k, int j, int i, char* basename) const ;
void name_theta(int l, int k, int j, char* basename) const ;
void name_phi(int l, int k, char* basename) const ;
const Tbl& theta_functions(int l, int nt) const ;
const Tbl& phi_functions(int l, int np) const ;
int get_nzone() const {return nzone; } ;
// Manipulation of basis
// ----------------------
public:
void dsdx() ;
void sx() ;
void mult_x() ;
void dsdt() ;
void ssint() ;
void mult_sint() ;
void mult_cost() ;
void ylm() ;
void give_quant_numbers (int, int, int,
int&, int&, int&) const ;
int give_lmax(const Mg3d& mgrid, int lz) const ;
// Outputs
// -------
public:
void sauve(FILE *) const ;
friend ostream& operator<<(ostream& , const Base_val& ) ;
friend Base_val operator*(const Base_val&, const Base_val&) ;
};
ostream& operator<<(ostream& , const Base_val& ) ;
Base_val operator*(const Base_val&, const Base_val&) ;
}
#endif
Lorene::Base_val
Bases of the spectral expansions.
Definition base_val.h:322
Lorene::Base_val::Base_val
Base_val(int nb_of_domains)
Standard constructor.
Definition base_val.C:150
Lorene::Base_val::operator<<
friend ostream & operator<<(ostream &, const Base_val &)
Display.
Definition base_val.C:238
Lorene::Base_val::mult_x
void mult_x()
The basis is transformed as with a multiplication by .
Definition base_val_manip.C:157
Lorene::Base_val::sauve
void sauve(FILE *) const
Save in a file.
Definition base_val.C:228
Lorene::Base_val::give_lmax
int give_lmax(const Mg3d &mgrid, int lz) const
Returns the highest multipole for a given grid.
Definition base_val_quantum.C:294
Lorene::Base_val::name_r
void name_r(int l, int k, int j, int i, char *basename) const
Name of the basis function in r ( ).
Definition base_val_name_r.C:84
Lorene::Base_val::set_base_t
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
Definition base_val.C:195
Lorene::Base_val::name_phi
void name_phi(int l, int k, char *basename) const
Name of the basis function in .
Definition base_val_name_phi.C:69
Lorene::Base_val::dsdt
void dsdt()
The basis is transformed as with a operation.
Definition base_val_manip.C:190
Lorene::Base_val::get_b
int get_b(int l) const
Returns the code for the expansion basis in domain no. l.
Definition base_val.h:389
Lorene::Base_val::sx
void sx()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:124
Lorene::Base_val::get_base_p
int get_base_p(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
Definition base_val.h:422
Lorene::Base_val::mult_sint
void mult_sint()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:286
Lorene::Base_val::name_theta
void name_theta(int l, int k, int j, char *basename) const
Name of the basis function in .
Definition base_val_name_theta.C:114
Lorene::Base_val::~Base_val
~Base_val()
Destructor.
Definition base_val.C:177
Lorene::Base_val::get_base_r
int get_base_r(int l) const
Returns the expansion basis for r ( ) functions in the domain of index l (e.g.
Definition base_val.h:400
Lorene::Base_val::set_base_r
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
Definition base_val.C:185
Lorene::Base_val::get_base_t
int get_base_t(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
Definition base_val.h:411
Lorene::Base_val::operator==
bool operator==(const Base_val &) const
Comparison operator.
Definition base_val.C:335
Lorene::Base_val::give_quant_numbers
void give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
Definition base_val_quantum.C:81
Lorene::Base_val::ssint
void ssint()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:238
Lorene::Base_val::b
int * b
Array (size: nzone ) of the spectral basis in each domain.
Definition base_val.h:331
Lorene::Base_val::phi_functions
const Tbl & phi_functions(int l, int np) const
Values of the phi basis functions at the phi collocation points.
Definition base_val_phi_funct.C:88
Lorene::Base_val::nzone
int nzone
Number of domains (zones).
Definition base_val.h:327
Lorene::Base_val::set_base_nondef
void set_base_nondef()
Sets the spectral bases to NONDEF.
Definition base_val.C:326
Lorene::Base_val::theta_functions
const Tbl & theta_functions(int l, int nt) const
Values of the theta basis functions at the theta collocation points.
Definition base_val_theta_funct.C:109
Lorene::Base_val::operator*
friend Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Definition base_val_mult.C:102
Lorene::Base_val::ylm
void ylm()
The basis is transformed as with a transformation to basis.
Definition base_val_manip.C:382
Lorene::Base_val::operator=
void operator=(const Base_val &)
Assignment.
Definition base_val.C:215
Lorene::Base_val::set_base_p
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
Definition base_val.C:204
Lorene::Base_val::get_nzone
int get_nzone() const
Returns the number of domains.
Definition base_val.h:508
Lorene::Base_val::dsdx
void dsdx()
The basis is transformed as with a operation.
Definition base_val_manip.C:91
Lorene::Base_val::mult_cost
void mult_cost()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:334
Lorene::Mg3d
Multi-domain grid.
Definition grilles.h:273
Lorene::Tbl
Basic array class.
Definition tbl.h:161
Lorene::operator*
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Definition base_val_mult.C:102
MSQ_R
#define MSQ_R
Extraction de l'info sur R.
Definition type_parite.h:152
MSQ_T
#define MSQ_T
Extraction de l'info sur Theta.
Definition type_parite.h:154
MSQ_P
#define MSQ_P
Extraction de l'info sur Phi.
Definition type_parite.h:156
Lorene
Lorene prototypes.
Definition app_hor.h:64