base_val_manip.C
/*
* 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
*
*/
char base_val_manip_C[] = "$Header: /cvsroot/Lorene/C++/Source/Base_val/base_val_manip.C,v 1.12 2015/03/09 10:32:27 j_novak Exp $" ;
/*
* $Id: base_val_manip.C,v 1.12 2015/03/09 10:32:27 j_novak Exp $
* $Log: base_val_manip.C,v $
* Revision 1.12 2015/03/09 10:32:27 j_novak
* Inclusion of r-Legendre bases.
*
* Revision 1.11 2014/10/13 08:52:38 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.10 2014/10/06 15:12:56 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.9 2009/10/08 16:20:13 j_novak
* Addition of new bases T_COS and T_SIN.
*
* Revision 1.8 2008/12/03 15:21:21 j_novak
* New method mult_cost.
*
* Revision 1.7 2008/02/18 13:53:38 j_novak
* Removal of special indentation instructions.
*
* Revision 1.6 2004/11/23 15:08:00 m_forot
* Added the bases for the cases without any equatorial symmetry
* (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I).
*
* Revision 1.5 2004/01/27 14:31:26 j_novak
* New method Base_val::mult_sint()
*
* Revision 1.4 2004/01/27 14:13:59 j_novak
* Added method Base_val::mult_x()
*
* Revision 1.3 2003/09/16 08:54:09 j_novak
* Addition of the T_LEG_II base (odd in theta, only for odd m) and the
* transformation functions to and from the T_SIN_P base.
*
* Revision 1.2 2002/10/16 14:36:30 j_novak
* Reorganization of #include instructions of standard C++, in order to
* use experimental version 3 of gcc.
*
* Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
* LORENE
*
* Revision 1.3 2001/10/12 15:06:50 novak
* *** empty log message ***
*
* Revision 1.2 2001/10/12 15:05:14 novak
* *** empty log message ***
*
* Revision 1.1 2001/10/12 14:57:24 novak
* Initial revision
*
*
* $Header: /cvsroot/Lorene/C++/Source/Base_val/base_val_manip.C,v 1.12 2015/03/09 10:32:27 j_novak Exp $
*
*/
// Headers C
#include <cstdlib>
#include <cassert>
// Headers Lorene
#include "headcpp.h"
#include "type_parite.h"
#include "base_val.h"
namespace Lorene {
void Base_val::dsdx() {
switch(get_base_r(0)) {
case R_CHEBP:
set_base_r(0, R_CHEBI) ;
break ;
case R_CHEBI:
set_base_r(0, R_CHEBP) ;
break ;
case R_CHEBPIM_P:
set_base_r(0, R_CHEBPIM_I) ;
break ;
case R_CHEBPIM_I:
set_base_r(0, R_CHEBPIM_P) ;
break ;
case R_CHEBPI_P:
set_base_r(0, R_CHEBPI_I) ;
break ;
case R_CHEBPI_I:
set_base_r(0, R_CHEBPI_P) ;
break ;
case R_LEGP:
set_base_r(0, R_LEGI) ;
break ;
case R_LEGI:
set_base_r(0, R_LEGP) ;
break ;
default:
break ;
}
return ;
}
void Base_val::sx() {
switch(get_base_r(0)) {
case R_CHEBP:
set_base_r(0, R_CHEBI) ;
break ;
case R_CHEBI:
set_base_r(0, R_CHEBP) ;
break ;
case R_CHEBPIM_P:
set_base_r(0, R_CHEBPIM_I) ;
break ;
case R_CHEBPIM_I:
set_base_r(0, R_CHEBPIM_P) ;
break ;
case R_CHEBPI_P:
set_base_r(0, R_CHEBPI_I) ;
break ;
case R_CHEBPI_I:
set_base_r(0, R_CHEBPI_P) ;
break ;
case R_LEGP:
set_base_r(0, R_LEGI) ;
break ;
case R_LEGI:
set_base_r(0, R_LEGP) ;
break ;
default:
break ;
}
return ;
}
void Base_val::mult_x() {
switch(get_base_r(0)) {
case R_CHEBP:
set_base_r(0, R_CHEBI) ;
break ;
case R_CHEBI:
set_base_r(0, R_CHEBP) ;
break ;
case R_CHEBPIM_P:
set_base_r(0, R_CHEBPIM_I) ;
break ;
case R_CHEBPIM_I:
set_base_r(0, R_CHEBPIM_P) ;
break ;
case R_CHEBPI_P:
set_base_r(0, R_CHEBPI_I) ;
break ;
case R_CHEBPI_I:
set_base_r(0, R_CHEBPI_P) ;
break ;
case R_LEGP:
set_base_r(0, R_LEGI) ;
break ;
case R_LEGI:
set_base_r(0, R_LEGP) ;
break ;
default:
break ;
}
return ;
}
void Base_val::dsdt() {
switch(get_base_t(0)) {
case T_COS_P:
set_base_t(T_SIN_P) ;
break ;
case T_COS_I:
set_base_t(T_SIN_I) ;
break ;
case T_SIN_P:
set_base_t(T_COS_P) ;
break ;
case T_SIN_I:
set_base_t(T_COS_I) ;
break ;
case T_COSSIN_CP:
set_base_t(T_COSSIN_SP) ;
break ;
case T_COSSIN_SP:
set_base_t(T_COSSIN_CP) ;
break ;
case T_COSSIN_CI:
set_base_t(T_COSSIN_SI) ;
break ;
case T_COSSIN_SI:
set_base_t(T_COSSIN_CI) ;
break ;
case T_COSSIN_C:
set_base_t(T_COSSIN_S) ;
break ;
case T_COSSIN_S:
set_base_t(T_COSSIN_C) ;
break ;
case T_COS:
set_base_t(T_SIN) ;
break ;
case T_SIN:
set_base_t(T_COS) ;
break ;
default:
cout << "Wrong base in Base_val::dsdt()!" << endl ;
abort() ;
exit(-1) ;
break ;
}
return ;
}
void Base_val::ssint() {
switch(get_base_t(0)) {
case T_COS_P:
set_base_t(T_SIN_I) ;
break ;
case T_COS_I:
set_base_t(T_SIN_P) ;
break ;
case T_SIN_P:
set_base_t(T_COS_I) ;
break ;
case T_SIN_I:
set_base_t(T_COS_P) ;
break ;
case T_COSSIN_CP:
set_base_t(T_COSSIN_SI) ;
break ;
case T_COSSIN_SP:
set_base_t(T_COSSIN_CI) ;
break ;
case T_COSSIN_CI:
set_base_t(T_COSSIN_SP) ;
break ;
case T_COSSIN_SI:
set_base_t(T_COSSIN_CP) ;
break ;
case T_COSSIN_C:
set_base_t(T_COSSIN_S) ;
break ;
case T_COSSIN_S:
set_base_t(T_COSSIN_C) ;
break ;
case T_COS:
set_base_t(T_SIN) ;
break ;
case T_SIN:
set_base_t(T_COS) ;
break ;
default:
cout << "Wrong base in Base_val::ssint()!" << endl ;
abort() ;
exit(-1) ;
break ;
}
return ;
}
void Base_val::mult_sint() {
switch(get_base_t(0)) {
case T_COS_P:
set_base_t(T_SIN_I) ;
break ;
case T_COS_I:
set_base_t(T_SIN_P) ;
break ;
case T_SIN_P:
set_base_t(T_COS_I) ;
break ;
case T_SIN_I:
set_base_t(T_COS_P) ;
break ;
case T_COSSIN_CP:
set_base_t(T_COSSIN_SI) ;
break ;
case T_COSSIN_SP:
set_base_t(T_COSSIN_CI) ;
break ;
case T_COSSIN_CI:
set_base_t(T_COSSIN_SP) ;
break ;
case T_COSSIN_SI:
set_base_t(T_COSSIN_CP) ;
break ;
case T_COSSIN_C:
set_base_t(T_COSSIN_S) ;
break ;
case T_COSSIN_S:
set_base_t(T_COSSIN_C) ;
break ;
case T_COS:
set_base_t(T_SIN) ;
break ;
case T_SIN:
set_base_t(T_COS) ;
break ;
default:
cout << "Wrong base in Base_val::mult_sint()!" << endl ;
abort() ;
exit(-1) ;
break ;
}
return ;
}
void Base_val::mult_cost() {
switch(get_base_t(0)) {
case T_COS_P:
set_base_t(T_COS_I) ;
break ;
case T_COS_I:
set_base_t(T_COS_P) ;
break ;
case T_SIN_P:
set_base_t(T_SIN_I) ;
break ;
case T_SIN_I:
set_base_t(T_SIN_P) ;
break ;
case T_COSSIN_CP:
set_base_t(T_COSSIN_CI) ;
break ;
case T_COSSIN_SP:
set_base_t(T_COSSIN_SI) ;
break ;
case T_COSSIN_CI:
set_base_t(T_COSSIN_CP) ;
break ;
case T_COSSIN_SI:
set_base_t(T_COSSIN_SP) ;
break ;
case T_COSSIN_C:
set_base_t(T_COSSIN_C) ;
break ;
case T_COSSIN_S:
set_base_t(T_COSSIN_S) ;
break ;
case T_COS:
set_base_t(T_COS) ;
break ;
case T_SIN:
set_base_t(T_SIN) ;
break ;
default:
cout << "Wrong base in Base_val::mult_cost()!" << endl ;
abort() ;
exit(-1) ;
break ;
}
return ;
}
void Base_val::ylm() {
switch(get_base_t(0)) {
case T_COS_P:
set_base_t(T_LEG_PP) ;
break ;
case T_COS_I:
set_base_t(T_LEG_IP) ;
break ;
case T_SIN_I:
set_base_t(T_LEG_PI) ;
break ;
case T_SIN_P:
set_base_t(T_LEG_II) ;
break ;
case T_COSSIN_CP:
set_base_t(T_LEG_P) ;
break ;
case T_COSSIN_CI:
set_base_t(T_LEG_I) ;
break ;
case T_COSSIN_C:
set_base_t(T_LEG) ;
break ;
case T_COSSIN_S:
set_base_t(T_LEG) ;
break ;
case T_COS:
set_base_t(T_LEG_MP) ;
break ;
default:
cout << "Wrong base in Base_val::ylm()!" << endl ;
abort() ;
exit(-1) ;
break ;
}
return ;
}
}
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::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::dsdt
void dsdt()
The basis is transformed as with a operation.
Definition base_val_manip.C:190
Lorene::Base_val::sx
void sx()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:124
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::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::ssint
void ssint()
The basis is transformed as with a multiplication.
Definition base_val_manip.C:238
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::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
T_LEG_MP
#define T_LEG_MP
fct. de Legendre associees avec m pair
Definition type_parite.h:238
R_LEGP
#define R_LEGP
base de Legendre paire (rare) seulement
Definition type_parite.h:184
T_LEG_PI
#define T_LEG_PI
fct. de Legendre associees paires avec m impair
Definition type_parite.h:224
T_COSSIN_SP
#define T_COSSIN_SP
sin pair-cos impair alternes, sin pour m=0
Definition type_parite.h:210
R_LEGI
#define R_LEGI
base de Legendre impaire (rare) seulement
Definition type_parite.h:186
R_CHEBI
#define R_CHEBI
base de Cheb. impaire (rare) seulement
Definition type_parite.h:170
T_LEG
#define T_LEG
fct. de Legendre associees
Definition type_parite.h:236
T_SIN_P
#define T_SIN_P
dev. sin seulement, harmoniques paires
Definition type_parite.h:202
T_COSSIN_S
#define T_COSSIN_S
dev. cos-sin alternes, sin pour m=0
Definition type_parite.h:194
R_CHEBPIM_I
#define R_CHEBPIM_I
Cheb. pair-impair suivant m, impair pour m=0.
Definition type_parite.h:178
T_COSSIN_SI
#define T_COSSIN_SI
sin impair-cos pair alternes, sin pour m=0
Definition type_parite.h:214
R_CHEBPI_I
#define R_CHEBPI_I
Cheb. pair-impair suivant l impair pour l=0.
Definition type_parite.h:174
T_LEG_P
#define T_LEG_P
fct. de Legendre associees paires
Definition type_parite.h:216
T_LEG_IP
#define T_LEG_IP
fct. de Legendre associees impaires avec m pair
Definition type_parite.h:222
T_COS_P
#define T_COS_P
dev. cos seulement, harmoniques paires
Definition type_parite.h:200
T_COSSIN_CI
#define T_COSSIN_CI
cos impair-sin pair alternes, cos pour m=0
Definition type_parite.h:212
R_CHEBPIM_P
#define R_CHEBPIM_P
Cheb. pair-impair suivant m, pair pour m=0.
Definition type_parite.h:176
T_COSSIN_CP
#define T_COSSIN_CP
cos pair-sin impair alternes, cos pour m=0
Definition type_parite.h:208
T_LEG_II
#define T_LEG_II
fct. de Legendre associees impaires avec m impair
Definition type_parite.h:226
T_LEG_I
#define T_LEG_I
fct. de Legendre associees impaires
Definition type_parite.h:220
T_SIN_I
#define T_SIN_I
dev. sin seulement, harmoniques impaires
Definition type_parite.h:206
T_COS
#define T_COS
dev. cos seulement
Definition type_parite.h:196
R_CHEBP
#define R_CHEBP
base de Cheb. paire (rare) seulement
Definition type_parite.h:168
T_SIN
#define T_SIN
dev. sin seulement
Definition type_parite.h:198
T_LEG_PP
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Definition type_parite.h:218
T_COS_I
#define T_COS_I
dev. cos seulement, harmoniques impaires
Definition type_parite.h:204
T_COSSIN_C
#define T_COSSIN_C
dev. cos-sin alternes, cos pour m=0
Definition type_parite.h:192
R_CHEBPI_P
#define R_CHEBPI_P
Cheb. pair-impair suivant l pair pour l=0.
Definition type_parite.h:172
Lorene
Lorene prototypes.
Definition app_hor.h:64