-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathharmonic_bond.cpp
More file actions
64 lines (49 loc) · 1.44 KB
/
harmonic_bond.cpp
File metadata and controls
64 lines (49 loc) · 1.44 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "harmonic_bond.h"
harmonic_bond::harmonic_bond(int i,string n1,string n2,double k,double r,string uni,string f):potential(n1,n2,uni,f)
{
setId1(i);
prefix="bond_coeff";
K=getEnergyFactor()*k;
req=r;
}
harmonic_bond::harmonic_bond(string n1,string n2,double k,double r,string uni,string f):potential(n1,n2,uni,f)
{
prefix="bond_coeff";
K=getEnergyFactor()*k;
req=r;
style="harmonic";
}
harmonic_bond::harmonic_bond(string n1, string n2, double k, double r, string uni, string f, string s):potential(n1,n2,uni,f)
{
prefix="bond_coeff";
K=getEnergyFactor()*k;
req=r;
style=s;
}
harmonic_bond::harmonic_bond(string n1,string n2,double k,string uni,string f):potential(n1,n2,uni,f)
{
K=getEnergyFactor()*k;
}
harmonic_bond::harmonic_bond(string n1, string n2, string uni, string f):potential(n1,n2,uni,f)
{
}
void harmonic_bond::print(ofstream &out)
{
if (out.is_open())
{
out<<setw(14)<<left<<prefix<<setw(5)<<getId1()<<setw(10)<<style<<setw(10)
<<getK()<<setw(15)<<" "
<<getReq()<<setw(10)<<right<<"#"
<<getName1()<<"-"<<getName2()<<" "<< getFile()<< endl;
}else
{
cout<<"Could not write to file\n";
}
}
void harmonic_bond::printTerminal()
{
cout<<prefix<<" "<<getId1()<<" "
<<getK()<<" "
<<getReq()<<" "<<right<<"#"
<<getName1()<<" "<<getName2()<<" "<< getFile()<< endl;
}