--- trunk/src/math/ConvexHull.cpp 2009/10/21 15:48:12 1378 +++ trunk/src/math/ConvexHull.cpp 2009/11/25 20:02:06 1390 @@ -5,19 +5,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,14 +28,23 @@ * University of Notre Dame has been advised of the possibility of * such damages. * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). + * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [4] Vardeman & Gezelter, in progress (2009). * + * * ConvexHull.cpp * * Purpose: To calculate convexhull, hull volume libqhull. * * Created by Charles F. Vardeman II on 11 Dec 2006. * @author Charles F. Vardeman II - * @version $Id: ConvexHull.cpp,v 1.19 2009-10-21 15:48:12 gezelter Exp $ + * @version $Id: ConvexHull.cpp,v 1.21 2009-11-25 20:02:01 gezelter Exp $ * */ @@ -62,7 +62,7 @@ #include #endif -using namespace oopse; +using namespace OpenMD; #ifdef HAVE_QHULL extern "C" @@ -77,9 +77,6 @@ extern "C" #include } -/* Old options Qt Qu Qg QG0 FA */ -/* More old opts Qc Qi Pp*/ - ConvexHull::ConvexHull() : Hull(), dim_(3), options_("qhull Qt Pp") { } @@ -126,11 +123,12 @@ void ConvexHull::computeHull(std::vector int nproc = MPI::COMM_WORLD.Get_size(); int myrank = MPI::COMM_WORLD.Get_rank(); int localHullSites = 0; - int* hullSitesOnProc = new int[nproc]; - int* coordsOnProc = new int[nproc]; - int* displacements = new int[nproc]; - int* vectorDisplacements = new int[nproc]; + std::vector hullSitesOnProc(nproc, 0); + std::vector coordsOnProc(nproc, 0); + std::vector displacements(nproc, 0); + std::vector vectorDisplacements(nproc, 0); + std::vector coords; std::vector vels; std::vector indexMap; @@ -277,13 +275,6 @@ void ConvexHull::computeHull(std::vector volume_ = qh totvol; area_ = qh totarea; -#ifdef IS_MPI - delete [] hullSitesOnProc; - delete [] coordsOnProc; - delete [] displacements; - delete [] vectorDisplacements; -#endif - qh_freeqhull(!qh_ALL); qh_memfreeshort(&curlong, &totlong); if (curlong || totlong) @@ -292,6 +283,10 @@ void ConvexHull::printHull(const std::string& geomFile } void ConvexHull::printHull(const std::string& geomFileName) { + +#ifdef IS_MPI + if (worldRank == 0) { +#endif FILE *newGeomFile; //create new .md file based on old .md file @@ -301,5 +296,8 @@ void ConvexHull::printHull(const std::string& geomFile qh_printfacets(newGeomFile, qh PRINTout[i], qh facet_list, NULL, !qh_ALL); fclose(newGeomFile); +#ifdef IS_MPI + } +#endif } #endif //QHULL