3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2009, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
33 * Tests for functionality of the "angle" trajectory analysis module.
35 * \author Teemu Murtola <teemu.murtola@cbr.su.se>
36 * \ingroup module_trajectoryanalysis
38 #include <gtest/gtest.h>
40 #include "gromacs/trajectoryanalysis/modules/angle.h"
42 #include "testutils/cmdlinetest.h"
44 #include "moduletest.h"
49 using gmx::test::CommandLine;
51 /********************************************************************
52 * Tests for gmx::analysismodules::Angle.
55 //! Test fixture for the angle analysis module.
56 typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::Angle>
59 TEST_F(AngleModuleTest, ComputesSimpleAngles)
61 const char *const cmdline[] = {
63 "-g1", "angle", "-group1", "resname RA1 RA2 and name A1 A2 A3"
65 setTopology("angle.gro");
66 runTest(CommandLine::create(cmdline));
69 TEST_F(AngleModuleTest, ComputesDihedrals)
71 const char *const cmdline[] = {
73 "-g1", "dihedral", "-group1", "resname RD1 RD2 RD3 and name A1 A2 A3 A4"
75 setTopology("angle.gro");
76 runTest(CommandLine::create(cmdline));
79 TEST_F(AngleModuleTest, ComputesVectorPairAngles)
81 const char *const cmdline[] = {
83 "-g1", "vector", "-group1", "resname RV1 RV2 and name A1 A2",
84 "-g2", "vector", "-group2", "resname RV3 RV4 and name A1 A2"
86 setTopology("angle.gro");
87 runTest(CommandLine::create(cmdline));
90 TEST_F(AngleModuleTest, ComputesVectorPlanePairAngles)
92 const char *const cmdline[] = {
94 "-g1", "vector", "-group1", "resname RV1 RV2 and name A1 A2",
95 "-g2", "plane", "-group2", "resname RP1 RP2 and name A1 A2 A3"
97 setTopology("angle.gro");
98 runTest(CommandLine::create(cmdline));
101 TEST_F(AngleModuleTest, ComputesPlaneZAxisAngles)
103 const char *const cmdline[] = {
105 "-g1", "plane", "-group1", "resname RP1 RP2 and name A1 A2 A3",
108 setTopology("angle.gro");
109 runTest(CommandLine::create(cmdline));
112 TEST_F(AngleModuleTest, ComputesVectorSphereNormalZAxisAngles)
114 const char *const cmdline[] = {
116 "-g1", "vector", "-group1", "resname RV1 RV2 and name A1 A2",
117 "-g2", "sphnorm", "-group2", "cog of resname RS"
119 setTopology("angle.gro");
120 runTest(CommandLine::create(cmdline));
123 TEST_F(AngleModuleTest, ComputesVectorTimeZeroAngles)
125 const char *const cmdline[] = {
127 "-g1", "vector", "-group1", "resname RV1 RV2 RV3 RV4 and name A1 A2",
130 setTopology("angle.gro");
131 setTrajectory("angle.gro");
132 runTest(CommandLine::create(cmdline));