-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgro.h
32 lines (29 loc) · 1008 Bytes
/
gro.h
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
32
#ifndef GRO_H
#define GRO_H
#include "model.h"
#include <vector>
#include <string>
#include <iostream>
//! Modify water molecules in a gro file to match model wm (see model.h)
/**
* \param os the output stream to write results to
* \param lines vector made up of the lines of the input gro file
* \param wm the water model to be used in the output
* \return the number of molecules changed
* \sa model.h
* \throws gro_error indicates error in parsing the input file
*/
int process_gro(std::ostream &os, const std::vector<std::string> &lines,
const model &wm);
//! Exception class to reflect error in parsing gro file
class gro_error: public std::runtime_error {
public:
//! Constructor of gro_error class
/**
* \param msg description of the error
* \param line the line in which the error occurred
*/
gro_error(const std::string & msg = "", const std::string & line = "") :
std::runtime_error(msg+"; current line:\n"+line) {}
};
#endif