/*
- *
- * This source code is part of
- *
- * G R O M A C S
- *
- * GROningen MAchine for Chemical Simulations
- *
- * VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
+ * This file is part of the GROMACS molecular simulation package.
+ *
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team,
* check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
* To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * the research papers on the package. Check out http://www.gromacs.org.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "do_fit.h"
#include "rmpbc.h"
#include "wgms.h"
-#include "magic.h"
#include "pbc.h"
#include "viewit.h"
#include "xvgr.h"
enum { euSel,euRect, euTric, euCompact, euNR};
-static int
-sort_comdist2(void *thunk, const void *a, const void *b)
-{
- /* Thunk should point to a real array with the distance to the cluster COM for each molecule,
- * a/b point to integers that refer to the molecule number.
- */
- real *pcomdist2 = thunk;
- int ia = * (int *)a;
- int ib = * (int *)b;
- int rc;
-
- if(pcomdist2[ia]<pcomdist2[ib])
- {
- rc=-1;
- }
- else if (pcomdist2[ia]>pcomdist2[ib])
- {
- rc=1;
- }
- else
- {
- rc=0;
- }
- return rc;
-}
-
-
static void calc_pbc_cluster(int ecenter,int nrefat,t_topology *top,int ePBC,
rvec x[],atom_id index[],
rvec clust_com,matrix box, rvec clustercenter)
copy_rvec(com,new_com);
switch (unitcell_enum) {
case euRect:
- put_atoms_in_box(box,1,&new_com);
+ put_atoms_in_box(ePBC,box,1,&new_com);
break;
case euTric:
put_atoms_in_triclinic_unitcell(ecenter,box,1,&new_com);
copy_rvec(com,new_com);
switch (unitcell_enum) {
case euRect:
- put_atoms_in_box(box,1,&new_com);
+ put_atoms_in_box(ePBC,box,1,&new_com);
break;
case euTric:
put_atoms_in_triclinic_unitcell(ecenter,box,1,&new_com);
gmx_fatal(FARGS,"%s is not a trajectory file, exiting\n",fn);
}
-#if (!defined WIN32 && !defined _WIN32 && !defined WIN64 && !defined _WIN64)
+#ifndef GMX_NATIVE_WINDOWS
void do_trunc(const char *fn, real t0)
{
t_fileio *in;
{ &bVels }, "Read and write velocities if possible" },
{ "-force", FALSE, etBOOL,
{ &bForce }, "Read and write forces if possible" },
-#if (!defined WIN32 && !defined _WIN32 && !defined WIN64 && !defined _WIN64)
+#ifndef GMX_NATIVE_WINDOWS
{ "-trunc", FALSE, etTIME,
{ &ttrunc },
"Truncate input trajectory file after this time (%t)" },
in_file=opt2fn("-f",NFILE,fnm);
if (ttrunc != -1) {
-#if (!defined WIN32 && !defined _WIN32 && !defined WIN64 && !defined _WIN64)
+#ifndef GMX_NATIVE_WINDOWS
do_trunc(in_file,ttrunc);
#endif
}
if (bPBCcomAtom) {
switch (unitcell_enum) {
case euRect:
- put_atoms_in_box(fr.box,natoms,fr.x);
+ put_atoms_in_box(ePBC,fr.box,natoms,fr.x);
break;
case euTric:
put_atoms_in_triclinic_unitcell(ecenter,fr.box,natoms,fr.x);
fprintf(stderr,"\n");
close_trj(status);
+ sfree(outf_base);
+
if (bRmPBC)
gmx_rmpbc_done(gpbc);