LORENE
ope_vorton_non_dege.C
1/*
2 * Copyright (c) 2003 Philippe Grandclement
3 *
4 * This file is part of LORENE.
5 *
6 * LORENE is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * LORENE is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with LORENE; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21char ope_vorton_non_dege_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_non_dege.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $" ;
22
23/*
24 * $Id: ope_vorton_non_dege.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $
25 * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_non_dege.C,v 1.4 2014/10/13 08:53:37 j_novak Exp $
26 *
27 */
28#include <cmath>
29#include <cstdlib>
30
31#include "proto.h"
32#include "ope_elementary.h"
33
34 //-------------------
35 //-- Pas prevu ----
36 //-------------------
37
38namespace Lorene {
39Matrice _vorton_non_dege_pas_prevu (const Matrice& so, int, int) {
40 cout << "vorton non dege : not implemented" << endl ;
41 abort() ;
42 exit(-1) ;
43 return so;
44}
45
46 //-------------------
47 //-- R_CHEB ------
48 //-------------------
49
50Matrice _vorton_non_dege_r_cheb (const Matrice& source, int, int) {
51
52 int n = source.get_dim(0) ;
53 int non_dege = 2 ;
54
55 Matrice res(n-non_dege, n-non_dege) ;
56 res.set_etat_qcq() ;
57 for (int i=0 ; i<n-non_dege ; i++)
58 for (int j=0 ; j<n-non_dege ; j++)
59 res.set(i, j) = source(i, j+non_dege) ;
60
61 res.set_band (2,2) ;
62 res.set_lu() ;
63 return res ;
64}
65
66
67 //-------------------
68 //-- R_CHEBU -----
69 //-------------------
70Matrice _vorton_non_dege_r_chebu_trois (const Matrice &lap, int l) {
71
72 int n = lap.get_dim(0) ;
73 if (l==0) {
74 Matrice res(n-1, n-1) ;
75 res.set_etat_qcq() ;
76 for (int i=0 ; i<n-1 ; i++)
77 for (int j=0 ; j<n-1 ; j++)
78 res.set(i, j) = lap(i, j+1) ;
79 res.set_band(3, 0) ;
80 res.set_lu() ;
81 return res ;
82 }
83 else {
84 Matrice res(n-2, n-2) ;
85 res.set_etat_qcq() ;
86 for (int i=0 ;i<n-2 ; i++)
87 for (int j=0 ; j<n-2 ; j++)
88 res.set(i, j) = lap(i, j+2) ;
89
90 res.set_band(2, 1) ;
91 res.set_lu() ;
92 return res ;
93 }
94}
95
96Matrice _vorton_non_dege_r_chebu (const Matrice &lap, int l, int puis) {
97
98 switch (puis) {
99 case 3 :
100 return _vorton_non_dege_r_chebu_trois (lap, l) ;
101 default :
102 abort() ;
103 exit(-1) ;
104 return Matrice(0, 0) ;
105 }
106}
107
109 if (ope_cl == 0x0)
110 do_ope_cl() ;
111
112 if (non_dege != 0x0)
113 delete non_dege ;
114
115 // Routines de derivation
116 static Matrice (*vorton_non_dege[MAX_BASE])(const Matrice&, int, int);
117 static int nap = 0 ;
118
119 // Premier appel
120 if (nap==0) {
121 nap = 1 ;
122 for (int i=0 ; i<MAX_BASE ; i++) {
123 vorton_non_dege[i] = _vorton_non_dege_pas_prevu ;
124 }
125 // Les routines existantes
126 vorton_non_dege[R_CHEB >> TRA_R] = _vorton_non_dege_r_cheb ;
127 vorton_non_dege[R_CHEBU >> TRA_R] = _vorton_non_dege_r_chebu ;
128 }
130}
131}
Time evolution with partial storage (*** under development ***).
Definition evolution.h:371
Matrix handling.
Definition matrice.h:152
int get_dim(int i) const
Returns the dimension of the matrix.
Definition matrice.C:260
int base_r
Radial basis of decomposition.
Matrice * ope_cl
Pointer on the banded-matrix of the operator.
Matrice * non_dege
Pointer on the non-degenerated matrix of the operator.
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
int l_quant
quantum number
int dzpuis
the associated dzpuis, if in the compactified domain.
virtual void do_ope_cl() const
Computes the banded-matrix of the operator.
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEB
base de Chebychev ordinaire (fin)
Lorene prototypes.
Definition app_hor.h:64