20 #include "headcpp.hpp"
21 #include "base_spectral.hpp"
38 fread_be (&indic,
sizeof(
int), 1, fd) ;
39 def = (indic==0) ?
true :
false ;
40 fread_be (&
ndim,
sizeof(
int), 1, fd) ;
43 for (
int i=0 ; i<
ndim ; i++)
46 for (
int i=0 ; i<
ndim ; i++)
72 int indic = (
def) ? 0 : 1 ;
73 fwrite_be (&indic,
sizeof(
int), 1, fd) ;
74 fwrite_be (&
ndim,
sizeof(
int), 1, fd) ;
76 for (
int i=0 ; i<
ndim ; i++)
84 for (
int i=0 ; i<
ndim ; i++)
88 for (
int i=
ndim-2 ; i>=0 ; i--) {
90 for (
int k=0 ; k<
ndim-1-i ; k++)
91 sizes.set(k) = nbr_coef(i+k+1) ;
97 o << so.
ndim <<
"-dimensional spectral base" << endl ;
99 for (
int l=0 ; l<so.
ndim ; l++) {
100 o <<
"Variable " << l << endl ;
105 o <<
"Base not defined" << endl ;
117 for (
int k(0) ; k < nbr_coefs(2) ; ++k)
120 for (
int j(0) ; j < nbr_coefs(1) ; ++j)
122 index.
set(0) = j ; index.
set(1) = k;
Class for storing the basis of decompositions of a field.
Base_spectral(int dimensions)
Standard constructor, the Base_spectral is not defined.
void save(FILE *) const
Saving function.
Bases_container bases_1d
Arrays containing the various basis of decomposition.
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 ...
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.
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.