KADATH
space_bin_ns.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 #include "bin_ns.hpp"
22 #include "utilities.hpp"
23 #include "point.hpp"
24 #include "scalar.hpp"
25 #include "tensor_impl.hpp"
26 #include "system_of_eqs.hpp"
27 #include "name_tools.hpp"
28 namespace Kadath {
29 double eta_lim_chi (double chi, double rext, double a, double eta_c) ;
30 double chi_lim_eta (double chi, double rext, double a, double chi_c) ;
31 
32 double zerosec(double (*f)(double, const Param&), const Param& parf,
33  double x1, double x2, double precis, int nitermax, int& niter) ;
34 
35 
36 
37 double func_abns (double aa, const Param& par) {
38  double r1 = par.get_double(0) ;
39  double r2 = par.get_double(1) ;
40  double d = par.get_double(2) ;
41  return (sqrt(aa*aa+r1*r1)+sqrt(aa*aa+r2*r2)-d) ;
42 }
43 
44 Space_bin_ns::Space_bin_ns (int ttype, double dist, double rinstar1, double rstar1, double routstar1,
45  double rinstar2, double rstar2, double routstar2, double rext, int nr) {
46 
47  ndim = 3 ;
48 
49  nshells = 0 ;
50  nbr_domains = 12 ;
51  type_base = ttype ;
52  domains = new Domain* [nbr_domains] ;
53 
54  Dim_array res (ndim) ;
55  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
56  Dim_array res_bi(ndim) ;
57  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
58 
59  // Bispheric :
60  // Computation of aa
61  Param par_a ;
62  par_a.add_double(routstar1,0) ;
63  par_a.add_double(routstar2,1) ;
64  par_a.add_double(dist,2) ;
65  double a_min = 0 ;
66  double a_max = dist/2. ;
67  double precis = PRECISION ;
68  int nitermax = 500 ;
69  int niter ;
70  double aa = zerosec(func_abns, par_a, a_min, a_max, precis, nitermax, niter) ;
71  double eta_plus = asinh(aa/routstar2) ;
72  double eta_minus = -asinh(aa/routstar1) ;
73 
74  double chi_c = 2*atan(aa/rext) ;
75  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
76  double eta_lim = eta_c/2. ;
77  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
78 
79  // First NS
80  Point center_minus (ndim) ;
81  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
82  domains[0] = new Domain_nucleus (0, ttype, rinstar1, center_minus, res) ;
83  domains[1] = new Domain_shell_outer_adapted (*this, 1, ttype, rinstar1, rstar1, center_minus, res) ;
84  domains[2] = new Domain_shell_inner_adapted (*this, 2, ttype, rstar1, routstar1, center_minus, res) ;
85 
86  // Second NS
87  Point center_plus (ndim) ;
88  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
89  domains[3] = new Domain_nucleus (3, ttype, rinstar2, center_plus, res) ;
90  domains[4] = new Domain_shell_outer_adapted (*this, 4, ttype, rinstar2, rstar2, center_plus, res) ;
91  domains[5] = new Domain_shell_inner_adapted (*this, 5, ttype, rstar2, routstar2, center_plus, res) ;
92 
93  // Bispheric part
94  domains[6] = new Domain_bispheric_chi_first(6, ttype, aa, eta_minus, rext, chi_lim, res_bi) ;
95  domains[7] = new Domain_bispheric_rect(7, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, res_bi) ;
96  domains[8] = new Domain_bispheric_eta_first(8, ttype, aa, rext, -eta_lim, eta_lim, res_bi) ;
97  domains[9] = new Domain_bispheric_rect(9, ttype, aa, rext, eta_plus, eta_lim, chi_lim, res_bi) ;
98  domains[10] = new Domain_bispheric_chi_first(10, ttype, aa, eta_plus, rext, chi_lim, res_bi) ;
99 
100  // Compactified domain
101  Point center(3) ;
102  domains[11] = new Domain_compact (11, ttype, rext, center, res) ;
103 
104  const Domain_shell_outer_adapted* pouter_1 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[1]) ;
105  pouter_1->vars_to_terms() ;
106  pouter_1->update() ;
107  const Domain_shell_inner_adapted* pinner_1 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[2]) ;
108  pinner_1->vars_to_terms() ;
109  pinner_1->update() ;
110  const Domain_shell_outer_adapted* pouter_2 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[4]) ;
111  pouter_2->vars_to_terms() ;
112  pouter_2->update() ;
113  const Domain_shell_inner_adapted* pinner_2 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[5]) ;
114  pinner_2->vars_to_terms() ;
115  pinner_2->update() ;
116 }
117 
118 Space_bin_ns::Space_bin_ns (int ttype, double dist, double rinstar1, double rstar1, double routstar1,
119  double rinstar2, double rstar2, double routstar2, double rext, double rshell, int nr) {
120 
121  ndim = 3 ;
122 
123  nshells = 1 ;
124  nbr_domains = 13 ;
125  type_base = ttype ;
126  domains = new Domain* [nbr_domains] ;
127 
128  Dim_array res (ndim) ;
129  res.set(0) = nr ; res.set(1) = nr ; res.set(2) = nr-1 ;
130  Dim_array res_bi(ndim) ;
131  res_bi.set(0) = nr ; res_bi.set(1) = nr ; res_bi.set(2) = nr ;
132 
133  // Bispheric :
134  // Computation of aa
135  Param par_a ;
136  par_a.add_double(routstar1,0) ;
137  par_a.add_double(routstar2,1) ;
138  par_a.add_double(dist,2) ;
139  double a_min = 0 ;
140  double a_max = dist/2. ;
141  double precis = PRECISION ;
142  int nitermax = 500 ;
143  int niter ;
144  double aa = zerosec(func_abns, par_a, a_min, a_max, precis, nitermax, niter) ;
145  double eta_plus = asinh(aa/routstar2) ;
146  double eta_minus = -asinh(aa/routstar1) ;
147 
148  double chi_c = 2*atan(aa/rext) ;
149  double eta_c = log((1+rext/aa)/(rext/aa-1)) ;
150  double eta_lim = eta_c/2. ;
151  double chi_lim = chi_lim_eta (eta_lim, rext, aa, chi_c) ;
152 
153  // First NS
154  Point center_minus (ndim) ;
155  center_minus.set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
156  domains[0] = new Domain_nucleus (0, ttype, rinstar1, center_minus, res) ;
157  domains[1] = new Domain_shell_outer_adapted (*this, 1, ttype, rinstar1, rstar1, center_minus, res) ;
158  domains[2] = new Domain_shell_inner_adapted (*this, 2, ttype, rstar1, routstar1, center_minus, res) ;
159 
160  // Second NS
161  Point center_plus (ndim) ;
162  center_plus.set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
163  domains[3] = new Domain_nucleus (3, ttype, rinstar2, center_plus, res) ;
164  domains[4] = new Domain_shell_outer_adapted (*this, 4, ttype, rinstar2, rstar2, center_plus, res) ;
165  domains[5] = new Domain_shell_inner_adapted (*this, 5, ttype, rstar2, routstar2, center_plus, res) ;
166 
167  // Bispheric part
168  domains[6] = new Domain_bispheric_chi_first(6, ttype, aa, eta_minus, rext, chi_lim, res_bi) ;
169  domains[7] = new Domain_bispheric_rect(7, ttype, aa, rext, eta_minus, -eta_lim, chi_lim, res_bi) ;
170  domains[8] = new Domain_bispheric_eta_first(8, ttype, aa, rext, -eta_lim, eta_lim, res_bi) ;
171  domains[9] = new Domain_bispheric_rect(9, ttype, aa, rext, eta_plus, eta_lim, chi_lim, res_bi) ;
172  domains[10] = new Domain_bispheric_chi_first(10, ttype, aa, eta_plus, rext, chi_lim, res_bi) ;
173 
174  // Shell in 1/R
175  Point center(3) ;
176  domains[11] = new Domain_shell (11, ttype, rext, rshell, center, res) ;
177 
178  // Compactified domain
179  domains[12] = new Domain_compact (12, ttype, rshell, center, res) ;
180 
181  const Domain_shell_outer_adapted* pouter_1 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[1]) ;
182  pouter_1->vars_to_terms() ;
183  pouter_1->update() ;
184  const Domain_shell_inner_adapted* pinner_1 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[2]) ;
185  pinner_1->vars_to_terms() ;
186  pinner_1->update() ;
187  const Domain_shell_outer_adapted* pouter_2 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[4]) ;
188  pouter_2->vars_to_terms() ;
189  pouter_2->update() ;
190  const Domain_shell_inner_adapted* pinner_2 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[5]) ;
191  pinner_2->vars_to_terms() ;
192  pinner_2->update() ;
193 }
194 
196  fread_be (&nbr_domains, sizeof(int), 1, fd) ;
197  fread_be (&ndim, sizeof(int), 1, fd) ;
198  fread_be (&type_base, sizeof(int), 1, fd) ;
199 
200  nshells = nbr_domains-12 ;
201 
202  domains = new Domain* [nbr_domains] ;
203  //First NS :
204  domains[0] = new Domain_nucleus (0, fd) ;
205  domains[1] = new Domain_shell_outer_adapted (*this, 1, fd) ;
206  domains[2] = new Domain_shell_inner_adapted (*this, 2, fd) ;
207 
208  //second NS :
209  domains[3] = new Domain_nucleus (3, fd) ;
210  domains[4] = new Domain_shell_outer_adapted (*this, 4, fd) ;
211  domains[5] = new Domain_shell_inner_adapted (*this, 5, fd) ;
212 
213  // Bispheric
214  domains[6] = new Domain_bispheric_chi_first(6, fd) ;
215  domains[7] = new Domain_bispheric_rect(7, fd) ;
216  domains[8] = new Domain_bispheric_eta_first(8, fd) ;
217  domains[9] = new Domain_bispheric_rect(9, fd) ;
218  domains[10] = new Domain_bispheric_chi_first(10, fd) ;
219 
220  for (int i=0 ; i<nshells ; i++)
221  domains[11+i] = new Domain_shell (11+i, fd) ;
222 
223  // Compactified
224  domains[11+nshells] = new Domain_compact(11+nshells, fd) ;
225 
226  const Domain_shell_outer_adapted* pouter_1 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[1]) ;
227  pouter_1->vars_to_terms() ;
228  pouter_1->update() ;
229  const Domain_shell_inner_adapted* pinner_1 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[2]) ;
230  pinner_1->vars_to_terms() ;
231  pinner_1->update() ;
232  const Domain_shell_outer_adapted* pouter_2 = dynamic_cast<const Domain_shell_outer_adapted*> (domains[4]) ;
233  pouter_2->vars_to_terms() ;
234  pouter_2->update() ;
235  const Domain_shell_inner_adapted* pinner_2 = dynamic_cast<const Domain_shell_inner_adapted*> (domains[5]) ;
236  pinner_2->vars_to_terms() ;
237  pinner_2->update() ;
238 
239 }
240 
242  Domain_shell_outer_adapted* pouter_1 = dynamic_cast<Domain_shell_outer_adapted*> (domains[1]) ;
243  pouter_1->del_deriv() ;
244  Domain_shell_inner_adapted* pinner_1 = dynamic_cast<Domain_shell_inner_adapted*> (domains[2]) ;
245  pinner_1->del_deriv() ;
246  Domain_shell_outer_adapted* pouter_2 = dynamic_cast<Domain_shell_outer_adapted*> (domains[4]) ;
247  pouter_2->del_deriv() ;
248  Domain_shell_inner_adapted* pinner_2 = dynamic_cast<Domain_shell_inner_adapted*> (domains[5]) ;
249  pinner_2->del_deriv() ;
250 }
251 
252 void Space_bin_ns::save (FILE* fd) const {
253  fwrite_be (&nbr_domains, sizeof(int), 1, fd) ;
254  fwrite_be (&ndim, sizeof(int), 1, fd) ;
255  fwrite_be (&type_base, sizeof(int), 1, fd) ;
256  for (int i=0 ; i<nbr_domains ; i++)
257  domains[i]->save(fd) ;
258 }
259 
261 
262  return (domains[1]->nbr_unknowns_from_adapted() + domains[4]->nbr_unknowns_from_adapted()) ;
263 }
264 
265 void Space_bin_ns::affecte_coef_to_variable_domains (int& pos, int cc, Array<int>& zedoms) const {
266 
267  // In star 1 ?
268  bool found_outer_1 = false ;
269  int old_pos = pos ;
270  domains[1]->affecte_coef(pos, cc, found_outer_1) ;
271  pos = old_pos ;
272  bool found_inner_1 = false ;
273  domains[2]->affecte_coef(pos, cc, found_inner_1) ;
274  assert (found_outer_1 == found_inner_1) ;
275  if (found_outer_1) {
276  zedoms.set(0) = 1 ;
277  zedoms.set(1) = 2 ;
278  }
279  else {
280  zedoms.set(0) = -1 ;
281  zedoms.set(1) = -1 ;
282  }
283 
284  // In star 2 ?
285  bool found_outer_2 = false ;
286  old_pos = pos ;
287  domains[4]->affecte_coef(pos, cc, found_outer_2) ;
288  pos = old_pos ;
289  bool found_inner_2 = false ;
290  domains[5]->affecte_coef(pos, cc, found_inner_2) ;
291  assert (found_outer_2 == found_inner_2) ;
292  if (found_outer_2) {
293  zedoms.set(0) = 4 ;
294  zedoms.set(1) = 5 ;
295  }
296 }
297 
298 void Space_bin_ns::xx_to_ders_variable_domains (const Array<double>& xx, int& conte) const {
299 
300  // Star 1
301  int old_conte = conte ;
302  domains[1]->xx_to_ders_from_adapted(xx, conte) ;
303  conte = old_conte ;
304  domains[2]->xx_to_ders_from_adapted(xx, conte) ;
305  // Star 2
306  old_conte = conte ;
307  domains[4]->xx_to_ders_from_adapted(xx, conte) ;
308  conte = old_conte ;
309  domains[5]->xx_to_ders_from_adapted(xx, conte) ;
310 }
311 
313 
314 
315  // First get the corrections :
316  // Star 1
317  int old_pos = pos ;
318  Val_domain cor_outer_1 (domains[1]) ;
319  domains[1]->xx_to_vars_from_adapted(cor_outer_1, xx, pos) ;
320  pos = old_pos ;
321  Val_domain cor_inner_1 (domains[2]) ;
322  domains[2]->xx_to_vars_from_adapted(cor_inner_1, xx, pos) ;
323 
324  // Star 2
325  old_pos = pos ;
326  Val_domain cor_outer_2 (domains[4]) ;
327  domains[4]->xx_to_vars_from_adapted(cor_outer_2, xx, pos) ;
328  pos = old_pos ;
329  Val_domain cor_inner_2 (domains[5]) ;
330  domains[5]->xx_to_vars_from_adapted(cor_inner_2, xx, pos) ;
331 
332  // Now update the variables :
333  for (int i=0 ; i<sys->nvar ; i++) {
334  for (int n=0 ; n<sys->var[i]->get_n_comp() ; n++) {
335  Scalar res(*this) ;
336  domains[1]->update_variable(cor_outer_1, *sys->var[i]->cmp[n], res) ;
337  domains[2]->update_variable(cor_inner_1, *sys->var[i]->cmp[n], res) ;
338  domains[4]->update_variable(cor_outer_2, *sys->var[i]->cmp[n], res) ;
339  domains[5]->update_variable(cor_inner_2, *sys->var[i]->cmp[n], res) ;
340 
341 
342  sys->var[i]->cmp[n]->set_domain(1) = res(1) ;
343  sys->var[i]->cmp[n]->set_domain(2) = res(2) ;
344  sys->var[i]->cmp[n]->set_domain(4) = res(4) ;
345  sys->var[i]->cmp[n]->set_domain(5) = res(5) ;
346  }
347  }
348 
349  // Now the constants :
350  for (int i=0 ; i<sys->ncst ; i++)
351  if (sys->cst[i*(sys->dom_max-sys->dom_min+1)]->get_type_data()==TERM_T)
352  for (int n=0 ; n<sys->cst[i*(sys->dom_max-sys->dom_min+1)]->val_t->get_n_comp() ; n++) {
353 
354  Scalar so (*this) ;
355  so = 0 ;
356  for (int d=1 ; d<=5 ; d++)
357  if (d!=3)
358  so.set_domain(d) = (*sys->cst[i*(sys->dom_max-sys->dom_min+1)+d]->val_t->cmp[n])(d) ;
359 
360  Scalar res(*this) ;
361  res = 0 ;
362  domains[1]->update_constante(cor_outer_1, so, res) ;
363  domains[2]->update_constante(cor_inner_1, so, res) ;
364  domains[4]->update_constante(cor_outer_2, so, res) ;
365  domains[5]->update_constante(cor_inner_2, so, res) ;
366 
367  sys->cst[i*(sys->dom_max-sys->dom_min+1)+1]->val_t->cmp[n]->set_domain(1) = res(1) ;
368  sys->cst[i*(sys->dom_max-sys->dom_min+1)+2]->val_t->cmp[n]->set_domain(2) = res(2) ;
369  sys->cst[i*(sys->dom_max-sys->dom_min+1)+4]->val_t->cmp[n]->set_domain(4) = res(4) ;
370  sys->cst[i*(sys->dom_max-sys->dom_min+1)+5]->val_t->cmp[n]->set_domain(5) = res(5) ;
371  }
372 
373  // Update the mapping :
374  domains[1]->update_mapping(cor_outer_1) ;
375  domains[2]->update_mapping(cor_inner_1) ;
376  domains[4]->update_mapping(cor_outer_2) ;
377  domains[5]->update_mapping(cor_inner_2) ;
378 }
379 
380 
382 
383  if (dom==2) {
384  // First sphere ;
385  Array<int> res (2,2) ;
386  switch (bound) {
387  case OUTER_BC :
388  res.set(0,0) = 6 ; // Matching with chi first
389  res.set(1,0) = INNER_BC ;
390  res.set(0,1) = 7 ; // Matching with rect
391  res.set(1,1) = INNER_BC ;
392  break ;
393  default :
394  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ;
395  abort() ;
396  }
397  return res ;
398  }
399 
400  if (dom== 5) {
401  // second sphere ;
402  Array<int> res(2, 2) ;
403  switch (bound) {
404  case OUTER_BC :
405  res.set(0,0) = 9 ; // Matching with rect
406  res.set(1,0) = INNER_BC ;
407  res.set(0,1) = 10 ; // Matching with chi_first
408  res.set(1,1) = INNER_BC ;
409  break ;
410  default :
411  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ; abort() ;
412  }
413  return res ;
414  }
415 
416  if (dom== 6) {
417  // first chi first :
418  Array<int> res(2,1) ;
419  switch (bound) {
420  case INNER_BC :
421  res.set(0,0) = 2 ; // First sphere
422  res.set(1,0) = OUTER_BC ;
423  break ;
424  case OUTER_BC :
425  res.set(0,0) = 11 ; // Compactified domain or first shell
426  res.set(1,0) = INNER_BC ;
427  break ;
428  default :
429  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ; abort() ;
430  }
431  return res ;
432  }
433 
434  if (dom==7) {
435  // first rect :
436  Array<int> res(2, 1) ;
437  switch (bound) {
438  case INNER_BC :
439  res.set(0,0) = 2 ; // First sphere
440  res.set(1,0) = OUTER_BC ;
441  break ;
442  case OUTER_BC :
443  res.set(0,0) = 11 ; // Compactified domain or first shell
444  res.set(1,0) = INNER_BC ;
445  break ;
446  default :
447  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ; abort() ;
448  }
449  return res ;
450  }
451 
452 
453  if (dom==8) {
454  // eta first
455  Array<int> res(2, 1) ;
456  switch (bound) {
457  case OUTER_BC :
458  res.set(0, 0) = 11 ; // Compactified domain or first shell
459  res.set(1, 0) = INNER_BC ;
460  break ;
461  default :
462  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ; abort() ;
463  }
464  return res ;
465  }
466 
467  if (dom==9) {
468  // second rect :
469  Array<int> res(2, 1) ;
470  switch (bound) {
471  case INNER_BC :
472  res.set(0, 0) = 5 ; // Second sphere
473  res.set(1, 0) = OUTER_BC ;
474  break ;
475  case OUTER_BC :
476  res.set(0, 0) = 11 ; // Compactified domain or first shell
477  res.set(1, 0) = INNER_BC ;
478  break ;
479  default :
480  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ; abort() ;
481  }
482  return res ;
483  }
484 
485  if (dom==10) {
486  // second chi first :
487  Array<int> res(2, 1) ;
488  switch (bound) {
489  case INNER_BC :
490  res.set(0,0) = 5 ; // second nucleus
491  res.set(1,0) = OUTER_BC ;
492  break ;
493  case OUTER_BC :
494  res.set(0,0) = 11 ; // Compactified domain or first shell
495  res.set(1,0) = INNER_BC ;
496  break ;
497  default :
498  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ;
499  abort() ;
500  }
501  return res ;
502  }
503 
504  if (dom==11) {
505  // compactified domain or first shell :
506  Array<int> res(2,5) ;
507  switch (bound) {
508  case INNER_BC :
509  res.set(0,0) = 6 ; // first chi first
510  res.set(0,1) = 7 ; // first rect
511  res.set(0,2) = 8 ; // eta first
512  res.set(0,3) = 9 ; // second rect
513  res.set(0,4) = 10 ; // second chi first
514  // Outer BC for all :
515  for (int i=0 ; i<5 ; i++)
516  res.set(1,i) = OUTER_BC ;
517  break ;
518  default :
519  cerr << "Bad bound in Space_bin_ns::get_indices_matching_non_std" << endl ;
520  abort() ;
521  }
522  return res ;
523  }
524 
525  cerr << "Bad domain in Space_bispheric::get_indices_matching_non_std" << endl ;
526  abort() ;
527 }
528 
529 }
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
Class for a spherical domain containing the origin and a symmetry with respect to the plane .
Definition: spheric.hpp:66
Class for a spherical-like domain, having a symmetry with respect to the plane .
Definition: adapted.hpp:51
void update() const
Updates all the quantities that depend on the inner radius (like the normal vectors).
void del_deriv() override
Destroys the derivated members (like coloc, cart and radius), when changing the type of colocation po...
virtual void vars_to_terms() const
The Term_eq describing the variable shape of the Domain are updated.
Class for a spherical-like domain, having a symmetry with respect to the plane .
Definition: adapted.hpp:367
void update() const
Updates all the quantities that depend on the inner radius (like the normal vectors).
void del_deriv() override
Destroys the derivated members (like coloc, cart and radius), when changing the type of colocation po...
virtual void vars_to_terms() const
The Term_eq describing the variable shape of the Domain are updated.
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 void xx_to_ders_from_adapted(const Array< double > &xx, int &conte) const
Affects the derivative part of variable a Domain from a set of values.
Definition: space.hpp:928
virtual void affecte_coef(int &conte, int cc, bool &found) const
The variation of the functions describing the shape of the Domain are affected from the unknowns of t...
Definition: space.hpp:906
virtual void update_variable(const Val_domain &shape, const Scalar &oldval, Scalar &newval) const
Update the value of a scalar, after the shape of the Domain has been changed by the system.
Definition: space.hpp:942
virtual void xx_to_vars_from_adapted(Val_domain &shape, const Array< double > &xx, int &conte) const
Computes the new boundary of a Domain from a set of values.
Definition: space.hpp:913
virtual void update_mapping(const Val_domain &shape)
Updates the variables parts of the Domain.
Definition: space.hpp:977
virtual void update_constante(const Val_domain &shape, const Scalar &oldval, Scalar &newval) const
Update the value of a scalar, after the shape of the Domain has been changed by the system.
Definition: space.hpp:961
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
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
Definition: scalar.hpp:555
virtual void save(FILE *) const
Saving function.
virtual int nbr_unknowns_from_variable_domains() const
Gives the number of unknowns coming from the variable shape of the domain.
virtual void xx_to_ders_variable_domains(const Array< double > &, int &) const
Update the vairable domains from a set of values.
virtual void xx_to_vars_variable_domains(System_of_eqs *, const Array< double > &, int &) const
Update the variables of a system, from the variation of the shape of the domains.
virtual void affecte_coef_to_variable_domains(int &, int, Array< int > &) const
The variation of the functions describing the shape of the Domain are affected from the unknowns of t...
Space_bin_ns(int ttype, double dist, double rinstar1, double rstar1, double routstar1, double rinstar2, double rstar2, double routstar2, double rext, int nr)
Standard constructor ; stars are initial spherical.
int nshells
Number of outer shells.
Definition: bin_ns.hpp:38
virtual ~Space_bin_ns()
Destructor.
virtual Array< int > get_indices_matching_non_std(int dom, int bound) const
Gives the number of the other domains, touching a given boundary.
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
Class used to describe and solve a system of equations.
MMPtr_array< Tensor > var
Pointer on the unknown fields.
MMPtr_array< Term_eq > cst
Pointers on the Term_eq coming from the constants passed by the user.
int dom_max
Highest domain number.
int ncst
Number of constants passed by the user.
int dom_min
Smallest domain number.
int nvar
Number of unknown fields.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69