File: TestBiotypeSelfCode.cpp

package info (click to toggle)
molmodel 3.1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,384 kB
  • sloc: cpp: 39,830; perl: 526; ansic: 107; makefile: 41
file content (31 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "SimTKmolmodel.h"
#include <exception>
#include <iostream>
#include <fstream>

using namespace SimTK;
using namespace std;

#define ASSERT(x, msg) SimTK_ASSERT_ALWAYS(x, msg)

int main(int argc, char **argv) {
    ASSERT(argc == 2, "Invalid number of arguments, expected 2");

    ifstream tinkerStream(argv[1]);
    ASSERT(tinkerStream.good(), "Cannot read TinkerAmber99 parameters file");

    try {
        Biotype argonBiotype = Biotype::Argon();
        DuMMForceFieldSubsystem dumm;
        dumm.populateFromTinkerParameterFile(tinkerStream);

        Biotype::generateAllBiotypeCode(cout);
        return 0;
    } catch (const exception &ex) {
        cerr << "EXCEPTION THROWN: " << ex.what() << endl;
        return 1;
    } catch (...) {
        cerr << "UNKNOWN EXCEPTION THROWN" << endl;
        return 1;
    }
}