Mathc initiation/Fichiers h : c60a9
Installer ce fichier dans votre répertoire de travail.
x_surfzx.h |
---|
/* ---------------------------------- */
/* save as x_surfzx.h */
/* ---------------------------------- */
double Sint_dzx(
double (*P_g)(double x, double y, double z),
double (*P_h)(double x, double z),
double (*P_u)(double x),
double (*P_v)(double x),
int nz,
double x
)
{
pt2d p;
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.;}
p.y = ((*P_u)(x)) + i*(((*P_v)(x))-((*P_u)(x)))/nz;
p.x = x;
M += m * ( (*P_g)(p.x,(*P_h)(p.x,p.y),p.y) *
sqrt( pow(fxy_x((*P_h),H,p),2) +
pow(fxy_y((*P_h),H,p),2) +
1));
}
return( ((((*P_v)(x)) -((*P_u)(x)))*M) / (3*nz) );
}
/* ---------------------------------- */
double surface_dzdx(
double (*P_g)(double x, double y, double z),
double (*P_h)(double x, double z),
double (*P_u)(double x),
double (*P_v)(double x),
int nz,
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 * Sint_dzx( (*P_g),(*P_h),
(*P_u),(*P_v),nz,
(ax + i*(bx-ax)/nx));
}
return( ((bx -ax)*M) / (3*nx) );
}
/* ---------------------------------- */
/* ---------------------------------- */
Déclaration des fichiers h.