ope_vorton_mat.C
/*
* Copyright (c) 2003 Philippe Grandclement
*
* 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 version 2
* as published by the Free Software Foundation.
*
* 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 ope_vorton_mat_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_mat.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $" ;
/*
* $Id: ope_vorton_mat.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $
* $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_mat.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $
*
*/
#include <cmath>
#include <cstdlib>
#include "proto.h"
#include "ope_elementary.h"
#include "diff.h"
//-----------------------------------
// Routine pour les cas non prevus --
//-----------------------------------
namespace Lorene {
Matrice _vorton_mat_pas_prevu(int, double, double, int, int) {
cout << "Vorton : base not implemented..." << endl ;
abort() ;
exit(-1) ;
Matrice res(1, 1) ;
return res;
}
//-------------------------
//-- CAS R_CHEBU -----
//------------------------
Matrice _vorton_mat_r_chebu_trois (int n, int lq) {
Diff_xdsdx2 xdd(R_CHEBU, n) ;
Diff_dsdx d(R_CHEBU, n) ;
Diff_sx sx(R_CHEBU, n) ;
return (xdd+2*d-lq*(lq+1)*sx) ;
}
Matrice _vorton_mat_r_chebu (int n, double, double, int lq, int dz) {
Matrice res(n, n) ;
res.set_etat_qcq() ;
switch (dz) {
case 3 :
res = _vorton_mat_r_chebu_trois (n, lq) ;
break ;
default :
abort() ;
exit(-1) ;
}
return res ;
}
//-------------------------
//-- CAS R_CHEB -----
//------------------------
Matrice _vorton_mat_r_cheb (int n, double alpha, double beta, int lq, int) {
Diff_dsdx2 d2(R_CHEB, n) ;
Diff_xdsdx2 xd2(R_CHEB, n) ;
Diff_x2dsdx2 x2d2(R_CHEB, n) ;
Diff_dsdx d1(R_CHEB, n) ;
Diff_xdsdx xd1(R_CHEB, n) ;
Diff_id id(R_CHEB, n) ;
double echelle = beta/alpha ;
return (x2d2 + (2*echelle)*xd2 + (echelle*echelle)*d2 - (lq*(lq+1))*id) ;
}
void Ope_vorton::do_ope_mat() const {
if (ope_mat != 0x0)
delete ope_mat ;
// Routines de derivation
static Matrice (*vorton_mat[MAX_BASE])(int, double, double, int, int);
static int nap = 0 ;
// Premier appel
if (nap==0) {
nap = 1 ;
for (int i=0 ; i<MAX_BASE ; i++) {
vorton_mat[i] = _vorton_mat_pas_prevu ;
}
// Les routines existantes
vorton_mat[R_CHEB >> TRA_R] = _vorton_mat_r_cheb ;
vorton_mat[R_CHEBU >> TRA_R] = _vorton_mat_r_chebu ;
}
ope_mat = new Matrice(vorton_mat[base_r](nr, alpha, beta, l_quant, dzpuis)) ;
}
}
Lorene::Diff_dsdx2
Class for the elementary differential operator (see the base class Diff ).
Definition diff.h:172
Lorene::Diff_dsdx
Class for the elementary differential operator (see the base class Diff ).
Definition diff.h:129
Lorene::Diff_id
Class for the elementary differential operator Identity (see the base class Diff ).
Definition diff.h:210
Lorene::Diff_sx
Class for the elementary differential operator division by (see the base class Diff ).
Definition diff.h:329
Lorene::Diff_x2dsdx2
Class for the elementary differential operator (see the base class Diff ).
Definition diff.h:490
Lorene::Diff_xdsdx2
Class for the elementary differential operator (see the base class Diff ).
Definition diff.h:531
Lorene::Diff_xdsdx
Class for the elementary differential operator (see the base class Diff ).
Definition diff.h:409
Lorene::Matrice
Matrix handling.
Definition matrice.h:152
Lorene::Ope_elementary::ope_mat
Matrice * ope_mat
Pointer on the matrix representation of the operator.
Definition ope_elementary.h:114
Lorene::Ope_elementary::beta
double beta
Parameter of the associated mapping.
Definition ope_elementary.h:109
Lorene::Ope_elementary::alpha
double alpha
Parameter of the associated mapping.
Definition ope_elementary.h:108
Lorene::Ope_elementary::base_r
int base_r
Radial basis of decomposition.
Definition ope_elementary.h:107
Lorene::Ope_elementary::nr
int nr
Number of radial points.
Definition ope_elementary.h:106
Lorene::Ope_vorton::l_quant
int l_quant
quantum number
Definition ope_elementary.h:997
Lorene::Ope_vorton::dzpuis
int dzpuis
the associated dzpuis, if in the compactified domain.
Definition ope_elementary.h:998
Lorene::Ope_vorton::do_ope_mat
virtual void do_ope_mat() const
Computes the matrix of the operator.
Definition ope_vorton_mat.C:94
MAX_BASE
#define MAX_BASE
Nombre max. de bases differentes.
Definition type_parite.h:144
R_CHEBU
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
Definition type_parite.h:180
TRA_R
#define TRA_R
Translation en R, used for a bitwise shift (in hex).
Definition type_parite.h:158
R_CHEB
#define R_CHEB
base de Chebychev ordinaire (fin)
Definition type_parite.h:166
Lorene
Lorene prototypes.
Definition app_hor.h:64