first commit
This commit is contained in:
commit
aaf40315c8
15 changed files with 17524 additions and 0 deletions
85
def_H.c
Normal file
85
def_H.c
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
double W(double Rij, double h)
|
||||
{
|
||||
|
||||
double v, v2, v3, tmp=0.0;
|
||||
|
||||
v = Rij/h; v2 = v*v; v3 = v*v*v;
|
||||
|
||||
if( (v >= 0.0) && (v <= 1.0) )
|
||||
{
|
||||
tmp = 1.0 - 1.5*v2 + 0.75*v3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (v > 1.0) && (v < 2.0) )
|
||||
{
|
||||
tmp = 0.25*(2.0-v)*(2.0-v)*(2.0-v);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = 0.0; /* if ( v >= 2.0 ) */
|
||||
}
|
||||
}
|
||||
|
||||
tmp = 1.0/(Pi*h*h*h)*tmp;
|
||||
|
||||
return(tmp);
|
||||
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void DEF_H(double x_gas[][3], double h_gas[], int sosed_gas[][NB])
|
||||
{
|
||||
|
||||
int sosed_tmp[N_GAS_MAX];
|
||||
double Xij, Yij, Zij;
|
||||
|
||||
for(i=0;i<N_GAS;i++)
|
||||
{
|
||||
|
||||
for(j=0;j<N_GAS;j++)
|
||||
{
|
||||
Xij = x_gas[i][0]-x_gas[j][0];
|
||||
Yij = x_gas[i][1]-x_gas[j][1];
|
||||
Zij = x_gas[i][2]-x_gas[j][2];
|
||||
|
||||
d[j] = Xij*Xij + Yij*Yij + Zij*Zij;
|
||||
|
||||
sosed_tmp[j] = ind_gas[j];
|
||||
} /* j */
|
||||
|
||||
my_sort(0, N_GAS-1, d, sosed_tmp);
|
||||
|
||||
// tmp = my_select(0, N_GAS-1, NB-1, d, sosed_tmp); d[NB-1] = tmp;
|
||||
|
||||
h_gas[i] = sqrt( d[NB-1] )*0.5;
|
||||
|
||||
for(k=0;k<NB;k++) sosed_gas[i][k] = sosed_tmp[k];
|
||||
|
||||
/*
|
||||
h_gas[i] = MAX(h_gas[i], h_min);
|
||||
h_gas[i] = MIN(h_gas[i], h_max);
|
||||
*/
|
||||
|
||||
/*
|
||||
tmp_l = ldiv(i, N/64);
|
||||
|
||||
if(tmp_l.rem == 0)
|
||||
{
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
}
|
||||
*/
|
||||
|
||||
} /* i */
|
||||
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
Loading…
Add table
Add a link
Reference in a new issue