80 assert(
etat != ETATNONDEF) ;
81 if (
etat == ETATZERO) return ;
85 double alp =
log(
pow(10., alpha)) ;
87 for (
int lz=lzmin; lz<=lzmax; lz++) {
88 if ((*
va.
c_cf)(lz).get_etat() == ETATQCQ)
89 for (
int k=0; k<mgrid.
get_np(lz); k++)
90 for (
int j=0; j<mgrid.
get_nt(lz); j++) {
91 int nr = mgrid.
get_nr(lz) ;
92 for (
int i=0; i<nr; i++) {
93 double eta = double(i)/double(nr-1) ;
116 assert(
etat != ETATNONDEF) ;
117 if (
etat == ETATZERO) return ;
122 for (
int lz=lzmin; lz<=lzmax; lz++) {
123 if ((*
va.
c_cf)(lz).get_etat() == ETATQCQ)
124 for (
int k=0; k<mgrid.
get_np(lz); k++)
125 for (
int j=0; j<mgrid.
get_nt(lz); j++) {
126 int nr = mgrid.
get_nr(lz) ;
127 for (
int i=0; i<nr; i++) {
128 double eta = double(i)/double(nr) ;
142 void exp_filter_r_all_domains(
Scalar& ss,
int p,
double alpha ) {
162 assert(
etat != ETATNONDEF) ;
163 if (
etat == ETATZERO) return ;
164 double alp =
log(
pow(10., alpha)) ;
168 int l_q, m_q, base_r ;
170 for (
int lz=lzmin; lz<=lzmax; lz++)
171 if ((*
va.
c_cf)(lz).get_etat() == ETATQCQ) {
172 int np = mgrid.
get_np(lz) ;
173 int nt = mgrid.
get_nt(lz) ;
174 int nr = mgrid.
get_nr(lz) ;
176 for (
int k=0; k<np; k++)
177 for (
int j=0; j<nt; j++) {
179 if (nullite_plm(j, nt, k, np, base) == 1 ) {
180 double eta = double(l_q) / double(lmax) ;
181 double sigma =
exp(alp*
pow(eta, 2*p)) ;
182 for (
int i=0; i<nr; i++)
206 assert(
etat != ETATNONDEF) ;
207 if (
etat == ETATZERO) return ;
208 double alp =
log(
pow(10., alpha)) ;
212 int l_q, m_q, base_r ;
214 for (
int lz=lzmin; lz<=lzmax; lz++)
215 if ((*
va.
c_cf)(lz).get_etat() == ETATQCQ) {
216 int np = mgrid.
get_np(lz) ;
217 int nt = mgrid.
get_nt(lz) ;
218 int nr = mgrid.
get_nr(lz) ;
220 for (
int k=0; k<np+1; k++)
221 for (
int j=0; j<nt; j++) {
223 if (nullite_plm(j, nt, k, np, base) == 1 ) {
224 double eta_theta = double(l_q) / double(lmax) ;
225 double sigma_theta = (p_tet != 0) ?
exp(alp*
pow(eta_theta, 2*p_tet)) : 1. ;
227 double eta_phi = (np>1) ?
double(
abs(m_q)) /
double(np) : 0. ;
228 double sigma_phi = (p_phi != 0) ?
exp(alp*
pow(eta_phi, 2*p_phi)) : 1. ;
229 for (
int i=0; i<nr; i++)
231 double eta_r = double(i) / double(nr-1) ;
232 double sigma_r = (p_r != 0) ?
exp(alp*
pow(eta_r, 2*p_r)) : 1. ;
233 va.
c_cf->
set(lz, k, j, i) *= sigma_r * sigma_theta * sigma_phi ;
254 void exp_filter_ylm_all_domains_phi(Scalar& ss,
int p_r,
int p_tet,
int p_phi,
double alpha ) {
255 int nz = ss.get_mp().get_mg()->get_nzone() ;
256 ss.exponential_filter_ylm_phi(0, nz-1, p_r, p_tet, p_phi, alpha) ;
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
int give_lmax(const Mg3d &mgrid, int lz) const
Returns the highest multipole for a given grid.
void ylm_i()
Inverse of ylm()
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void coef() const
Computes the coeffcients of *this.
void give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
friend Scalar exp(const Scalar &)
Exponential.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
void ylm()
Computes the coefficients of *this.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
virtual void exponential_filter_ylm_phi(int lzmin, int lzmax, int p_r, int p_tet, int p_phi, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the angular directions.
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the radial direction.
void exp_filter_ylm_all_domains(Scalar &ss, int p, double alpha=-16.)
Applies an exponential filter in angular directions in all domains.
friend Scalar pow(const Scalar &, int)
Power .
virtual void del_deriv() const
Logical destructor of the derivatives.
Base_val base
Bases on which the spectral expansion is performed.
Mtbl * c
Values of the function at the points of the multi-grid.
int get_nzone() const
Returns the number of domains.
Valeur va
The numerical value of the Scalar.
void sarra_filter_r_all_domains(double p, double alpha=1E-16)
Applies an exponential filter in radial direction in all domains for the case where p is a double (se...
friend Scalar log(const Scalar &)
Neperian logarithm.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Bases of the spectral expansions.
void sarra_filter_r(int lzmin, int lzmax, double p, double alpha=-1E-16)
Applies an exponential filter to the spectral coefficients in the radial direction.
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary)...
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void del_deriv()
Logical destructor of the derivatives.
friend Scalar abs(const Scalar &)
Absolute value.
virtual void exponential_filter_ylm(int lzmin, int lzmax, int p, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the angular directions.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
const Map & get_mp() const
Returns the mapping.