Commit 816a5109 authored by pugmire's avatar pugmire
Browse files

Merge 1.12RC bug fixes to trunk.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8870 18c085ea-50e0-402c-830e-de6fd14e8384
parent ff6e95a8
......@@ -110,6 +110,10 @@ avtParDomSLAlgorithm::~avtParDomSLAlgorithm()
// Dave Pugmire, Wed Apr 1 11:21:05 EDT 2009
// Message size and number of receives moved to Initialize().
//
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Establish how many streamlines there are once each proc determines if a
// seed is in the domain.
//
// ****************************************************************************
......@@ -128,22 +132,53 @@ avtParDomSLAlgorithm::Initialize(vector<avtStreamlineWrapper *> &seedPts)
for (int i = 0; i < seedPts.size(); i++)
{
avtStreamlineWrapper *s = seedPts[i];
avtVector endPt;
s->GetEndPoint(endPt);
if (OwnDomain(s->domain))
{
avtVector endPt;
s->GetEndPoint(endPt);
if (PointInDomain(endPt, s->domain))
activeSLs.push_back(s);
else
{
numSLChange--;
delete s;
}
}
else
delete s;
}
ExchangeTermination();
//Check for seeds owned by multiple procs.
/*
int *idBuffer = new int[numSeedPoints], *idBuffer2 = new int[numSeedPoints];
for (int i = 0; i < numSeedPoints; i++)
idBuffer[i] = 0;
list<avtStreamlineWrapper *>::iterator s;
for (s = activeSLs.begin(); s != activeSLs.end(); ++s)
idBuffer[(*s)->id]++;
SumIntArrayAcrossAllProcessors(idBuffer, idBuffer2, numSeedPoints);
for (int i = 0; i < numSeedPoints; i++)
{
debug5<<"SEED_COUNT: id= "<<i<<" cnt= "<<idBuffer2[i]<<endl;
if (idBuffer2[i] > 1)
{
debug5<<"DUPLICATE SEED: "<<i<<endl;
}
}
delete [] idBuffer;
delete [] idBuffer2;
*/
totalNumStreamlines = activeSLs.size();
SumIntAcrossAllProcessors(totalNumStreamlines);
/*
debug5<<"Init_totalNumStreamlines= "<<totalNumStreamlines<<endl;
debug5<<"My SLs: "<<endl;
list<avtStreamlineWrapper *>::iterator s;
for (s = activeSLs.begin(); s != activeSLs.end(); ++s)
debug5<<"ID "<<(*s)->id<<" dom= "<<(*s)->domain<<endl;
*/
debug1<<"My SLcount= "<<activeSLs.size()<<endl;
debug1<<"I own: [";
......@@ -239,10 +274,11 @@ avtParDomSLAlgorithm::RunAlgorithm()
{
avtStreamlineWrapper *s = activeSLs.front();
activeSLs.pop_front();
IntegrateStreamline(s);
if (s->status == avtStreamlineWrapper::TERMINATE)
{
debug5<<"TerminatedSL: "<<s->id<<endl;
terminatedSLs.push_back(s);
numSLChange--;
}
......@@ -255,7 +291,7 @@ avtParDomSLAlgorithm::RunAlgorithm()
//Check for new SLs.
int earlyTerminations = 0;
RecvSLs(activeSLs, earlyTerminations);
numSLChange -= earlyTerminations;
//numSLChange -= earlyTerminations;
ExchangeTermination();
CheckPendingSendRequests();
......@@ -287,6 +323,9 @@ avtParDomSLAlgorithm::RunAlgorithm()
// Dave Pugmire, Thu Sep 24 13:52:59 EDT 2009
// SLs are exchanged after processing, simplifying this method.
//
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Bug fix. Set the new domain before communicating SL.
//
// ****************************************************************************
void
......@@ -297,17 +336,22 @@ avtParDomSLAlgorithm::HandleOOBSL(avtStreamlineWrapper *s)
for (int i = 0; i < s->seedPtDomainList.size(); i++)
{
// if i > 0, we create new streamlines.
if (i > 0)
numSLChange++;
// if (i > 0)
// numSLChange++;
int domRank = DomainToRank(s->seedPtDomainList[i]);
s->domain = s->seedPtDomainList[i];
if (domRank == rank)
{
activeSLs.push_back(s);
//debug5<<"Handle OOB: id= "<<s->id<<" "<<s->domain<<" --> me"<<endl;
}
else
{
vector<avtStreamlineWrapper *> sls;
sls.push_back(s);
SendSLs(domRank,sls);
SendSLs(domRank, sls);
//debug5<<"Handle OOB: id= "<<s->id<<" "<<s->domain<<" --> "<<domRank<<endl;
}
}
}
......
......@@ -269,7 +269,7 @@ avtParSLAlgorithm::ExchangeSLSteps()
int idx = (*t)->id % N;
myIDs[idx] = rank;
myIDs[idx+N] += 1;
debug5<<"I own "<<(*t)->id<<" "<<(*t)->sequenceCnt<<" idx= "<<idx<<endl;
debug5<<"I own id= "<<(*t)->id<<" "<<(*t)->sequenceCnt<<" idx= "<<idx<<endl;
}
t++;
......
......@@ -1564,8 +1564,8 @@ avtStreamlineFilter::PointInDomain(avtVector &pt, DomainType &domain)
if (ds == NULL)
{
debug5<<"Get DS failed for domain= "<<domain<<endl;
EXCEPTION0(ImproperUseException);
debug5<<"FALSE"<<endl;
return false;
}
......@@ -1630,13 +1630,13 @@ avtStreamlineFilter::PointInDomain(avtVector &pt, DomainType &domain)
int foundCell = -1, subId = 0;
int success = cellLocator->FindClosestPointWithinRadius(p, rad, resPt,
foundCell, subId, dist);
if (DebugStream::Level5())
debug5<<(success?"TRUE":"FALSE")<<" cellLocator"<<endl;
if (success && DebugStream::Level5())
debug5<< "suc = "<<success<<" dist = "<<dist<<" resPt= ["<<resPt[0]
<<" "<<resPt[1]<<" "<<resPt[2]<<"] subId= "<<subId<<" foundCell= "<<foundCell<<endl;
return (success == 1 ? true : false);
}
......@@ -1764,7 +1764,7 @@ avtStreamlineFilter::DomainToRank(DomainType &domain)
//debug1<<"avtStreamlineFilter::DomainToRank("<<domain<<") = "<<domainToRank[domain]<<endl;
if (domain.timeStep != 0)
if (doPathlines && domain.timeStep != 0)
EXCEPTION1(ImproperUseException, "Fix DomainToRank for time slices.");
return domainToRank[domain.domain];
......@@ -1834,6 +1834,9 @@ avtStreamlineFilter::DomainToRank(DomainType &domain)
// Dave Pugmire, Tue Aug 18 09:10:49 EDT 2009
// Add ability to restart integration of streamlines.
//
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Bug fix. Out-of-bounds SLs were being set to terminated.
//
// ****************************************************************************
avtIVPSolver::Result
......@@ -1901,32 +1904,35 @@ avtStreamlineFilter::IntegrateDomain(avtStreamlineWrapper *slSeg,
// When restarting a streamline one step is always taken. To avoid
// this unneed step check to see if the termination criteria was
// previously met.
if (DebugStream::Level5()) debug5<<"IntegrateDomain: slSeg->terminated= "<<slSeg->terminated<<endl;
if( ! slSeg->terminated )
{
if (intersectObj)
slSeg->sl->SetIntersectionObject(intersectObj);
if (doPathlines)
{
avtIVPVTKTimeVaryingField field(velocity1, t1, t2);
result = slSeg->sl->Advance(&field,
slSeg->terminationType,
slSeg->termination);
}
else
{
avtIVPVTKField field(velocity1);
result = slSeg->sl->Advance(&field,
slSeg->terminationType,
slSeg->termination);
}
// Termination criteria was met.
slSeg->terminated = (result == avtIVPSolver::TERMINATE);
if (intersectObj)
slSeg->sl->SetIntersectionObject(intersectObj);
if (doPathlines)
{
avtIVPVTKTimeVaryingField field(velocity1, t1, t2);
result = slSeg->sl->Advance(&field,
slSeg->terminationType,
slSeg->termination);
}
else
{
avtIVPVTKField field(velocity1);
result = slSeg->sl->Advance(&field,
slSeg->terminationType,
slSeg->termination);
}
// Termination criteria was met.
slSeg->terminated = (result == avtIVPSolver::TERMINATE);
debug5<<"Advance:= "<<result<<endl;
debug5<<"IntegrateDomain: slSeg->terminated= "<<slSeg->terminated<<endl;
}
else
result = avtIVPSolver::TERMINATE;
result = avtIVPSolver::TERMINATE;
numSteps = slSeg->sl->size() - numSteps;
//slSeg->Debug();
......@@ -1940,27 +1946,37 @@ avtStreamlineFilter::IntegrateDomain(avtStreamlineWrapper *slSeg,
// Not in any domains.
if (slSeg->seedPtDomainList.size() == 0)
{
slSeg->status = avtStreamlineWrapper::TERMINATE;
}
// We are in the same domain.
else if (slSeg->seedPtDomainList.size() >= 1)
{
// pathline terminates if timestep is out of bounds.
if (doPathlines && slSeg->domain.timeStep == -1)
{
slSeg->status = avtStreamlineWrapper::TERMINATE;
}
if (slSeg->domain == oldDomain && numSteps == 0)
{
slSeg->status = avtStreamlineWrapper::TERMINATE;
slSeg->status = avtStreamlineWrapper::TERMINATE;
}
else
{
slSeg->status = avtStreamlineWrapper::OUTOFBOUNDS;
}
}
else
{
//slSeg->status = avtStreamlineWrapper::TERMINATE;
}
}
else
{
slSeg->status = avtStreamlineWrapper::TERMINATE;
}
velocity1->Delete();
if (cellToPt1)
......@@ -2038,20 +2054,13 @@ avtStreamlineFilter::IntegrateStreamline(avtStreamlineWrapper *slSeg, int maxSte
//SL terminates.
else
{
if (DebugStream::Level5())
{
debug5<<"Terminate!\n";
debug5<<avtIVPSolver::OK<<endl;
debug5<<avtIVPSolver::TERMINATE<<endl;
debug5<<avtIVPSolver::OUTSIDE_DOMAIN<<endl;
}
if (DebugStream::Level5()) debug5<<"Terminate!\n";
slSeg->status = avtStreamlineWrapper::TERMINATE;
}
}
if (DebugStream::Level5())
debug5 << " IntegrateStreamline DONE: status = " << (slSeg->status==avtStreamlineWrapper::TERMINATE ? "TERMINATE" : "OOB")
<< " domCnt= "<<slSeg->seedPtDomainList.size()<<endl;
debug5 << "IntegrateStreamline DONE: status = "<<slSeg->status<<" doms= "<<slSeg->seedPtDomainList<<endl;
}
// ****************************************************************************
......@@ -2301,6 +2310,9 @@ randMinus1_1()
// Dave Pugmire, Tue Aug 18 09:10:49 EDT 2009
// Add ability to restart integration of streamlines.
//
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Bug fix. Seed points with multiple domains need to be given a separate ID.
//
// ****************************************************************************
void
......@@ -2345,7 +2357,7 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
U.normalize();
N.normalize();
if(dataSpatialDimension <= 2)
N = avtVector(0.,0.,1.);
N = avtVector(0.,0.,1.);
// Determine the right vector.
avtVector R(U % N);
R.normalize();
......@@ -2477,6 +2489,7 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
double dZ = dataRange[5]-dataRange[4];
double minRange = std::min(dX, std::min(dY,dZ));
int ID = 0;
for (int i = 0; i < candidatePts.size(); i++)
{
vector<int> dl;
......@@ -2531,8 +2544,9 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
{
pd.pt = candidatePts[i];
pd.domain = dl[j];
pd.id = i;
pd.id = ID;
ptDom.push_back(pd);
ID++;
}
}
......@@ -2568,6 +2582,7 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
slSeg->domain.timeStep = seedTimeStep0;
slSeg->termination = termination;
slSeg->terminationType = terminationType;
debug5<<"Create seed: id= "<<ptDom[i].id<<" pt= "<<ptDom[i].pt<<" dom= "<<ptDom[i].domain<<endl;
pts.push_back(slSeg);
}
......@@ -2577,14 +2592,18 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
avtStreamline *sl = new avtStreamline(solver, seedTime0, pt);
sl->SetScalarValueType(scalarVal);
int id = ptDom[i].id;
if (streamlineDirection == VTK_INTEGRATE_BOTH_DIRECTIONS)
id += ptDom.size();
avtStreamlineWrapper *slSeg;
slSeg = new avtStreamlineWrapper(sl,
avtStreamlineWrapper::BWD,
ptDom[i].id);
avtStreamlineWrapper::BWD, id);
slSeg->domain = ptDom[i].domain;
slSeg->domain.timeStep = seedTimeStep0;
slSeg->termination = termination;
slSeg->termination = -termination;
slSeg->terminationType = terminationType;
debug5<<"Create seed: id= "<<ptDom[i].id<<" pt= "<<ptDom[i].pt<<" dom= "<<ptDom[i].domain<<endl;
pts.push_back(slSeg);
}
}
......
......@@ -264,7 +264,10 @@ class avtIVPState
// Added OnExitDomain method.
//
// Dave Pugmire, Tue Aug 19, 17:38:03 EDT 2008
// Chagned how distanced based termination is computed.
// Changned how distanced based termination is computed.
//
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Add operator<< for enums.
//
// ****************************************************************************
......@@ -318,6 +321,37 @@ protected:
virtual void AcceptStateVisitor(avtIVPStateHelper& sv) = 0;
};
inline std::ostream& operator<<( std::ostream& out, const avtIVPSolver::Result &res )
{
switch (res)
{
case avtIVPSolver::OK: out<<"OK"; break;
case avtIVPSolver::TERMINATE: out<<"TERMINATE"; break;
case avtIVPSolver::OUTSIDE_DOMAIN: out<<"OUTSIDE_DOMAIN"; break;
case avtIVPSolver::STEPSIZE_UNDERFLOW: out<<"STEPSIZE_UNDERFLOW"; break;
case avtIVPSolver::STIFFNESS_DETECTED: out<<"STIFFNESS_DETECTED"; break;
case avtIVPSolver::UNSPECIFIED_ERROR: out<<"UNSPECIFIED_ERROR"; break;
default:
out<<"UNKNOWN_RESULT"; break;
}
return out;
}
inline std::ostream& operator<<( std::ostream& out, const avtIVPSolver::TerminateType &term )
{
switch (term)
{
case avtIVPSolver::TIME: out<<"TIME"; break;
case avtIVPSolver::DISTANCE: out<<"DISTANCE"; break;
case avtIVPSolver::STEPS: out<<"STEPS"; break;
case avtIVPSolver::INTERSECTIONS: out<<"INTERSECTIONS"; break;
default:
out<<"UNKNOWN_TERMINATION"; break;
}
return out;
}
#endif
......@@ -272,7 +272,6 @@ avtStreamline::DoAdvance(avtIVPSolver* ivp,
result = ivp->Step(field, termType, end, step);
if (DebugStream::Level5())
debug5<<" T= "<<ivp->GetCurrentT()<<" "<<ivp->GetCurrentY()<<endl;
if (intersectionsSet)
HandleIntersections((end>0), step, termType, end, &result);
......@@ -283,7 +282,6 @@ avtStreamline::DoAdvance(avtIVPSolver* ivp,
debug5<<ivp->GetCurrentY()<<" not in domain\n";
// integrator left the domain, retry with smaller step
// if step size is below given minimum, give up
// restore old state to before failed step
double hBeforePush = ivp->GetNextStepSize();
ivp->PutState( state );
......@@ -378,7 +376,7 @@ avtStreamline::DoAdvance(avtIVPSolver* ivp,
// Code cleanup.
//
// Dave Pugmire, Tue Mar 31 17:08:29 EDT 2009
// Set the step's T value when leaping out.
// Set the step's T value when leaping out.
//
// Hank Childs, Fri Apr 10 23:31:22 CDT 2009
// Put if statements in front of debug's. The generation of strings to
......@@ -386,12 +384,15 @@ avtStreamline::DoAdvance(avtIVPSolver* ivp,
//
// Mark C. Miller, Wed Apr 22 13:48:13 PDT 2009
// Changed interface to DebugStream to obtain current debug level.
// Dave Pugmire, Tue Nov 3 09:15:41 EST 2009
// Replace size() with much more efficient empty().
//
// ****************************************************************************
void
avtStreamline::HandleGhostZones(bool forward, double *extents)
{
if (size() == 0 || extents == NULL)
if (_steps.empty() || extents == NULL)
return;
// Determine the minimum non-zero data extent.
......@@ -640,7 +641,6 @@ avtStreamline::HandleIntersections(bool forward,
}
}
// ****************************************************************************
// Method: avtStreamline::IntersectPlane
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment