KADATH
space_bispheric.cpp
1 /*
2  Copyright 2017 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath 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 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath 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 Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "headcpp.hpp"
21 
22 #include "bispheric.hpp"
23 #include "scalar.hpp"
24 #include "tensor_impl.hpp"
25 #include "param.hpp"
26 #include "utilities.hpp"
27 namespace Kadath {
28 double eta_lim_chi (double chi, double rext, double a, double eta_c) ;
29 double chi_lim_eta (double chi, double rext, double a, double chi_c) ;
30 
31 double zerosec(double (*f)(double, const Param&), const Param& parf,
32  double x1, double x2, double precis, int nitermax, int& niter) ;
33 
34 
35 double func_a (double aa, const Param& par) {
36  double r1 = par.get_double(0) ;
37  double r2 = par.get_double(1) ;
38  double d = par.get_double(2) ;
39  return (sqrt(aa*aa+r1*r1)+sqrt(aa*aa+r2*r2)-d) ;
40 }
41 
42 Space_bispheric::Space_bispheric (int ttype, double distance, double r1, double r2, double rext, int nr) {
43 
44  // Verif :
45  ndim = 3 ;
46 
47  nbr_domains = 8 ;
48 
49  ndom_minus = 1 ;
50  ndom_plus = 1 ;
51  nshells = 0 ;
52 
53  type_base = ttype ;
54  domains = new Domain* [nbr_domains] ;
55 
56  Dim_array res (ndim) ;
57  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
58  Dim_array res_bi(ndim) ;
59  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
60 
61  // Bispheric :
62  // Computation of aa
63  Param par_a ;
64  par_a.add_double(r1,0) ;
65  par_a.add_double(r2,1) ;
66  par_a.add_double(distance,2) ;
67  double a_min = 0 ;
68  double a_max = distance/2. ;
69  double precis = PRECISION ;
70  int nitermax = 500 ;
71  int niter ;
72  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
73  double eta_plus = asinh(aa/r2) ;
74  double eta_minus = -asinh(aa/r1) ;
75 
76  double chi_c = 2*atan(aa/rext) ;
77  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
78  double eta_lim = eta_c/2. ;
79  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
80 
81  // The spheres
82  Point center (ndim) ;
83  center.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ; center.set(2) = 0 ; center.set(3) = 0 ;
84  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
85  domains[0] = new Domain_nucleus(0, ttype, r1, center, res) ;
86  center.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
87  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
88  domains[1] = new Domain_nucleus(1, ttype, r2, center, res) ;
89 
90  // Bispherical domains antitrigo order:
91  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rext, chi_lim, res_bi) ;
92  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, res_bi) ;
93  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rext, -eta_lim, eta_lim, res_bi) ;
94  domains[5] = new Domain_bispheric_rect(5, ttype, aa, rext, eta_plus, eta_lim, chi_lim, res_bi) ;
95  domains[6] = new Domain_bispheric_chi_first(6, ttype, aa, eta_plus, rext, chi_lim, res_bi) ;
96 
97  // ZEC
98  center.set(1) = 0 ;
99  domains[7] = new Domain_compact (7, ttype,rext, center, res) ;;
100 }
101 
102 Space_bispheric::Space_bispheric (int ttype, double distance, double r1, double r2, int nn, const Array<double>& rr, int nr) {
103 
104  // Verif :
105  ndim = 3 ;
106 
107 
108  ndom_minus = 1 ;
109  ndom_plus = 1 ;
110  nshells = nn ;
111 
112  nbr_domains = 8 + nshells ;
113 
114  type_base = ttype ;
115  domains = new Domain* [nbr_domains] ;
116 
117  Dim_array res (ndim) ;
118  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
119  Dim_array res_bi(ndim) ;
120  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
121 
122  // Bispheric :
123  // Computation of aa
124  Param par_a ;
125  par_a.add_double(r1,0) ;
126  par_a.add_double(r2,1) ;
127  par_a.add_double(distance,2) ;
128  double a_min = 0 ;
129  double a_max = distance/2. ;
130  double precis = PRECISION ;
131  int nitermax = 500 ;
132  int niter ;
133  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
134  double eta_plus = asinh(aa/r2) ;
135  double eta_minus = -asinh(aa/r1) ;
136 
137  double chi_c = 2*atan(aa/rr(0)) ;
138  double eta_c = log((1+rr(0)/aa)/(rr(0)/aa-1)) ;
139  double eta_lim = eta_c/2. ;
140  double chi_lim = chi_lim_eta (eta_lim, rr(0), aa, chi_c) ;
141 
142  // The spheres
143  Point center (ndim) ;
144  center.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ; center.set(2) = 0 ; center.set(3) = 0 ;
145  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
146  domains[0] = new Domain_nucleus(0, ttype, r1, center, res) ;
147  center.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
148  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
149  domains[1] = new Domain_nucleus(1, ttype, r2, center, res) ;
150 
151  // Bispherical domains antitrigo order:
152  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rr(0), chi_lim, res_bi) ;
153  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rr(0), eta_minus, -eta_lim, chi_lim, res_bi) ;
154  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rr(0), -eta_lim, eta_lim, res_bi) ;
155  domains[5] = new Domain_bispheric_rect(5, ttype, aa, rr(0), eta_plus, eta_lim, chi_lim, res_bi) ;
156  domains[6] = new Domain_bispheric_chi_first(6, ttype, aa, eta_plus, rr(0), chi_lim, res_bi) ;
157 
158  // Shells
159  center.set(1) = 0 ;
160  for (int i=0 ; i<nshells ; i++)
161  domains[7+i] = new Domain_shell (7+i, ttype, rr(i), rr(i+1), center, res) ;
162 
163  // ZEC
164  domains[7+nshells] = new Domain_compact (7+nshells, ttype,rr(nshells), center, res) ;
165 }
166 
167 Space_bispheric::Space_bispheric (int ttype, double distance, double r1, double r2, int nn, const Array<double>& rr, const Array<int>& type_r, int nr) {
168 
169  // Verif :
170  ndim = 3 ;
171 
172  ndom_minus = 1 ;
173  ndom_plus = 1 ;
174  nshells = nn ;
175 
176  nbr_domains = 8 + nshells ;
177  type_base = ttype ;
178  domains = new Domain* [nbr_domains] ;
179 
180  Dim_array res (ndim) ;
181  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
182  Dim_array res_bi(ndim) ;
183  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
184 
185  // Bispheric :
186  // Computation of aa
187  Param par_a ;
188  par_a.add_double(r1,0) ;
189  par_a.add_double(r2,1) ;
190  par_a.add_double(distance,2) ;
191  double a_min = 0 ;
192  double a_max = distance/2. ;
193  double precis = PRECISION ;
194  int nitermax = 500 ;
195  int niter ;
196  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
197  double eta_plus = asinh(aa/r2) ;
198  double eta_minus = -asinh(aa/r1) ;
199 
200  double chi_c = 2*atan(aa/rr(0)) ;
201  double eta_c = log((1+rr(0)/aa)/(rr(0)/aa-1)) ;
202  double eta_lim = eta_c/2. ;
203  double chi_lim = chi_lim_eta (eta_lim, rr(0), aa, chi_c) ;
204 
205  // The spheres
206  Point center (ndim) ;
207  center.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ; center.set(2) = 0 ; center.set(3) = 0 ;
208  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
209  domains[0] = new Domain_nucleus(0, ttype, r1, center, res) ;
210  center.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
211  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
212  domains[1] = new Domain_nucleus(1, ttype, r2, center, res) ;
213 
214  // Bispherical domains antitrigo order:
215  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rr(0), chi_lim, res_bi) ;
216  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rr(0), eta_minus, -eta_lim, chi_lim, res_bi) ;
217  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rr(0), -eta_lim, eta_lim, res_bi) ;
218  domains[5] = new Domain_bispheric_rect(5, ttype, aa, rr(0), eta_plus, eta_lim, chi_lim, res_bi) ;
219  domains[6] = new Domain_bispheric_chi_first(6, ttype, aa, eta_plus, rr(0), chi_lim, res_bi) ;
220 
221  // Shells
222  center.set(1) = 0 ;
223  for (int i=0 ; i<nshells ; i++) {
224  switch (type_r(i)) {
225  case STD_TYPE:
226  domains[7+i] = new Domain_shell (7+i,ttype, rr(i), rr(i+1), center, res) ;
227  break ;
228  case LOG_TYPE:
229  domains[7+i] = new Domain_shell_log (7+i,ttype, rr(i), rr(i+1), center, res) ;
230  break ;
231  case SURR_TYPE:
232  domains[7+i] = new Domain_shell_surr (7+i, ttype, rr(i), rr(i+1), center, res) ;
233  break ;
234  default:
235  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
236  abort() ;
237  }
238  }
239 
240  // ZEC
241  domains[7+nshells] = new Domain_compact (7+nshells, ttype,rr(nshells), center, res) ;
242 }
243 
244 Space_bispheric::Space_bispheric (int ttype, double distance, int nminus, const Array<double>& rminus, int nplus, const Array<double>& rplus, int nn, const Array<double>& rr, const Array<int>& type_r, int nr, bool withnuc) {
245 
246  // Verif :
247  ndim = 3 ;
248 
249  ndom_minus = nminus ;
250  ndom_plus = nplus ;
251  nshells = nn ;
252 
253  nbr_domains = (withnuc) ? ndom_minus + ndom_plus + nshells + 8 : ndom_minus + ndom_plus + nshells + 6 ;
254  type_base = ttype ;
255  domains = new Domain* [nbr_domains] ;
256 
257  Dim_array res (ndim) ;
258  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
259  Dim_array res_bi(ndim) ;
260  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
261 
262  // Bispheric :
263  // Computation of aa
264  double r1 = rminus(nminus) ;
265  double r2 = rplus(nplus) ;
266 
267  if (fabs(r1-r2)>1e-12) {
268  cerr << "Constructor of Space_bispheric not correct for different radii" << endl ;
269  abort() ;
270  }
271 
272  Param par_a ;
273  par_a.add_double(r1,0) ;
274  par_a.add_double(r2,1) ;
275  par_a.add_double(distance,2) ;
276  double a_min = 0 ;
277  double a_max = distance/2. ;
278  double precis = PRECISION ;
279  int nitermax = 500 ;
280  int niter ;
281  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
282  double eta_plus = asinh(aa/r2) ;
283  double eta_minus = -asinh(aa/r1) ;
284 
285  double chi_c = 2*atan(aa/rr(0)) ;
286  double eta_c = log((1+rr(0)/aa)/(rr(0)/aa-1)) ;
287  double eta_lim = eta_c/2. ;
288  double chi_lim = chi_lim_eta (eta_lim, rr(0), aa, chi_c) ;
289 
290  // The spheres
291  int current = 0 ;
292  Point center_minus (ndim) ;
293  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
294  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
295  if (withnuc) {
296  domains[current] = new Domain_nucleus(current, ttype, rminus(0), center_minus, res) ;
297  current ++ ;
298  }
299 
300  for (int i=0 ; i<ndom_minus ; i++) {
301  domains[current] = new Domain_shell(current, ttype, rminus(i), rminus(i+1), center_minus, res) ;
302  current ++ ;
303  }
304 
305  Point center_plus (ndim) ;
306  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
307  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
308  if (withnuc) {
309  domains[current] = new Domain_nucleus(current, ttype, rplus(0), center_plus, res) ;
310  current ++ ;
311  }
312 
313  for (int i=0 ; i<ndom_plus ; i++) {
314  domains[current] = new Domain_shell(current, ttype, rplus(i), rplus(i+1), center_plus, res) ;
315  current ++ ;
316  }
317 
318  // Bispherical domains antitrigo order:
319  domains[current] = new Domain_bispheric_chi_first(current, ttype, aa, eta_minus, rr(0), chi_lim, res_bi) ;
320  domains[current+1] = new Domain_bispheric_rect(current+1, ttype, aa, rr(0), eta_minus, -eta_lim, chi_lim, res_bi) ;
321  domains[current+2] = new Domain_bispheric_eta_first(current+2, ttype, aa, rr(0), -eta_lim, eta_lim, res_bi) ;
322  domains[current+3] = new Domain_bispheric_rect(current+3,ttype, aa, rr(0), eta_plus, eta_lim, chi_lim, res_bi) ;
323  domains[current+4] = new Domain_bispheric_chi_first(current+4,ttype, aa, eta_plus, rr(0), chi_lim, res_bi) ;
324  current += 5 ;
325  // Shells
326  Point center(3) ;
327  for (int i=0 ; i<nshells ; i++) {
328  switch (type_r(i)) {
329  case STD_TYPE:
330  domains[current] = new Domain_shell (current, ttype, rr(i), rr(i+1), center, res) ;
331  current ++ ;
332  break ;
333  case LOG_TYPE:
334  domains[current] = new Domain_shell_log (current, ttype, rr(i), rr(i+1), center, res) ;
335  current ++ ;
336  break ;
337  case SURR_TYPE:
338  domains[current] = new Domain_shell_surr (current, ttype, rr(i), rr(i+1), center, res) ;
339  current ++ ;
340  break ;
341  default:
342  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
343  abort() ;
344  }
345  }
346 
347  // ZEC
348  domains[current] = new Domain_compact (current, ttype,rr(nshells), center, res) ;
349 }
350 
351 Space_bispheric::Space_bispheric (int ttype, double distance, int nminus, const Array<double>& rminus, const Array<int>& type_r_minus, int nplus, const Array<double>& rplus, const Array<int>& type_r_plus, int nn, const Array<double>& rr, const Array<int>& type_r, int nr, bool withnuc) {
352 
353  // Verif :
354  ndim = 3 ;
355 
356  ndom_minus = nminus ;
357  ndom_plus = nplus ;
358  nshells = nn ;
359 
360  nbr_domains = (withnuc) ? ndom_minus + ndom_plus + nshells + 8 : ndom_minus + ndom_plus + nshells + 6 ;
361  type_base = ttype ;
362  domains = new Domain* [nbr_domains] ;
363 
364  Dim_array res (ndim) ;
365  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
366  Dim_array res_bi(ndim) ;
367  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
368 
369  // Bispheric :
370  // Computation of aa
371  double r1 = rminus(nminus) ;
372  double r2 = rplus(nplus) ;
373 
374  if (fabs(r1-r2)>1e-12) {
375  cerr << "Constructor of Space_bispheric not correct for different radii" << endl ;
376  abort() ;
377  }
378 
379  Param par_a ;
380  par_a.add_double(r1,0) ;
381  par_a.add_double(r2,1) ;
382  par_a.add_double(distance,2) ;
383  double a_min = 0 ;
384  double a_max = distance/2. ;
385  double precis = PRECISION ;
386  int nitermax = 500 ;
387  int niter ;
388  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
389  double eta_plus = asinh(aa/r2) ;
390  double eta_minus = -asinh(aa/r1) ;
391 
392  double chi_c = 2*atan(aa/rr(0)) ;
393  double eta_c = log((1+rr(0)/aa)/(rr(0)/aa-1)) ;
394  double eta_lim = eta_c/2. ;
395  double chi_lim = chi_lim_eta (eta_lim, rr(0), aa, chi_c) ;
396 
397  // The spheres
398  int current = 0 ;
399  Point center_minus (ndim) ;
400  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
401  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
402  if (withnuc) {
403  domains[current] = new Domain_nucleus(current, ttype, rminus(0), center_minus, res) ;
404  current ++ ;
405  }
406 
407  for (int i=0 ; i<ndom_minus ; i++) {
408  switch (type_r_minus(i)) {
409  case STD_TYPE:
410  domains[current] = new Domain_shell (current, ttype, rminus(i), rminus(i+1), center_minus, res) ;
411  current ++ ;
412  break ;
413  case LOG_TYPE:
414  domains[current] = new Domain_shell_log (current, ttype, rminus(i), rminus(i+1), center_minus, res) ;
415  current ++ ;
416  break ;
417  case SURR_TYPE:
418  domains[current] = new Domain_shell_surr (current, ttype, rminus(i), rminus(i+1), center_minus, res) ;
419  current ++ ;
420  break ;
421  default:
422  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
423  abort() ;
424  }
425 
426  }
427 
428  Point center_plus (ndim) ;
429  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
430  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
431  if (withnuc) {
432  domains[current] = new Domain_nucleus(current, ttype, rplus(0), center_plus, res) ;
433  current ++ ;
434  }
435 
436  for (int i=0 ; i<ndom_plus ; i++) {
437  switch (type_r_minus(i)) {
438  case STD_TYPE:
439  domains[current] = new Domain_shell (current, ttype, rplus(i), rplus(i+1), center_plus, res) ;
440  current ++ ;
441  break ;
442  case LOG_TYPE:
443  domains[current] = new Domain_shell_log (current, ttype, rplus(i), rplus(i+1), center_plus, res) ;
444  current ++ ;
445  break ;
446  case SURR_TYPE:
447  domains[current] = new Domain_shell_surr (current, ttype, rplus(i), rplus(i+1), center_plus, res) ;
448  current ++ ;
449  break ;
450  default:
451  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
452  abort() ;
453  }
454  }
455 
456 
457  // Bispherical domains antitrigo order:
458  domains[current] = new Domain_bispheric_chi_first(current, ttype, aa, eta_minus, rr(0), chi_lim, res_bi) ;
459  domains[current+1] = new Domain_bispheric_rect(current+1, ttype, aa, rr(0), eta_minus, -eta_lim, chi_lim, res_bi) ;
460  domains[current+2] = new Domain_bispheric_eta_first(current+2, ttype, aa, rr(0), -eta_lim, eta_lim, res_bi) ;
461  domains[current+3] = new Domain_bispheric_rect(current+3,ttype, aa, rr(0), eta_plus, eta_lim, chi_lim, res_bi) ;
462  domains[current+4] = new Domain_bispheric_chi_first(current+4,ttype, aa, eta_plus, rr(0), chi_lim, res_bi) ;
463  current += 5 ;
464  // Shells
465  Point center(3) ;
466  for (int i=0 ; i<nshells ; i++) {
467  switch (type_r(i)) {
468  case STD_TYPE:
469  domains[current] = new Domain_shell (current, ttype, rr(i), rr(i+1), center, res) ;
470  current ++ ;
471  break ;
472  case LOG_TYPE:
473  domains[current] = new Domain_shell_log (current, ttype, rr(i), rr(i+1), center, res) ;
474  current ++ ;
475  break ;
476  case SURR_TYPE:
477  domains[current] = new Domain_shell_surr (current, ttype, rr(i), rr(i+1), center, res) ;
478  current ++ ;
479  break ;
480  default:
481  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
482  abort() ;
483  }
484  }
485 
486  // ZEC
487  domains[current] = new Domain_compact (current, ttype,rr(nshells), center, res) ;
488 }
489 
490 Space_bispheric::Space_bispheric (int ttype, double distance, double rhor1, double rshell1, double rhor2, double rshell2, double rext, int nr) {
491 
492  // Verif :
493  ndim = 3 ;
494 
495  ndom_minus = 1 ;
496  ndom_plus = 1 ;
497  nshells = 0 ;
498 
499  nbr_domains =8 ;
500  type_base = ttype ;
501  domains = new Domain* [nbr_domains] ;
502 
503  Dim_array res (ndim) ;
504  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
505  Dim_array res_bi(ndim) ;
506  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
507 
508  // Bispheric :
509  // Computation of aa
510  double r1 = rshell1 ;
511  double r2 = rshell2 ;
512 
513  Param par_a ;
514  par_a.add_double(r1,0) ;
515  par_a.add_double(r2,1) ;
516  par_a.add_double(distance,2) ;
517  double a_min = 0 ;
518  double a_max = distance/2. ;
519  double precis = PRECISION ;
520  int nitermax = 500 ;
521  int niter ;
522  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
523  double eta_plus = asinh(aa/r2) ;
524  double eta_minus = -asinh(aa/r1) ;
525 
526  double chi_c = 2*atan(aa/rext) ;
527  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
528  double eta_lim = eta_c/2. ;
529  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
530 
531  // The spheres
532  Point center_minus (ndim) ;
533  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
534  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
535 
536  Point center_plus (ndim) ;
537  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
538  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
539 
540  domains[0] = new Domain_shell(0, ttype, rhor1, rshell1, center_minus, res) ;
541  domains[1] = new Domain_shell(1, ttype, rhor2, rshell2, center_plus, res) ;
542 
543  // Bispherical domains antitrigo order:
544  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rext, chi_lim, res_bi) ;
545  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, res_bi) ;
546  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rext, -eta_lim, eta_lim, res_bi) ;
547  domains[5] = new Domain_bispheric_rect(5,ttype, aa, rext, eta_plus, eta_lim, chi_lim, res_bi) ;
548  domains[6] = new Domain_bispheric_chi_first(6,ttype, aa, eta_plus, rext, chi_lim, res_bi) ;
549 
550  // Shells
551  Point center(3) ;
552  domains[7] = new Domain_compact (7, ttype, rext, center, res) ;
553 }
554 
555 
556 Space_bispheric::Space_bispheric (int ttype, double distance, double rhor1, double rshell1, double rhor2, double rshell2, double rext, Dim_array** resol) {
557 
558  // Verif :
559  ndim = 3 ;
560 
561  ndom_minus = 1 ;
562  ndom_plus = 1 ;
563  nshells = 0 ;
564 
565  nbr_domains =8 ;
566  type_base = ttype ;
567  domains = new Domain* [nbr_domains] ;
568 
569  // Bispheric :
570  // Computation of aa
571  double r1 = rshell1 ;
572  double r2 = rshell2 ;
573 
574  Param par_a ;
575  par_a.add_double(r1,0) ;
576  par_a.add_double(r2,1) ;
577  par_a.add_double(distance,2) ;
578  double a_min = 0 ;
579  double a_max = distance/2. ;
580  double precis = PRECISION ;
581  int nitermax = 500 ;
582  int niter ;
583  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
584  double eta_plus = asinh(aa/r2) ;
585  double eta_minus = -asinh(aa/r1) ;
586 
587  double chi_c = 2*atan(aa/rext) ;
588  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
589  double eta_lim = eta_c/2. ;
590  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
591 
592  // The spheres
593  Point center_minus (ndim) ;
594  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
595  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
596 
597  Point center_plus (ndim) ;
598  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
599  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
600 
601  domains[0] = new Domain_shell(0, ttype, rhor1, rshell1, center_minus, *resol[0]) ;
602  domains[1] = new Domain_shell(1, ttype, rhor2, rshell2, center_plus, *resol[1]) ;
603 
604  // Bispherical domains antitrigo order:
605  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rext, chi_lim, *resol[2]) ;
606  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, *resol[3]) ;
607  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rext, -eta_lim, eta_lim, *resol[4]) ;
608  domains[5] = new Domain_bispheric_rect(5,ttype, aa, rext, eta_plus, eta_lim, chi_lim, *resol[5]) ;
609  domains[6] = new Domain_bispheric_chi_first(6,ttype, aa, eta_plus, rext, chi_lim, *resol[6]) ;
610 
611  // Shells
612  Point center(3) ;
613  domains[7] = new Domain_compact (7, ttype, rext, center, *resol[7]) ;
614 }
615 
616 Space_bispheric::Space_bispheric (int ttype, double distance, double rhor1, double rshell1, double rhor2, double rshell2, int nn, const Array<double>& rr, int nr) {
617 
618  // Verif :
619  ndim = 3 ;
620 
621  ndom_minus = 1 ;
622  ndom_plus = 1 ;
623  nshells = nn ;
624 
625  nbr_domains =8+nn ;
626  type_base = ttype ;
627  domains = new Domain* [nbr_domains] ;
628 
629  Dim_array res (ndim) ;
630  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
631  Dim_array res_bi(ndim) ;
632  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
633 
634  // Bispheric :
635  // Computation of aa
636  double r1 = rshell1 ;
637  double r2 = rshell2 ;
638 
639  double rext = rr(0) ;
640 
641  Param par_a ;
642  par_a.add_double(r1,0) ;
643  par_a.add_double(r2,1) ;
644  par_a.add_double(distance,2) ;
645  double a_min = 0 ;
646  double a_max = distance/2. ;
647  double precis = PRECISION ;
648  int nitermax = 500 ;
649  int niter ;
650  double aa = zerosec(func_a, par_a, a_min, a_max, precis, nitermax, niter) ;
651  double eta_plus = asinh(aa/r2) ;
652  double eta_minus = -asinh(aa/r1) ;
653 
654  double chi_c = 2*atan(aa/rext) ;
655  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
656  double eta_lim = eta_c/2. ;
657  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
658 
659  // The spheres
660  Point center_minus (ndim) ;
661  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
662  a_minus = aa*cosh(eta_minus)/sinh(eta_minus) ;
663 
664  Point center_plus (ndim) ;
665  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
666  a_plus = aa*cosh(eta_plus)/sinh(eta_plus) ;
667 
668  domains[0] = new Domain_shell(0, ttype, rhor1, rshell1, center_minus, res) ;
669  domains[1] = new Domain_shell(1, ttype, rhor2, rshell2, center_plus, res) ;
670 
671  // Bispherical domains antitrigo order:
672  domains[2] = new Domain_bispheric_chi_first(2, ttype, aa, eta_minus, rext, chi_lim, res_bi) ;
673  domains[3] = new Domain_bispheric_rect(3, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, res_bi) ;
674  domains[4] = new Domain_bispheric_eta_first(4, ttype, aa, rext, -eta_lim, eta_lim, res_bi) ;
675  domains[5] = new Domain_bispheric_rect(5,ttype, aa, rext, eta_plus, eta_lim, chi_lim, res_bi) ;
676  domains[6] = new Domain_bispheric_chi_first(6,ttype, aa, eta_plus, rext, chi_lim, res_bi) ;
677 
678  // Shells
679  Point center(3) ;
680  for (int i=0 ; i<nn ; i++)
681  domains[7+i] = new Domain_shell (7+i, ttype, rr(i), rr(i+1), center, res) ;
682  domains[7+nn] = new Domain_compact (7+nn, ttype, rr(nn), center, res) ;
683 }
684 
685 Space_bispheric::Space_bispheric (FILE*fd, int type_shells, bool old) {
686 
687  fread_be (&nbr_domains, sizeof(int), 1, fd) ;
688  fread_be (&ndim, sizeof(int), 1, fd) ;
689  fread_be (&type_base, sizeof(int), 1, fd) ;
690  fread_be (&a_minus, sizeof(double), 1, fd) ;
691  fread_be (&a_plus, sizeof(double), 1, fd) ;
692 
693  if (!old) {
694  fread_be (&ndom_minus, sizeof(int), 1, fd) ;
695  fread_be (&ndom_plus, sizeof(int), 1, fd) ;
696  fread_be (&nshells, sizeof(int), 1, fd) ;
697  }
698  else {
699  ndom_minus = 1 ;
700  ndom_plus = 1 ;
701  nshells = nbr_domains-8 ;
702  }
703 
704  // Check whether one has nucleii or not
705  double nnuc = nbr_domains - 1 - nshells - ndom_minus - ndom_plus - 5;
706  bool nucleus = (nnuc>=2) ? true : false ;
707 
708  domains = new Domain* [nbr_domains] ;
709 
710  int current = 0 ;
711  if (nucleus) {
712  domains[current] = new Domain_nucleus(current, fd) ;
713  current ++ ;
714  }
715 
716  for (int i=0 ; i<ndom_minus ; i++) {
717  domains[current] = new Domain_shell(current, fd) ;
718  current ++ ;
719  }
720 
721  if (nucleus) {
722  domains[current] = new Domain_nucleus(current, fd) ;
723  current ++ ;
724  }
725 
726  for (int i=0 ; i<ndom_plus ; i++) {
727  domains[current] = new Domain_shell(current, fd) ;
728  current ++ ;
729  }
730 
731  // Bispherical domains antitrigo order:
732  domains[current] = new Domain_bispheric_chi_first(current, fd) ;
733  current ++ ;
734  domains[current] = new Domain_bispheric_rect(current, fd) ;
735  current ++ ;
736  domains[current] = new Domain_bispheric_eta_first(current, fd) ;
737  current ++ ;
738  domains[current] = new Domain_bispheric_rect(current, fd) ;
739  current ++ ;
740  domains[current] = new Domain_bispheric_chi_first(current, fd) ;
741  current ++ ;
742 
743  // Shells :
744  for (int i=0 ; i<nshells ; i++)
745  switch (type_shells) {
746  case STD_TYPE :
747  domains[current] = new Domain_shell(current, fd) ;
748  current ++ ;
749  break ;
750  case LOG_TYPE :
751  domains[current] = new Domain_shell_log(current, fd) ;
752  current ++ ;
753  break ;
754  case SURR_TYPE :
755  domains[current] = new Domain_shell_surr(current, fd) ;
756  current ++ ;
757  break ;
758  default:
759  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
760  abort() ;
761  }
762 
763  // Compact
764  domains[current] = new Domain_compact(current, fd) ;
765  current ++ ;
766 }
767 
768 Space_bispheric::Space_bispheric (FILE*fd, int type_minus, int type_plus, int type_shells) {
769 
770  fread_be (&nbr_domains, sizeof(int), 1, fd) ;
771  fread_be (&ndim, sizeof(int), 1, fd) ;
772  fread_be (&type_base, sizeof(int), 1, fd) ;
773  fread_be (&a_minus, sizeof(double), 1, fd) ;
774  fread_be (&a_plus, sizeof(double), 1, fd) ;
775 
776  fread_be (&ndom_minus, sizeof(int), 1, fd) ;
777  fread_be (&ndom_plus, sizeof(int), 1, fd) ;
778  fread_be (&nshells, sizeof(int), 1, fd) ;
779 
780  // Check whether one has nucleii or not
781  double nnuc = nbr_domains - 1 - nshells - ndom_minus - ndom_plus - 5;
782  bool nucleus = (nnuc>=2) ? true : false ;
783 
784  domains = new Domain* [nbr_domains] ;
785 
786  int current = 0 ;
787  if (nucleus) {
788  domains[current] = new Domain_nucleus(current, fd) ;
789  current ++ ;
790  }
791 
792  for (int i=0 ; i<ndom_minus ; i++)
793  switch (type_minus) {
794  case STD_TYPE :
795  domains[current] = new Domain_shell(current, fd) ;
796  current ++ ;
797  break ;
798  case LOG_TYPE :
799  domains[current] = new Domain_shell_log(current, fd) ;
800  current ++ ;
801  break ;
802  case SURR_TYPE :
803  domains[current] = new Domain_shell_surr(current, fd) ;
804  current ++ ;
805  break ;
806  default:
807  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
808  abort() ;
809  }
810 
811 
812 
813  if (nucleus) {
814  domains[current] = new Domain_nucleus(current, fd) ;
815  current ++ ;
816  }
817 
818  for (int i=0 ; i<ndom_plus ; i++)
819  switch (type_plus) {
820  case STD_TYPE :
821  domains[current] = new Domain_shell(current, fd) ;
822  current ++ ;
823  break ;
824  case LOG_TYPE :
825  domains[current] = new Domain_shell_log(current, fd) ;
826  current ++ ;
827  break ;
828  case SURR_TYPE :
829  domains[current] = new Domain_shell_surr(current, fd) ;
830  current ++ ;
831  break ;
832  default:
833  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
834  abort() ;
835  }
836 
837  // Bispherical domains antitrigo order:
838  domains[current] = new Domain_bispheric_chi_first(current, fd) ;
839  current ++ ;
840  domains[current] = new Domain_bispheric_rect(current, fd) ;
841  current ++ ;
842  domains[current] = new Domain_bispheric_eta_first(current, fd) ;
843  current ++ ;
844  domains[current] = new Domain_bispheric_rect(current, fd) ;
845  current ++ ;
846  domains[current] = new Domain_bispheric_chi_first(current, fd) ;
847  current ++ ;
848 
849  // Shells :
850  for (int i=0 ; i<nshells ; i++)
851  switch (type_shells) {
852  case STD_TYPE :
853  domains[current] = new Domain_shell(current, fd) ;
854  current ++ ;
855  break ;
856  case LOG_TYPE :
857  domains[current] = new Domain_shell_log(current, fd) ;
858  current ++ ;
859  break ;
860  case SURR_TYPE :
861  domains[current] = new Domain_shell_surr(current, fd) ;
862  current ++ ;
863  break ;
864  default:
865  cerr << "Unknown type of shells in Space_bishperic constructor" << endl ;
866  abort() ;
867  }
868 
869  // Compact
870  domains[current] = new Domain_compact(current, fd) ;
871  current ++ ;
872 }
873 
875 {
876 }
877 
878 
879 void Space_bispheric::save (FILE* fd) const {
880  fwrite_be (&nbr_domains, sizeof(int), 1, fd) ;
881  fwrite_be (&ndim, sizeof(int), 1, fd) ;
882  fwrite_be (&type_base, sizeof(int), 1, fd) ;
883  fwrite_be (&a_minus, sizeof(double), 1, fd) ;
884  fwrite_be (&a_plus, sizeof(double), 1, fd) ;
885  fwrite_be (&ndom_minus, sizeof(int), 1, fd) ;
886  fwrite_be (&ndom_plus, sizeof(int), 1, fd) ;
887  fwrite_be (&nshells, sizeof(int), 1, fd) ;
888  for (int i=0 ; i<nbr_domains ; i++)
889  domains[i]->save(fd) ;
890 }
891 
893 
894  if (dom==ndom_minus-1) {
895  // First sphere ;
896  Array<int> res (2,2) ;
897  switch (bound) {
898  case OUTER_BC :
899  res.set(0,0) = ndom_minus+ndom_plus ; // Matching with chi first
900  res.set(1,0) = INNER_BC ;
901  res.set(0,1) = ndom_minus+ndom_plus+1 ; // Matching with rect
902  res.set(1,1) = INNER_BC ;
903  break ;
904  default :
905  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ;
906  abort() ;
907  }
908  return res ;
909  }
910 
911  if (dom== ndom_minus+ndom_plus-1) {
912  // second sphere ;
913  Array<int> res(2, 2) ;
914  switch (bound) {
915  case OUTER_BC :
916  res.set(0,0) = ndom_minus+ndom_plus+3 ; // Matching with rect
917  res.set(1,0) = INNER_BC ;
918  res.set(0,1) = ndom_minus+ndom_plus+4 ; // Matching with chi_first
919  res.set(1,1) = INNER_BC ;
920  break ;
921  default :
922  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ; abort() ;
923  }
924  return res ;
925  }
926 
927  if (dom== ndom_minus+ndom_plus) {
928  // first chi first :
929  Array<int> res(2,1) ;
930  switch (bound) {
931  case INNER_BC :
932  res.set(0,0) = ndom_minus-1 ; // First sphere
933  res.set(1,0) = OUTER_BC ;
934  break ;
935  case OUTER_BC :
936  res.set(0,0) = ndom_minus+ndom_plus+5 ; // Compactified domain or first shell
937  res.set(1,0) = INNER_BC ;
938  break ;
939  default :
940  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ; abort() ;
941  }
942  return res ;
943  }
944 
945  if (dom==ndom_minus+ndom_plus+1) {
946  // first rect :
947  Array<int> res(2, 1) ;
948  switch (bound) {
949  case INNER_BC :
950  res.set(0,0) = ndom_minus-1 ; // First sphere
951  res.set(1,0) = OUTER_BC ;
952  break ;
953  case OUTER_BC :
954  res.set(0,0) = ndom_minus+ndom_plus+5 ; // Compactified domain or first shell
955  res.set(1,0) = INNER_BC ;
956  break ;
957  default :
958  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ; abort() ;
959  }
960  return res ;
961  }
962 
963 
964  if (dom==ndom_plus+ndom_minus+2) {
965  // eta first
966  Array<int> res(2, 1) ;
967  switch (bound) {
968  case OUTER_BC :
969  res.set(0, 0) = ndom_minus+ndom_plus+5 ; // Compactified domain or first shell
970  res.set(1, 0) = INNER_BC ;
971  break ;
972  default :
973  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ; abort() ;
974  }
975  return res ;
976  }
977 
978  if (dom==ndom_minus+ndom_plus+3) {
979  // second rect :
980  Array<int> res(2, 1) ;
981  switch (bound) {
982  case INNER_BC :
983  res.set(0, 0) = ndom_minus+ndom_plus-1 ; // Second sphere
984  res.set(1, 0) = OUTER_BC ;
985  break ;
986  case OUTER_BC :
987  res.set(0, 0) = ndom_minus+ndom_plus+5 ; // Compactified domain or first shell
988  res.set(1, 0) = INNER_BC ;
989  break ;
990  default :
991  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ; abort() ;
992  }
993  return res ;
994  }
995 
996  if (dom==ndom_minus+ndom_plus+4) {
997  // second chi first :
998  Array<int> res(2, 1) ;
999  switch (bound) {
1000  case INNER_BC :
1001  res.set(0,0) = ndom_minus+ndom_plus-1 ; // second nucleus
1002  res.set(1,0) = OUTER_BC ;
1003  break ;
1004  case OUTER_BC :
1005  res.set(0,0) = ndom_minus+ndom_plus+5 ; // Compactified domain or first shell
1006  res.set(1,0) = INNER_BC ;
1007  break ;
1008  default :
1009  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ;
1010  abort() ;
1011  }
1012  return res ;
1013  }
1014 
1015  if (dom==ndom_minus+ndom_plus+5) {
1016  // compactified domain or first shell :
1017  Array<int> res(2,5) ;
1018  switch (bound) {
1019  case INNER_BC :
1020  res.set(0,0) = ndom_minus+ndom_plus ; // first chi first
1021  res.set(0,1) = ndom_minus+ndom_plus+1 ; // first rect
1022  res.set(0,2) = ndom_minus+ndom_plus+2 ; // eta first
1023  res.set(0,3) = ndom_minus+ndom_plus+3 ; // second rect
1024  res.set(0,4) = ndom_minus+ndom_plus+4 ; // second chi first
1025  // Outer BC for all :
1026  for (int i=0 ; i<5 ; i++)
1027  res.set(1,i) = OUTER_BC ;
1028  break ;
1029  default :
1030  cerr << "Bad bound in Space_bispheric::get_indices_matching_non_std" << endl ;
1031  abort() ;
1032  }
1033  return res ;
1034  }
1035 
1036  cerr << "Bad domain in Space_bispheric::get_indices_matching_non_std" << endl ;
1037  abort() ;
1038 }
1039 
1040 
1041 double Space_bispheric::int_inf (const Scalar& so) const {
1042 
1043  const Domain_compact* p_cmp = dynamic_cast <const Domain_compact*> (domains[nbr_domains-1]) ;
1044  if (p_cmp==0x0) {
1045  cerr << "No compactified domain in Space_bispheric::int_inf" << endl ;
1046  abort() ;
1047  }
1048  return p_cmp->integ (so(nbr_domains-1), OUTER_BC) ;
1049 }
1050 
1051 
1052 double Space_bispheric::int_sphere_one (const Scalar& so) const {
1053 
1054  if (ndom_minus==1) {
1055  return (domains[ndom_minus+ndom_plus]->integ(so(ndom_minus+ndom_plus), INNER_BC) + domains[ndom_minus+ndom_plus+1]->integ(so(ndom_minus+ndom_plus+1), INNER_BC)) ;
1056  }
1057  else {
1058  return domains[1]->integ(so(1), INNER_BC) ;
1059  }
1060 }
1061 
1062 double Space_bispheric::int_sphere_two (const Scalar& so) const {
1063 
1064  if (ndom_plus==1) {
1065  return (domains[ndom_minus+ndom_plus+3]->integ(so(ndom_minus+ndom_plus+3), INNER_BC) + domains[ndom_minus+ndom_plus+4]->integ(so(ndom_minus+ndom_plus+4), INNER_BC)) ;
1066  }
1067  else {
1068  return domains[ndom_minus+1]->integ(so(1), INNER_BC) ;
1069  }
1070 }
1071 
1072 }
reference set(const Index &pos)
Read/write of an element.
Definition: array.hpp:186
Class for storing the dimensions of an array.
Definition: dim_array.hpp:34
int & set(int i)
Read/write of the size of a given dimension.
Definition: dim_array.hpp:54
Class for bispherical coordinates with a symmetry with respect to the plane .
Definition: bispheric.hpp:460
Class for bispherical coordinates with a symmetry with respect to the plane .
Definition: bispheric.hpp:878
Class for bispherical coordinates with a symmetry with respect to the plane .
Definition: bispheric.hpp:64
Class for a spherical compactified domain and a symmetry with respect to the plane .
Definition: spheric.hpp:1007
virtual double integ(const Val_domain &, int) const
Surface integral on a given boundary.
Class for a spherical domain containing the origin and a symmetry with respect to the plane .
Definition: spheric.hpp:66
Class for a spherical shell and a symmetry with respect to the plane .
Definition: spheric.hpp:1507
Class for a spherical shell and a symmetry with respect to the plane .
Definition: spheric.hpp:1597
Class for a spherical shell and a symmetry with respect to the plane .
Definition: spheric.hpp:555
Abstract class that implements the fonctionnalities common to all the type of domains.
Definition: space.hpp:60
virtual double integ(const Val_domain &so, int bound) const
Surface integral on a given boundary.
Definition: domain.cpp:1486
Parameter storage.
Definition: param.hpp:30
void add_double(double x, int position=0)
Adds the the address of a new double to the list.
Definition: param.cpp:115
The class Point is used to store the coordinates of a point.
Definition: point.hpp:30
double & set(int i)
Read/write of a coordinate.
Definition: point.hpp:47
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
Definition: scalar.hpp:67
int nshells
Number of shells outside the bispheric region.
Definition: bispheric.hpp:1247
int ndom_minus
Number of spherical domains inside the first sphere.
Definition: bispheric.hpp:1245
double int_sphere_one(const Scalar &so) const
Computes the surface integral on the first sphere.
virtual void save(FILE *) const
Saving function.
virtual ~Space_bispheric()
Destructor.
int ndom_plus
Number of spherical domains inside the second sphere.
Definition: bispheric.hpp:1246
double int_inf(const Scalar &so) const
Computes the surface integral at infinity.
virtual Array< int > get_indices_matching_non_std(int, int) const
Gives the number of the other domains, touching a given boundary.
Space_bispheric(int ttype, double dist, double r1, double r2, double rext, int nr)
Standard constructor
double a_minus
X-absolute coordinate of the center of the first sphere.
Definition: bispheric.hpp:1243
double a_plus
X-absolute coordinate of the center of the second sphere.
Definition: bispheric.hpp:1244
double int_sphere_two(const Scalar &so) const
Computes the surface integral on the second sphere.
int type_base
Type of basis used (i.e. using either Chebyshev or Legendre polynomials).
Definition: space.hpp:1367
int ndim
Number of dimensions (should be the same for all the Domains).
Definition: space.hpp:1366
Domain ** domains
Pointers on the various Domains.
Definition: space.hpp:1368
int nbr_domains
Number od Domains.
Definition: space.hpp:1365