ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/constraints/ZconstraintForceManager.hpp
Revision: 1911
Committed: Mon Jan 10 18:05:45 2005 UTC (19 years, 5 months ago) by tim
File size: 3443 byte(s)
Log Message:
more work in zconstraint

File Contents

# Content
1 /*
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 #ifndef CONSTRAINTS_ZCONSTRAINTFORCEMANAGER_HPP
26 #define CONSTRAINTS_ZCONSTRAINTFORCEMANAGER_HPP
27 #include <list>
28 #include <string>
29 #include <vector>
30 #include "brains/ForceManager.hpp"
31 #include "constraints/ZconsStruct.hpp"
32 namespace oopse {
33
34 class ZconstraintForceManager : public ForceManager {
35 public:
36 ZconstraintForceManager(SimInfo* info);
37
38 virtual void calcForces(bool needPotential, bool needStress);
39
40 double getZConsTime() { return zconsTime_; }
41 std::string getZConsOutput() { return zconsOutput_; }
42
43 void update();
44
45 private:
46
47 bool isZMol(Molecule* mol);
48 void thermalize(void);
49
50 void zeroVelocity();
51 void doZconstraintForce();
52 void doHarmonic();
53 bool checkZConsState();
54 bool haveFixedZMols();
55 bool haveMovingMols();
56 void updateZPos();
57 void updateCantPos();
58 void calcTotalMassMovingZMols();
59 double getZTargetPos(int index);
60 double getZFOfFixedZMols(Molecule* mol, StuntDouble* sd, double totalForce) ;
61 double getZFOfMovingMols(StuntDouble* sd, double totalForce) ;
62 double getHFOfFixedZMols(Molecule* mol, StuntDouble* sd, double totalForce);
63 double getHFOfUnconsMols(StuntDouble* sd, double totalForce);
64
65 std::list<ZconstraintMol> movingZMols_; /**< moving zconstraint molecules*/
66 std::list<ZconstraintMol> fixedZMols_; /**< fixed zconstraint molecules*/
67 std::vector<Molecule*> unzconsMols_; /**< free molecules*/
68
69 double zconsTime_;
70 std::string zconsOutput_;
71 double zconsTol_;
72 bool usingSMD_;
73 double zconsFixingTime_;
74 double zconsGap_;
75 bool usingZconsGap_;
76 double dt_;
77
78 const static int whichDirection = 2;
79
80 std::map<int, ZconstraintParam> allZMolIndices_;
81
82 Snapshot* currSnapshot_;
83 double currZconsTime_;
84
85 double totMassMovingZMols_;
86 double totMassUnconsMols_; /**< mass of unconstraint molecules in the whole system (never change) */
87
88 ZConsWriter* fzOut;
89 const static double infiniteTime = 1e31;
90 };
91
92 }
93 #endif

Properties

Name Value
svn:executable *