|
KADATH
|
Class for storing the basis of decompositions of a field. More...
#include <base_spectral.hpp>
Public Types | |
| using | Bases_container = Memory_mapped_array< Array< int > *, int > |
| Sylvain'stuff. More... | |
Public Member Functions | |
| Base_spectral (int dimensions) | |
Standard constructor, the Base_spectral is not defined. More... | |
| Base_spectral (const Base_spectral &so) | |
| Copy constructor. More... | |
| Base_spectral (FILE *) | |
| Constructor from a file. More... | |
| Base_spectral (Base_spectral &&so) | |
| Move constructor. More... | |
| Base_spectral & | operator= (Base_spectral &&so) |
| Move assignment operator. More... | |
| ~Base_spectral () | |
| Destructor. More... | |
| void | save (FILE *) const |
| Saving function. More... | |
| void | swap (Base_spectral &so) |
| Swaps data between the source and this. More... | |
| bool | is_def () const |
| void | set_non_def () |
| Sets all the basis to the undefined state. More... | |
| Base_spectral & | operator= (const Base_spectral &) |
| Assignement operator. More... | |
| const Array< int > * | get_base_1d (int i) const |
| Returns one of the 1d base array. More... | |
| void | allocate (const Dim_array &nbr_coefs) |
| Allocates the various arrays, for a given number of coefficients. More... | |
| void | set (Dim_array const &nbr_coefs, int basephi, int basetheta, int baser) |
| Allocates the various arrays, for a given number of coefficients and sets basis to some values (same for all harmonics). More... | |
| void | coef_dim (int var, int nbr, Array< double > *&tab) const |
| Array< double > | coef (const Dim_array &nbr_coefs, const Array< double > &so) const |
| void | coef_i_dim (int var, int nbr, Array< double > *&tab) const |
| Performs the inverse coefficient transformation for one particular variable. More... | |
| Array< double > | coef_i (const Dim_array &nbr_points, const Array< double > &so) const |
| double | summation (const Point &num, const Array< double > &tab) const |
| Computes the spectral summation. More... | |
| Array< double > | ope_1d (int(*function)(int, Array< double > &), int var, const Array< double > &so, Base_spectral &base) const |
| One-dimensional operator acting in the coefficient space. More... | |
Protected Attributes | |
| bool | def |
true if the Base_spectral is defined and false otherwise. More... | |
| int | ndim |
| Number of dimensions. More... | |
| Bases_container | bases_1d |
| Arrays containing the various basis of decomposition. More... | |
Friends | |
| class | Space |
| class | Space_spheric |
| class | Scalar |
| class | Domain_nucleus |
| class | Domain_shell |
| class | Domain_shell_log |
| class | Domain_compact |
| class | Domain_bispheric_rect |
| class | Domain_bispheric_chi_first |
| class | Domain_bispheric_eta_first |
| class | Domain_critic_inner |
| class | Domain_critic_outer |
| class | Domain_polar_nucleus |
| class | Domain_polar_shell |
| class | Domain_polar_shell_inner_adapted |
| class | Domain_polar_shell_outer_adapted |
| class | Domain_polar_compact |
| class | Domain_oned_ori |
| class | Domain_oned_qcq |
| class | Domain_oned_inf |
| class | Domain_spheric_periodic_nucleus |
| class | Domain_spheric_periodic_shell |
| class | Domain_spheric_periodic_compact |
| class | Domain_spheric_time_nucleus |
| class | Domain_spheric_time_shell |
| class | Domain_spheric_time_compact |
| class | Domain_shell_inner_adapted |
| class | Domain_shell_outer_adapted |
| class | Domain_shell_inner_homothetic |
| class | Domain_shell_outer_homothetic |
| class | Domain_nucleus_symphi |
| class | Domain_shell_symphi |
| class | Domain_compact_symphi |
| class | Domain_polar_periodic_nucleus |
| class | Domain_polar_periodic_shell |
| class | Domain_fourD_periodic_nucleus |
| class | Domain_fourD_periodic_shell |
| bool | operator== (const Base_spectral &, const Base_spectral &) |
| Comparison operator. More... | |
| ostream & | operator<< (ostream &o, const Base_spectral &) |
| Display. More... | |
Class for storing the basis of decompositions of a field.
It mainly consists in a list of integers, encoding the various basis.
CHEB : Chebyshev polynomials. CHEB_EVEN : even Chebyshev polynomials. CHEB_ODD : odd Chebyshev polynomials. COSSIN : series of sines and cosines. COS : series of cosines. COS_EVEN : series of even cosines. COS_ODD : series of odd cosines. SIN : series of sines. SIN_EVEN : series of even sines. SIN_ODD : series of odd sines. LEG : Legendre polynomials. LEG_EVEN : even Legendre polynomials. LEG_ODD : odd Legendre polynomials. COSSIN_EVEN : series of sines and cosines with even harmonics only. COSSIN_ODD : series of sines and cosines with odd harmonics only. Definition at line 69 of file base_spectral.hpp.
| using Kadath::Base_spectral::Bases_container = Memory_mapped_array<Array<int>*,int> |
Sylvain'stuff.
Definition at line 72 of file base_spectral.hpp.
|
inlineexplicit |
Standard constructor, the Base_spectral is not defined.
| dimensions | [input] : number of dimensions. |
Definition at line 89 of file base_spectral.hpp.
|
inline |
| Kadath::Base_spectral::Base_spectral | ( | FILE * | fd | ) |
Constructor from a file.
Definition at line 36 of file base_spectral.cpp.
|
inline |
|
inline |
| void Kadath::Base_spectral::allocate | ( | const Dim_array & | nbr_coefs | ) |
Allocates the various arrays, for a given number of coefficients.
| nbr_coefs | [input] : a Dim_array storing the number of coefficients in each dimenions. |
Definition at line 82 of file base_spectral.cpp.
| Array< double > Kadath::Base_spectral::coef | ( | const Dim_array & | nbr_coefs, |
| const Array< double > & | so | ||
| ) | const |
Computes the coefficients for all the variables.
| nbr_coefs | [input] : number of coefficients. |
| so | [input] : values of the field in the configuration space. |
Definition at line 96 of file coef.cpp.
References coef_dim(), and ndim.
| void Kadath::Base_spectral::coef_dim | ( | int | var, |
| int | nbr, | ||
| Array< double > *& | tab | ||
| ) | const |
performs the coefficient transformation for one particular variable.
| var | [input] : the variable for which the coefficients are to be computed. |
| nbr | [input] : number of coefficients for var. |
| tab | [input/output] : values of the field, before and after the computation of the coefficients. |
Definition at line 28 of file coef.cpp.
References bases_1d, Kadath::Array< T >::get_dimensions(), Kadath::Array< T >::get_size(), Kadath::Array_iterator::inc(), Kadath::Array_iterator::inc1(), ndim, Kadath::Array_iterator::set(), Kadath::Array< T >::set(), and Kadath::Dim_array::set().
| Array< double > Kadath::Base_spectral::coef_i | ( | const Dim_array & | nbr_points, |
| const Array< double > & | so | ||
| ) | const |
Computes the values in the configuration space.
| nbr_points | [input] : number of points. |
| so | [input] : values of the field in the coefficients space. |
Definition at line 96 of file coef_i.cpp.
References coef_i_dim(), and ndim.
| void Kadath::Base_spectral::coef_i_dim | ( | int | var, |
| int | nbr, | ||
| Array< double > *& | tab | ||
| ) | const |
Performs the inverse coefficient transformation for one particular variable.
| var | [input] : the variable for which the coefficients are to be computed. |
| nbr | [input] : number of points in the configuration space for var. |
| tab | [input/output] : values of the field, before and after the computation of the coefficients. |
Definition at line 28 of file coef_i.cpp.
References bases_1d, Kadath::Array< T >::get_dimensions(), Kadath::Array< T >::get_size(), Kadath::Array_iterator::inc(), Kadath::Array_iterator::inc1(), ndim, Kadath::Array_iterator::set(), Kadath::Array< T >::set(), and Kadath::Dim_array::set().
|
inline |
Returns one of the 1d base array.
Definition at line 119 of file base_spectral.hpp.
References bases_1d.
|
inline |
true if the basis is defined, false otherwise. Definition at line 109 of file base_spectral.hpp.
References def.
| Array< double > Kadath::Base_spectral::ope_1d | ( | int(*)(int, Array< double > &) | function, |
| int | var, | ||
| const Array< double > & | so, | ||
| Base_spectral & | base | ||
| ) | const |
One-dimensional operator acting in the coefficient space.
| function | [input] : function pointing to the particular operation to be performed (i.e. like mult_sin_x_1d ) |
| var | [input] : variable on which the operatio is to be performed. |
| so | [input] : coefficients of the field before the operation. |
| base | [input/output] : basis of the field. After the operation, the basis associated with var may is changed but not the others basis which should be changed by hand, if needed. |
Definition at line 26 of file ope_1d.cpp.
References bases_1d, Kadath::Array< T >::get_dimensions(), Kadath::Array< T >::get_size(), Kadath::Array_iterator::inc(), Kadath::Array_iterator::inc1(), ndim, Kadath::Array_iterator::set(), and Kadath::Array< T >::set().
|
inline |
Move assignment operator.
Definition at line 235 of file base_spectral.hpp.
|
inline |
Assignement operator.
Definition at line 251 of file base_spectral.hpp.
| void Kadath::Base_spectral::save | ( | FILE * | fd | ) | const |
Saving function.
Definition at line 71 of file base_spectral.cpp.
| void Kadath::Base_spectral::set | ( | Dim_array const & | nbr_coefs, |
| int | basephi, | ||
| int | basetheta, | ||
| int | baser | ||
| ) |
Allocates the various arrays, for a given number of coefficients and sets basis to some values (same for all harmonics).
It assumes one is working in 3D.
| nbr_coefs | [input] : a Dim_array storing the number of coefficients in each dimenions. |
| basephi | : basis for |
| basetheta | : basis for |
| baser | : basis for |
Definition at line 109 of file base_spectral.cpp.
References allocate(), bases_1d, def, Kadath::Dim_array::get_ndim(), and Kadath::Index::set().
|
inline |
Sets all the basis to the undefined state.
Definition at line 242 of file base_spectral.hpp.
Computes the spectral summation.
| num | [input] : numerical coordinates used in the summation. |
| tab | [input] : spectral coefficients of the field. |
Definition at line 272 of file summation_1d.cpp.
References bases_1d, Kadath::Array< T >::get_dimensions(), Kadath::Array< T >::get_ndim(), Kadath::Array< T >::get_size(), Kadath::Index::inc(), ndim, Kadath::Array< T >::set(), Kadath::Dim_array::set(), and Kadath::Index::set().
|
inline |
Swaps data between the source and this.
Definition at line 264 of file base_spectral.hpp.
|
friend |
Display.
Definition at line 96 of file base_spectral.cpp.
|
friend |
Comparison operator.
Definition at line 270 of file base_spectral.hpp.
|
protected |
Arrays containing the various basis of decomposition.
The size of each array depends on the order of the various numerical coordinates.
Definition at line 82 of file base_spectral.hpp.
|
protected |
true if the Base_spectral is defined and false otherwise.
Definition at line 75 of file base_spectral.hpp.
|
protected |
Number of dimensions.
Definition at line 76 of file base_spectral.hpp.