ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/brains/SimModel.hpp
Revision: 1696
Committed: Tue Nov 2 15:23:46 2004 UTC (19 years, 10 months ago) by tim
File size: 5148 byte(s)
Log Message:
adding SimModel(something similar as SimInfo)

File Contents

# User Rev Content
1 tim 1642 /*
2     * Copyright (C) 2000-2004 Object Oriented Parallel Simulation Engine (OOPSE) project
3     *
4     * Contact: oopse@oopse.org
5     *
6     * This program is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU Lesser General Public License
8     * as published by the Free Software Foundation; either version 2.1
9     * of the License, or (at your option) any later version.
10     * All we ask is that proper credit is given for our work, which includes
11     * - but is not limited to - adding the above copyright notice to the beginning
12     * of your source code files, and to any copyright notice that you may distribute
13     * with programs based on this work.
14     *
15     * This program is distributed in the hope that it will be useful,
16     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     * GNU Lesser General Public License for more details.
19     *
20     * You should have received a copy of the GNU Lesser General Public License
21     * along with this program; if not, write to the Free Software
22     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23     *
24     */
25    
26 tim 1696 /**
27     * @file SimModel.hpp
28     * @author tlin
29     * @date 11/02/2004
30     * @version 1.0
31     */
32    
33 tim 1642 #ifndef BRAINS_SIMMODEL_HPP
34     #define BRAINS_SIMMODEL_HPP
35 tim 1696 #include <vector>
36     #include <iostream>
37 tim 1642
38 tim 1696 #include "primitives/Molecule.hpp"
39     #include "utils/PropertyMap.hpp"
40 tim 1642
41 tim 1696 namespace oopse{
42    
43     /**
44     * @class SimModel SimModel.hpp "brains/SimModel.hpp"
45     * @brief
46     */
47 tim 1642 class SimModel {
48     public:
49 tim 1696 SimModel();
50     virtual ~SimModel();
51 tim 1642
52 tim 1696 /**
53     * Adds a molecule
54     * @return return true if adding successfully, return false if the molecule is already in SimModel
55     * @param mol molecule to be added
56     */
57     bool addMolecule(Molecule* mol);
58    
59     /**
60     * Removes a molecule from SimModel
61     * @return true if removing successfully, return false if molecule is not in this SimModel
62     */
63     bool removeMolecule(Molecule* mol);
64    
65     /**
66     * Returns the number of molecules.
67     * @return the number of molecules in this SimModel
68     */
69     int getNMolecules() {
70     return molecules_.size();
71     }
72    
73     /** Returns the total number of atoms in this SimModel */
74     unsigned int getNAtoms() {
75     return nAtom_;
76     }
77    
78     /** Returns the total number of bonds in this SimModel */
79     unsigned int getNBonds(){
80     return nBond_;
81     }
82    
83     /** Returns the total number of bends in this SimModel */
84     unsigned int getNBends() {
85     return nBend_;
86     }
87    
88     /** Returns the total number of torsions in this SimModel */
89     unsigned int getNTorsions() {
90     return nTorsion_;
91     }
92    
93     /** Returns the total number of rigid bodies in this SimModel */
94     unsigned int getNRigidBodies() {
95     return nRigidBodies_;
96     }
97    
98     /** Returns the total number of integrable objects in this SimModel */
99     unsigned int getNIntegrableObjects() {
100     return nIntegrableObjects_;
101     }
102    
103     /** Returns the total number of cutoff groups in this SimModel */
104     unsigned int getNCutoffGroups() {
105     return nCutoffGroups_;
106     }
107    
108     /** Returns the total number of constraints in this SimModel */
109     unsigned int getNConstraints() {
110     return nConstraints_;
111     }
112    
113     /**
114     * Returns the first molecule in this SimModel and intialize the iterator.
115     * @return the first molecule, return NULL if there is not molecule in this SimModel
116     * @param i the iterator of molecule array (user shouldn't change it)
117     */
118     Molecule* beginMolecule(std::vector<Molecule*>::iterator& i);
119    
120     /**
121     * Returns the next avaliable Molecule based on the iterator.
122     * @return the next avaliable molecule, return NULL if reaching the end of the array
123     * @param i the iterator of molecule array
124     */
125     Molecule* nextMolecule(std::vector<Molecule*>::iterator& i);
126    
127     /** Returns the number of degrees of freedom */
128     int getNDF();
129    
130     /** Returns the number of raw degrees of freedom */
131     int getNDFRaw();
132    
133     /** Returns the number of translational degrees of freedom */
134     int getNDFtranslational();
135    
136     /** Returns the snapshot manager. */
137     SnapshotManager* getSnapshotManager() {
138     return sman_;
139     }
140    
141     /** Sets the snapshot manager. */
142     void setSnapshotManager(SnapshotManager* sman) {
143     sman_ = sman;
144     }
145    
146 tim 1642 private:
147 tim 1696
148     int nAtom_;
149     int nBond_;
150     int nBend_;
151     int nTorsion_;
152     int nRigidBody_;
153     int nCutoffGroup_;
154     int nConstraints_;
155    
156     std::vector<Molecule*> molecules_; /**< Molecule array */
157     PropertyMap properties_; /** Generic Property */
158     SnapshotManager* sman_; /** SnapshotManager */
159    
160 tim 1642 };
161    
162     } //namespace oopse
163     #endif //BRAINS_SIMMODEL_HPP