1 |
/* |
2 |
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
* |
4 |
* The University of Notre Dame grants you ("Licensee") a |
5 |
* non-exclusive, royalty free, license to use, modify and |
6 |
* redistribute this software in source and binary code form, provided |
7 |
* that the following conditions are met: |
8 |
* |
9 |
* 1. Acknowledgement of the program authors must be made in any |
10 |
* publication of scientific results based in part on use of the |
11 |
* program. An acceptable form of acknowledgement is citation of |
12 |
* the article in which the program was described (Matthew |
13 |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
* |
18 |
* 2. Redistributions of source code must retain the above copyright |
19 |
* notice, this list of conditions and the following disclaimer. |
20 |
* |
21 |
* 3. Redistributions in binary form must reproduce the above copyright |
22 |
* notice, this list of conditions and the following disclaimer in the |
23 |
* documentation and/or other materials provided with the |
24 |
* distribution. |
25 |
* |
26 |
* This software is provided "AS IS," without a warranty of any |
27 |
* kind. All express or implied conditions, representations and |
28 |
* warranties, including any implied warranty of merchantability, |
29 |
* fitness for a particular purpose or non-infringement, are hereby |
30 |
* excluded. The University of Notre Dame and its licensors shall not |
31 |
* be liable for any damages suffered by licensee as a result of |
32 |
* using, modifying or distributing the software or its |
33 |
* derivatives. In no event will the University of Notre Dame or its |
34 |
* licensors be liable for any lost revenue, profit or data, or for |
35 |
* direct, indirect, special, consequential, incidental or punitive |
36 |
* damages, however caused and regardless of the theory of liability, |
37 |
* arising out of the use of or inability to use software, even if the |
38 |
* University of Notre Dame has been advised of the possibility of |
39 |
* such damages. |
40 |
*/ |
41 |
|
42 |
#ifndef IO_NODELIST_H |
43 |
#define IO_NODELIST_H |
44 |
|
45 |
/* enumerates the different types of nodes the statments can be */ |
46 |
|
47 |
typedef enum { GLOBAL_HEAD, COMPONENT_HEAD, |
48 |
MOLECULE_HEAD, ATOM_HEAD, BOND_HEAD, BEND_HEAD, TORSION_HEAD, |
49 |
MEMBERS_STMT, CONSTRAINT_STMT, ASSIGNMENT_STMT, POSITION_STMT, |
50 |
ORIENTATION_STMT, ZCONSTRAINT_HEAD, |
51 |
RIGIDBODY_HEAD, CUTOFFGROUP_HEAD } node_type; |
52 |
|
53 |
/* a structure to hold the index of the members of a bond, bend, or torsion */ |
54 |
|
55 |
typedef struct members_data_tag{ |
56 |
int nMembers; |
57 |
int* memberList; |
58 |
} members_data; |
59 |
|
60 |
/* a structure to hold constraint information */ |
61 |
|
62 |
typedef struct constraint_data_tag{ |
63 |
double constraint_val; |
64 |
} constraint_data; |
65 |
|
66 |
/* a structure to hold assignment info */ |
67 |
|
68 |
typedef enum{ STR_ASSN, INT_ASSN, DOUBLE_ASSN } assign_type; |
69 |
|
70 |
typedef union{ |
71 |
int i_val; |
72 |
double d_val; |
73 |
char* str_ptr; |
74 |
} assignment_value; |
75 |
|
76 |
typedef struct assignment_data_tag{ |
77 |
assign_type type; |
78 |
char* identifier; // left hand side |
79 |
assignment_value rhs; // right hand side |
80 |
} assignment_data; |
81 |
|
82 |
/* a structure to hold the position information */ |
83 |
|
84 |
typedef struct position_data_tag{ |
85 |
double x; |
86 |
double y; |
87 |
double z; |
88 |
} position_data; |
89 |
|
90 |
/* a structure to hold the orientation information */ |
91 |
|
92 |
typedef struct orientation_data_tag{ |
93 |
double phi; |
94 |
double theta; |
95 |
double psi; |
96 |
} orientation_data; |
97 |
|
98 |
/* here's the master node type. This is the node that will be strung |
99 |
together by the yacc parser. Each statement will an individual |
100 |
node. Block statements will act as branch nodes, pointing to their |
101 |
own set of statement lists.*/ |
102 |
|
103 |
typedef struct node_tag{ |
104 |
node_type type; |
105 |
int index; // needed for atoms, bonds, etc. |
106 |
struct node_tag* next_stmt; // the next statement |
107 |
struct node_tag* prev_stmt; // the previous statement |
108 |
struct node_tag* stmt_list; // the statment list if this is a block. |
109 |
|
110 |
/* this is a union to hold the statement data */ |
111 |
|
112 |
union{ |
113 |
members_data mbrs; |
114 |
constraint_data cnstr; |
115 |
assignment_data asmt; |
116 |
position_data pos; |
117 |
orientation_data ort; |
118 |
} the_data; |
119 |
|
120 |
} node; |
121 |
|
122 |
|
123 |
|
124 |
#endif |