From 006a06ce99c01d282e63c0abc42c0db53b5960b6 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Wed, 27 Jan 2016 15:05:24 +0100 Subject: [PATCH] regtest --- regtest/basic/rt-make-7/COLVAR.reference | 2 ++ regtest/basic/rt-make-7/Makefile | 1 + regtest/basic/rt-make-7/config | 1 + regtest/basic/rt-make-7/main.cpp | 37 ++++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 regtest/basic/rt-make-7/COLVAR.reference create mode 100644 regtest/basic/rt-make-7/Makefile create mode 100644 regtest/basic/rt-make-7/config create mode 100644 regtest/basic/rt-make-7/main.cpp diff --git a/regtest/basic/rt-make-7/COLVAR.reference b/regtest/basic/rt-make-7/COLVAR.reference new file mode 100644 index 000000000..298bd6e7b --- /dev/null +++ b/regtest/basic/rt-make-7/COLVAR.reference @@ -0,0 +1,2 @@ +#! FIELDS time d d1 + 0.000000 5.196152 5.196152 diff --git a/regtest/basic/rt-make-7/Makefile b/regtest/basic/rt-make-7/Makefile new file mode 100644 index 000000000..3703b27ce --- /dev/null +++ b/regtest/basic/rt-make-7/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/basic/rt-make-7/config b/regtest/basic/rt-make-7/config new file mode 100644 index 000000000..df1f95bf3 --- /dev/null +++ b/regtest/basic/rt-make-7/config @@ -0,0 +1 @@ +type=make diff --git a/regtest/basic/rt-make-7/main.cpp b/regtest/basic/rt-make-7/main.cpp new file mode 100644 index 000000000..a2e926a2a --- /dev/null +++ b/regtest/basic/rt-make-7/main.cpp @@ -0,0 +1,37 @@ +#include "plumed/wrapper/Plumed.h" +#include <vector> + +using namespace PLMD; + +int main(){ + Plumed* plumed=new Plumed; + + int natoms=10; + + std::vector<double> positions(3*natoms,0.0); + for(unsigned i=0;i<natoms;i++) positions[i]=i; + std::vector<double> masses(natoms,1.0); + std::vector<double> forces(3*natoms,0.0); + std::vector<double> box(9,0.0); + std::vector<double> virial(9,0.0); + + plumed->cmd("setNatoms",&natoms); + plumed->cmd("setLogFile","test.log"); + plumed->cmd("init"); + plumed->cmd("readInputLine","d: DISTANCE ATOMS=1,2"); + plumed->cmd("readInputLine","d1: DISTANCE ATOMS={1 2}"); // check if braces are parsed correctly + plumed->cmd("readInputLine","PRINT ARG=d,d1 FILE=COLVAR"); + + + int step=1; + plumed->cmd("setStep",&step); + plumed->cmd("setPositions",&positions[0]); + plumed->cmd("setBox",&box[0]); + plumed->cmd("setForces",&forces[0]); + plumed->cmd("setVirial",&virial[0]); + plumed->cmd("setMasses",&masses[0]); + plumed->cmd("calc"); + + delete plumed; + return 0; +} -- GitLab