ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/applications/dynamicProps/TimeCorrFunc.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/applications/dynamicProps/TimeCorrFunc.cpp (file contents):
Revision 2017 by tim, Mon Feb 14 17:35:25 2005 UTC vs.
Revision 2018 by tim, Mon Feb 14 17:57:01 2005 UTC

# Line 79 | Line 79 | TimeCorrFunc::TimeCorrFunc(SimInfo* info, const std::s
79      bsMan_ = new BlockSnapshotManager(info, dumpFilename_, storageLayout_);
80      info_->setSnapshotManager(bsMan_);
81  
82 +    evaluator1_.loadScriptString(selectionScript1_);
83 +    evaluator2_.loadScriptString(selectionScript2_);
84 +    
85      //if selection is static, we only need to evaluate it once
86      if (!evaluator1_.isDynamic()) {
87          seleMan1_.setSelectionSet(evaluator1_.evaluate());
# Line 102 | Line 105 | TimeCorrFunc::TimeCorrFunc(SimInfo* info, const std::s
105      
106  
107      
108 <    /**@todo Fixed Me */
108 >    /**@todo Fix Me */
109      Globals* simParams = info_->getSimParams();
110      if (simParams->haveSampleTime()){
111          deltaTime_ = simParams->getSampleTime();
# Line 152 | Line 155 | void TimeCorrFunc::correlateBlocks(int block1, int blo
155  
156   void TimeCorrFunc::correlateBlocks(int block1, int block2) {
157  
158 <  int jstart, jend;
156 <  
157 <  assert(bsMan_->isBlockActive(block1) && bsMan_->isBlockActive(block2));
158 >    int jstart, jend;
159  
160 <  SnapshotBlock snapshotBlock1 = bsMan_->getSnapshotBlock(block1);
160 <  SnapshotBlock snapshotBlock2 = bsMan_->getSnapshotBlock(block2);
160 >    assert(bsMan_->isBlockActive(block1) && bsMan_->isBlockActive(block2));
161  
162 <  jend = snapshotBlock2.second;
163 <  
164 <  for (int i = snapshotBlock1.first; i < snapshotBlock1.second; ++i) {
165 <    
166 <    //evaluate selection if it is dynamic
167 <    if (evaluator1_.isDynamic()) {
168 <      seleMan1_.setSelectionSet(evaluator1_.evaluate());
169 <      validateSelection(seleMan1_);
170 <    }
171 <    
172 <    //update the position or velocity of the atoms belong to rigid bodies
173 <    updateFrame(i);
174 <    
175 <    // if the two blocks are the same, we don't want to correlate
176 <    // backwards in time, so start j at the same frame as i
162 >    SnapshotBlock snapshotBlock1 = bsMan_->getSnapshotBlock(block1);
163 >    SnapshotBlock snapshotBlock2 = bsMan_->getSnapshotBlock(block2);
164  
165 <    if (block1 == block2)
166 <      jstart = i;
167 <    else
168 <      jstart = snapshotBlock2.first;
169 <    
170 <    for(int j  = jstart; j < jend; ++j) {
171 <      //evaluate selection
172 <      if (!evaluator2_.isDynamic()) {
173 <        seleMan2_.setSelectionSet(evaluator2_.evaluate());
174 <        validateSelection(seleMan2_);
175 <      }  
176 <      //update the position or velocity of the atoms belong to rigid bodies
177 <      updateFrame(j);
178 <      
179 <      correlateFrames(i, j);
165 >    jend = snapshotBlock2.second;
166 >
167 >    for (int i = snapshotBlock1.first; i < snapshotBlock1.second; ++i) {
168 >
169 >        //update the position or velocity of the atoms belong to rigid bodies
170 >        updateFrame(i);
171 >
172 >        // if the two blocks are the same, we don't want to correlate
173 >        // backwards in time, so start j at the same frame as i
174 >        if (block1 == block2) {
175 >        jstart = i;
176 >        } else {
177 >            jstart = snapshotBlock2.first;
178 >        }
179 >        
180 >        for(int j  = jstart; j < jend; ++j) {
181 >            //update the position or velocity of the atoms belong to rigid bodies
182 >            updateFrame(j);
183 >
184 >            correlateFrames(i, j);
185 >        }
186      }
194  }
187   }
188  
189   void TimeCorrFunc::updateFrame(int frame){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines