From 7309a8a0d7bd6c99d7efdc24de9878a902099399 Mon Sep 17 00:00:00 2001 From: chr Date: Sun, 5 Jul 2015 02:29:20 +0000 Subject: [PATCH] Strip extra spaces from code. git-svn-id: https://codeforge.lbl.gov/anonscm/voro@588 6221c96e-593b-4ce1-a500-64c4038a1943 --- trunk/examples/extra/l_shape.cc | 25 +++++++++++++++++-------- trunk/src/cell.cc | 27 ++++++++++----------------- trunk/src/cell.hh | 4 ++-- trunk/src/cmd_line.cc | 15 +++++++-------- trunk/src/container.cc | 1 - trunk/src/container_prd.cc | 4 ++-- trunk/src/container_prd.hh | 2 +- trunk/src/rad_option.hh | 26 +++++++++++++------------- trunk/src/v_compute.cc | 1 - trunk/src/wall.hh | 1 - 10 files changed, 52 insertions(+), 54 deletions(-) diff --git a/trunk/examples/extra/l_shape.cc b/trunk/examples/extra/l_shape.cc index 25c8ee9..cf6a65f 100644 --- a/trunk/examples/extra/l_shape.cc +++ b/trunk/examples/extra/l_shape.cc @@ -13,27 +13,36 @@ const int particles=20; // This function returns a random double between 0 and 1 double rnd() {return double(rand())/RAND_MAX;} -// Create a wall class that, whenever called, will replace the Voronoi cell -// with a prescribed shape, in this case a dodecahedron +// Create a wall class that will initialize the Voronoi cell to fill the +// L-shaped domain class wall_l_shape : public wall { public: wall_l_shape() { v.init_l_shape(); + v.draw_gnuplot(0,0,0,"l_shape_init.gnu"); }; bool point_inside(double x,double y,double z) {return true;} bool cut_cell(voronoicell &c,double x,double y,double z) { - // Set the cell to be equal to the dodecahedron + // Set the cell to be equal to the L-shape c=v; c.translate(-x,-y,-z); + + // Set the tolerance to 100, to make the code search + // for cases where non-convex cells are cut in multiple + // places c.big_tol=100; return true; } bool cut_cell(voronoicell_neighbor &c,double x,double y,double z) { - // Set the cell to be equal to the dodecahedron + // Set the cell to be equal to the L-shape c=v; c.translate(-x,-y,-z); + + // Set the tolerance to 100, to make the code search + // for cases where non-convex cells are cut in multiple + // places c.big_tol=100; return true; } @@ -45,15 +54,14 @@ int main() { int i=0; double x,y,z; - // Create a container with the geometry given above. This is bigger - // than the particle packing itself. + // Create a container container con(-1,1,-1,1,-1,1,5,5,5,false,false,false,8); // Create the L-shape wall class and add it to the container wall_l_shape(wls); con.add_wall(wls); - // Import the irregular particle packing + // Add particles, making sure not to place any outside of the L-shape while(i=3 @@ -285,7 +285,6 @@ void voronoicell_base::add_memory_xse() { stacke3=xse+current_xsearch_size; } - /** Initializes a Voronoi cell as a rectangular box with the given dimensions. * \param[in] (xmin,xmax) the minimum and maximum x coordinates. * \param[in] (ymin,ymax) the minimum and maximum y coordinates. @@ -486,7 +485,7 @@ inline bool voronoicell_base::search_upward(unsigned int &uw,int &lp,int &ls,int up=lp; return false; } - + while(uw==0) { //if(++count>=p) failsafe_find(lp,ls,us,l,u); @@ -557,7 +556,7 @@ bool voronoicell_base::definite_max(int &lp,int &ls,double &l,double &u,unsigned // Skip the point if it's already marked if(ed[qp][nu[qp]<<1]<0) continue; qw=m_test(qp,q); - + // This point is a better maximum. Reset markers and // return true. if(q>l) { @@ -602,7 +601,7 @@ inline bool voronoicell_base::search_downward(unsigned int &lw,int &lp,int &ls,i if(u>l) break; } if(us==nu[up]) if(definite_min(lp,us,l,u,lw)) return false; - + while(lw==2) { //if(++count>=p) failsafe_find(lp,ls,us,l,u); @@ -667,7 +666,7 @@ bool voronoicell_base::definite_min(int &lp,int &us,double &l,double &u,unsigned // Skip the point if it's already marked if(ed[qp][nu[qp]<<1]<0) continue; qw=m_test(qp,q); - + // This point is a better minimum. Reset markers and // return true. if(qds) flip(*(--stackp)); return true; } - + /** Cuts the Voronoi cell by a particle whose center is at a separation of * (x,y,z) from the cell center. The value of rsq should be initially set to * \f$x^2+y^2+z^2\f$. @@ -739,7 +738,7 @@ bool voronoicell_base::nplane(vc_class &vc,double x,double y,double z,double rsq // Store initial number of vertices int op=p; - + if(create_facet(vc,lp,ls,l,us,u,p_id)) return false; int k=0;int xtra=0; while(xse+k=op) continue; @@ -765,7 +764,7 @@ bool voronoicell_base::nplane(vc_class &vc,double x,double y,double z,double rsq if(create_facet(vc,-1,0,0,0,u,p_id)) return false; } else { - // This is a new facet + // This is a new facet us=ed[lp][nu[lp]+ls]; m_test(lp,l); if(create_facet(vc,lp,ls,l,us,u,p_id)) return false; @@ -1716,7 +1715,6 @@ void voronoicell_base::minkowski_formula(double x0,double y0,double z0,double r, ar+=arc*si; } - /** Calculates the areas of each face of the Voronoi cell and prints the * results to an output stream. * \param[out] v the vector to store the results in. */ @@ -1753,7 +1751,6 @@ void voronoicell_base::face_areas(std::vector &v) { reset_edges(); } - /** Calculates the total surface area of the Voronoi cell. * \return The computed area. */ double voronoicell_base::surface_area() { @@ -1787,7 +1784,6 @@ double voronoicell_base::surface_area() { return 0.125*area; } - /** Calculates the centroid of the Voronoi cell, by decomposing the cell into * tetrahedra extending outward from the zeroth vertex. * \param[out] (cx,cy,cz) references to floating point numbers in which to @@ -1992,7 +1988,6 @@ unsigned int voronoicell_base::m_calc(int n,double &ans) { return maskr; } - /** Checks to see if a given vertex is inside, outside or within the test * plane. If the point is far away from the test plane, the routine immediately * returns whether it is inside or outside. If the routine is close the the @@ -2098,7 +2093,6 @@ inline void voronoicell_base::normals_search(std::vector &v,int i,int j, v.push_back(0); } - /** Returns the number of faces of a computed Voronoi cell. * \return The number of faces. */ int voronoicell_base::number_of_faces() { @@ -2159,7 +2153,6 @@ void voronoicell_base::output_vertices(FILE *fp) { } } - /** Returns a vector of the vertex vectors in the global coordinate system. * \param[out] v the vector to store the results in. * \param[in] (x,y,z) the position vector of the particle in the global @@ -2344,7 +2337,7 @@ inline bool voronoicell_base::plane_intersects_track(double x,double y,double z, for(int tp=0;tprsq) return true; return false; -/* +/* int ls,us,lp; double l,u; unsigned int uw; diff --git a/trunk/src/cell.hh b/trunk/src/cell.hh index 8c19ecc..331504e 100644 --- a/trunk/src/cell.hh +++ b/trunk/src/cell.hh @@ -48,7 +48,7 @@ class voronoicell_base { /** This sets the size of the auxiliary delete stack. */ int current_delete2_size; /** This sets the size of the extra search stack. */ - int current_xsearch_size; + int current_xsearch_size; /** This sets the total number of vertices in the current cell. */ int p; @@ -446,7 +446,7 @@ class voronoicell_neighbor : public voronoicell_base { template voronoicell_neighbor(c_class &con) : voronoicell_base(con.max_len_sq) { memory_setup(); - } + } ~voronoicell_neighbor(); void operator=(voronoicell &c); void operator=(voronoicell_neighbor &c); diff --git a/trunk/src/cmd_line.cc b/trunk/src/cmd_line.cc index d645d70..3a1f0d7 100644 --- a/trunk/src/cmd_line.cc +++ b/trunk/src/cmd_line.cc @@ -265,12 +265,12 @@ int main(int argc,char **argv) { double w0=atof(argv[i++]),w1=atof(argv[i++]); double w2=atof(argv[i++]),w3=atof(argv[i++]); double w4=atof(argv[i++]),w5=atof(argv[i]); - wl.add_wall(new wall_plane(-1,0,0,-w0,j));j--; - wl.add_wall(new wall_plane(1,0,0,w1,j));j--; - wl.add_wall(new wall_plane(0,-1,0,-w2,j));j--; - wl.add_wall(new wall_plane(0,1,0,w3,j));j--; - wl.add_wall(new wall_plane(0,0,-1,-w4,j));j--; - wl.add_wall(new wall_plane(0,0,1,w5,j));j--; + wl.add_wall(new wall_plane(-1,0,0,-w0,j));j--; + wl.add_wall(new wall_plane(1,0,0,w1,j));j--; + wl.add_wall(new wall_plane(0,-1,0,-w2,j));j--; + wl.add_wall(new wall_plane(0,1,0,w3,j));j--; + wl.add_wall(new wall_plane(0,0,-1,-w4,j));j--; + wl.add_wall(new wall_plane(0,0,1,w5,j));j--; } else if(strcmp(argv[i],"-ws")==0) { if(i>=argc-11) {error_message();wl.deallocate();return VOROPP_CMD_LINE_ERROR;} i++; @@ -487,7 +487,7 @@ int main(int argc,char **argv) { "Total V. cell volume : %g\n",tp,((double) tp)/(nx*ny*nz), vcc,(bx-ax)*(by-ay)*(bz-az),vol); } - + // Close output files fclose(outfile); if(gnu_file!=NULL) fclose(gnu_file); @@ -495,4 +495,3 @@ int main(int argc,char **argv) { if(povv_file!=NULL) fclose(povv_file); return 0; } - diff --git a/trunk/src/container.cc b/trunk/src/container.cc index 7f7f457..26c99df 100644 --- a/trunk/src/container.cc +++ b/trunk/src/container.cc @@ -516,7 +516,6 @@ void container_base::draw_domain_pov(FILE *fp) { "sphere{<%g,%g,%g>,rr}\nsphere{<%g,%g,%g>,rr}\n",ax,ay,bz,bx,ay,bz,ax,by,bz,bx,by,bz); } - /** The wall_list constructor sets up an array of pointers to wall classes. */ wall_list::wall_list() : walls(new wall*[init_wall_size]), wep(walls), wel(walls+init_wall_size), current_wall_size(init_wall_size) {} diff --git a/trunk/src/container_prd.cc b/trunk/src/container_prd.cc index 8ecdff2..0df0009 100644 --- a/trunk/src/container_prd.cc +++ b/trunk/src/container_prd.cc @@ -28,7 +28,7 @@ namespace voro { * particle. */ container_periodic_base::container_periodic_base(double bx_,double bxy_,double by_, double bxz_,double byz_,double bz_,int nx_,int ny_,int nz_,int init_mem_,int ps_) - : unitcell(bx_,bxy_,by_,bxz_,byz_,bz_), + : unitcell(bx_,bxy_,by_,bxz_,byz_,bz_), voro_base(nx_,ny_,nz_,bx_/nx_,by_/ny_,bz_/nz_), max_len_sq(unit_voro.max_radius_squared()), ey(int(max_uv_y*ysp+1)), ez(int(max_uv_z*zsp+1)), wy(ny+ey), wz(nz+ez), oy(ny+2*ey), oz(nz+2*ez), oxyz(nx*oy*oz), id(new int*[oxyz]), p(new double*[oxyz]), @@ -140,7 +140,7 @@ void container_periodic_poly::put(int n,double x,double y,double z,double r,int int ijk; put_locate_block(ijk,x,y,z,ai,aj,ak); for(int l=0;l vc; friend class voro_compute; diff --git a/trunk/src/rad_option.hh b/trunk/src/rad_option.hh index d946fa4..1ea52c5 100644 --- a/trunk/src/rad_option.hh +++ b/trunk/src/rad_option.hh @@ -15,7 +15,7 @@ namespace voro { -/** \brief Class containing all of the routines that are specific to computing +/** \brief Class containing all of the routines that are specific to computing * the regular Voronoi tessellation. * * The container and container_periodic classes are derived from this class, @@ -46,11 +46,11 @@ class radius_mono { * \param[in] rs the value to consider. * \return The value with the radius squared added. */ inline double r_max_add(double rs) {return rs;} - /** Subtracts the radius squared of a particle from a given + /** Subtracts the radius squared of a particle from a given * value. * \param[in] rs the value to consider. * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. + * \param[in] q the index of the particle within the block. * \return The value with the radius squared subtracted. */ inline double r_current_sub(double rs,int ijk,int q) {return rs;} /** Scales a plane displacement prior to use in the plane cutting @@ -58,7 +58,7 @@ class radius_mono { * \param[in] rs the initial plane displacement. * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ + * \return The scaled plane displacement. */ inline double r_scale(double rs,int ijk,int q) {return rs;} /** Scales a plane displacement prior to use in the plane * cutting algorithm, and also checks if it could possibly cut @@ -69,11 +69,11 @@ class radius_mono { * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. * \return True if the cell could possibly cut the cell, false - * otherwise. */ + * otherwise. */ inline bool r_scale_check(double &rs,double mrs,int ijk,int q) {return rssqrt(mrs*crs);} /** Scales a plane displacement during a plane bounds check. * \param[in] lrs the plane displacement. - * \return The scaled value. */ + * \return The scaled value. */ inline double r_cutoff(double lrs) {return lrs*r_val;} /** Adds the maximum radius squared to a given value. * \param[in] rs the value to consider. - * \return The value with the radius squared added. */ + * \return The value with the radius squared added. */ inline double r_max_add(double rs) {return rs+max_radius*max_radius;} - /** Subtracts the radius squared of a particle from a given + /** Subtracts the radius squared of a particle from a given * value. * \param[in] rs the value to consider. * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. + * \param[in] q the index of the particle within the block. * \return The value with the radius squared subtracted. */ inline double r_current_sub(double rs,int ijk,int q) { return rs-ppr[ijk][4*q+3]*ppr[ijk][4*q+3]; @@ -131,7 +131,7 @@ class radius_poly { * \param[in] rs the initial plane displacement. * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ + * \return The scaled plane displacement. */ inline double r_scale(double rs,int ijk,int q) { return rs+r_rad-ppr[ijk][4*q+3]*ppr[ijk][4*q+3]; } diff --git a/trunk/src/v_compute.cc b/trunk/src/v_compute.cc index 84991fd..54b6a85 100644 --- a/trunk/src/v_compute.cc +++ b/trunk/src/v_compute.cc @@ -779,7 +779,6 @@ inline bool voro_compute::face_z_test(v_cell &c,double x0,double y0,dou return true; } - /** This routine checks to see whether a point is within a particular distance * of a nearby region. If the point is within the distance of the region, then * the routine returns true, and computes the maximum distance from the point diff --git a/trunk/src/wall.hh b/trunk/src/wall.hh index 6db0c5a..59343af 100644 --- a/trunk/src/wall.hh +++ b/trunk/src/wall.hh @@ -86,7 +86,6 @@ struct wall_cylinder : public wall { const double xc,yc,zc,xa,ya,za,asi,rc; }; - /** \brief A class representing a conical wall object. * * This class represents a cone wall object. */ -- 2.11.4.GIT