20 #include "headcpp.hpp"
21 #include "spheric_periodic.hpp"
22 #include "term_eq.hpp"
24 #include "tensor_impl.hpp"
26 #include "array_math.hpp"
28 void coef_1d (
int, Array<double>&) ;
46 cerr <<
"Unknown case in Domain_spheric_periodic_shell::fitwaves" << endl ;
54 double lambda2 = factor - expo*expo*
ome*
ome ;
59 res = AA/exp(-sqrt(lambda2)*rmax)*pow(rmax,
double(dim-1)/2.) ;
61 res = AA/sin(sqrt(-lambda2)*rmax+phase)* pow(rmax,
double(dim-1)/2.) ;
92 cerr <<
"Unknown case in Domain_spheric_periodic_shell::fitwaves" << endl ;
97 for (
int nn=0 ; nn<max ; nn++) {
114 cerr <<
"Unknown case in Domain_spheric_periodic_shell::fitwaves" << endl ;
118 double lambda2 = factor - expo*expo*
ome*
ome ;
120 double sh = (lambda2>0) ? exp(-sqrt(lambda2)*rmax)/pow(rmax,
double(dim-1)/2.) :
121 sin(sqrt(-lambda2)*rmax+phases(nn))/ pow(rmax,
double(dim-1)/2.) ;
123 double dsh = (lambda2>0) ? exp(-sqrt(lambda2)*rmax)/pow(rmax,
double(dim-1)/2.)*(-sqrt(lambda2)-double(dim-1)/2./rmax) :
124 sqrt(-lambda2)*cos(sqrt(-lambda2)*rmax+phases(nn))/ pow(rmax,
double(dim-1)/2.) - double(dim-1)/2.*sin(sqrt(-lambda2)*rmax+phases(nn))/ pow(rmax,
double(dim+1)/2.) ;
141 cerr <<
"fitwaves only defined with respect for a tensor" << endl ;
148 cerr <<
"Domain mismatch in Domain_spheric_periodic_shell::fitwaves (Term_eq version)" << endl ;
153 for (
int i=0 ; i<so.
get_val_t().get_n_comp() ; i++) {
165 for (
int i=0 ; i<so.
get_der_t().get_n_comp() ; i++) {
174 return Term_eq (dom, resval, resder) ;
176 else return Term_eq (dom, resval) ;
Bases_container bases_1d
Arrays containing the various basis of decomposition.
double alpha
Relates the numerical to the physical radii.
Val_domain fitwaves(const Val_domain &so, const Array< double > &phases, int dim, double fact) const
Fit some field with homogenous solutions of the wave equation (Val_domain version).
double ome
Relates the numerical time to the physical one.
double give_harmonique(const Val_domain &so, int nn, double phase, int dim, double fact) const
Computes the coefficient of a given outgoing wave harmonique inside some field, at the outer boundary...
double beta
Relates the numerical to the physical radii.
virtual double val_boundary(int, const Val_domain &, const Index &) const
Computes the value of a field at a boundary.
virtual Val_domain der_normal(const Val_domain &, int) const
Normal derivative with respect to a given surface.
Dim_array nbr_coefs
Number of coefficients.
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
const Domain * get_domain(int i) const
returns a pointer on the domain.
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
virtual Array< int > indices(int pos) const
Gives the values of the indices corresponding to a location in the array used for storage of the comp...
const Space & get_space() const
Returns the Space.
This class is intended to describe the manage objects appearing in the equations.
int get_type_data() const
const Tensor * get_p_der_t() const
Tensor const & get_val_t() const
Tensor const & get_der_t() const
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Base_spectral base
Spectral basis of the field.
double & set_coef(const Index &pos)
Read/write the value of the field in the coefficient space.
void set_zero()
Sets the Val_domain to zero (logical state to zero and arrays destroyed).
void allocate_coef()
Allocates the values in the coefficient space and destroys the values in the configuration space.
bool check_if_zero() const
Check whether the logical state is zero or not.
void coef() const
Computes the coefficients.
Array< double > get_coef() const