30char grille_val_interp_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valencia/grille_val_interp.C,v 1.13 2014/10/13 08:53:48 j_novak Exp $" ;
88#include "grille_val.h"
111 cout <<
"Grille_val::compatibilite: the number of dimensions" <<
endl ;
112 cout <<
"of both grids do not coincide!" <<
endl;
116 cout <<
"Grille_val::compatibilite: the symmetries in theta" <<
endl ;
117 cout <<
"of both grids do not coincide!" <<
endl;
121 cout <<
"Grille_val::compatibilite: the symmetries in phi" <<
endl ;
122 cout <<
"of both grids do not coincide!" <<
endl;
138 if (
mgrid->get_type_t() == SYM)
147 if (
mgrid->get_type_t() == SYM)
151 if (
mgrid->get_type_p() == SYM) {
182 cout <<
"Grille_val::compatibilite: the number of dimensions" <<
endl ;
183 cout <<
"of both grids do not coincide!" <<
endl;
188 cout <<
"Grille_val::compatibilite: the symmetries in theta" <<
endl ;
189 cout <<
"of both grids do not coincide!" <<
endl;
193 cout <<
"Grille_val::compatibilite: the symmetries in phi" <<
endl ;
194 cout <<
"of both grids do not coincide!" <<
endl;
227 cout <<
"Grille_val::contenue_dans: the number of dimensions" <<
endl ;
228 cout <<
"of both grids do not coincide!" <<
endl;
232 cout <<
"Grille_val::contenue_dans: the symmetries in theta" <<
endl ;
233 cout <<
"of both grids do not coincide!" <<
endl;
237 cout <<
"Grille_val::contenue_dans: the symmetries in phi" <<
endl ;
238 cout <<
"of both grids do not coincide!" <<
endl;
247 double radius2 = radius*radius ;
283 cout <<
"Grille_val::contenue_dans: the symmetries in theta" <<
endl ;
284 cout <<
"of both grids do not coincide!" <<
endl;
288 cout <<
"Grille_val::contenue_dans: the symmetries in phi" <<
endl ;
289 cout <<
"of both grids do not coincide!" <<
endl;
319 farr.set_etat_qcq() ;
394 cout <<
"Spline interpolation not implemented yet!" <<
endl ;
399 cout <<
"Unknown type of interpolation!" <<
endl ;
425 fdept->set_etat_qcq() ;
430 farr.set_etat_qcq() ;
433 for (
int i=0;
i<
ntv;
i++) {
442 fdept->set_etat_qcq() ;
444 for (
int i=0;
i<
nrm;
i++) {
454#ifndef DOXYGEN_SHOULD_SKIP_THIS
464int copar(
const void* a,
const void* b) {
465 double x = (
reinterpret_cast<const Point*
>(a))->x ;
466 double y = (
reinterpret_cast<const Point*
>(b))->x ;
467 return x > y ? 1 : -1 ;
485 int nz =
zdep.get_dim(0) ;
486 int nx =
xdep.get_dim(0) ;
487 int nr =
rarr.get_dim(0) ;
488 int nt =
tarr.get_dim(0) ;
491 farr.set_etat_qcq() ;
497 for (
it=0;
it < nt;
it++) {
498 for (
ir=0;
ir < nr;
ir++) {
506 void* base =
reinterpret_cast<void*
>(
zlk) ;
541 tablo.set_etat_qcq() ;
542 for (
int j=0;
j<
nx;
j++) {
566 void*
bas2 =
reinterpret_cast<void*
>(
xlk) ;
594 for (
int j=0;
j<
nx;
j++) {
654 fdept->set_etat_qcq() ;
659 farr.set_etat_qcq() ;
661 for (
int i=0;
i<
npv;
i++) {
672 fdept->set_etat_qcq() ;
673 for (
int i=0;
i<
ntm;
i++) {
674 for (
int j=0;
j<
nrm;
j++) {
697 int nr =
rarr.get_dim(0) ;
698 int nt =
tarr.get_dim(0) ;
699 int np =
parr.get_dim(0) ;
701 farr.set_etat_qcq() ;
707 rarr2->set_etat_qcq() ;
713 int nr2 =
coq ? 2*nr : nr ;
717 for(
int iz=0;
iz<nz;
iz++) {
719 carre.set_etat_qcq() ;
726 for (
int ip=0;
ip<np;
ip++)
731 for (
int ip=0;
ip<np;
ip++) {
733 carre.set_etat_qcq() ;
736 for (
int iz=0;
iz<nz;
iz++)
740 for (
int it=0;
it<nt;
it++)
741 for (
int ir=0;
ir<nr;
ir++)
Active physical coordinates and mapping derivatives.
int * dim
Array of dimensions (size: ndim).
int ndim
Number of dimensions of the Tbl: can be 1, 2 or 3.
Time evolution with partial storage (*** under development ***).
int type_p
Type of symmetry in :
int nfantome
The number of hidden cells (same on each side)
double * zrmin
Lower boundary for z (or r ) direction
Dim_tbl dim
The dimensions of the grid.
Tbl * zr
Arrays containing the values of coordinate z (or r) on the nodes
double get_zr(const int i) const
Read-only of a particular value of the coordinate z (or r ) at the nodes.
int type_t
Type of symmetry in :
Tbl interpol1(const Tbl &rdep, const Tbl &rarr, const Tbl &fdep, int flag, const int type_inter) const
Performs 1D interpolation.
double * zrmax
Higher boundary for z (or r ) direction
double * xmax
Higher boundary for x dimension.
double * xmin
Lower boundary for x dimension.
double * ymin
Lower boundary for y dimension.
double * ymax
Higher boundary for y dimension.
Tbl interpol2c(const Tbl &xdep, const Tbl &zdep, const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const
Same as before, but the coordinates of source points are passed explicitly (xdep, zdep).
virtual Tbl interpol3(const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const Tbl &phiarr, const int type_inter) const
Performs 3D interpolation.
Tbl * y
Arrays containing the values of coordinate y on the nodes.
virtual Tbl interpol2(const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const
Performs 2D interpolation.
virtual bool compatible(const Map *mp, const int lmax, const int lmin=0) const
Checks if the spectral grid and mapping are compatible with the Grille_val caracteristics for the int...
Tbl * x
Arrays containing the values of coordinate x on the nodes.
virtual bool contenue_dans(const Map &mp, const int lmax, const int lmin=0) const
Checks if Gval_cart is contained inside the spectral grid/mapping within the domains [lmin,...
virtual bool compatible(const Map *mp, const int lmax, const int lmin=0) const
Checks if the spectral grid and mapping are compatible with the Grille_val caracteristics for the int...
virtual bool contenue_dans(const Map &mp, const int lmax, const int lmin=0) const
Checks if Gval_spher is contained inside the spectral grid/mapping within the domains [lmin,...
Tbl * phi
Arrays containing the values of coordinate on the nodes.
virtual Tbl interpol3(const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const Tbl &phiarr, const int type_inter) const
Performs 3D interpolation.
virtual Tbl interpol2(const Tbl &fdep, const Tbl &rarr, const Tbl &tetarr, const int type_inter) const
Performs 2D interpolation.
Tbl * tet
Arrays containing the values of coordinate on the nodes.
Base class for coordinate mappings.
Coord r
r coordinate centered on the grid
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
Cmp sin(const Cmp &)
Sine.
Cmp cos(const Cmp &)
Cosine.