ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/types/AtomType.cpp
Revision: 1652
Committed: Tue Oct 26 22:25:19 2004 UTC (19 years, 8 months ago) by gezelter
File size: 1473 byte(s)
Log Message:
Making ShapeType into a ShapeAtomType, fixing some isXXX

File Contents

# User Rev Content
1 gezelter 1632 #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 gezelter 1652
17 gezelter 1632 // and massless:
18     mass = 0.0;
19    
20     // atom type is a Tabula Rasa:
21     atp.is_LennardJones = 0;
22     atp.is_Electrostatic = 0;
23     atp.is_Charge = 0;
24     atp.is_Directional = 0;
25     atp.is_Sticky = 0;
26     atp.is_GayBerne = 0;
27     atp.is_EAM = 0;
28     atp.is_Shape = 0;
29     atp.is_FLARB = 0;
30     }
31    
32     void AtomType::complete() {
33    
34     int status;
35    
36 gezelter 1652 if (name.empty()) {
37 gezelter 1632 sprintf( painCave.errMsg,
38     "Attempting to complete an AtomType without giving "
39     "it a name!\n");
40     painCave.severity = OOPSE_ERROR;
41     painCave.isFatal = 1;
42     simError();
43     }
44    
45     if (atp.ident == -1) {
46     sprintf( painCave.errMsg,
47     "Attempting to complete AtomType %s without setting the"
48 gezelter 1652 " ident!/n", name.c_str());
49 gezelter 1632 painCave.severity = OOPSE_ERROR;
50     painCave.isFatal = 1;
51     simError();
52     }
53    
54     status = 0;
55    
56 chrisfen 1638 makeAtype(&atp, &status);
57 gezelter 1632
58     if (status != 0) {
59     sprintf( painCave.errMsg,
60 gezelter 1652 "Fortran rejected AtomType %s!\n", name.c_str());
61 gezelter 1632 painCave.severity = OOPSE_ERROR;
62     painCave.isFatal = 1;
63     simError();
64     }
65     }
66     }