| 1 |
/* |
| 2 |
* Copyright (c) 2000-2004 Jerome Novak |
| 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 as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* LORENE is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with LORENE; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
|
| 23 |
char map_af_dalembert_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_af_dalembert.C,v 1.18 2014/10/13 08:53:02 j_novak Exp $" ; |
| 24 |
|
| 25 |
/* |
| 26 |
* $Id: map_af_dalembert.C,v 1.18 2014/10/13 08:53:02 j_novak Exp $ |
| 27 |
* $Log: map_af_dalembert.C,v $ |
| 28 |
* Revision 1.18 2014/10/13 08:53:02 j_novak |
| 29 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 30 |
* |
| 31 |
* Revision 1.17 2014/10/06 15:13:11 j_novak |
| 32 |
* Modified #include directives to use c++ syntax. |
| 33 |
* |
| 34 |
* Revision 1.16 2008/08/27 08:55:31 jl_cornou |
| 35 |
* Added R_JACO02 case |
| 36 |
* |
| 37 |
* Revision 1.15 2007/11/06 14:42:20 j_novak |
| 38 |
* Copy of field at previous time-steps to local variables to deal with the |
| 39 |
* dzpuis. |
| 40 |
* |
| 41 |
* Revision 1.14 2006/08/31 08:56:37 j_novak |
| 42 |
* Added the possibility to have a shift in the quantum number l in the operator. |
| 43 |
* |
| 44 |
* Revision 1.13 2004/06/08 14:01:27 j_novak |
| 45 |
* *** empty log message *** |
| 46 |
* |
| 47 |
* Revision 1.11 2004/03/04 15:15:48 e_gourgoulhon |
| 48 |
* Treatment of case fj in state ETATZERO at the end. |
| 49 |
* |
| 50 |
* Revision 1.10 2004/03/01 13:30:28 j_novak |
| 51 |
* Corrected some errors |
| 52 |
* |
| 53 |
* Revision 1.9 2004/03/01 09:57:03 j_novak |
| 54 |
* the wave equation is solved with Scalars. It now accepts a grid with a |
| 55 |
* compactified external domain, which the solver ignores and where it copies |
| 56 |
* the values of the field from one time-step to the next. |
| 57 |
* |
| 58 |
* Revision 1.8 2003/07/22 13:24:48 j_novak |
| 59 |
* *** empty log message *** |
| 60 |
* |
| 61 |
* Revision 1.7 2003/06/20 10:08:12 j_novak |
| 62 |
* *** empty log message *** |
| 63 |
* |
| 64 |
* Revision 1.6 2003/06/20 09:27:10 j_novak |
| 65 |
* Modif commentaires. |
| 66 |
* |
| 67 |
* Revision 1.5 2003/06/19 16:16:38 j_novak |
| 68 |
* Parabolic approximation for a non flat dalembert operator |
| 69 |
* |
| 70 |
* Revision 1.4 2003/06/18 08:45:27 j_novak |
| 71 |
* In class Mg3d: added the member get_radial, returning only a radial grid |
| 72 |
* For dAlembert solver: the way the coefficients of the operator are defined has been changed. |
| 73 |
* |
| 74 |
* Revision 1.3 2002/01/03 15:30:28 j_novak |
| 75 |
* Some comments modified. |
| 76 |
* |
| 77 |
* Revision 1.2 2002/01/02 14:07:57 j_novak |
| 78 |
* Dalembert equation is now solved in the shells. However, the number of |
| 79 |
* points in theta and phi must be the same in each domain. The solver is not |
| 80 |
* completely tested (beta version!). |
| 81 |
* |
| 82 |
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon |
| 83 |
* LORENE |
| 84 |
* |
| 85 |
* Revision 1.7 2001/10/16 10:04:22 novak |
| 86 |
* cleaning (no more source terms for enhanced BC) |
| 87 |
* |
| 88 |
* Revision 1.6 2001/07/19 14:07:15 novak |
| 89 |
* tentative for new outgoing boundary condition |
| 90 |
* |
| 91 |
* Revision 1.5 2000/12/04 15:01:34 novak |
| 92 |
* *** empty log message *** |
| 93 |
* |
| 94 |
* Revision 1.4 2000/12/04 14:20:36 novak |
| 95 |
* odd case enabled |
| 96 |
* |
| 97 |
* Revision 1.3 2000/11/27 14:54:51 novak |
| 98 |
* 3D boundary conditions operational |
| 99 |
* |
| 100 |
* Revision 1.2 2000/10/24 16:18:34 novak |
| 101 |
* Outgoing wave boundary conditions and addition of the Tbl coeff |
| 102 |
* |
| 103 |
* Revision 1.1 2000/10/19 14:17:39 novak |
| 104 |
* Initial revision |
| 105 |
* |
| 106 |
* |
| 107 |
* $Header: /cvsroot/Lorene/C++/Source/Map/map_af_dalembert.C,v 1.18 2014/10/13 08:53:02 j_novak Exp $ |
| 108 |
* |
| 109 |
*/ |
| 110 |
//Header C++ |
| 111 |
#include <cmath> |
| 112 |
|
| 113 |
// Header Lorene: |
| 114 |
#include "tensor.h" |
| 115 |
#include "param.h" |
| 116 |
#include "proto.h" |
| 117 |
|
| 118 |
//************************************************************************** |
| 119 |
|
| 120 |
namespace Lorene { |
| 121 |
|
| 122 |
void Map_af::dalembert(Param& par, Scalar& fjp1, const Scalar& fj, const Scalar& fjm1, |
| 123 |
const Scalar& source) const { |
| 124 |
|
| 125 |
|
| 126 |
assert(source.get_etat() != ETATNONDEF) ; |
| 127 |
assert(source.get_mp().get_mg() == mg) ; |
| 128 |
assert(fj.get_etat() != ETATNONDEF) ; |
| 129 |
assert(fj.get_mp().get_mg() == mg) ; |
| 130 |
assert(fjm1.get_etat() != ETATNONDEF) ; |
| 131 |
assert(fjm1.get_mp().get_mg() == mg) ; |
| 132 |
assert(fjp1.get_mp().get_mg() == mg) ; |
| 133 |
|
| 134 |
assert(par.get_n_double() == 1) ; |
| 135 |
assert(par.get_n_int() >= 1) ; |
| 136 |
assert(par.get_n_int_mod() == 1) ; |
| 137 |
int& nap = par.get_int_mod() ; |
| 138 |
assert ((nap == 0) || (par.get_n_tbl_mod() > 1)) ; |
| 139 |
|
| 140 |
int nz = mg->get_nzone() ; |
| 141 |
bool ced = (mg->get_type_r(nz-1) == UNSURR) ; |
| 142 |
int nz0 = (ced ? nz - 1 : nz) ; |
| 143 |
double dt = par.get_double() ; |
| 144 |
|
| 145 |
Scalar fj_local = fj ; |
| 146 |
Scalar fjm1_local = fjm1 ; |
| 147 |
if (ced) { |
| 148 |
fj_local.annule_domain(nz-1) ; |
| 149 |
fjm1_local.annule_domain(nz-1) ; |
| 150 |
} |
| 151 |
Scalar sigma = 2*fj_local - fjm1_local ; // The source (first part) |
| 152 |
|
| 153 |
// Coefficients |
| 154 |
//------------- |
| 155 |
|
| 156 |
Tbl* coeff ; |
| 157 |
if (nap == 0) { |
| 158 |
coeff = new Tbl(12,nz); |
| 159 |
coeff->set_etat_qcq() ; |
| 160 |
par.add_tbl_mod(*coeff) ; |
| 161 |
} |
| 162 |
else |
| 163 |
coeff= &par.get_tbl_mod() ; |
| 164 |
Tbl a1(nz) ; a1 = 1 ; //Flat dalembertian |
| 165 |
Tbl a2(nz) ; a2 = 0 ; |
| 166 |
Tbl a3(nz) ; a3 = 0 ; |
| 167 |
|
| 168 |
if (par.get_n_tensor_mod() > 0) { // Metric in front of the dalembertian |
| 169 |
assert(par.get_n_tensor_mod() == 1) ; |
| 170 |
Scalar* metri = dynamic_cast<Scalar*>(&par.get_tensor_mod()) ; |
| 171 |
assert(metri != 0x0) ; |
| 172 |
assert (metri->get_etat() == ETATQCQ) ; |
| 173 |
|
| 174 |
const Map_af* tmap ; //Spherically symmetric grid and mapping |
| 175 |
if (nap == 0) { |
| 176 |
double* bornes = new double[nz+1] ; |
| 177 |
bornes[0] = beta[0] ; |
| 178 |
for (int i=0; i<nz; i++) bornes[i+1] = alpha[i] + beta[i] ; |
| 179 |
tmap = new Map_af(*mg->get_radial() , bornes) ; |
| 180 |
par.add_map(*tmap) ; |
| 181 |
delete [] bornes ; |
| 182 |
} |
| 183 |
else { |
| 184 |
tmap = dynamic_cast<const Map_af*>(&par.get_map()) ; |
| 185 |
assert (tmap != 0x0) ; |
| 186 |
} |
| 187 |
metri->set_spectral_va().ylm() ; |
| 188 |
|
| 189 |
Scalar xmetr(*tmap) ; // l=0 part of the potential in front of the Laplacian |
| 190 |
xmetr.set_etat_qcq() ; |
| 191 |
xmetr.std_spectral_base() ; |
| 192 |
xmetr.set_spectral_va().set_base_t(T_LEG_PP) ; // Only l=0 matters in any case... |
| 193 |
xmetr.set_spectral_va().set_etat_cf_qcq() ; |
| 194 |
Mtbl_cf* mt = xmetr.set_spectral_va().c_cf ; |
| 195 |
mt->annule_hard() ; |
| 196 |
for (int lz=0; lz<nz0; lz++) |
| 197 |
for (int ir=0; ir<mg->get_nr(lz); ir++) |
| 198 |
mt->set(lz,0,0,ir) = (*metri->get_spectral_va().c_cf)(lz, 0, 0, ir) ; //only l=0 |
| 199 |
|
| 200 |
if (mg->get_nt(0) != 1) xmetr = xmetr / sqrt(double(2)) ; //!!! |
| 201 |
xmetr.set_spectral_va().ylm_i() ; |
| 202 |
xmetr.set_spectral_va().coef_i() ; |
| 203 |
const Mtbl& erre = this->r ; |
| 204 |
|
| 205 |
a1.set_etat_qcq() ; |
| 206 |
a2.set_etat_qcq() ; |
| 207 |
a3.set_etat_qcq() ; |
| 208 |
Scalar mime(*this) ; |
| 209 |
mime.annule_hard() ; |
| 210 |
for (int lz=0; lz<nz0; lz++) { |
| 211 |
int nr = mg->get_nr(lz); |
| 212 |
double r1 = erre(lz, 0, 0, nr-1) ; |
| 213 |
double rm1 = erre(lz, 0, 0, 0) ; |
| 214 |
double x1 = xmetr.val_grid_point(lz, 0, 0, nr-1) ; |
| 215 |
double xm1 = xmetr.val_grid_point(lz, 0, 0, 0) ; |
| 216 |
|
| 217 |
if (mg->get_type_r(lz) == RARE) { //In the nucleus, no a2*r |
| 218 |
a1.set(lz) = xm1 ; |
| 219 |
a2.set(lz) = 0 ; |
| 220 |
a3.set(lz) = (x1 - a1(lz)) / (r1 * r1); |
| 221 |
} |
| 222 |
else { // In the shells, general case |
| 223 |
int i0 = (nr-1)/2 ; |
| 224 |
double r0 = erre(lz, 0, 0, i0) ; |
| 225 |
double x0 = xmetr.val_grid_point(lz, 0, 0, i0) ; |
| 226 |
double p1 = (r1 - rm1)*(r1 - r0) ; |
| 227 |
double pm1 = (r0 - rm1)*(r1 - rm1) ; |
| 228 |
double p0 = (r0 - rm1)*(r1 - r0) ; |
| 229 |
a1.set(lz) = xm1*r1*r0/pm1 + x1*rm1*r0/p1 - x0*rm1*r1/p0 ; |
| 230 |
a2.set(lz) = x0*(rm1 + r1)/p0 - xm1*(r1 + r0)/pm1 |
| 231 |
- x1*(rm1 + r0)/p1 ; |
| 232 |
a3.set(lz) = xm1/pm1+x1/p1-x0/p0 ; |
| 233 |
} |
| 234 |
|
| 235 |
for (int k=0; k<mg->get_np(lz)+2; k++) |
| 236 |
for (int j=0; j<mg->get_nt(lz); j++) |
| 237 |
for (int i=0; i<nr; i++) |
| 238 |
mime.set_grid_point(lz, k, j, i) = a1(lz) + erre(lz, 0, 0, i)* |
| 239 |
(a2(lz) + erre(lz, 0, 0, i)*a3(lz)) ; |
| 240 |
|
| 241 |
Tbl diff = metri->domain(lz) - mime.domain(lz) ; |
| 242 |
double offset = max(diff) ; // Not sure that this is really |
| 243 |
a1.set(lz) += offset ; // necessary (supposed to ensure stability). |
| 244 |
mime.set_domain(lz) += offset ; |
| 245 |
} |
| 246 |
|
| 247 |
Scalar reste = (*metri - mime)*fj_local.laplacian() ; |
| 248 |
if (ced) reste.annule_domain(nz-1) ; |
| 249 |
sigma += (dt*dt)*(source + reste) ; |
| 250 |
if (ced) sigma.annule_domain(nz-1) ; |
| 251 |
sigma += (0.5*dt*dt)*mime*fjm1_local.laplacian() ; //Source (2nd part) |
| 252 |
} |
| 253 |
else { |
| 254 |
sigma += (dt*dt) * source ; |
| 255 |
if (ced) sigma.annule_domain(nz-1) ; |
| 256 |
sigma += (0.5*dt*dt)*fjm1_local.laplacian() ; |
| 257 |
if (par.get_n_int() > 1) { //there is a shift in the quantum number l |
| 258 |
int dl = -1 ; |
| 259 |
int l_min = par.get_int(1) ; |
| 260 |
sigma.set_spectral_va().ylm() ; |
| 261 |
Scalar tmp = fjm1_local ; |
| 262 |
tmp.div_r() ; tmp.div_r() ; // f^(J-1) / r^2 |
| 263 |
tmp.set_spectral_va().ylm() ; |
| 264 |
const Base_val& base = tmp.get_spectral_base() ; |
| 265 |
int l_q, m_q, baser ; |
| 266 |
|
| 267 |
for (int lz=0; lz<nz-1; lz++) { |
| 268 |
int nt = mg->get_nt(lz) ; |
| 269 |
int np = mg->get_np(lz) ; |
| 270 |
for (int k=0; k<np+2; k++) |
| 271 |
for (int j=0; j<nt; j++) { |
| 272 |
base.give_quant_numbers(lz, k, j, m_q, l_q, baser) ; |
| 273 |
if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q+dl >= l_min) ) { |
| 274 |
for (int i=0; i<mg->get_nr(lz); i++) { |
| 275 |
sigma.set_spectral_va().c_cf->set(lz, k, j, i) -= |
| 276 |
0.5*dt*dt*dl*(2*l_q + dl +1) |
| 277 |
*(*tmp.get_spectral_va().c_cf)(lz, k, j, i) ; |
| 278 |
} |
| 279 |
} |
| 280 |
} |
| 281 |
} |
| 282 |
if (sigma.get_spectral_va().c != 0x0) { |
| 283 |
delete sigma.set_spectral_va().c ; |
| 284 |
sigma.set_spectral_va().c = 0x0 ; |
| 285 |
} |
| 286 |
} |
| 287 |
} |
| 288 |
if (ced) sigma.annule_domain(nz-1) ; |
| 289 |
|
| 290 |
//-------------------------------------------- |
| 291 |
// The operator reads |
| 292 |
// Id - 0.5dt^2*(a1 + a2 r + a3 r^2)Laplacian |
| 293 |
//-------------------------------------------- |
| 294 |
for (int i=0; i<nz; i++) { |
| 295 |
coeff->set(1,i) = a1(i) ; |
| 296 |
coeff->set(2,i) = a2(i) ; |
| 297 |
coeff->set(3,i) = a3(i) ; |
| 298 |
coeff->set(4,i) = 0. ; |
| 299 |
coeff->set(5,i) = 0. ; |
| 300 |
coeff->set(6,i) = 0. ; |
| 301 |
coeff->set(7,i) = 0. ; |
| 302 |
coeff->set(8,i) = 0. ; |
| 303 |
coeff->set(9,i) = 0. ; |
| 304 |
coeff->set(10,i) = beta[i] ; |
| 305 |
coeff->set(11,i) = alpha[i] ; |
| 306 |
} |
| 307 |
|
| 308 |
// Defining the boundary conditions |
| 309 |
// -------------------------------- |
| 310 |
double R = this->val_r(nz0-1, 1., 0., 0.) ; |
| 311 |
int nr = mg->get_nr(nz0-1) ; |
| 312 |
int nt = mg->get_nt(nz0-1) ; |
| 313 |
int np2 = mg->get_np(nz0-1) + 2; |
| 314 |
|
| 315 |
// For each pair of quantic numbers l, m one the result must satisfy |
| 316 |
// bc1 * f_{l,m} (R) + bc2 * f_{l,m}'(R) = tbc3_{l,m} |
| 317 |
// Memory is allocated for the parameter (par) at first call |
| 318 |
double* bc1 ; |
| 319 |
double* bc2 ; |
| 320 |
Tbl* tbc3 ; |
| 321 |
Tbl* phijm1 = 0x0 ; |
| 322 |
Tbl* phij = 0x0 ; |
| 323 |
if (nap == 0) { |
| 324 |
bc1 = new double ; |
| 325 |
bc2 = new double ; |
| 326 |
tbc3 = new Tbl(np2,nt) ; |
| 327 |
par.add_double_mod(*bc1,1) ; |
| 328 |
par.add_double_mod(*bc2,2) ; |
| 329 |
par.add_tbl_mod(*tbc3,1) ; |
| 330 |
// Hereafter the enhanced outgoing-wave condition needs 2 auxiliary |
| 331 |
// functions phij and phijm1 to define the evolution on the boundary |
| 332 |
// surface (outer sphere). |
| 333 |
if (par.get_int(0) == 2) { |
| 334 |
phijm1 = new Tbl(np2,nt) ; |
| 335 |
phij = new Tbl(np2,nt) ; |
| 336 |
par.add_tbl_mod(*phijm1,2) ; |
| 337 |
par.add_tbl_mod(*phij,3) ; |
| 338 |
phij->annule_hard() ; |
| 339 |
phijm1->annule_hard() ; |
| 340 |
} |
| 341 |
nap = 1 ; |
| 342 |
} |
| 343 |
else { |
| 344 |
bc1 = &par.get_double_mod(1) ; |
| 345 |
bc2 = &par.get_double_mod(2) ; |
| 346 |
tbc3 = &par.get_tbl_mod(1) ; |
| 347 |
if (par.get_int(0) == 2) { |
| 348 |
phijm1 = &par.get_tbl_mod(2) ; |
| 349 |
phij = &par.get_tbl_mod(3) ; |
| 350 |
} |
| 351 |
} |
| 352 |
switch (par.get_int(0)) { |
| 353 |
case 0: // Homogeneous boundary conditions (f(t,r=R) =0) |
| 354 |
*bc1 = 1 ; |
| 355 |
*bc2 = 0 ; |
| 356 |
|
| 357 |
*tbc3 = 0 ; |
| 358 |
|
| 359 |
break ; |
| 360 |
case 1: { // Outgoing wave condition (f(t,r) = 1/r S(t-r/c)) |
| 361 |
Valeur bound3(mg) ; |
| 362 |
bound3 = R*(4*fj_local.get_spectral_va() - fjm1_local.get_spectral_va()) ; |
| 363 |
if (bound3.get_etat() == ETATZERO) { |
| 364 |
*bc1 = 3*R + 2*dt ; |
| 365 |
*bc2 = 2*R*dt ; |
| 366 |
*tbc3 = 0 ; |
| 367 |
} |
| 368 |
else { |
| 369 |
if (nz0>1) bound3.annule(0,nz0-2) ; |
| 370 |
|
| 371 |
bound3.coef() ; |
| 372 |
bound3.ylm() ; |
| 373 |
|
| 374 |
*bc1 = 3*R + 2*dt ; |
| 375 |
*bc2 = 2*R*dt ; |
| 376 |
|
| 377 |
tbc3->set_etat_qcq() ; |
| 378 |
double val ; |
| 379 |
for (int k=0; k<np2; k++) |
| 380 |
for (int j=0; j<nt; j++) { |
| 381 |
val = 0. ; |
| 382 |
for (int i=0; i<nr; i++) |
| 383 |
val += (*bound3.c_cf)(nz0-1,k,j,i) ; |
| 384 |
tbc3->set(k,j) = val ; |
| 385 |
} |
| 386 |
} |
| 387 |
break ; |
| 388 |
} |
| 389 |
/****************************************************************** |
| 390 |
* Enhanced outgoing wave condition. |
| 391 |
* Time integration of the wave equation on the sphere for the |
| 392 |
* auxiliary function phij. |
| 393 |
*****************************************************************/ |
| 394 |
case 2: { |
| 395 |
Valeur souphi(mg) ; |
| 396 |
souphi = fj_local.get_spectral_va()/R - fj_local.dsdr().get_spectral_va() ; |
| 397 |
if (nz0>1) souphi.annule(0,nz0-2) ; |
| 398 |
souphi.coef() ; |
| 399 |
souphi.ylm() ; |
| 400 |
|
| 401 |
bool zero = (souphi.get_etat() == ETATZERO) ; |
| 402 |
if (zero) { |
| 403 |
Base_val base_ref(mg->std_base_scal()) ; //## Maybe not good... |
| 404 |
base_ref.dsdx() ; |
| 405 |
base_ref.ylm() ; |
| 406 |
souphi.set_base(base_ref) ; |
| 407 |
} |
| 408 |
|
| 409 |
int l_s, m_s, base_r ; |
| 410 |
double val ; |
| 411 |
int dl = (par.get_n_int() > 1) ? -1 : 0 ; |
| 412 |
for (int k=0; k<np2; k++) { |
| 413 |
for (int j=0; j<nt; j++) { |
| 414 |
donne_lm(nz, nz0-1, j, k, souphi.base, m_s, l_s, base_r) ; |
| 415 |
l_s += dl ; |
| 416 |
val = 0. ; |
| 417 |
if (!zero) |
| 418 |
val = -4*dt*dt*l_s*(l_s+1)*souphi.c_cf->val_out_bound_jk(nz0-1, j, k) ; |
| 419 |
double multi = 8*R*R + dt*dt*(6+3*l_s*(l_s+1)) + 12*R*dt ; |
| 420 |
val = ( 16*R*R*(*phij)(k,j) - |
| 421 |
(multi-24*R*dt)*(*phijm1)(k,j) |
| 422 |
+ val)/multi ; |
| 423 |
phijm1->set(k,j) = (*phij)(k,j) ; |
| 424 |
phij->set(k,j) = val ; |
| 425 |
} |
| 426 |
} |
| 427 |
Valeur bound3(mg) ; |
| 428 |
*bc1 = 3*R + 2*dt ; |
| 429 |
*bc2 = 2*R*dt ; |
| 430 |
bound3 = R*(4*fj_local.get_spectral_va() - fjm1_local.get_spectral_va()) ; |
| 431 |
if (bound3.get_etat() == ETATZERO) *tbc3 = 0 ; |
| 432 |
else { |
| 433 |
if (nz0 > 1) bound3.annule(0,nz0-2) ; |
| 434 |
bound3.coef() ; |
| 435 |
bound3.ylm() ; |
| 436 |
tbc3->set_etat_qcq() ; |
| 437 |
for (int k=0; k<np2; k++) |
| 438 |
for (int j=0; j<nt; j++) { |
| 439 |
val = 0. ; |
| 440 |
for (int i=0; i<nr; i++) |
| 441 |
val += (*bound3.c_cf)(nz0-1,k,j,i) ; |
| 442 |
tbc3->set(k,j) = val + 2*R*dt*(*phij)(k,j); |
| 443 |
} |
| 444 |
} |
| 445 |
break ; |
| 446 |
} |
| 447 |
default: |
| 448 |
cout << "ERROR: Map_af::dalembert" << endl ; |
| 449 |
cout << "The boundary condition par.get_int(0) = "<< par.get_int(0) |
| 450 |
<< " is unknown!" << endl ; |
| 451 |
abort() ; |
| 452 |
} |
| 453 |
|
| 454 |
if (sigma.get_etat() == ETATZERO) { |
| 455 |
fjp1.set_etat_zero() ; |
| 456 |
return ; |
| 457 |
} |
| 458 |
|
| 459 |
// Spherical harmonic expansion of the source |
| 460 |
// ------------------------------------------ |
| 461 |
Valeur& sourva = sigma.set_spectral_va() ; |
| 462 |
|
| 463 |
// Spectral coefficients of the source |
| 464 |
assert(sourva.get_etat() == ETATQCQ) ; |
| 465 |
sourva.ylm() ; // spherical harmonic transforms |
| 466 |
|
| 467 |
// Final result returned as a Scalar |
| 468 |
// ------------------------------ |
| 469 |
fjp1.set_etat_zero() ; // to call Scalar::del_t(). |
| 470 |
fjp1.set_etat_qcq() ; |
| 471 |
|
| 472 |
// Call to the Mtbl_cf version |
| 473 |
// --------------------------- |
| 474 |
fjp1.set_spectral_va() = sol_dalembert(par, *this, *(sourva.c_cf) ) ; |
| 475 |
fjp1.set_spectral_va().ylm_i() ; // Back to standard basis. |
| 476 |
|
| 477 |
if (ced) { |
| 478 |
if (fj.get_etat() == ETATZERO) { |
| 479 |
fjp1.annule_domain(nz-1) ; |
| 480 |
} |
| 481 |
else { |
| 482 |
fjp1.set_domain(nz-1) = fj.domain(nz-1) ; |
| 483 |
} |
| 484 |
fjp1.set_dzpuis(fj.get_dzpuis()) ; |
| 485 |
} |
| 486 |
} |
| 487 |
|
| 488 |
} |