LORENE
ope_pois_vect_r.C
1 /*
2  * Methods of class Ope_pois_vect_r
3  *
4  * (see file ope_elementary.h for documentation)
5  *
6  */
7 
8 /*
9  * Copyright (c) 2004 Jerome Novak
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License version 2
15  * as published by the Free Software Foundation.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 
30 /*
31  * $Id: ope_pois_vect_r.C,v 1.3 2016/12/05 16:18:12 j_novak Exp $
32  * $Log: ope_pois_vect_r.C,v $
33  * Revision 1.3 2016/12/05 16:18:12 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.2 2014/10/13 08:53:34 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.1 2004/05/10 15:28:22 j_novak
40  * First version of functions for the solution of the r-component of the
41  * vector Poisson equation.
42  *
43  *
44  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/ope_pois_vect_r.C,v 1.3 2016/12/05 16:18:12 j_novak Exp $
45  *
46  */
47 
48 #include"type_parite.h"
49 #include "ope_elementary.h"
50 
51 namespace Lorene {
52 Matrice ope_pvect_r_mat(int , int , double , int, int ) ;
53 Tbl sh_pvect_r(int, int, double, int) ;
54 Matrice cl_pvect_r (const Matrice&, int, double, int, int) ;
55 Matrice nondeg_pvect_r (const Matrice&, int, double, int, int) ;
56 Tbl val_solh (int, double, double, int) ;
57 
58 // Standard constructor :
59 Ope_pois_vect_r::Ope_pois_vect_r (int nbr, int baser, double alf, double bet, int lq, int dz):
60  Ope_poisson(nbr, baser, alf, bet, lq, dz)
61 {
62  assert (dzpuis == 4) ;
63 }
64 
65 // Constructor by copy :
67 {
68  assert (dzpuis == 4) ;
69 
70 }
71 
72 // Destructor :
74 
75 // True functions :
77  if (ope_mat != 0x0)
78  delete ope_mat ;
79 
80  ope_mat = new Matrice
81  (ope_pvect_r_mat(nr, l_quant, beta/alpha, dzpuis, base_r)) ;
82 }
83 
85  if (ope_mat == 0x0)
86  do_ope_mat() ;
87 
88  if (ope_cl != 0x0)
89  delete ope_cl ;
90 
91  ope_cl = new Matrice
92  (cl_pvect_r(*ope_mat, l_quant, beta/alpha, dzpuis, base_r)) ;
93 }
94 
96  if (ope_cl == 0x0)
97  do_ope_cl() ;
98 
99  if (non_dege != 0x0)
100  delete non_dege ;
101 
102  non_dege = new Matrice
103  (nondeg_pvect_r(*ope_cl, l_quant, beta/alpha, dzpuis, base_r)) ;
104 }
105 
107 
108  int l1 = ( (l_quant == 0) ? 1 : l_quant - 1 ) ;
109  int l2 = l_quant + 1 ;
110 
111  Tbl valeurs1 (val_solh (l1, alpha, beta, base_r)) ;
112  Tbl valeurs2 (val_solh (l2, alpha, beta, base_r)) ;
113 
114  assert (valeurs1.get_ndim() == valeurs2.get_ndim()) ;
115 
116  if (valeurs1.get_ndim() == 2) {
117  // cas 2 sh
118  s_one_plus = valeurs1(0,0) ;
119  s_one_minus = valeurs1(0,1) ;
120  ds_one_plus = valeurs1(0,2) ;
121  ds_one_minus = valeurs1(0,3) ;
122 
123  s_two_plus = valeurs2(1,0) ;
124  s_two_minus = valeurs2(1,1) ;
125  ds_two_plus = valeurs2(1,2) ;
126  ds_two_minus = valeurs2(1,3) ;
127  }
128  else {
129  // cas 1 sh :
130  Tbl& valeurs = (base_r == R_CHEBU) ? valeurs2 : valeurs1 ;
131  s_one_plus = valeurs(0) ;
132  s_one_minus = valeurs(1) ;
133  ds_one_plus = valeurs(2) ;
134  ds_one_minus = valeurs(3) ;
135  }
136 
137  return sh_pvect_r(nr, l_quant, beta/alpha, base_r) ;
138 }
139 
140 }
double alpha
Parameter of the associated mapping.
Matrice * ope_cl
Pointer on the banded-matrix of the operator.
double s_one_minus
Value of the first homogeneous solution at the inner boundary.
double ds_two_minus
Value of the derivative of the second homogeneous solution at the inner boundary. ...
double beta
Parameter of the associated mapping.
Lorene prototypes.
Definition: app_hor.h:67
Matrice * ope_mat
Pointer on the matrix representation of the operator.
double ds_two_plus
Value of the derivative of the second homogeneous solution at the outer boundary. ...
virtual void do_ope_mat() const
Computes the matrix of the operator.
int dzpuis
the associated dzpuis, if in the compactified domain.
int l_quant
quantum number
int base_r
Radial basis of decomposition.
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
Ope_pois_vect_r(int nbr, int baser, double alf, double bet, int lq, int dz)
Standard constructor.
double ds_one_plus
Value of the derivative of the first homogeneous solution at the outer boundary.
int get_ndim() const
Gives the number of dimensions (ie dim.ndim)
Definition: tbl.h:420
virtual Tbl get_solh() const
Computes the homogeneous solutions(s).
Matrix handling.
Definition: matrice.h:152
double s_two_minus
Value of the second homogeneous solution at the inner boundary.
Class for the operator of the Poisson equation (i.e.
Class for the operator of the r component of the vector Poisson equation.
double s_one_plus
Value of the first homogeneous solution at the outer boundary.
int nr
Number of radial points.
double ds_one_minus
Value of the derivative of the first homogeneous solution at the inner boundary.
Basic array class.
Definition: tbl.h:164
virtual ~Ope_pois_vect_r()
Destructor.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
Definition: type_parite.h:180
virtual void do_ope_cl() const
Computes the banded-matrix of the operator.
double s_two_plus
Value of the second homogeneous solution at the outer boundary.
Matrice * non_dege
Pointer on the non-degenerated matrix of the operator.