diff --git a/tests/lbpm_porenetwork_pp.cpp b/tests/lbpm_porenetwork_pp.cpp index f29fd95f..ef8edb2f 100644 --- a/tests/lbpm_porenetwork_pp.cpp +++ b/tests/lbpm_porenetwork_pp.cpp @@ -143,35 +143,46 @@ int main(int argc, char **argv) int index=0; while ( index < nsph ) { getline ( SPHERES, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; spheres(0,index)=strtod(value.c_str(),NULL); getline ( SPHERES, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; spheres(1,index)=strtod(value.c_str(),NULL); getline ( SPHERES, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; spheres(2,index)=strtod(value.c_str(),NULL); getline ( SPHERES, value ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; spheres(3,index)=strtod(value.c_str(),NULL); printf("cx=%f,cy=%f,cz=%f,r=%f\n",spheres(0,index),spheres(1,index),spheres(2,index),spheres(3,index)); index++; //cout << string( value, 1, value.length()-2 ); // display value removing the first and the last character from it } - printf("Reading spheres \n"); + printf("Reading cylinders \n"); ifstream CYLINDERS ( "cylinders.csv" ); // declare file stream: http://www.cplusplus.com/reference/iostream/ifstream/ index=0; while ( index < ncyl ) { getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(0,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(1,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(2,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(3,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(4,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value, ' ' ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(5,index)=strtod(value.c_str(),NULL); getline ( CYLINDERS, value ); // read a string until next comma: http://www.cplusplus.com/reference/string/getline/ + value = value*double(Nx-1)/Lx; cylinders(6,index)=strtod(value.c_str(),NULL); printf("x=%f,y=%f,z=%f,r=%f\n",cylinders(0,index),cylinders(1,index),cylinders(2,index),cylinders(6,index)); index++; @@ -186,13 +197,13 @@ int main(int argc, char **argv) // Compute the distance to each cylinder for (int p=0; p