Commit 20356f34 authored by hrchilds's avatar hrchilds
Browse files

Update from August 11, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@299 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2202a72d
......@@ -439,7 +439,7 @@ avtGenericDatabase::GetOutput(avtDataSpecification_p spec,
// ****************************************************************************
// Method: avtGenericDatabase::UpdateInternalState
// Method: avtGenericDatabase::UpdateinternalState
//
// Purpose:
// Do some internal bookkeeping. This is mostly to handle current
......@@ -3440,6 +3440,10 @@ avtGenericDatabase::ReadDataset(avtDatasetCollection &ds, vector<int> &domains,
//
// Mark C. Miller, Tue Aug 10 14:16:36 PDT 2004
// Added check for if ghosts had been read from file and return immediately
//
// Mark C. Miller, Wed Aug 11 14:41:06 PDT 2004
// Moved check for if ghost had been read from file to just before ghost
// node stuff. Made it contribute to results for shouldStop
//
// ****************************************************************************
......@@ -3458,13 +3462,6 @@ avtGenericDatabase::CommunicateGhosts(avtDatasetCollection &ds,
avtVarType type = md->DetermineVarType(varname);
std::string meshname = md->MeshForVar(varname);
//
// Return immediately if we've alread got ghost zones we've read from the
// database
//
if (md->GetContainsGhostZones(meshname) == AVT_HAS_GHOSTS)
return false;
void_ref_ptr vr = cache.GetVoidRef("any_mesh",
AUXILIARY_DATA_DOMAIN_BOUNDARY_INFORMATION,
-1, -1);
......@@ -3949,6 +3946,10 @@ avtGenericDatabase::CommunicateGhosts(avtDatasetCollection &ds,
}
int shouldStop = (haveGlobalNodeIds ? 0 : 1);
// set shouldStop to 1 also if we arrive here already having ghosts
if (md->GetContainsGhostZones(meshname) == AVT_HAS_GHOSTS)
shouldStop = 1;
#ifdef PARALLEL
int parallelShouldStop;
MPI_Allreduce(&shouldStop, &parallelShouldStop, 1, MPI_INT, MPI_MAX,
......@@ -3956,13 +3957,7 @@ avtGenericDatabase::CommunicateGhosts(avtDatasetCollection &ds,
shouldStop = parallelShouldStop;
#endif
if (shouldStop > 0)
{
debug1 << "Not applying ghost zones because not all the domains "
<< "have global node ids." << endl;
return false;
}
else
if (shouldStop == 0)
{
int timerHandle = visitTimer->StartTimer();
......
......@@ -264,6 +264,9 @@ avtLocateNodeQuery::DeterminePickedNode(vtkDataSet *ds, int foundCell, float *pp
// Test for coincident points, return the one that is part of the
// original intersected cell.
//
// Kathleen Bonnell, Tue Aug 10 09:06:54 PDT 2004
// Set id when validOrigNodes size is 1.
//
// ****************************************************************************
int
......@@ -318,11 +321,12 @@ avtLocateNodeQuery::FindClosestPoint(vtkDataSet *ds, const int isectedCell,
if (validOrigNodes.size() == 1)
{
origNode = validOrigNodes[0];
id = validClosestPoints[0];
}
else
{
oNode = -1;
oNode = -1;
id = -1;
// some close nodes are same distance, find the one
// that belongs to the isected cell.
vtkIdList *cellPts = vtkIdList::New();
......
......@@ -65,6 +65,9 @@ avtNodePickQuery::~avtNodePickQuery()
// Creation: May 13, 2004
//
// Modifications:
// Kathleen Bonnell, Tue Aug 10 09:06:54 PDT 2004
// When material-selection has been applied, ensure that RetriveVarInfo
// will be using the correct zone ids for this dataset.
//
// ****************************************************************************
......@@ -145,7 +148,14 @@ avtNodePickQuery::Execute(vtkDataSet *ds, const int dom)
if (pickAtts.GetMatSelected())
{
RetrieveVarInfo(ds);
//
// The zone numbers stored in IncidentElements are not the correct
// ones to use with this dataset ... get the correct ones to use
// with RetrieveVarInfo, then reset them.
//
intVector pickedZones = pickAtts.GetIncidentElements();
intVector currentZones = GetCurrentZoneForOriginal(ds, pickedZones);
RetrieveVarInfo(ds, pickAtts.GetElementNumber(), currentZones);
}
//
......
......@@ -133,7 +133,16 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
src->Query(&pickAtts);
if (pickAtts.GetMatSelected())
RetrieveVarInfo(ds);
{
//
// The zone numbers stored in IncidentElements are not the correct
// ones to use with this dataset ... get the correct ones to use
// with RetrieveVarInfo, then reset them.
//
intVector pickedZones = pickAtts.GetIncidentElements();
intVector currentZones = GetCurrentZoneForOriginal(ds, pickedZones);
RetrieveVarInfo(ds, pickAtts.GetElementNumber(), currentZones);
}
//
// Set the domain and zone of pickAtts in relation to the
......
......@@ -64,6 +64,9 @@ avtPickByZoneQuery::~avtPickByZoneQuery()
// Kathleen Bonnell, Thu Jul 8 16:42:05 PDT 2004
// Changed the way that zoneid is modified when accounting for ghost zones.
//
// Kathleen Bonnell, Tue Aug 10 13:14:38 PDT 2004
// Account for material selection.
//
// ****************************************************************************
void
......@@ -74,13 +77,23 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
return;
}
int zoneid = pickAtts.GetElementNumber();
int userZoneId = pickAtts.GetElementNumber();
int zoneid = userZoneId;
int maxEls = ds->GetNumberOfCells();
if (zoneid < 0 || zoneid >= maxEls)
if (pickAtts.GetMatSelected())
{
EXCEPTION2(BadCellException, zoneid+cellOrigin, maxEls+cellOrigin);
//
// The zone id stored in ElementNumber will not be correct relative
// to this dataset. Retrieve the correct one for use with
// RetrieveVarInfo, then reset it.
//
zoneid = GetCurrentZoneForOriginal(ds, userZoneId);
}
if (zoneid < 0 || zoneid >= maxEls)
{
EXCEPTION2(BadCellException, userZoneId+cellOrigin, maxEls+cellOrigin);
}
int type = ds->GetDataObjectType();
bool needRealId = ghostType == AVT_HAS_GHOSTS &&
......@@ -129,8 +142,12 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
src->Query(&pickAtts);
pickAtts.SetElementNumber(userZoneId+cellOrigin);
if (pickAtts.GetMatSelected())
RetrieveVarInfo(ds);
{
RetrieveVarInfo(ds, zoneid, pickAtts.GetIncidentElements());
}
//
// Set the domain and zone of pickAtts in relation to the
......@@ -156,12 +173,9 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
{
SetRealIds(ds);
//
// Put the real ids in the correct spot for output.
pickAtts.SetElementNumber(pickAtts.GetRealElementNumber());
// Put the real node ids in the correct spot for output.
pickAtts.SetIncidentElements(pickAtts.GetRealIncidentElements());
}
pickAtts.SetElementNumber(pickAtts.GetElementNumber() + cellOrigin);
//
// Use the cell center as the place to position the pick letter.
......
......@@ -14,6 +14,7 @@
#include <vtkPointData.h>
#include <vtkPoints.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnsignedIntArray.h>
#include <vtkVisItUtility.h>
#include <avtExpressionEvaluatorFilter.h>
......@@ -251,6 +252,10 @@ avtPickQuery::PostExecute(void)
// Kathleen Bonnell, Wed Jun 2 10:21:50 PDT 2004
// Moved Node and Zone-specific code to Preparation method.
//
// Kathleen Bonnell, Tue Aug 10 09:15:58 PDT 2004
// When material selection has been applied, request OriginalZoneNumbers
// and OriginalNodeNumbers.
//
// ****************************************************************************
avtDataObject_p
......@@ -309,6 +314,12 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
dspec->AddSecondaryVariable(vars[i].c_str());
}
}
if (pickAtts.GetMatSelected())
{
dspec->TurnZoneNumbersOn();
dspec->TurnNodeNumbersOn();
}
avtPipelineSpecification_p pspec = new avtPipelineSpecification(dspec, 0);
avtDataObject_p temp;
......@@ -648,6 +659,29 @@ avtPickQuery::GetZoneCoords(vtkDataSet *ds, const int zoneId)
}
// ****************************************************************************
// Method: avtPickQuery::RetrieveVarInfo
//
// Purpose:
// Convenience method, so derived types don't need to pass new args.
//
// Arguments:
// ds The dataset to retrieve information from.
//
// Programmer: Kathleen Bonnell
// Creation: August 11, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
{
RetrieveVarInfo(ds, pickAtts.GetElementNumber(), pickAtts.GetIncidentElements());
}
// ****************************************************************************
// Method: avtPickQuery::RetrieveVarInfo
//
......@@ -671,10 +705,16 @@ avtPickQuery::GetZoneCoords(vtkDataSet *ds, const int zoneId)
// Kathleen Bonnell, Thu Jul 22 12:10:19 PDT 2004
// Set PickVarInfo's treatAsASCII from DataAttributes' treatAsASCII.
//
// Kathleen Bonnell, Wed Aug 11 09:21:07 PDT 2004
// Added args findElement, and findIncidentElements, used when the
// elements stored in pickAtts don't correspond to the element numbers
// used by ds.
//
// ****************************************************************************
void
avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
avtPickQuery::RetrieveVarInfo(vtkDataSet* ds, const int findElement,
const intVector &findIncidentElements)
{
bool treatAsASCII = false;
avtDataAttributes &data = GetInput()->GetInfo().GetAttributes();
......@@ -761,7 +801,7 @@ avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
{
SNPRINTF(buff, 80, "(%d)", incidentElements[k]);
names.push_back(buff);
varArray->GetTuple(incidentElements[k], temp);
varArray->GetTuple(findIncidentElements[k], temp);
mag = 0;
for (int i = 0; i < nComponents; i++)
{
......@@ -781,7 +821,7 @@ avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
// data we want is associated with element
SNPRINTF(buff, 80, "(%d)", element);
names.push_back(buff);
varArray->GetTuple(element, temp);
varArray->GetTuple(findElement, temp);
mag = 0.;
for (int i = 0; i < nComponents; i++)
{
......@@ -1078,3 +1118,102 @@ avtPickQuery::RetrieveZones(vtkDataSet *ds, int foundNode)
return success;
}
// ****************************************************************************
// Method: avtPickQuery::GetCurrentZoneForOriginal
//
// Purpose:
// Determines the zone in the dataset whose original zone designation
/// matches that of the passed zone.
//
// Arguments:
// ds The dataset to retrieve information from.
// origZone An 'original' zone id.
//
// Returns:
// The zone id in ds whose original zone id matches the arg.
// If 'avtOriginalCellNumbers' is not present, then the value is equal to
// the arg value.
//
// Programmer: Kathleen Bonnell
// Creation: August 11, 2004
//
// Modifications:
//
// ****************************************************************************
int
avtPickQuery::GetCurrentZoneForOriginal(vtkDataSet *ds, const int origZone)
{
int currentZone = origZone;
vtkUnsignedIntArray *origCells = vtkUnsignedIntArray::SafeDownCast(
ds->GetCellData()->GetArray("avtOriginalCellNumbers"));
if (origCells)
{
int nTuples = origCells->GetNumberOfTuples();
int nComp = origCells->GetNumberOfComponents();
int comp = nComp -1;
unsigned int *oc = origCells->GetPointer(0);
for (int i = 0; i < nTuples; i++)
{
if (oc[i*nComp+comp] == origZone)
{
currentZone = i;
break;
}
}
}
return currentZone;
}
// ****************************************************************************
// Method: avtPickQuery::GetCurrentZoneForOriginal
//
// Purpose:
// Determines the zones in the dataset whose original zone designation
/// matches those of the passed list.
//
// Arguments:
// ds The dataset to retrieve information from.
// origZones A list of 'original' zone ids.
//
// Returns:
// The list of zone ids in ds whose original zone ids match those
// of the passed list. If 'avtOriginalCellNumbers' is not present,
// then the returned list is equialent to the passed list.
//
// Programmer: Kathleen Bonnell
// Creation: August 11, 2004
//
// Modifications:
//
// ****************************************************************************
intVector
avtPickQuery::GetCurrentZoneForOriginal(vtkDataSet *ds, const intVector &origZones)
{
intVector currentZones = origZones;
vtkUnsignedIntArray *origCells = vtkUnsignedIntArray::SafeDownCast(
ds->GetCellData()->GetArray("avtOriginalCellNumbers"));
if (origCells)
{
int nTuples = origCells->GetNumberOfTuples();
int nComp = origCells->GetNumberOfComponents();
int comp = nComp -1;
unsigned int *oc = origCells->GetPointer(0);
int nFound = 0;
for (int i = 0; i < nTuples && nFound < origZones.size(); i++)
{
for (int j = 0; j < currentZones.size(); j++)
{
if (oc[i*nComp+comp] == origZones[j])
{
currentZones[j] = i;
nFound++;
break;
}
}
}
}
return currentZones;
}
......@@ -59,6 +59,10 @@ class avtExpressionEvaluatorFilter;
// No longer inherit from avtVariableQuery, moved common methods back to
// this class: (RetrieveNodes, RetrieveZones, RetrieveVarInfo).
//
// Kathleen Bonnell, Wed Aug 11 09:21:07 PDT 2004
// Added RetrieveVarInfo method with extra args. Added two
// GetCurrentZoneForOriginal methods.
//
// ****************************************************************************
class QUERY_API avtPickQuery : public avtDatasetQuery
......@@ -104,9 +108,16 @@ class QUERY_API avtPickQuery : public avtDatasetQuery
void SetRealIds(vtkDataSet *);
void RetrieveVarInfo(vtkDataSet *);
void RetrieveVarInfo(vtkDataSet *, const int,
const intVector &);
bool RetrieveNodes(vtkDataSet *, int);
bool RetrieveZones(vtkDataSet *, int);
int GetCurrentZoneForOriginal(vtkDataSet *,
const int);
intVector GetCurrentZoneForOriginal(vtkDataSet *,
const intVector&);
PickAttributes pickAtts;
avtExpressionEvaluatorFilter *eef;
avtQueryableSource *src;
......
......@@ -78,6 +78,9 @@ avtZonePickQuery::SetInvTransform(const avtMatrix *m)
// Creation: May 20, 2004
//
// Modifications:
// Kathleen Bonnell, Tue Aug 10 09:12:54 PDT 2004
// When material selection has been applied, ensure that RetrieveVarInfo
// will be using the correct zone id for this dataset.
//
// ****************************************************************************
......@@ -163,7 +166,14 @@ avtZonePickQuery::Execute(vtkDataSet *ds, const int dom)
if (pickAtts.GetMatSelected())
{
RetrieveVarInfo(ds);
//
// The zone id stored in ElementNumber will not be correct relative
// to this dataset. Retrieve the correct one for use with
// RetrieveVarInfo, then reset it.
//
int currentZone = GetCurrentZoneForOriginal(ds, pickAtts.GetElementNumber());
RetrieveVarInfo(ds, currentZone, pickAtts.GetIncidentElements());
}
//
......
......@@ -90,6 +90,7 @@ enhancements and bug-fixes that were added to this release.</p>
<li>The border around items in the Subset window is not drawn correctly for items that have turndowns.</li>
<li>Some windows in VisIt put -0.000 in their text fields.</li>
<li>Auto-determine which plot a plot atts is meant for when possible.</li>
<li>Pick output inconsistent on a pc plot with no materials removed, and the same plot with materials removed.</li>
</ul>
<p>Click the following link to view the release notes for the previous version
of VisIt: <a href="relnotes1.3.3.html">VisIt 1.3.3 Release Notes</a>.</p>
......
......@@ -1526,6 +1526,7 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files,
// files unrelated.
//
if(extraSmartGrouping &&
pattern.size() >= 2 &&
pattern.substr(pattern.size() - 2) == ".*")
{
std::string pattern2;
......
......@@ -301,6 +301,10 @@ avtSliceFilter::Equivalent(const AttributeGroup *a)
// Hank Childs, Tue Jun 29 07:24:11 PDT 2004
// Use interval trees when slicing by percent.
//
// Kathleen Bonnell, Tue Aug 10 09:20:32 PDT 2004
// Always turn on Node/Zone numbers, because Pick will not work correctly
// without them.
//
// ****************************************************************************
avtPipelineSpecification_p
......@@ -308,6 +312,16 @@ avtSliceFilter::PerformRestriction(avtPipelineSpecification_p spec)
{
avtPipelineSpecification_p rv = new avtPipelineSpecification(spec);
//
// Pick returns wrong results (even with transform) when slice lies
// along boundary between zones. So always turn on zone, node
// numbers. WE MAY WANT TO REVERT BACK IN THE FUTURE IF A
// BETTER WAY CAN BE FOUND FOR PICK TO RETURN CORRECT RESULTS.
rv->GetDataSpecification()->TurnZoneNumbersOn();
rv->GetDataSpecification()->TurnNodeNumbersOn();
#if 0
if (atts.GetProject2d() && rv->GetDataSpecification()->MayRequireZones())
{
rv->GetDataSpecification()->TurnZoneNumbersOn();
......@@ -325,6 +339,7 @@ avtSliceFilter::PerformRestriction(avtPipelineSpecification_p spec)
{
rv->GetDataSpecification()->TurnNodeNumbersOn();
}
#endif
//
// Get the interval tree.
......
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