Commit 4a641b91 authored by hrchilds's avatar hrchilds
Browse files

Update from August 24, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@307 18c085ea-50e0-402c-830e-de6fd14e8384
parent d6185bb5
...@@ -2389,6 +2389,11 @@ avtRectilinearDomainBoundaries::ExchangeMesh(vector<int> domainNum, ...@@ -2389,6 +2389,11 @@ avtRectilinearDomainBoundaries::ExchangeMesh(vector<int> domainNum,
// Programmer: Hank Childs // Programmer: Hank Childs
// Creation: August 14, 2004 // Creation: August 14, 2004
// //
// Modifications:
//
// Hank Childs, Tue Aug 24 09:25:39 PDT 2004
// Create avtRealDims.
//
// **************************************************************************** // ****************************************************************************
void void
...@@ -2476,6 +2481,23 @@ avtStructuredDomainBoundaries::CreateGhostNodes(vector<int> domainNum, ...@@ -2476,6 +2481,23 @@ avtStructuredDomainBoundaries::CreateGhostNodes(vector<int> domainNum,
ds->GetPointData()->AddArray(gn); ds->GetPointData()->AddArray(gn);
gn->Delete(); gn->Delete();
//
// Create a field-data array indicating the extents of real zones.
// Used during ghostzone removal.
//
vtkIntArray *realDims = vtkIntArray::New();
realDims->SetName("avtRealDims");
realDims->SetNumberOfTuples(6);
realDims->SetValue(0, 0);
realDims->SetValue(1, dims[0]);
realDims->SetValue(2, 0);
realDims->SetValue(3, dims[1]);
realDims->SetValue(4, 0);
realDims->SetValue(5, dims[2]);
ds->GetFieldData()->AddArray(realDims);
ds->GetFieldData()->CopyFieldOn("avtRealDims");
realDims->Delete();
} }
} }
......
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
// Brad Whitlock, Tue Jul 20 16:10:51 PST 2004 // Brad Whitlock, Tue Jul 20 16:10:51 PST 2004
// Added variable units. // Added variable units.
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added cellCountMultiplierForSRThreshold
//
// **************************************************************************** // ****************************************************************************
avtPlot::avtPlot() avtPlot::avtPlot()
...@@ -94,6 +97,7 @@ avtPlot::avtPlot() ...@@ -94,6 +97,7 @@ avtPlot::avtPlot()
silr = NULL; silr = NULL;
index = -1; index = -1;
intermediateDataObject = NULL; intermediateDataObject = NULL;
cellCountMultiplierForSRThreshold = 0.0; // an invalid value
} }
...@@ -234,6 +238,9 @@ avtPlot::GetDataExtents(vector<double> &extents) ...@@ -234,6 +238,9 @@ avtPlot::GetDataExtents(vector<double> &extents)
// Hank Childs, Tue Feb 24 13:47:47 PST 2004 // Hank Childs, Tue Feb 24 13:47:47 PST 2004
// Fixed memory leak. // Fixed memory leak.
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added code to set cellCountMultiplierForSRThreshold back to zero
//
// **************************************************************************** // ****************************************************************************
void void
...@@ -255,6 +262,7 @@ avtPlot::SetVarName(const char *name) ...@@ -255,6 +262,7 @@ avtPlot::SetVarName(const char *name)
legend->SetVarName(varname); legend->SetVarName(varname);
} }
needsRecalculation = true; needsRecalculation = true;
cellCountMultiplierForSRThreshold = 0.0;
} }
// **************************************************************************** // ****************************************************************************
...@@ -380,6 +388,9 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec, ...@@ -380,6 +388,9 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec,
// Brad Whitlock, Tue Jul 20 16:39:07 PST 2004 // Brad Whitlock, Tue Jul 20 16:39:07 PST 2004
// Added code to set the units for the plot. // Added code to set the units for the plot.
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added call to set cell count multiplier for SR threshold
//
// **************************************************************************** // ****************************************************************************
avtDataObjectWriter_p avtDataObjectWriter_p
...@@ -441,6 +452,8 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec, ...@@ -441,6 +452,8 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec,
} }
ENDTRY ENDTRY
SetCellCountMultiplierForSRThreshold(dob);
return writer; return writer;
} }
...@@ -1105,4 +1118,43 @@ avtPlot::ReleaseData(void) ...@@ -1105,4 +1118,43 @@ avtPlot::ReleaseData(void)
theater.SetInput(NULL, doi, NULL); theater.SetInput(NULL, doi, NULL);
} }
// ****************************************************************************
// Method: avtPlot::SetCellCountMultiplierForSRThreshold
//
// Purpose: Default method to set a plot's cell count multiplier for SR
// threshold. By default, all plot's that don't override this method
// will set a value of 1.0.
//
// Programmer: Mark C. Miller
// Creation: August 23, 2004
//
// ****************************************************************************
void
avtPlot::SetCellCountMultiplierForSRThreshold(const avtDataObject_p)
{
cellCountMultiplierForSRThreshold = 1.0;
}
// ****************************************************************************
// Method: avtPlot::GetCellCountMultiplierForSRThreshold
//
// Purpose: Return the cell count multiplier for SR threshold. However, throw
// an exception if this information is requested but hasn't already been set.
//
// Programmer: Mark C. Miller
// Creation: August 23, 2004
//
// ****************************************************************************
float
avtPlot::GetCellCountMultiplierForSRThreshold() const
{
if (cellCountMultiplierForSRThreshold == 0.0)
{
EXCEPTION1(ImproperUseException, "The plot has not been executed such "
"that the cell count multiplier for SR threshold can be computed");
}
return cellCountMultiplierForSRThreshold;
}
...@@ -145,6 +145,10 @@ class AttributeSubject; ...@@ -145,6 +145,10 @@ class AttributeSubject;
// Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004 // Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004
// Added GetCellCountMultiplierForSRThreshold // Added GetCellCountMultiplierForSRThreshold
// //
// Mark C. Miller, Mon Aug 23 20:27:17 PDT 2004
// Made GetCellCountMultiplierForSRThreshold non-virtual
// Added SetCellCountMultiplierForSRThreshold
//
// **************************************************************************** // ****************************************************************************
class PLOTTER_API avtPlot class PLOTTER_API avtPlot
...@@ -199,8 +203,7 @@ class PLOTTER_API avtPlot ...@@ -199,8 +203,7 @@ class PLOTTER_API avtPlot
virtual const AttributeSubject virtual const AttributeSubject
*SetOpaqueMeshIsAppropriate(bool) *SetOpaqueMeshIsAppropriate(bool)
{ return NULL; }; { return NULL; };
virtual float GetCellCountMultiplierForSRThreshold() const float GetCellCountMultiplierForSRThreshold() const;
{ return 1.0; };
protected: protected:
bool needsRecalculation; bool needsRecalculation;
...@@ -218,6 +221,7 @@ class PLOTTER_API avtPlot ...@@ -218,6 +221,7 @@ class PLOTTER_API avtPlot
char *varname; char *varname;
char *varunits; char *varunits;
vector<double> dataExtents; vector<double> dataExtents;
float cellCountMultiplierForSRThreshold;
avtDataObjectWriter_p Execute(avtDataObject_p, avtDataObjectWriter_p Execute(avtDataObject_p,
avtPipelineSpecification_p, avtPipelineSpecification_p,
...@@ -243,6 +247,9 @@ class PLOTTER_API avtPlot ...@@ -243,6 +247,9 @@ class PLOTTER_API avtPlot
EnhanceSpecification(avtPipelineSpecification_p); EnhanceSpecification(avtPipelineSpecification_p);
virtual avtDecorationsMapper virtual avtDecorationsMapper
*GetDecorationsMapper(void); *GetDecorationsMapper(void);
virtual void SetCellCountMultiplierForSRThreshold(
const avtDataObject_p dob);
}; };
typedef ref_ptr<avtPlot> avtPlot_p; typedef ref_ptr<avtPlot> avtPlot_p;
......
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
#include <vtkCell.h> #include <vtkCell.h>
#include <vtkDataSet.h> #include <vtkDataSet.h>
#include <vtkDataSetRemoveGhostCells.h>
#include <vtkGeometryFilter.h> #include <vtkGeometryFilter.h>
#include <vtkPolyData.h> #include <vtkPolyData.h>
#include <avtQueryableSource.h> #include <avtQueryableSource.h>
#include <DebugStream.h> #include <DebugStream.h>
#include <ImproperUseException.h>
#ifdef PARALLEL #ifdef PARALLEL
#include <mpi.h> #include <mpi.h>
...@@ -90,20 +92,28 @@ avtEulerianQuery::~avtEulerianQuery() ...@@ -90,20 +92,28 @@ avtEulerianQuery::~avtEulerianQuery()
// Instead of creating a data array, keep track of the Eulerian // Instead of creating a data array, keep track of the Eulerian
// for this domain in domToEulerMap. // for this domain in domToEulerMap.
// //
// Hank Childs, Tue Aug 24 08:47:57 PDT 2004
// Manually remove ghost cells, since the geometry filter only removes
// vtkGhostLevels, not vtkGhostNodes.
//
// **************************************************************************** // ****************************************************************************
void void
avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom) avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
{ {
gFilter->SetInput(in_ds); gFilter->SetInput(in_ds);
vtkDataSetRemoveGhostCells *ghost_remover =
vtkPolyData *pds = vtkPolyData::New(); vtkDataSetRemoveGhostCells::New();
ghost_remover->SetInput(gFilter->GetOutput());
gFilter->SetOutput(pds); vtkDataSet *out = ghost_remover->GetOutput();
if (out->GetDataObjectType() != VTK_POLY_DATA)
pds->Delete(); {
// The output of a geometry filter should always be poly-data.
EXCEPTION0(ImproperUseException);
}
vtkPolyData *pds = (vtkPolyData *) out;
pds->Update(); pds->Update();
pds->SetSource(NULL);
// I believe this isn't good enough. I believe the facelist filter // I believe this isn't good enough. I believe the facelist filter
// simply passes points through, and only modifies the cell structure. // simply passes points through, and only modifies the cell structure.
...@@ -197,6 +207,7 @@ avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom) ...@@ -197,6 +207,7 @@ avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
Eulerian = numUsedPoints - edges.size() + nCells; Eulerian = numUsedPoints - edges.size() + nCells;
domToEulerMap.insert(DomainToEulerMap::value_type(dom, Eulerian)); domToEulerMap.insert(DomainToEulerMap::value_type(dom, Eulerian));
ghost_remover->Delete();
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <vtkCellData.h> #include <vtkCellData.h>
#include <vtkDataSet.h> #include <vtkDataSet.h>
#include <vtkIdList.h>
#include <vtkPointData.h> #include <vtkPointData.h>
#include <vtkUnsignedCharArray.h> #include <vtkUnsignedCharArray.h>
...@@ -249,6 +250,9 @@ avtSummationQuery::PostExecute(void) ...@@ -249,6 +250,9 @@ avtSummationQuery::PostExecute(void)
// Kathleen Bonnell, Fri Nov 15 09:07:36 PST 2002 // Kathleen Bonnell, Fri Nov 15 09:07:36 PST 2002
// Added dom argument. // Added dom argument.
// //
// Hank Childs, Tue Aug 24 08:22:24 PDT 2004
// Add support for ghost nodes.
//
// **************************************************************************** // ****************************************************************************
void void
...@@ -267,30 +271,53 @@ avtSummationQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -267,30 +271,53 @@ avtSummationQuery::Execute(vtkDataSet *ds, const int dom)
EXCEPTION1(InvalidVariableException, variableName); EXCEPTION1(InvalidVariableException, variableName);
} }
vtkUnsignedCharArray *ghosts = NULL; vtkUnsignedCharArray *ghost_zones = NULL;
if (!pointData && !sumGhostValues) if (!pointData && !sumGhostValues)
{ {
ghosts = (vtkUnsignedCharArray *) ghost_zones = (vtkUnsignedCharArray *)
ds->GetCellData()->GetArray("vtkGhostLevels"); ds->GetCellData()->GetArray("vtkGhostLevels");
} }
vtkUnsignedCharArray *ghost_nodes = NULL;
if (!sumGhostValues)
{
ghost_nodes = (vtkUnsignedCharArray *)
ds->GetPointData()->GetArray("vtkGhostNodes");
}
int nValues = arr->GetNumberOfTuples(); int nValues = arr->GetNumberOfTuples();
vtkIdList *list = vtkIdList::New();
for (int i = 0 ; i < nValues ; i++) for (int i = 0 ; i < nValues ; i++)
{ {
float val = arr->GetTuple1(i); float val = arr->GetTuple1(i);
if (ghosts != NULL) if (ghost_zones != NULL)
{ {
unsigned char g = ghosts->GetValue(i); unsigned char g = ghost_zones->GetValue(i);
if (g != 0) if (g != 0)
{ {
val = 0.; val = 0.;
} }
} }
if (ghost_nodes != NULL)
{
bool allGhost = true;
ds->GetCellPoints(i, list);
vtkIdType npts = list->GetNumberOfIds();
for (int j = 0 ; j < npts ; j++)
{
vtkIdType id = list->GetId(j);
unsigned char g = ghost_nodes->GetValue(id);
if (g == 0)
allGhost = false;
}
if (allGhost)
val = 0.;
}
if (sumOnlyPositiveValues && val < 0.) if (sumOnlyPositiveValues && val < 0.)
continue; continue;
sum += val; sum += val;
} }
list->Delete();
} }
...@@ -754,6 +754,9 @@ RPCExecutor<SetWinAnnotAttsRPC>::Execute(SetWinAnnotAttsRPC *rpc) ...@@ -754,6 +754,9 @@ RPCExecutor<SetWinAnnotAttsRPC>::Execute(SetWinAnnotAttsRPC *rpc)
// Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004 // Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004
// Added code to pass cellCountMultiplier to WriteData // Added code to pass cellCountMultiplier to WriteData
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Moved code to get cellCountMultiplier to inside GetOutput
//
// **************************************************************************** // ****************************************************************************
template<> template<>
void void
...@@ -787,7 +790,7 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc) ...@@ -787,7 +790,7 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc)
{ {
// save the current network id for later // save the current network id for later
bool shouldSendAbort = false; bool shouldSendAbort = false;
float cellCountMultiplier = netmgr->GetPlot()->GetCellCountMultiplierForSRThreshold(); float cellCountMultiplier;
int netId = netmgr->GetCurrentNetworkId(); int netId = netmgr->GetCurrentNetworkId();
avtNullData abortDob(NULL); avtNullData abortDob(NULL);
...@@ -796,7 +799,8 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc) ...@@ -796,7 +799,8 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc)
avtDataObjectWriter_p writer; avtDataObjectWriter_p writer;
TRY TRY
{ {
writer = netmgr->GetOutput(rpc->GetRespondWithNull(),false); writer = netmgr->GetOutput(rpc->GetRespondWithNull(), false,
&cellCountMultiplier);
} }
CATCH(AbortException) CATCH(AbortException)
{ {
......
...@@ -1263,9 +1263,13 @@ NetworkManager::UpdatePlotAtts(int id, const AttributeGroup *atts) ...@@ -1263,9 +1263,13 @@ NetworkManager::UpdatePlotAtts(int id, const AttributeGroup *atts)
// Kathleen Bonnell, Wed Jun 2 09:48:29 PDT 2004 // Kathleen Bonnell, Wed Jun 2 09:48:29 PDT 2004
// Set MayRequireNodes. // Set MayRequireNodes.
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added cellCountMultiplier arg and call to get and set it
//
// **************************************************************************** // ****************************************************************************
avtDataObjectWriter_p avtDataObjectWriter_p
NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender) NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender,
float *cellCountMultiplier)
{ {
// Is the network complete? // Is the network complete?
...@@ -1289,6 +1293,10 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender) ...@@ -1289,6 +1293,10 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
workingNet->GetPipelineSpec(), workingNet->GetPipelineSpec(),
&windowAttributes); &windowAttributes);
// get the SR multiplier
*cellCountMultiplier =
workingNet->GetPlot()->GetCellCountMultiplierForSRThreshold();
if (respondWithNullData) if (respondWithNullData)
{ {
// get the data object at the input to the writer // get the data object at the input to the writer
...@@ -1383,6 +1391,9 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender) ...@@ -1383,6 +1391,9 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
// Added code to get cell count multiplier for SR mode and adjust // Added code to get cell count multiplier for SR mode and adjust
// cell counts for SR threshold // cell counts for SR threshold
// //
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added arg to GetOutput call
//
// **************************************************************************** // ****************************************************************************
avtDataObjectWriter_p avtDataObjectWriter_p
NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly) NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
...@@ -1429,12 +1440,12 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly) ...@@ -1429,12 +1440,12 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
// get the network output as we would normally // get the network output as we would normally
workingNet = NULL; workingNet = NULL;
UseNetwork(plotIds[i]); UseNetwork(plotIds[i]);
float cellCountMultiplier = float cellCountMultiplier;
GetPlot()->GetCellCountMultiplierForSRThreshold();
DataNetwork *workingNetSaved = workingNet; DataNetwork *workingNetSaved = workingNet;
int t4 = visitTimer->StartTimer(); int t4 = visitTimer->StartTimer();
avtDataObjectWriter_p tmpWriter = GetOutput(false,true); avtDataObjectWriter_p tmpWriter = GetOutput(false, true,
&cellCountMultiplier);
avtDataObject_p dob = tmpWriter->GetInput(); avtDataObject_p dob = tmpWriter->GetInput();
// merge polygon info output across processors // merge polygon info output across processors
......
...@@ -173,6 +173,9 @@ class VisWindow; ...@@ -173,6 +173,9 @@ class VisWindow;
// Added frameAndState data member and associated arg to // Added frameAndState data member and associated arg to
// SetAnnotationAttributes // SetAnnotationAttributes
// //
// Mark C. Miller, Mon Aug 23 20:27:17 PDT 2004
// Added argument to GetOutput for cell count multiplier
//
// **************************************************************************** // ****************************************************************************
class NetworkManager class NetworkManager
{ {
...@@ -221,7 +224,8 @@ class NetworkManager ...@@ -221,7 +224,8 @@ class NetworkManager
void SetLoadBalancer(LoadBalancer *lb) {loadBalancer = lb;}; void SetLoadBalancer(LoadBalancer *lb) {loadBalancer = lb;};
avtDataObjectWriter_p GetOutput(bool respondWithNullData, avtDataObjectWriter_p GetOutput(bool respondWithNullData,
bool calledForRender); bool calledForRender,
float *cellCountMultiplier);
avtDataObjectWriter_p Render(intVector networkIds, bool getZBuffer, avtDataObjectWriter_p Render(intVector networkIds, bool getZBuffer,
bool do3DAnnotsOnly); bool do3DAnnotsOnly);
......
...@@ -219,26 +219,32 @@ avtMeshPlot::Create() ...@@ -219,26 +219,32 @@ avtMeshPlot::Create()
} }
// **************************************************************************** // ****************************************************************************
// Method: avtMeshPlot::GetCellCountMultiplierForSRThreshold // Method: avtMeshPlot::SetCellCountMultiplierForSRThreshold
// //
// Purpose: Returns number of polygons each point in the plot's output will be // Purpose: Sets number of polygons each point in the plot's output will be
// glyphed into. // glyphed into.
// //
// Programmer: Mark C. Miller // Programmer: Mark C. Miller
// Creation: August 12, 2004 // Creation: August 12, 2004
// //
// Modifications:
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed to the Set... method (Get is now done in avtPlot.C)
//
// **************************************************************************** // ****************************************************************************
float
avtMeshPlot::GetCellCountMultiplierForSRThreshold() const void
avtMeshPlot::SetCellCountMultiplierForSRThreshold(const avtDataObject_p dob)
{ {
float retval = 1.0; if (*dob)
if (*behavior)
{ {
int dim = behavior->GetInfo().GetAttributes().GetSpatialDimension(); int dim = dob->GetInfo().GetAttributes().GetSpatialDimension();
if (dim == 0) if (dim == 0)
retval = 6.0; cellCountMultiplierForSRThreshold = 6.0;
else
cellCountMultiplierForSRThreshold = 1.0;
} }
return retval;
} }
// ****************************************************************************