Commit 3f4c4d29 authored by allens's avatar allens

updated the termination criateria

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@22098 18c085ea-50e0-402c-830e-de6fd14e8384
parent 266301e5
......@@ -131,7 +131,10 @@ avtPoincareIC::CheckForTermination(avtIVPStep& step, avtIVPField *)
{
numIntersections++;
if (numIntersections >= maxIntersections)
{
terminatedBecauseOfMaxIntersections = true;
return true;
}
}
return false;
......
......@@ -321,16 +321,20 @@ public:
avtPoincareIC( const avtPoincareIC& );
avtPoincareIC& operator=( const avtPoincareIC& );
bool IntersectPlane(const avtVector &p0, const avtVector &p1);
bool IntersectPlane(const avtVector &p0, const avtVector &p1);
public:
virtual bool CheckForTermination(avtIVPStep& step, avtIVPField *);
bool TerminatedBecauseOfMaxIntersections(void)
{ return terminatedBecauseOfMaxIntersections; };
// Intersection points.
bool intersectionsSet;
int maxIntersections;
int numIntersections;
double intersectPlaneEq[4]; // Typically the Y=0 plane i.e. 0, 1, 0
bool terminatedBecauseOfMaxIntersections;
// These are the fieldline points as stripped out of the IC
// proper. They are stored here for convience so the analysis can
......
......@@ -603,7 +603,7 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
unsigned int max_groups = stats.size() / max_samples;
unsigned int mult = 0;
double minPercent = 0.5;
double minPercent = 0.6;
std::map< int, int > GCDCount;
std::map<int, int>::iterator ic;
......@@ -648,7 +648,6 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
++cc;
}
// Set a 0.75 threshold for now.
if( minPercent < (double) cc / (double) num_entries)
{
// If no previous resonance match take it and quit.
......@@ -692,7 +691,6 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
++cc;
}
// Set a 0.75 threshold for now.
if( minPercent < (double) cc / (double) num_entries)
{
minPercent = (double) cc / (double) num_entries;
......@@ -3730,7 +3728,6 @@ FieldlineLib::fieldlineProperties( std::vector< Point > &ptList,
windingGroupOffset = Blankinship( toroidalWinding, poloidalWinding );
// Surface or island so check for the secondary axis case. To date
// we have seen secondary axis in 1,1 surfaces and islands and in
// higher order islands. But no in higher order surfaces.
......
......@@ -2406,7 +2406,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
// because it was terminated rather having a normal finish. So
// regardless of the analysis terminate the fieldline analysis
// because additional integration steps are not possible.
if( poincare_ic->status.Terminated())
if( poincare_ic->status.Terminated() &&
!poincare_ic->TerminatedBecauseOfMaxIntersections() )
{
poincare_ic->properties.nPuncturesNeeded = 0;
poincare_ic->properties.analysisState =
......@@ -2421,6 +2422,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
else if( poincare_ic->properties.analysisState ==
FieldlineProperties::ADDING_POINTS )
{
poincare_ic->status.ClearTerminationMet();
// Do not add more points than the user specified.
if( poincare_ic->properties.nPuncturesNeeded > maxPunctures )
poincare_ic->properties.nPuncturesNeeded = maxPunctures;
......@@ -2453,6 +2456,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
else if( poincare_ic->properties.analysisState ==
FieldlineProperties::ADD_O_POINTS )
{
poincare_ic->status.ClearTerminationMet();
// Make sure more analysis is done in the poincare filter
// once O point seeds are added to the queue.
analysisComplete = false;
......@@ -2465,6 +2470,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
properties.searchState ==
FieldlineProperties::ISLAND_BOUNDARY_SEARCH )
{
poincare_ic->status.ClearTerminationMet();
// Make sure more analysis is done in the poincare filter
// once boundary seed points are added to the queue.
analysisComplete = false;
......
......@@ -603,7 +603,7 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
unsigned int max_groups = stats.size() / max_samples;
unsigned int mult = 0;
double minPercent = 0.5;
double minPercent = 0.6;
std::map< int, int > GCDCount;
std::map<int, int>::iterator ic;
......@@ -648,7 +648,6 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
++cc;
}
// Set a 0.75 threshold for now.
if( minPercent < (double) cc / (double) num_entries)
{
// If no previous resonance match take it and quit.
......@@ -692,7 +691,6 @@ ResonanceCheck( std::vector< std::pair< unsigned int, double > > &stats,
++cc;
}
// Set a 0.75 threshold for now.
if( minPercent < (double) cc / (double) num_entries)
{
minPercent = (double) cc / (double) num_entries;
......@@ -2697,6 +2695,32 @@ FieldlineLib::fieldlineProperties( std::vector< Point > &ptList,
unsigned int OLineToroidalWinding,
std::string OLineAxisFilename )
{
if( ptList.empty() )
{
fi.type = FieldlineProperties::UNKNOWN_TYPE;
fi.analysisState = FieldlineProperties::TERMINATED;
fi.safetyFactor = 0;
fi.toroidalWinding = 0;
fi.poloidalWinding = 0;
fi.poloidalWindingP = 0;
fi.toroidalResonance = 0;
fi.poloidalResonance = 0;
fi.windingPairs.clear();
fi.topWindingPairs.clear();
fi.windingGroupOffset = 0;
fi.islands = 0;
fi.islandGroups = 0;
fi.nnodes = 0;
fi.nPuncturesNeeded = 0;
fi.seedPoints.clear();
return;
}
std::vector< Point > poloidal_puncture_pts;
std::vector< Point > poloidal_puncture_pts2;
std::vector< Point > ridgeline_points;
......@@ -3704,7 +3728,6 @@ FieldlineLib::fieldlineProperties( std::vector< Point > &ptList,
windingGroupOffset = Blankinship( toroidalWinding, poloidalWinding );
// Surface or island so check for the secondary axis case. To date
// we have seen secondary axis in 1,1 surfaces and islands and in
// higher order islands. But no in higher order surfaces.
......
......@@ -559,47 +559,11 @@ QvisPoincarePlotWindow::CreateWindowContents()
this, SLOT(OLineAxisFileNameProcessText()));
OLineAnalysisLayout->addWidget(OLineAxisFileName, 2, 1, 1, 3);
// Create the overlaps group box.
QGroupBox *overlapsGroup = new QGroupBox(secondTab);
overlapsGroup->setTitle(tr("Overlaps"));
mainLayout->addWidget(overlapsGroup, 8, 0, 1, 3, Qt::AlignTop);
QGridLayout *overlapsLayout = new QGridLayout(overlapsGroup);
overlapsLayout->setMargin(5);
overlapsLayout->setSpacing(10);
overlapsLabel = new QLabel(tr("Overlaping curve sections"), secondTab);
overlapsLayout->addWidget(overlapsLabel, 0, 0, Qt::AlignTop);
overlaps = new QWidget(secondTab);
overlapsButtonGroup= new QButtonGroup(overlaps);
QHBoxLayout *overlapTypeLayout = new QHBoxLayout(overlaps);
overlapTypeLayout->setMargin(0);
overlapTypeLayout->setSpacing(10);
QRadioButton *overlapTypeRaw =
new QRadioButton(tr("Raw"), overlaps);
overlapsButtonGroup->addButton(overlapTypeRaw,0);
overlapTypeLayout->addWidget(overlapTypeRaw);
QRadioButton *overlapTypeRemove =
new QRadioButton(tr("Remove"), overlaps);
overlapsButtonGroup->addButton(overlapTypeRemove,1);
overlapTypeLayout->addWidget(overlapTypeRemove);
QRadioButton *overlapTypeMerge =
new QRadioButton(tr("Merge"), overlaps);
overlapsButtonGroup->addButton(overlapTypeMerge,2);
overlapTypeLayout->addWidget(overlapTypeMerge);
QRadioButton *overlapTypeSmooth =
new QRadioButton(tr("Smooth"), overlaps);
overlapsButtonGroup->addButton(overlapTypeSmooth,3);
overlapTypeLayout->addWidget(overlapTypeSmooth);
connect(overlapsButtonGroup, SIGNAL(buttonClicked(int)),
this, SLOT(overlapsChanged(int)));
overlapsLayout->addWidget(overlaps, 0, 1, Qt::AlignTop);
// Create the options group box.
QGroupBox *analysisOptionsGroup = new QGroupBox(secondTab);
analysisOptionsGroup->setTitle(tr("Options"));
mainLayout->addWidget(analysisOptionsGroup, 9, 0, 1, 3, Qt::AlignTop);
mainLayout->addWidget(analysisOptionsGroup, 8, 0, 2, 3, Qt::AlignTop);
QGridLayout *analysisOptionsLayout = new QGridLayout(analysisOptionsGroup);
analysisOptionsLayout->setMargin(5);
......@@ -811,10 +775,47 @@ QvisPoincarePlotWindow::CreateWindowContents()
displayLayout->addWidget(adjustPlane, 1, 3);
// Create the options group box.
// Create the overlaps group box.
QGroupBox *overlapsGroup = new QGroupBox(thirdTab);
overlapsGroup->setTitle(tr("Overlaps"));
mainLayout->addWidget(overlapsGroup, 3, 0);
QGridLayout *overlapsLayout = new QGridLayout(overlapsGroup);
overlapsLayout->setMargin(5);
overlapsLayout->setSpacing(10);
overlapsLabel = new QLabel(tr("Overlaping curve sections"), thirdTab);
overlapsLayout->addWidget(overlapsLabel, 0, 0, Qt::AlignTop);
overlaps = new QWidget(secondTab);
overlapsButtonGroup= new QButtonGroup(overlaps);
QHBoxLayout *overlapTypeLayout = new QHBoxLayout(overlaps);
overlapTypeLayout->setMargin(0);
overlapTypeLayout->setSpacing(10);
QRadioButton *overlapTypeRaw =
new QRadioButton(tr("Raw"), overlaps);
overlapsButtonGroup->addButton(overlapTypeRaw,0);
overlapTypeLayout->addWidget(overlapTypeRaw);
QRadioButton *overlapTypeRemove =
new QRadioButton(tr("Remove"), overlaps);
overlapsButtonGroup->addButton(overlapTypeRemove,1);
overlapTypeLayout->addWidget(overlapTypeRemove);
QRadioButton *overlapTypeMerge =
new QRadioButton(tr("Merge"), overlaps);
overlapsButtonGroup->addButton(overlapTypeMerge,2);
overlapTypeLayout->addWidget(overlapTypeMerge);
QRadioButton *overlapTypeSmooth =
new QRadioButton(tr("Smooth"), overlaps);
overlapsButtonGroup->addButton(overlapTypeSmooth,3);
overlapTypeLayout->addWidget(overlapTypeSmooth);
connect(overlapsButtonGroup, SIGNAL(buttonClicked(int)),
this, SLOT(overlapsChanged(int)));
overlapsLayout->addWidget(overlaps, 0, 1, Qt::AlignTop);
// Create the options group box.
QGroupBox *optionsGroup = new QGroupBox(thirdTab);
optionsGroup->setTitle(tr("Options"));
mainLayout->addWidget(optionsGroup, 3, 0);
mainLayout->addWidget(optionsGroup, 4, 0);
QGridLayout *optionsLayout = new QGridLayout(optionsGroup);
optionsLayout->setMargin(5);
......@@ -851,7 +852,7 @@ QvisPoincarePlotWindow::CreateWindowContents()
//
QGroupBox * miscGroup = new QGroupBox(thirdTab);
miscGroup->setTitle(tr("Misc"));
mainLayout->addWidget(miscGroup, 4, 0);
mainLayout->addWidget(miscGroup, 5, 0);
QGridLayout *miscLayout = new QGridLayout(miscGroup);
miscLayout->setMargin(5);
......@@ -2319,15 +2320,11 @@ QvisPoincarePlotWindow::fieldConstantProccessText()
void
QvisPoincarePlotWindow::integrationTypeChanged(int val)
{
if(val == 4) // Unused
Apply();
else if(val != atts->GetIntegrationType())
if(val != atts->GetIntegrationType())
{
atts->SetIntegrationType(PoincareAttributes::IntegrationType(val));
Apply();
}
}
......
......@@ -225,7 +225,6 @@ class QvisPoincarePlotWindow : public QvisPostableWindowObserver
QLabel *absTolLabel;
QCheckBox *forceNodal;
QButtonGroup *coordinateButtonGroup;
QWidget *analysis;
QButtonGroup *analysisButtonGroup;
......
......@@ -1764,7 +1764,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
// because it was terminated rather having a normal finish. So
// regardless of the analysis terminate the fieldline analysis
// because additional integration steps are not possible.
if( poincare_ic->status.Terminated())
if( poincare_ic->status.Terminated() &&
!poincare_ic->TerminatedBecauseOfMaxIntersections() )
{
poincare_ic->properties.nPuncturesNeeded = 0;
poincare_ic->properties.analysisState =
......@@ -1779,6 +1780,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
else if( poincare_ic->properties.analysisState ==
FieldlineProperties::ADDING_POINTS )
{
poincare_ic->status.ClearTerminationMet();
// Do not add more points than the user specified.
if( poincare_ic->properties.nPuncturesNeeded > maxPunctures )
poincare_ic->properties.nPuncturesNeeded = maxPunctures;
......@@ -1811,6 +1814,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
else if( poincare_ic->properties.analysisState ==
FieldlineProperties::ADD_O_POINTS )
{
poincare_ic->status.ClearTerminationMet();
// Make sure more analysis is done in the poincare filter
// once O point seeds are added to the queue.
analysisComplete = false;
......@@ -1823,6 +1828,8 @@ avtPoincareFilter::ClassifyFieldlines(std::vector<avtIntegralCurve *> &ics)
properties.searchState ==
FieldlineProperties::ISLAND_BOUNDARY_SEARCH )
{
poincare_ic->status.ClearTerminationMet();
// Make sure more analysis is done in the poincare filter
// once boundary seed points are added to the queue.
analysisComplete = false;
......@@ -2182,7 +2189,7 @@ avtPoincareFilter::CreatePoincareOutput( avtDataTree *dt,
bool completeIslands = true;
if( summaryFlag )
if( summaryFlag )
{
double safetyFactor;
......
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