ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ConstraintAlgorithm.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/ConstraintAlgorithm.cpp (file contents):
Revision 1234 by tim, Fri Jun 4 03:15:31 2004 UTC vs.
Revision 1248 by tim, Fri Jun 4 19:30:05 2004 UTC

# Line 2 | Line 2
2   #include "ConstraintPair.hpp"
3   #include "SimInfo.hpp"
4   #include "ConstraintManager.hpp"
5 + #include "simError.h"
6  
7   ////////////////////////////////////////////////////////////////////////////////
8   //Implementation of ConstraintAlgorithm
# Line 27 | Line 28 | void ConstraintAlgorithm::doConstrain(){
28   }
29  
30   void ConstraintAlgorithm::doConstrain(){
31 <  const int maxConsIteration = 30;
31 >  const int maxConsIteration = 300;
32    bool done;
33    int iteration;
34    int maxIteration;
# Line 37 | Line 38 | void ConstraintAlgorithm::doConstrain(){
38    int exeStatus;
39  
40  
41 +  error = false;
42    
43    for(ceIter->first(); !ceIter->isEnd(); ceIter->next()){
44      consElem =  ceIter->currentItem();
# Line 62 | Line 64 | void ConstraintAlgorithm::doConstrain(){
64  
65        switch(exeStatus){
66          case consFail:
67 <          cerr << "ConstraintAlgorithm::doConstrain() Error: Constraint Fail" << endl;          
67 >          cerr << "ConstraintAlgorithm::doConstrain() Error: Constraint Fail" << endl;        
68 >          error = true;
69            break;
70          case consSuccess:
71            //constrain the pair by moving two elements
# Line 76 | Line 79 | void ConstraintAlgorithm::doConstrain(){
79          case consPairHandlerFail:
80            //can not found call back functor for constraint pair
81            cerr << "ConstraintAlgorithm::doConstrain() Error: can not found callback functor for constraint pair " << endl;
82 +          error = true;
83            break;          
84          case consElemHandlerFail:
85            //can not found callback functor for constraint element
86            cerr << "ConstraintAlgorithm::doConstrain() Error: can not found callback functor for constraint element " << endl;
87 +          error = true;
88            break;
89          default:          
90            cerr << "ConstraintAlgorithm::doConstrain() Error: unrecognized status" << endl;
91 +          error = true;
92            break;
93        }      
94      }//end for(iter->first())
# Line 95 | Line 101 | void ConstraintAlgorithm::doConstrain(){
101  
102      iteration++;
103    }//end while
104 <  
104 >
105 >  //if (!done){
106 >  //  error = true;
107 >  //  sprintf(painCave.errMsg,
108 >  //          "Constraint failure in constrainB, too many iterations: %d\n",
109 >  //          iteration);
110 >  //  painCave.isFatal = 1;
111 >  //  simError();    
112 >  //}
113   }
114  
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines