20 #include "headcpp.hpp"
21 #include "utilities.hpp"
24 #include "array_math.hpp"
25 #include "val_domain.hpp"
45 fread_be (&
xlim,
sizeof(
double), 1, fd) ;
49 Domain_critic_outer::~Domain_critic_outer() {
54 for (
int l=0 ; l<
ndim ; l++) safe_delete(
coloc[l]);
62 fwrite_be (&
ndim,
sizeof(
int), 1, fd) ;
63 fwrite_be (&
type_base,
sizeof(
int), 1, fd) ;
64 fwrite_be (&
xlim,
sizeof(
double), 1, fd) ;
68 o <<
"Outer critic domain (cylindric)" << endl ;
70 o <<
"X max = " <<
xlim << endl ;
75 double coloc_leg_parity (
int,
int) ;
83 for (
int i=0 ; i<
ndim ; i++)
94 for (
int i=0 ; i<
ndim ; i++)
102 cerr <<
"Unknown type of basis in Domain_critic_outer::do_coloc" << endl ;
108 for (
int i=0 ; i<2 ; i++)
109 assert (
coloc[i] !=
nullptr) ;
110 assert (
p_X==
nullptr) ;
116 while (index.
inc()) ;
120 for (
int i=0 ; i<2 ; i++)
121 assert (
coloc[i] !=
nullptr) ;
122 assert (
p_T==
nullptr) ;
128 while (index.
inc()) ;
149 if ((xx(1)<
xlim-prec) || (xx(1)>1.+prec))
151 if ((xx(2)<-prec) || (xx(2)>M_PI+prec))
157 for (
int i=0 ; i<2 ; i++)
158 assert (
coloc[i] !=
nullptr) ;
159 for (
int i=0 ; i<2 ; i++)
160 assert (
absol[i] ==
nullptr) ;
161 for (
int i=0 ; i<2 ; i++) {
163 absol[i]->allocate_conf() ;
168 absol[0]->set(index) = (*
coloc[0])(index(0)) ;
169 absol[1]->set(index) = (*
coloc[1])(index(1)) ;
171 while (index.
inc()) ;
177 res.
set(1) = (so(1) - (1.+
xlim)/2.) * 2. / (1.-
xlim) ;
188 base.
bases_1d[1]->set(0) = COSSIN_EVEN ;
199 base.
bases_1d[1]->set(0) = COSSIN_EVEN ;
212 base.
bases_1d[1]->set(0) = COSSIN_ODD ;
223 base.
bases_1d[1]->set(0) = COSSIN_ODD ;
235 bool res_def = true ;
250 res.
bases_1d[1]->set(0) = COSSIN_EVEN ;
253 res.
bases_1d[1]->set(0) = COSSIN_ODD ;
263 res.
bases_1d[1]->set(0) = COSSIN_ODD ;
266 res.
bases_1d[1]->set(0) = COSSIN_EVEN ;
309 for (
int dim=0 ; dim<a.
ndim ; dim++)
320 if (strcmp(p,
"X ")==0)
322 if (strcmp(p,
"T ")==0)
Class for storing the basis of decompositions of a field.
Bases_container bases_1d
Arrays containing the various basis of decomposition.
void allocate(const Dim_array &nbr_coefs)
Allocates the various arrays, for a given number of coefficients.
bool def
true if the Base_spectral is defined and false otherwise.
int ndim
Number of dimensions.
Class for storing the dimensions of an array.
int & set(int i)
Read/write of the size of a given dimension.
void save(FILE *) const
Save function.
Class for a 2-dimensional cylindrical type domain.
void do_T() const
Computes .
virtual void set_legendre_todd_base(Base_spectral &) const
Gives the base using Legendre polynomials, for odd functions in (critic space case)
virtual void set_legendre_base(Base_spectral &) const
Gives the standard base for Legendre polynomials.
virtual const Point absol_to_num(const Point &xxx) const
Computes the numerical coordinates from the physical ones.
Domain_critic_outer(int num, int ttype, const Dim_array &nbr, double xl)
Standard constructor :
virtual void save(FILE *) const
Saving function.
virtual void set_cheb_base(Base_spectral &so) const
Gives the standard base for Chebyshev polynomials.
virtual const Val_domain & get_X() const
Returns the variable .
virtual void set_cheb_todd_base(Base_spectral &so) const
Gives the base using Chebyshev polynomials, for odd functions in (critic space case)
virtual Base_spectral mult(const Base_spectral &, const Base_spectral &) const
Method for the multiplication of two Base_spectral.
double xlim
Relates the numerical to the variable.
virtual const Val_domain & get_T() const
Returns the variable .
virtual int give_place_var(char *) const
Translates a name of a coordinate into its corresponding numerical name.
virtual void do_absol() const
Computes the absolute coordinates.
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
virtual void do_coloc()
Computes the colocation points.
void del_deriv() override
Destroys the derivated members (like coloc, cart and radius), when changing the type of colocation po...
virtual ostream & print(ostream &o) const
Delegate function to virtualize the << operator.
Val_domain * p_T
Pointer on the variable.
Val_domain * p_X
Pointer on the variable.
void do_X() const
Computes .
Abstract class that implements the fonctionnalities common to all the type of domains.
Memory_mapped_array< Val_domain * > absol
Asbolute coordinates (if defined ; usually Cartesian-like)
int ndim
Number of dimensions.
Dim_array nbr_coefs
Number of coefficients.
Dim_array nbr_points
Number of colocation points.
int type_base
Type of colocation point :
Memory_mapped_array< Array< double > * > coloc
Colocation points in each dimension (stored in ndim 1d- arrays)
Class that gives the position inside a multi-dimensional Array.
bool inc(int increm, int var=0)
Increments the position of the Index.
The class Point is used to store the coordinates of a point.
const int & get_ndim() const
Returns the number of dimensions.
double & set(int i)
Read/write of a coordinate.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
double & set(const Index &pos)
Read/write the value of the field in the configuration space.
void allocate_conf()
Allocates the values in the configuration space and destroys the values in the coefficients space.