20 #include "headcpp.hpp"
21 #include "utilities.hpp"
24 #include "array_math.hpp"
25 #include "val_domain.hpp"
28 void coef_1d (
int, Array<double>&) ;
29 void coef_i_1d (
int, Array<double>&) ;
30 int der_1d (
int, Array<double>&) ;
34 Domain(num, ttype, nbr), alpha(lim) {
44 fread_be (&
alpha,
sizeof(
double), 1, fd) ;
54 fwrite_be (&
ndim,
sizeof(
int), 1, fd) ;
55 fwrite_be (&
type_base,
sizeof(
int), 1, fd) ;
56 fwrite_be (&
alpha,
sizeof(
double), 1, fd) ;
60 o <<
"One dimensional domain containing 0" << endl ;
61 o <<
"Rmax = " <<
alpha << endl ;
76 cerr <<
"Unknown boundary case in Domain_oned_ori::der_normal" << endl ;
84 assert (
coloc[0] != 0x0) ;
85 assert (
absol[0] == 0x0) ;
87 absol[0]->allocate_conf() ;
99 assert (
coloc[0] != 0x0) ;
106 while (index.
inc()) ;
113 bool res = ((xx(1)>=-prec) && (xx(1) <=
alpha+prec)) ? true : false ;
120 assert (
is_in(abs)) ;
126 double coloc_leg_parity(
int,
int) ;
145 cerr <<
"Unknown type of basis in Domain_oned_ori::do_coloc" << endl ;
156 base.
bases_1d[0]->set(0) = CHEB_EVEN ;
165 base.
bases_1d[0]->set(0) = CHEB_ODD ;
174 base.
bases_1d[0]->set(0) = LEG_EVEN ;
183 base.
bases_1d[0]->set(0) = LEG_ODD ;
198 bool res_def = true ;
214 res.
bases_1d[0]->set(0) = CHEB_EVEN ;
217 res.
bases_1d[0]->set(0) = CHEB_ODD ;
228 res.
bases_1d[0]->set(0) = CHEB_ODD ;
231 res.
bases_1d[0]->set(0) = CHEB_EVEN ;
241 res.
bases_1d[0]->set(0) = LEG_EVEN ;
258 res.
bases_1d[0]->set(0) = LEG_EVEN ;
271 for (
int dim=0 ; dim<a.
ndim ; dim++)
282 if (strcmp(p,
"X ")==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 get_ndim() const
Returns the number of dimensions.
void save(FILE *) const
Save function.
Class for a 1-dimensional spherical domain containing the origin.
virtual void do_absol() const
Computes the absolute coordinates.
virtual void do_der_abs_from_der_var(const Val_domain *const *const der_var, Val_domain **const der_abs) const
Computes the derivative with respect to the absolute Cartesian coordinates from the derivative with r...
virtual int give_place_var(char *) const
Translates a name of a coordinate into its corresponding numerical name.
virtual const Point absol_to_num(const Point &) const
Computes the numerical coordinates from the physical ones.
virtual Base_spectral mult(const Base_spectral &, const Base_spectral &) const
Method for the multiplication of two Base_spectral.
virtual void save(FILE *) const
Saving function.
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
virtual void do_radius() const
Computes the generalized radius.
virtual void do_coloc()
Computes the colocation points.
virtual void set_legendre_base(Base_spectral &) const
Gives the standard base for Legendre polynomials.
virtual void set_cheb_base_odd(Base_spectral &) const
Gives the base using odd Chebyshev polynomials$.
double alpha
Relates the numerical radius to the physical one.
virtual ostream & print(ostream &o) const
Delegate function to virtualize the << operator.
virtual void set_cheb_base(Base_spectral &) const
Gives the standard base for Chebyshev polynomials.
Domain_oned_ori(int num, int ttype, double radius, const Dim_array &nbr)
Standard constructor :
virtual void set_legendre_base_odd(Base_spectral &) const
Gives the base using odd Legendre polynomials$.
virtual ~Domain_oned_ori()
Destructor.
virtual Val_domain der_normal(const Val_domain &, int) const
Normal derivative with respect to a given surface.
Abstract class that implements the fonctionnalities common to all the type of domains.
virtual void del_deriv()
Destroys the derivated members (like coloc, cart and radius), when changing the type of colocation po...
Val_domain * radius
The generalized radius.
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.
Val_domain der_var(int i) const
Computes the derivative with respect to a numerical coordinate.
void allocate_conf()
Allocates the values in the configuration space and destroys the values in the coefficients space.