fix swc stuff try 2

This commit is contained in:
James McClure 2022-08-27 16:06:30 -04:00
parent fc4af2d712
commit 9229de2875
2 changed files with 8 additions and 16 deletions

View File

@ -215,26 +215,18 @@ void Domain::read_swc(const std::string &Filename) {
double x = i*voxel_length + start_x;
double y = j*voxel_length + start_y;
double z = k*voxel_length + start_z;
double distance;
double s = ((x-xp)*alpha+(y-yp)*beta+(z-zp)*gamma) / (alpha*alpha + beta*beta + gamma*gamma);
double di = ri - sqrt((x-xi)*(x-xi) + (y-yi)*(y-yi) + (z-zi)*(z-zi));
double dp = rp - sqrt((x-xp)*(x-xp) + (y-yp)*(y-yp) + (z-zp)*(z-zp));
// linear variation for radius
double radius = rp + (ri - rp)*s/length;
distance = radius - sqrt((x-xp-alpha*s)*(x-xp-alpha*s) + (y-yp-beta*s)*(y-yp-beta*s) + (z-zp-gamma*s)*(z-zp-gamma*s));
if (distance < di) distance = di;
if (distance < dp) distance = dp;
if (s > length){
distance = di;
}
else if (s < 0.0){
distance = dp;
}
else {
// linear variation for radius
double radius = rp + (ri - rp)*s/length;
distance = radius - sqrt((x-xp-alpha*s)*(x-xp-alpha*s) + (y-yp-beta*s)*(y-yp-beta*s) + (z-zp-gamma*s)*(z-zp-gamma*s));
if (distance < di) distance = di;
if (distance < dp) distance = dp;
}
if ( distance > 0.0 ){
/* label the voxel */
//id[k*Nx*Ny + j*Nx + i] = label;

View File

@ -133,7 +133,7 @@ int main(int argc, char **argv)
IonModel.RunMembrane(IonModel.FluidVelocityDummy,PoissonSolver.ElectricField,PoissonSolver.Psi); //solve for ion transport with membrane
//comm.barrier();
if (rank == 0) printf(" Membrane step %i \n",timestep);
//if (rank == 0) printf(" Membrane step %i \n",timestep);
fflush(stdout);