Sommaire


Installer ce fichier dans votre répertoire de travail.

x_jwvu.h
/* --------------------------------- */
/* save as x_jwvu.h                  */
/* --------------------------------- */
double J_z_wvu(
double (*P_f)(double x, double y, double z),

double (*P_X)(double x, double y, double z),
double (*P_Y)(double x, double y, double z),
double (*P_Z)(double x, double y, double z),

double (*P_az)(double x, double y),
double (*P_bz)(double x, double y),
   int   nz,

double y,

double x
)
{
pt3d   p;
	
double z = 0;

   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.;}

  z = ((*P_az)(x,y)) + i*(((*P_bz)(x,y))-((*P_az)(x,y)))/nz;
  
  p.x = x;
  p.y = y;   
  p.z = z;    
     
  M += m * (*P_f)( ((*P_X)(x,y,z)), 
                   ((*P_Y)(x,y,z)), 
                   ((*P_Z)(x,y,z))) 
                         * 
                 /* Jacobian */   
                      
                    fabs(
                    
              fxyz_x((*P_X),H,p) 
                       * 
   ( fxyz_y((*P_Y),H,p)*fxyz_z((*P_Z),H,p)
                       -
     fxyz_z((*P_Y),H,p)*fxyz_y((*P_Z),H,p) ) 
     
                       - 
                                       
              fxyz_y((*P_X),H,p) 
                       * 
   ( fxyz_x((*P_Y),H,p)*fxyz_z((*P_Z),H,p)
                       -
     fxyz_z((*P_Y),H,p)*fxyz_x((*P_Z),H,p) )
     
                       + 
                                       
              fxyz_z((*P_X),H,p) 
                       * 
   ( fxyz_x((*P_Y),H,p)*fxyz_y((*P_Z),H,p)
                       -
     fxyz_y((*P_Y),H,p)*fxyz_x((*P_Z),H,p) )
                        );
 }

  return( ((((*P_bz)(x,y)) -((*P_az)(x,y)))*M) / (3*nz) );
}
/* --------------------------------- */
double J_y_wvu(
double (*P_f)(double x, double y, double z),

double (*P_X)(double x, double y, double z),
double (*P_Y)(double x, double y, double z),
double (*P_Z)(double x, double y, double z),
   
double (*P_az)(double x, double y),
double (*P_bz)(double x, double y),
   int   nz,

double (*P_ay)(double x),
double (*P_by)(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 * J_z_wvu( (*P_f),
                    (*P_X), (*P_Y),(*P_Z),                            
                    (*P_az),(*P_bz),nz,
                    (((*P_ay)(x))+i*(((*P_by)(x))-((*P_ay)(x)))/ny),
                     x);
 }

 return( ((((*P_by)(x)) -((*P_ay)(x)))*M) / (3*ny) );
}
/* --------------------------------- */
double J_wvu(
double (*P_f)(double x, double y, double z),

double (*P_X)(double x, double y, double z),
double (*P_Y)(double x, double y, double z),
double (*P_Z)(double x, double y, double z),
   
double (*P_az)(double x, double y),
double (*P_bz)(double x, double y),
   int   nz,
      
double (*P_ay)(double x),
double (*P_by)(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 * J_y_wvu( (*P_f),
                    (*P_X), (*P_Y),(*P_Z),                                
                    (*P_az),(*P_bz),nz,
                    (*P_ay),(*P_by),ny,
                     (ax+i*(bx-ax)/nx));
 }

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


----