Mathc initiation/Fichiers h : c64a9


Sommaire


Installer ce fichier dans votre répertoire de travail.

x_fluzyx.h
/* --------------------------------- */
/* save as x_fluzyx.h                */
/* --------------------------------- */
double flux_z_dzdydx(

double (*P_M)(double x, double y, double z),
double (*P_N)(double x, double y, double z),
double (*P_P)(double x, double y, double z),

double (*P_u)(double x, double y),
double (*P_v)(double x, double y),
   int nz,
   
double y,

double x
)
{
pt3d n;
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nz; i++)
 {
       if(i ==0 || i== nz){m = 1.;}
  else if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

          n.x = x;
          n.y = y;
          n.z = ((*P_u)(x,y)) + i*(((*P_v)(x,y))-((*P_u)(x,y)))/nz;


  M += m * (fxyz_x((*P_M),H,n) + fxyz_y((*P_N),H,n) + fxyz_z((*P_P),H,n)) ;
 }

  return( ((((*P_v)(x,y)) -((*P_u)(x,y)))*M) / (3*nz) );
}
/* --------------------------------- */
double flux_y_dzdydx(
double (*P_M)(double x, double y, double z),
double (*P_N)(double x, double y, double z),
double (*P_P)(double x, double y, double z),

double (*P_u)(double x, double y),
double (*P_v)(double x, double y),
   int nz,
   
double (*P_s)(double x),
double (*P_t)(double x),
   int ny,
   
double x
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= ny; i++)
 {
       if(i ==0 || i== ny){m = 1.;}
  else if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

  M += m * flux_z_dzdydx(
                             (*P_M),
                             (*P_N),
                             (*P_P),
                             
                             (*P_u),
                             (*P_v),
                               nz,
                             
                           (((*P_s)(x))+i*(((*P_t)(x))-((*P_s)(x)))/ny),
                               
                                x);
 }

 return( ((((*P_t)(x)) -((*P_s)(x)))*M) / (3*ny) );
}
/* --------------------------------- */
double flux_dzdydx(

double (*P_M)(double x, double y, double z),
double (*P_N)(double x, double y, double z),
double (*P_P)(double x, double y, double z),

double (*P_u)(double x, double y),
double (*P_v)(double x, double y),
   int nz,
   
double (*P_s)(double x),
double (*P_t)(double x),
   int ny,
   
double ax,
double bx,
   int nx
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nx; i++)
 {
       if(i ==0 || i== nx){m = 1.;}
  else if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

  M += m * flux_y_dzdydx(
                             (*P_M),
                             (*P_N),
                             (*P_P),
                             
                             (*P_u),
                             (*P_v),
                               nz,
                               
                             (*P_s),
                             (*P_t),
                               ny,
                               
                             (ax+i*(bx-ax)/nx));
 }

  return( ((bx -ax)*M) / (3*nx) );
}
/* --------------------------------- */
/* --------------------------------- */


Déclaration des fichiers h.