ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/integrators/Integrator.cpp
Revision: 1907
Committed: Thu Jan 6 22:31:07 2005 UTC (19 years, 7 months ago) by tim
File size: 3500 byte(s)
Log Message:
constraint is almost working

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
26 #include "brains/Snapshot.hpp"
27 #include "integrators/Integrator.hpp"
28 #include "utils/simError.h"
29 namespace oopse {
30 Integrator::Integrator(SimInfo* info)
31 : info_(info), forceMan_(NULL) , needPotential(false), needStress(false), velocitizer_(NULL),
32 needVelocityScaling(false), dumpWriter(NULL), statWriter(NULL), thermo(info),
33 currentSnapshot_(info->getSnapshotManager()->getCurrentSnapshot()) {
34
35 Globals* simParams = info->getSimParams();
36
37 if (simParams->haveDt()) {
38 dt = simParams->getDt();
39 } else {
40 sprintf(painCave.errMsg,
41 "Integrator Error: dt is not set\n");
42 painCave.isFatal = 1;
43 simError();
44 }
45
46 if (simParams->haveRunTime()) {
47 runTime = simParams->getRunTime();
48 } else {
49
50 }
51 // set the status, sample, and thermal kick times
52 if (simParams->haveSampleTime()){
53 sampleTime = simParams->getSampleTime();
54 statusTime = sampleTime;
55 } else{
56 sampleTime = simParams->getRunTime();
57 statusTime = sampleTime;
58 }
59
60 if (simParams->haveStatusTime()){
61 statusTime = simParams->getStatusTime();
62 }
63
64 if (simParams->haveThermalTime()){
65 thermalTime = simParams->getThermalTime();
66 } else {
67 thermalTime = simParams->getRunTime();
68 }
69
70 if (!simParams->getUseInitTime()) {
71 currentSnapshot_->setTime(0.0);
72 }
73
74 //create a default a ForceManager
75 //if the subclass want to using different ForceManager, use setForceManager
76 forceMan_ = new ForceManager(info);
77
78 // check for the temperature set flag (velocity scaling)
79 if (simParams->haveTempSet()) {
80 needVelocityScaling = simParams->getTempSet();
81
82 if (simParams->haveTargetTemp()) {
83 targetScalingTemp = simParams->getTargetTemp();
84 }
85 else {
86 sprintf(painCave.errMsg,
87 "Integrator Error: Target Temperature is not set\n");
88 painCave.isFatal = 1;
89 simError();
90
91 }
92 }
93
94 //create a default a velocitizer
95 //if the subclass want to using different velocitizer, use setVelocitizer
96 velocitizer_ = new Velocitizer(info);
97
98 }
99
100 Integrator::~Integrator(){
101 delete forceMan_;
102 delete velocitizer_;
103
104 delete dumpWriter;
105 delete statWriter;
106 }
107
108
109 }
110