1 |
#include <stdlib.h> |
2 |
#include <stdio.h> |
3 |
#include <string.h> |
4 |
#include <iostream> |
5 |
|
6 |
#include "types/AtomType.hpp" |
7 |
#include "utils/simError.h" |
8 |
#define __C |
9 |
#include "UseTheForce/DarkSide/atype_interface.h" |
10 |
|
11 |
namespace oopse { |
12 |
AtomType::AtomType(){ |
13 |
|
14 |
// initialize to an error: |
15 |
atp.ident = -1; |
16 |
|
17 |
// and massless: |
18 |
mass = 0.0; |
19 |
|
20 |
// atom type is a Tabula Rasa: |
21 |
atp.is_Directional = 0; |
22 |
atp.is_LennardJones = 0; |
23 |
atp.is_Electrostatic = 0; |
24 |
atp.is_Charge = 0; |
25 |
atp.is_Dipole = 0; |
26 |
atp.is_Sticky = 0; |
27 |
atp.is_GayBerne = 0; |
28 |
atp.is_EAM = 0; |
29 |
atp.is_Shape = 0; |
30 |
atp.is_FLARB = 0; |
31 |
} |
32 |
|
33 |
void AtomType::complete() { |
34 |
|
35 |
int status; |
36 |
|
37 |
if (name.empty()) { |
38 |
sprintf( painCave.errMsg, |
39 |
"Attempting to complete an AtomType without giving " |
40 |
"it a name!\n"); |
41 |
painCave.severity = OOPSE_ERROR; |
42 |
painCave.isFatal = 1; |
43 |
simError(); |
44 |
} |
45 |
|
46 |
if (atp.ident == -1) { |
47 |
sprintf( painCave.errMsg, |
48 |
"Attempting to complete AtomType %s without setting the" |
49 |
" ident!/n", name.c_str()); |
50 |
painCave.severity = OOPSE_ERROR; |
51 |
painCave.isFatal = 1; |
52 |
simError(); |
53 |
} |
54 |
|
55 |
status = 0; |
56 |
|
57 |
makeAtype(&atp, &status); |
58 |
|
59 |
if (status != 0) { |
60 |
sprintf( painCave.errMsg, |
61 |
"Fortran rejected AtomType %s!\n", name.c_str()); |
62 |
painCave.severity = OOPSE_ERROR; |
63 |
painCave.isFatal = 1; |
64 |
simError(); |
65 |
} |
66 |
} |
67 |
} |