LORENE
param_elliptic_pseudo_1d.C
1/*
2 * Copyright (c) 2004 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 param_elliptic_pseudo_1d_C[] = "$Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_pseudo_1d.C,v 1.3 2014/10/13 08:53:37 j_novak Exp $" ;
22
23/*
24 * $Id: param_elliptic_pseudo_1d.C,v 1.3 2014/10/13 08:53:37 j_novak Exp $
25 * $Log: param_elliptic_pseudo_1d.C,v $
26 * Revision 1.3 2014/10/13 08:53:37 j_novak
27 * Lorene classes and functions now belong to the namespace Lorene.
28 *
29 * Revision 1.2 2014/10/06 15:13:15 j_novak
30 * Modified #include directives to use c++ syntax.
31 *
32 * Revision 1.1 2004/08/24 09:14:49 p_grandclement
33 * Addition of some new operators, like Poisson in 2d... It now requieres the
34 * GSL library to work.
35 *
36 * Also, the way a variable change is stored by a Param_elliptic is changed and
37 * no longer uses Change_var but rather 2 Scalars. The codes using that feature
38 * will requiere some modification. (It should concern only the ones about monopoles)
39 *
40 *
41 * $Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_pseudo_1d.C,v 1.3 2014/10/13 08:53:37 j_novak Exp $
42 *
43 */
44
45#include "headcpp.h"
46
47#include <cmath>
48#include <cstdlib>
49
50#include "param_elliptic.h"
51#include "base_val.h"
52#include "map.h"
53#include "ope_elementary.h"
54#include "change_var.h"
55#include "scalar.h"
56
57
58namespace Lorene {
60
61 if (type_map != MAP_AFF) {
62 cout << "set_poisson_pseudo_1d only defined for an affine mapping..." << endl ;
63 abort() ;
64 }
65 else {
66
67 int nz = get_mp().get_mg()->get_nzone() ;
68
69 int nr ;
70 double alpha, beta ;
71 int m_quant, l_quant, base_r_1d ;
72
73 int conte = 0 ;
74 for (int l=0 ; l<nz ; l++) {
75
76 nr = get_mp().get_mg()->get_nr(l) ;
77 alpha = get_alpha (l) ;
78 beta = get_beta (l) ;
79
80 for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
81 for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
82 if (operateurs[conte] != 0x0)
83 delete operateurs[conte] ;
84 source.get_spectral_va().base.give_quant_numbers(l, k, j, m_quant, l_quant, base_r_1d) ;
85 if ((k!=1) && (l!=nz-1))
86 operateurs[conte] = new Ope_poisson_pseudo_1d (nr, base_r_1d, alpha, beta, l_quant) ;
87 else
88 operateurs[conte] = 0x0 ;
89 conte ++ ;
90 }
91 }
92 }
93}
94
96
97 int dzpuis = source.get_dzpuis() ;
98 assert (masse > 0) ;
99
100 if (type_map != MAP_AFF) {
101 cout << "set_helmholtz_minus_pseudo_1d only defined for an affine mapping..." << endl ;
102 abort() ;
103 }
104 else {
105
106 int nz = get_mp().get_mg()->get_nzone() ;
107 if (zone == nz-1)
108 source.check_dzpuis(2) ;
109 int nr ;
110 double alpha, beta ;
111 int m_quant, l_quant, base_r_1d ;
112
113 int conte = 0 ;
114 for (int l=0 ; l<nz ; l++) {
115
116 nr = get_mp().get_mg()->get_nr(l) ;
117 alpha = get_alpha (l) ;
118 beta = get_beta (l) ;
119
120 for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
121 for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
122 if (l==zone) {
123 if (operateurs[conte] != 0x0)
124 delete operateurs[conte] ;
125 source.get_spectral_va().base.give_quant_numbers
126 (l, k, j, m_quant, l_quant, base_r_1d) ;
128 alpha, beta, l_quant, masse, dzpuis) ;
129 }
130 conte ++ ;
131 }
132 }
133 }
134}
135
136}
Time evolution with partial storage (*** under development ***).
Definition evolution.h:371
Class for the operator of the modified Helmholtz equation in pseudo-1d.
Class for the operator of the Poisson equation in pseudo 1d.
const Map_radial & get_mp() const
Returns the mapping.
void set_poisson_pseudo_1d(Scalar &so)
Set the operator to everywhere but in the compactified domain.
void set_helmholtz_minus_pseudo_1d(int zone, double mas, Scalar &so)
Set the operator to in one domain.
Ope_elementary ** operateurs
Array on the elementary operators.
int type_map
Type of mapping either MAP_AFF or MAP_LOG.
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene prototypes.
Definition app_hor.h:64