ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/types/AtomType.cpp
Revision: 1638
Committed: Fri Oct 22 23:00:06 2004 UTC (19 years, 8 months ago) by chrisfen
File size: 1568 byte(s)
Log Message:
Dear god!  It runs and conserves energy!

File Contents

# Content
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 // make the type empty:
17 name = NULL;
18 // and massless:
19 mass = 0.0;
20
21 // atom type is a Tabula Rasa:
22 atp.is_LennardJones = 0;
23 atp.is_Electrostatic = 0;
24 atp.is_Charge = 0;
25 atp.is_Directional = 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 AtomType::~AtomType() {
34 if ( name != NULL ) free(name);
35 }
36
37 void AtomType::complete() {
38
39 int status;
40
41 if (name == NULL) {
42 sprintf( painCave.errMsg,
43 "Attempting to complete an AtomType without giving "
44 "it a name!\n");
45 painCave.severity = OOPSE_ERROR;
46 painCave.isFatal = 1;
47 simError();
48 }
49
50 if (atp.ident == -1) {
51 sprintf( painCave.errMsg,
52 "Attempting to complete AtomType %s without setting the"
53 " ident!/n", name);
54 painCave.severity = OOPSE_ERROR;
55 painCave.isFatal = 1;
56 simError();
57 }
58
59 status = 0;
60
61 makeAtype(&atp, &status);
62
63 if (status != 0) {
64 sprintf( painCave.errMsg,
65 "Fortran rejected AtomType %s!\n", name);
66 painCave.severity = OOPSE_ERROR;
67 painCave.isFatal = 1;
68 simError();
69 }
70 }
71 }