Skip to content

Commit

Permalink
Fixed sodtube
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienLoiseau committed Jun 20, 2017
1 parent d5e5dc1 commit 7a21ac2
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions app/sodtube/generator/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ int main(int argc, char * argv[]){
P[part] = pressure_2;
rho[part] = rho_2;
u[part] = u_2;
m[part] = m_2;
//m[part] = m_2;
}else{
P[part] = pressure_1;
rho[part] = rho_1;
u[part] = u_1;
m[part] = m_1;
//m[part] = m_1;
}

m[part] = rho[part]*middle/(nparticles/2.);

//m[part] = 0.;
// Y and Z not used
// VX, VY, VZ and AX, AY, AZ stay to 0
Expand All @@ -119,25 +121,6 @@ int main(int argc, char * argv[]){
//std::cout<<x[part]<<": "<<h[part]<<std::endl;
}

// For each particle, search the neighbors to find the mass
//for(int64_t p1=0;p1<nparticlesproc; ++p1){
// for(int64_t p2=0;p2<nparticlesproc;++p2){
// if( fabs(x[p1]-x[p2]) < 2*smoothing_length ){
// Then consider it for my mass
// m[p1] += rho[p2]/kernel::cubic_spline_kernel
// (fabs(x[p1]-x[p2]),smoothing_length);
// }
// }
//}

//double totalmass = 0.;
//for(int64_t p1=0;p1<nparticlesproc; ++p1){
// totalmass += m[p1];
//}
//for(int64_t p1=0;p1<nparticlesproc; ++p1){
// m[p1] = m[p1]/totalmass;
//}

char filename[128];
//sprintf(filename,"%s_%d.h5part",fileprefix,nparticles);
sprintf(filename,"%s.h5part",fileprefix,nparticles);
Expand Down

0 comments on commit 7a21ac2

Please sign in to comment.