20 #include "headcpp.hpp"
21 #include "bin_fake.hpp"
22 #include "utilities.hpp"
25 #include "tensor_impl.hpp"
26 #include "system_of_eqs.hpp"
27 #include "name_tools.hpp"
30 double eta_lim_chi (
double chi,
double rext,
double a,
double eta_c) ;
31 double chi_lim_eta (
double chi,
double rext,
double a,
double chi_c) ;
33 double zerosec(
double (*f)(
double,
const Param&),
const Param& parf,
34 double x1,
double x2,
double precis,
int nitermax,
int& niter) ;
37 double func_afake (
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) ;
53 res.
set(0) = nr ; res.
set(1) = nr ; res.
set(2) = nr-1 ;
55 res_bi.
set(0) = nr ; res_bi.
set(1) = nr ; res_bi.
set(2) = nr ;
64 double a_max = dist/2. ;
65 double precis = PRECISION ;
68 double aa = zerosec(func_afake, par_a, a_min, a_max, precis, nitermax, niter) ;
69 double eta_plus = asinh(aa/r2) ;
70 double eta_minus = -asinh(aa/r1) ;
72 double chi_c = 2*atan(aa/rbi) ;
73 double eta_c = log((1+rbi/aa)/(rbi/aa-1)) ;
74 double eta_lim = eta_c/2. ;
75 double chi_lim = chi_lim_eta (eta_lim, rbi, aa, chi_c) ;
79 center_minus.
set(1) = aa*cosh(eta_minus)/sinh(eta_minus) ;
84 center_plus.
set(1) = aa*cosh(eta_plus)/sinh(eta_plus) ;
105 fread_be (&
ndim,
sizeof(
int), 1, fd) ;
106 fread_be (&
type_base,
sizeof(
int), 1, fd) ;
133 fwrite_be (&
ndim,
sizeof(
int), 1, fd) ;
134 fwrite_be (&
type_base,
sizeof(
int), 1, fd) ;
148 res.
set(1,0) = INNER_BC ;
150 res.
set(1,1) = INNER_BC ;
153 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ;
165 res.
set(1,0) = INNER_BC ;
167 res.
set(1,1) = INNER_BC ;
170 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ; abort() ;
181 res.
set(1,0) = OUTER_BC ;
185 res.
set(1,0) = INNER_BC ;
188 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ; abort() ;
199 res.
set(1,0) = OUTER_BC ;
203 res.
set(1,0) = INNER_BC ;
206 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ; abort() ;
218 res.
set(1, 0) = INNER_BC ;
221 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ; abort() ;
232 res.
set(1, 0) = OUTER_BC ;
236 res.
set(1, 0) = INNER_BC ;
239 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ; abort() ;
250 res.
set(1,0) = OUTER_BC ;
254 res.
set(1,0) = INNER_BC ;
257 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ;
274 for (
int i=0 ; i<5 ; i++)
275 res.
set(1,i) = OUTER_BC ;
278 cerr <<
"Bad bound in Space_bin_fake::get_indices_matching_non_std" << endl ;
284 cerr <<
"Bad domain in Space_bispheric::get_indices_matching_non_std" << endl ;
reference set(const Index &pos)
Read/write of an element.
Class for storing the dimensions of an array.
int & set(int i)
Read/write of the size of a given dimension.
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for a spherical compactified domain and a symmetry with respect to the plane .
Class for a spherical domain containing the origin and a symmetry with respect to the plane .
Class for a spherical shell and a symmetry with respect to the plane .
Abstract class that implements the fonctionnalities common to all the type of domains.
void add_double(double x, int position=0)
Adds the the address of a new double to the list.
The class Point is used to store the coordinates of a point.
double & set(int i)
Read/write of a coordinate.
Space_bin_fake(int ttype, double dist, double r1, double r2, double rbi, double rext, int nr)
Standard constructor.
virtual Array< int > get_indices_matching_non_std(int dom, int bound) const
Gives the number of the other domains, touching a given boundary.
virtual void save(FILE *) const
Saving function.
virtual ~Space_bin_fake()
Destructor.
int type_base
Type of basis used (i.e. using either Chebyshev or Legendre polynomials).
int ndim
Number of dimensions (should be the same for all the Domains).
Domain ** domains
Pointers on the various Domains.
int nbr_domains
Number od Domains.