#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
/*! \brief Margin for setting up the DD grid */
#include "gromacs/math/gmxcomplex.h"
#include "gromacs/math/vec.h"
#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
struct gmx_ewald_tab_t
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
/* There's nothing special to do here if just masses are perturbed,
* but if either charge or type is perturbed then the implementation
#include "gromacs/ewald/pme.h"
#include "gromacs/math/vec.h"
#include "gromacs/timing/cyclecounter.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#ifdef DEBUG_PME
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "pme-internal.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/simd/simd.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "pme-internal.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
static void low_mspeed(real tempi,
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
static rvec *xptr, box_1;
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
gmx_bool yesno(void)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <stdio.h>
#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/fatalerror.h"
#ifdef __cplusplus
extern "C" {
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "listed-internal.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/idef.h"
#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
struct gmx_wallcycle;
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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.
+ *
+ * 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 research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "gmxpre.h"
+
+#include <cmath>
+
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+
+void m_inv_ur0(gmx_cxx_const matrix src, matrix dest)
+{
+ double tmp = src[XX][XX]*src[YY][YY]*src[ZZ][ZZ];
+ if (std::fabs(tmp) <= 100*GMX_REAL_MIN)
+ {
+ gmx_fatal(FARGS, "Can not invert matrix, determinant is zero");
+ }
+
+ dest[XX][XX] = 1/src[XX][XX];
+ dest[YY][YY] = 1/src[YY][YY];
+ dest[ZZ][ZZ] = 1/src[ZZ][ZZ];
+ dest[ZZ][XX] = (src[YY][XX]*src[ZZ][YY]*dest[YY][YY]
+ - src[ZZ][XX])*dest[XX][XX]*dest[ZZ][ZZ];
+ dest[YY][XX] = -src[YY][XX]*dest[XX][XX]*dest[YY][YY];
+ dest[ZZ][YY] = -src[ZZ][YY]*dest[YY][YY]*dest[ZZ][ZZ];
+ dest[XX][YY] = 0.0;
+ dest[XX][ZZ] = 0.0;
+ dest[YY][ZZ] = 0.0;
+}
+
+void m_inv(gmx_cxx_const matrix src, matrix dest)
+{
+ const real smallreal = (real)1.0e-24;
+ const real largereal = (real)1.0e24;
+
+ real determinant = det(src);
+ real c = (real)1.0/determinant;
+ real fc = (real)std::fabs(c);
+
+ if ((fc <= smallreal) || (fc >= largereal))
+ {
+ gmx_fatal(FARGS, "Can not invert matrix, determinant = %e", determinant);
+ }
+
+ dest[XX][XX] = c*(src[YY][YY]*src[ZZ][ZZ]-src[ZZ][YY]*src[YY][ZZ]);
+ dest[XX][YY] = -c*(src[XX][YY]*src[ZZ][ZZ]-src[ZZ][YY]*src[XX][ZZ]);
+ dest[XX][ZZ] = c*(src[XX][YY]*src[YY][ZZ]-src[YY][YY]*src[XX][ZZ]);
+ dest[YY][XX] = -c*(src[YY][XX]*src[ZZ][ZZ]-src[ZZ][XX]*src[YY][ZZ]);
+ dest[YY][YY] = c*(src[XX][XX]*src[ZZ][ZZ]-src[ZZ][XX]*src[XX][ZZ]);
+ dest[YY][ZZ] = -c*(src[XX][XX]*src[YY][ZZ]-src[YY][XX]*src[XX][ZZ]);
+ dest[ZZ][XX] = c*(src[YY][XX]*src[ZZ][YY]-src[ZZ][XX]*src[YY][YY]);
+ dest[ZZ][YY] = -c*(src[XX][XX]*src[ZZ][YY]-src[ZZ][XX]*src[XX][YY]);
+ dest[ZZ][ZZ] = c*(src[XX][XX]*src[YY][YY]-src[YY][XX]*src[XX][YY]);
+}
#include "gromacs/math/utilities.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
#ifdef __cplusplus
dest[ZZ][ZZ] = r1*m1[ZZ][ZZ];
}
-static gmx_inline void m_inv_ur0(gmx_cxx_const matrix src, matrix dest)
-{
- double tmp = src[XX][XX]*src[YY][YY]*src[ZZ][ZZ];
- if (fabs(tmp) <= 100*GMX_REAL_MIN)
- {
- gmx_fatal(FARGS, "Can not invert matrix, determinant is zero");
- }
-
- dest[XX][XX] = 1/src[XX][XX];
- dest[YY][YY] = 1/src[YY][YY];
- dest[ZZ][ZZ] = 1/src[ZZ][ZZ];
- dest[ZZ][XX] = (src[YY][XX]*src[ZZ][YY]*dest[YY][YY]
- - src[ZZ][XX])*dest[XX][XX]*dest[ZZ][ZZ];
- dest[YY][XX] = -src[YY][XX]*dest[XX][XX]*dest[YY][YY];
- dest[ZZ][YY] = -src[ZZ][YY]*dest[YY][YY]*dest[ZZ][ZZ];
- dest[XX][YY] = 0.0;
- dest[XX][ZZ] = 0.0;
- dest[YY][ZZ] = 0.0;
-}
-
-static gmx_inline void m_inv(gmx_cxx_const matrix src, matrix dest)
-{
- const real smallreal = (real)1.0e-24;
- const real largereal = (real)1.0e24;
- real deter, c, fc;
-
- deter = det(src);
- c = (real)1.0/deter;
- fc = (real)fabs(c);
-
- if ((fc <= smallreal) || (fc >= largereal))
- {
- gmx_fatal(FARGS, "Can not invert matrix, determinant = %e", deter);
- }
-
- dest[XX][XX] = c*(src[YY][YY]*src[ZZ][ZZ]-src[ZZ][YY]*src[YY][ZZ]);
- dest[XX][YY] = -c*(src[XX][YY]*src[ZZ][ZZ]-src[ZZ][YY]*src[XX][ZZ]);
- dest[XX][ZZ] = c*(src[XX][YY]*src[YY][ZZ]-src[YY][YY]*src[XX][ZZ]);
- dest[YY][XX] = -c*(src[YY][XX]*src[ZZ][ZZ]-src[ZZ][XX]*src[YY][ZZ]);
- dest[YY][YY] = c*(src[XX][XX]*src[ZZ][ZZ]-src[ZZ][XX]*src[XX][ZZ]);
- dest[YY][ZZ] = -c*(src[XX][XX]*src[YY][ZZ]-src[YY][XX]*src[XX][ZZ]);
- dest[ZZ][XX] = c*(src[YY][XX]*src[ZZ][YY]-src[ZZ][XX]*src[YY][YY]);
- dest[ZZ][YY] = -c*(src[XX][XX]*src[ZZ][YY]-src[ZZ][XX]*src[XX][YY]);
- dest[ZZ][ZZ] = c*(src[XX][XX]*src[YY][YY]-src[YY][XX]*src[XX][YY]);
-}
+/* Routines defined in invertmatrix.cpp */
+void m_inv_ur0(gmx_cxx_const matrix src, matrix dest);
+void m_inv(gmx_cxx_const matrix src, matrix dest);
static gmx_inline void mvmul(gmx_cxx_const matrix a, const rvec src, rvec dest)
{
return (m[XX][XX]+m[YY][YY]+m[ZZ][ZZ]);
}
-static gmx_inline real _divide_err(real a, real b, const char *file, int line)
-{
- if (fabs(b) <= GMX_REAL_MIN)
- {
- gmx_fatal(FARGS, "Dividing by zero, file %s, line %d", file, line);
- }
- return a/b;
-}
-
-static gmx_inline int _mod(int a, int b, const char *file, int line)
-{
- if (b == 0)
- {
- gmx_fatal(FARGS, "Modulo zero, file %s, line %d", file, line);
- }
- return a % b;
-}
-
/* Operations on multidimensional rvecs, used e.g. in edsam.c */
static gmx_inline void m_rveccopy(int dim, gmx_cxx_const rvec *a, rvec *b)
{
-box[ZZ][XX]*box[ZZ][XX]-box[ZZ][YY]*box[ZZ][YY]);
}
-#define divide_err(a, b) _divide_err((a), (b), __FILE__, __LINE__)
-#define mod(a, b) _mod((a), (b), __FILE__, __LINE__)
-
#ifdef __cplusplus
}
#endif
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/snprintf.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pulling/pull.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
static const char *conrmsd_nm[] = { "Constr. rmsd", "Constr.2 rmsd" };
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/legacyheaders/types/inputrec.h"
#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
void init_global_signals(struct gmx_signalling_t *gs, const t_commrec *cr,
#include "gromacs/mdlib/nbnxn_simd.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/simd/simd.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/mdlib/nbnxn_consts.h"
#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/fatalerror.h"
#define NCL_PER_SUPERCL (NBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER)
#define CL_SIZE (NBNXN_GPU_CLUSTER_SIZE)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/mdlib/nbnxn_consts.h"
#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
/*! \brief Typedefs for declaring lookup tables of kernel functions.
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
#include "gromacs/simd/vector_operations.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#ifdef NBNXN_SEARCH_BB_SIMD4
{
for (m = 0; (m < DIM); m++)
{
- b_inv[m] = divide_err(1.0, box_size[m]);
+ if (gmx_numzero(box_size[m]))
+ {
+ gmx_fatal(FARGS, "Dividing by zero box size!");
+ }
+ b_inv[m] = 1.0/box_size[m];
}
bTriclinic = TRICLINIC(box);
}
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
real RF_excl_correction(const t_forcerec *fr, t_graph *g,
const t_mdatoms *mdatoms, const t_blocka *excl,
#include "gromacs/timing/wallcycle.h"
#include "gromacs/timing/walltime_accounting.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/sysinfo.h"
#include "gromacs/legacyheaders/update.h"
#include "gromacs/math/vec.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pulling/pull.h"
#include "gromacs/random/random.h"
#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/legacyheaders/txtdump.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
t_vcm *init_vcm(FILE *fp, gmx_groups_t *groups, t_inputrec *ir)
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
void make_wall_tables(FILE *fplog, const output_env_t oenv,
#include "gromacs/legacyheaders/main.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
/*! \brief Search for \p fnm_cp in fnm and return true iff found
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
-#include "gromacs/utility/fatalerror.h"
#ifdef __cplusplus
extern "C" {
#include "gromacs/pulling/pull_internal.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/timing/cyclecounter.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/qsort_threadsafe.h"
#include "gromacs/utility/smalloc.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
int
gmx_calc_cog(t_topology * /* top */, rvec x[], int nrefat, atom_id index[], rvec xout)
#include <cmath>
#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
static const char *SwS = {"SWAP:"}; /**< For output that comes from the swap module */
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/selection/nbsearch.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#define PROBABILITYCUTOFF 100
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/atomprop.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"