ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/constraints/ZconstraintForceManager.hpp
Revision: 1910
Committed: Fri Jan 7 21:50:13 2005 UTC (19 years, 8 months ago) by tim
File size: 3759 byte(s)
Log Message:
ZConstraintForceManager in progress

File Contents

# User Rev Content
1 tim 1910 /*
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 "primitives/Molecule.hpp"
32     namespace oopse {
33    
34     struct ZconstraintParam {
35     double zTargetPos; /**< target zconstraint position */
36     double kz; /**< force constant */
37     double cantVel; /**< The velocity of cantilever */
38     };
39    
40     struct ZconstraintMol {
41     Molecule* mol;
42     ZconstraintParam param;
43     double fz;
44     double zpos;
45     double cantPos; /**< current position of cantilever */
46     double endFixingTime;
47     };
48    
49     class ZconstraintForceManager : public ForceManager {
50     public:
51     ZconstraintForceManager(SimInfo* info);
52    
53     virtual void calcForces(bool needPotential, bool needStress);
54    
55     double getZConsTime() { return zconsTime_; }
56     std::string getZConsOutput() { return zconsOutput_; }
57    
58     void update();
59    
60     private:
61    
62     bool isZMol(Molecule* mol);
63     void thermalize(void);
64    
65     void zeroVelocity();
66     void doZconstraintForce();
67     void doHarmonic();
68     bool checkZConsState();
69     bool haveFixedZMols();
70     bool haveMovingMols();
71     void updateZPos();
72     void updateCantPos();
73     void calcTotalMassMovingZMols();
74     double getZTargetPos(int index);
75     double getZFOfFixedZMols(Molecule* mol, StuntDouble* sd, double totalForce) ;
76     double getZFOfMovingMols(StuntDouble* sd, double totalForce) ;
77     double getHFOfFixedZMols(Molecule* mol, StuntDouble* sd, double totalForce);
78     double getHFOfUnconsMols(StuntDouble* sd, double totalForce);
79    
80     std::list<ZconstraintMol> movingZMols_; /**< moving zconstraint molecules*/
81     std::list<ZconstraintMol> fixedZMols_; /**< fixed zconstraint molecules*/
82     std::vector<Molecule*> unzconsMols_; /**< free molecules*/
83    
84     double zconsTime_;
85     std::string zconsOutput_;
86     double zconsTol_;
87     bool usingSMD_;
88     double zconsFixingTime_;
89     double zconsGap_;
90     bool usingZconsGap_;
91     double dt_;
92    
93     const static int whichDirection = 2;
94    
95     std::map<int, ZconstraintParam> allZMolIndices_;
96    
97     Snapshot* currSnapshot_;
98     double currZconsTime_;
99    
100     double totMassMovingZMols_;
101     double totMassUnconsMols_; /**< mass of unconstraint molecules in the whole system (never change) */
102    
103     ZConsWriter* fzOut;
104     const static double infiniteTime = 1e31;
105     };
106    
107     }
108     #endif

Properties

Name Value
svn:executable *