Commit 27ffc4fe authored by hrchilds's avatar hrchilds

Update from September 13, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@540 18c085ea-50e0-402c-830e-de6fd14e8384
parent a7c2e17c
......@@ -521,7 +521,9 @@
<Field name="numNodesSet" type="bool">true</Field>
<Field name="numNodes" type="int">2</Field>
<Field name="partitionSet" type="bool">true</Field>
<Field name="partition" type="string">views</Field>
<Field name="partition" type="string">white</Field>
<Field name="launchArgsSet" type="bool">true</Field>
<Field name="launchArgs" type="string">-pool views</Field>
<Field name="bankSet" type="bool">true</Field>
<Field name="bank" type="string">vws_llnl</Field>
<Field name="timeLimitSet" type="bool">true</Field>
......
......@@ -544,7 +544,9 @@
<Field name="numNodesSet" type="bool">true</Field>
<Field name="numNodes" type="int">2</Field>
<Field name="partitionSet" type="bool">true</Field>
<Field name="partition" type="string">views</Field>
<Field name="partition" type="string">white</Field>
<Field name="launchArgsSet" type="bool">true</Field>
<Field name="launchArgs" type="string">-pool views</Field>
<Field name="bankSet" type="bool">true</Field>
<Field name="bank" type="string">vws_llnl</Field>
<Field name="timeLimitSet" type="bool">true</Field>
......
......@@ -60,7 +60,8 @@ enum avtMeshType
AVT_UNSTRUCTURED_MESH, /* 2 */
AVT_POINT_MESH, /* 3 */
AVT_SURFACE_MESH, /* 4 */
AVT_UNKNOWN_MESH /* 5 */
AVT_CSG_MESH, /* 5 */
AVT_UNKNOWN_MESH /* 6 */
};
......
......@@ -12,6 +12,7 @@
#include <vtkCell.h>
#include <vtkCellData.h>
#include <vtkCSGGrid.h>
#include <vtkDataSet.h>
#include <vtkFloatArray.h>
#include <vtkIdList.h>
......@@ -102,17 +103,20 @@ static const char *DataArrayTypeName(vtkDataArray *arr)
// ****************************************************************************
// Function: PrecisionInBytes
//
// Purpose: Given a vtk data array, return its precision in bytes
// Purpose: Given a vtk data type, return its precision in bytes
//
// Programmer: Mark C. Miller
// Creation: April 4, 2005
//
// Modifications:
// Mark C. Miller, Tue Sep 13 20:07:48 PDT 2005
// Made it just take data type as arg instead of a vtkDataArray
// ****************************************************************************
static int
PrecisionInBytes(vtkDataArray *var)
PrecisionInBytes(int dataType)
{
switch (var->GetDataType())
switch (dataType)
{
case VTK_VOID: return sizeof(void*);
// case VTK_BIT: not sure what to do here
......@@ -130,6 +134,24 @@ PrecisionInBytes(vtkDataArray *var)
}
}
// ****************************************************************************
// Function: PrecisionInBytes
//
// Purpose: Given a vtk data array, return its precision in bytes
//
// Programmer: Mark C. Miller
// Creation: August 10, 2005
//
// ****************************************************************************
static int
PrecisionInBytes(vtkDataArray *var)
{
if (var)
return PrecisionInBytes(var->GetDataType());
else
return PrecisionInBytes(VTK_FLOAT);
}
// ****************************************************************************
// Function: IsAdmissibleDataType
//
......@@ -253,7 +275,7 @@ ConvertDataArrayToFloat(vtkDataArray *oldArr)
}
// ****************************************************************************
// Funcion: GetCoordDataArray
// Funcion: GetCoordDataType
//
// Purpose: Given a vtkDataSet, return a sample the first of its
// coordinate arrays
......@@ -261,9 +283,13 @@ ConvertDataArrayToFloat(vtkDataArray *oldArr)
// Programmer: Mark C. Miller
// Creation: April 4, 2005
//
// Modifications:
// Mark C. Miller, Tue Sep 13 20:07:48 PDT 2005
// Made it return the coordinate data type explicitly. Also, made it
// a little more lenient about getting null pointers
// ****************************************************************************
static vtkDataArray*
GetCoordDataArray(vtkDataSet *ds)
static int
GetCoordDataType(vtkDataSet *ds)
{
switch (ds->GetDataObjectType())
{
......@@ -272,9 +298,9 @@ GetCoordDataArray(vtkDataSet *ds)
case VTK_UNSTRUCTURED_GRID:
{
vtkPointSet *ps = vtkPointSet::SafeDownCast(ds);
if (ps != 0)
if (ps && ps->GetPoints() && ps->GetPoints()->GetData())
{
return ps->GetPoints()->GetData();
return ps->GetPoints()->GetData()->GetDataType();
}
}
break;
......@@ -282,19 +308,14 @@ GetCoordDataArray(vtkDataSet *ds)
case VTK_RECTILINEAR_GRID:
{
vtkRectilinearGrid *rg = vtkRectilinearGrid::SafeDownCast(ds);
if (rg != 0)
if (rg && rg->GetXCoordinates())
{
return rg->GetXCoordinates();
return rg->GetXCoordinates()->GetDataType();
}
}
break;
case VTK_IMAGE_DATA:
case VTK_STRUCTURED_POINTS:
return 0;
break;
}
return 0;
return VTK_FLOAT;
}
// ****************************************************************************
......@@ -3346,10 +3367,10 @@ avtGenericDatabase::GetMesh(const char *meshname, int ts, int domain,
ts, domain, material);
if ((mesh != NULL) && IsAdmissibleDataType(admissibleDataTypes,
GetCoordDataArray(mesh)->GetDataType()))
GetCoordDataType(mesh)))
{
if (!needNativePrecision &&
(PrecisionInBytes(GetCoordDataArray(mesh)) > sizeof(float)))
(PrecisionInBytes(GetCoordDataType(mesh)) > sizeof(float)))
{
mesh = (vtkDataSet *) cache.GetVTKObject(meshname,
avtVariableCache::DATASET_NAME,
......@@ -3437,11 +3458,10 @@ avtGenericDatabase::GetMesh(const char *meshname, int ts, int domain,
// Convert BEFORE caching only if native precision is greater
// than float and VisIt has NOT asked for native precision
//
const char *cacheTypeName =
GetCoordDataArray(mesh)->GetDataType() == VTK_FLOAT ?
const char *cacheTypeName = GetCoordDataType(mesh) == VTK_FLOAT ?
avtVariableCache::DATASET_NAME :
avtVariableCache::NATIVE_DATASET_NAME;
if (PrecisionInBytes(GetCoordDataArray(mesh)) > sizeof(float) &&
if (PrecisionInBytes(GetCoordDataType(mesh)) > sizeof(float) &&
!needNativePrecision)
{
vtkDataSet *mesh1 = ConvertDataSetToFloat(mesh);
......@@ -3477,7 +3497,7 @@ avtGenericDatabase::GetMesh(const char *meshname, int ts, int domain,
// convert here, go ahead and cache the converted result too.
//
if (!IsAdmissibleDataType(admissibleDataTypes,
GetCoordDataArray(mesh)->GetDataType()))
GetCoordDataType(mesh)))
{
vtkDataSet *mesh1 = ConvertDataSetToFloat(mesh);
......
......@@ -15,6 +15,7 @@
#include <avtParallel.h>
#include <avtRay.h>
#include <avtRelativeValueSamplePointArbitrator.h>
#include <avtResampleSelection.h>
#include <avtSamplePointExtractor.h>
#include <avtSourceFromAVTDataset.h>
#include <avtWorldSpaceToImageSpaceTransform.h>
......@@ -45,12 +46,17 @@ vtkDataArray *GetCoordinates(float, float, int);
// Programmer: Hank Childs
// Creation: March 26, 2001
//
// Modifications:
// Mark C. Miller, Tue Sep 13 20:09:49 PDT 2005
// Initialized selection id
//
// ****************************************************************************
avtResampleFilter::avtResampleFilter(const AttributeGroup *a)
{
atts = *(ResampleAttributes*)a;
primaryVariable = NULL;
selID = -1;
}
......@@ -151,11 +157,24 @@ avtResampleFilter::Execute(void)
// Use vtkDataArray in place of vtkScalars for rgrid coordinates,
// to match VTK 4.0 API.
//
// Mark C. Miller, Tue Sep 13 20:09:49 PDT 2005
// Permitted poly data to pass through
//
// ****************************************************************************
bool
avtResampleFilter::InputNeedsNoResampling(void)
{
avtDataTree_p inDT = GetInputDataTree();
//
// permit VTK_POLY_DATA to pass through unchanged
//
int n = 0;
vtkDataSet **in_dss = inDT->GetAllLeaves(n);
if (n && in_dss && in_dss[0] && in_dss[0]->GetDataObjectType() == VTK_POLY_DATA)
return true;
//
// If a specific set of dimensions was requested, then this is not going
// to work.
......@@ -170,7 +189,6 @@ avtResampleFilter::InputNeedsNoResampling(void)
//
// If there is more than one domain, GetSingleLeaf will return NULL.
//
avtDataTree_p inDT = GetInputDataTree();
vtkDataSet *in_ds = inDT->GetSingleLeaf();
if (in_ds == NULL)
{
......@@ -346,11 +364,26 @@ avtResampleFilter::BypassResample(void)
// Hank Childs, Sun Mar 13 10:07:07 PST 2005
// Fix memory leak.
//
// Mark C. Miller, Tue Sep 13 20:09:49 PDT 2005
// Added test for if data selection has already been applied
//
// ****************************************************************************
void
avtResampleFilter::ResampleInput(void)
{
//
// If the selection this filter exists to create has already been handled,
// then we can skip execution
//
if (GetInput()->GetInfo().GetAttributes().GetSelectionApplied(selID))
{
debug1 << "Bypassing Resample operator because database plugin "
"claims to have applied the selection already" << endl;
SetOutputDataTree(GetInputDataTree());
return;
}
int i, j;
avtRelativeValueSamplePointArbitrator *arb = NULL;
......@@ -929,6 +962,9 @@ GetCoordinates(float start, float length, int numEls)
// Turn off ghost data, since ghost data created upstream will not be
// pertinent after resampling.
//
// Mark C. Miller, Tue Sep 13 20:09:49 PDT 2005
// Added support for resample data selection
//
// ****************************************************************************
avtPipelineSpecification_p
......@@ -940,6 +976,28 @@ avtResampleFilter::PerformRestriction(avtPipelineSpecification_p oldspec)
avtPipelineSpecification_p spec = new avtPipelineSpecification(oldspec,
oldspec->GetDataSpecification());
//
// First tell the file format reader that we are going to be doing a
// resample selection.
//
avtResampleSelection *sel = new avtResampleSelection;
int counts[3];
counts[0] = atts.GetWidth();
counts[1] = atts.GetHeight();
counts[2] = atts.GetDepth();
sel->SetCounts(counts);
double starts[3];
starts[0] = atts.GetMinX();
starts[1] = atts.GetMinY();
starts[2] = atts.GetMinZ();
sel->SetStarts(starts);
double stops[3];
stops[0] = atts.GetMaxX();
stops[1] = atts.GetMaxY();
stops[2] = atts.GetMaxZ();
sel->SetStops(stops);
selID = spec->GetDataSpecification()->AddDataSelection(sel);
spec->NoDynamicLoadBalancing();
spec->SetHaveRectilinearMeshOptimizations(true);
spec->GetDataSpecification()->SetDesiredGhostDataType(NO_GHOST_DATA);
......
......@@ -26,6 +26,8 @@
// Hank Childs, Fri Apr 6 17:39:40 PDT 2001
// Added ability to bypass filter with already valid rectilinear grids.
//
// Mark C. Miller, Tue Sep 13 20:09:49 PDT 2005
// Added selID to support data selections
// ****************************************************************************
class AVTFILTERS_API avtResampleFilter : public avtDatasetToDatasetFilter
......@@ -42,6 +44,7 @@ class AVTFILTERS_API avtResampleFilter : public avtDatasetToDatasetFilter
protected:
ResampleAttributes atts;
char *primaryVariable;
int selID;
virtual void Execute(void);
virtual void RefashionDataObjectInfo(void);
......
// ************************************************************************* //
// avtResampleSelection.C //
// ************************************************************************* //
#include <limits.h>
#include <avtResampleSelection.h>
// ****************************************************************************
// Method: avtResampleSelection constructor
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
avtResampleSelection::avtResampleSelection()
{
ndims = 3;
starts[0] = -10.0;
starts[1] = -10.0;
starts[2] = -10.0;
stops[0] = 10.0;
stops[1] = 10.0;
stops[2] = 10.0;
counts[0] = 100;
counts[1] = 100;
counts[2] = 100;
}
// ****************************************************************************
// Method: SetStarts
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::SetStarts(const double *_starts)
{
int i;
for (i = 0; i < ndims; i++)
starts[i] = _starts[i];
for (i = ndims; i < 3; i++)
starts[i] = 0.0;
}
// ****************************************************************************
// Method: SetStops
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::SetStops(const double *_stops)
{
int i;
for (i = 0; i < ndims; i++)
stops[i] = _stops[i];
for (i = ndims; i < 3; i++)
stops[i] = 0.0;
}
// ****************************************************************************
// Method: SetCounts
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::SetCounts(const int *_counts)
{
int i;
for (i = 0; i < ndims; i++)
counts[i] = _counts[i];
for (i = ndims; i < 3; i++)
counts[i] = 0;
}
// ****************************************************************************
// Method: GetStarts
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::GetStarts(double *_starts) const
{
int i;
for (i = 0; i < ndims; i++)
_starts[i] = starts[i];
for (i = ndims; i < 3; i++)
_starts[i] = 0.0;
}
// ****************************************************************************
// Method: GetStops
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::GetStops(double *_stops) const
{
int i;
for (i = 0; i < ndims; i++)
_stops[i] = stops[i];
for (i = ndims; i < 3; i++)
_stops[i] = 0.0;
}
// ****************************************************************************
// Method: GetCounts
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtResampleSelection::GetCounts(int *_counts) const
{
int i;
for (i = 0; i < ndims; i++)
_counts[i] = counts[i];
for (i = ndims; i < 3; i++)
_counts[i] = 0;
}
// ****************************************************************************
// Method: operator==
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
bool
avtResampleSelection::operator==(const avtResampleSelection &sel) const
{
if (ndims != sel.ndims)
return false;
for (int i = 0; i < ndims; i++)
{
if (starts[i] != sel.starts[i])
return false;
if (stops[i] != sel.stops[i])
return false;
if (counts[i] != sel.counts[i])
return false;
}
return true;
}
// ************************************************************************* //
// avtResampleSelection.h //
// ************************************************************************* //
#ifndef AVT_RESAMPLE_SELECTION_H
#define AVT_RESAMPLE_SELECTION_H
#include <pipeline_exports.h>
#include <ref_ptr.h>
#include <avtDataSelection.h>
// ****************************************************************************
// Class: avtResampleSelection
//
// Purpose: Specify data selection by a uniform resampling. The context in
// which resampling behaves as a data "selection" operation is one in which
// the input is a non-discrete (e.g. continuous) representation of the data.
// In that case, resampling has the effect of selecting a finite set of
// points (the samples) fron an infinity of points (the continuum) in which
// the data actually originates.
//
// The default is a uniform sampling 100 samples in each of X, Y and Z
// between -10.0 and 10.0 on each axis.
//
// To specify samples on an orthogonal slice on the Y-axis, for example,
// you would specify starts[1] = stops[1] = Y-index and counts[1] = 0
// with other values as desired.
//
// Programmer: Mark C. Miller
// Creation: August 16, 2005
//
// ****************************************************************************
class PIPELINE_API avtResampleSelection : public avtDataSelection
{
public:
avtResampleSelection();
virtual ~avtResampleSelection() {} ;
virtual const char * GetType() const
{ return "Resample Data Selection"; };
void SetNDims(int _ndims)
{ ndims = _ndims; };
void SetStarts(const double *_starts);
void SetStops(const double *_stops);
void SetCounts(const int *_counts);
void GetNDims(int &_ndims) const
{ _ndims = ndims; } ;
void GetStarts(double *_starts) const;
void GetStops(double *_stops) const;
void GetCounts(int *_counts) const;
bool operator==(const avtResampleSelection &) const;
private:
int ndims;
double starts[3];
double stops[3];
int counts[3];
};
typedef ref_ptr<avtResampleSelection> avtResampleSelection_p;
#endif
......@@ -200,6 +200,9 @@
# Hank Childs, Fri Apr 8 09:43:05 PDT 2005
# Add new partition strategy.
#
# Mark C. Miller, Tue Aug 16 19:28:18 PDT 2005
# Added avtResampleSelection.C
#
##############################################################################
@SET_MAKE@
......@@ -255,6 +258,7 @@ Data_src= \
Data/avtRay.C \
Data/avtRayFunction.C \
Data/avtRelativeValueSamplePointArbitrator.C \
Data/avtResampleSelection.C \
Data/avtSamplePointArbitrator.C \
Data/avtSamplePoints.C \
Data/avtSpatialBoxSelection.C \
......
<?xml version="1.0"?>
<Plugin name="Silo" label="Silo" type="database" dbtype="STMD" version="1.0" haswriter="yes">
<Extensions> silo pdb </Extensions>
<CXXFLAGS> $(SILO_INCLUDE) </CXXFLAGS>
<LIBS> $(SILO_LIB) </LIBS>
<Plugin name="Silo" type="database" label="Silo" version="1.0" enabled="true" mdspecificcode="true" onlyengine="false" noengine="false" dbtype="STMD" haswriter="true" hasoptions="false">
<CXXFLAGS>
$(SILO_INCLUDE)
</CXXFLAGS>
<LIBS>
$(SILO_LIB)
</LIBS>
<Extensions>
silo
pdb
</Extensions>
<Attribute name="" purpose="" persistent="true">
</Attribute>
</Plugin>
This diff is collapsed.
......@@ -5,11 +5,13 @@
#ifndef AVT_SILO_FILE_FORMAT_H
#define AVT_SILO_FILE_FORMAT_H
#include <avtDataSelection.h>
#include <avtSTMDFileFormat.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <silo.h>
......@@ -101,6 +103,13 @@ typedef struct
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// Added methods to GetCycle/Time
//
// Mark C. Miller, Wed Aug 10 12:00:00 PDT 2005
// Added resample data selections to support CSG mesh discretization
//
// Jeremy Meredith, Tue Sep 13 15:57:05 PDT 2005
// Changed domainDirs to a set to ensure log(n) search times.
//
// ****************************************************************************
class avtSiloFileFormat : public avtSTMDFileFormat
......@@ -133,6 +142,10 @@ class avtSiloFileFormat : public avtSTMDFileFormat
void ActivateTimestep(void);
virtual void RegisterDataSelections(
const std::vector<avtDataSelection_p> &selList,
std::vector<bool> *selectionsApplied);
protected:
DBfile **dbfiles;
int tocIndex;
......@@ -141,7 +154,7 @@ class avtSiloFileFormat : public avtSTMDFileFormat
static bool madeGlobalSiloCalls;
std::vector<std::string> domainDirs;
std::set<std::string> domainDirs;
// The following fields are for determining multimeshes for multivars
std::vector<std::string> firstSubMesh;
......@@ -164,6 +177,8 @@ class avtSiloFileFormat : public avtSTMDFileFormat
std::map<std::string, std::vector<int> > arbMeshZoneRangesToSkip;
std::vector<avtDataSelection_p> selList;
std::vector<bool> *selsApplied;
DBfile *GetFile(int);
DBfile *OpenFile(int, bool skipGlobalInfo = false);
......@@ -186,6 +201,7 @@ class avtSiloFileFormat : public avtSTMDFileFormat
vtkDataSet *CreateCurvilinearMesh(DBquadmesh *);
vtkDataSet *CreateRectilinearMesh(DBquadmesh *);
vtkDataSet *GetCSGMesh(DBfile *, const char *, int);
vtkDataSet *GetPointMesh(DBfile *, const char *);
vtkDataSet *GetQuadMesh(DBfile *, const char *, int);
vtkDataSet *GetUnstructuredMesh(DBfile *, const char *,
......
<?xml version="1.0"?>
<Plugin name="Resample" type="operator" label="Resample" version="1.0" enabled="false" mdspecificcode="false" onlyengine="false" noengine="false">
<Plugin name="Resample" type="operator" label="Resample" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false">
<Files components="E">
avtResamplePluginFilter.C
</Files>
......
......@@ -13,8 +13,8 @@
//
// Returns: A pointer to the newly allocated attribute subject.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Wed Aug 17 01:52:31 PDT 2005
//
// ****************************************************************************
......@@ -34,8 +34,8 @@ ResampleCommonPluginInfo::AllocAttributes()
// to The destination attribute subject.
// from The source attribute subject.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Wed Aug 17 01:52:31 PDT 2005
//
// ****************************************************************************
......
......@@ -15,8 +15,8 @@
// Purpose:
// Return a new EnginePluginInfo for the Resample operator.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Wed Aug 17 01:52:31 PDT 2005
//
// ****************************************************************************
extern "C" EngineOperatorPluginInfo* GetEngineInfo()
......@@ -32,8 +32,8 @@ extern "C" EngineOperatorPluginInfo* GetEngineInfo()
//
// Returns: A pointer to the newly allocated avtPluginFilter.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Wed Aug 17 01:52:31 PDT 2005
//
// ****************************************************************************
......
......@@ -16,8 +16,8 @@
// Purpose:
// Return a new GUIPluginInfo for the Resample operator.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Wed Aug 17 01:52:31 PDT 2005
//
// ****************************************************************************
extern "C" GUIOperatorPluginInfo* GetGUIInfo()
......@@ -33,8 +33,8 @@ extern "C" GUIOperatorPluginInfo* GetGUIInfo()
//
// Returns: A pointer to the name to use in the GUI menu.
//
// Programmer: childs -- generated by xml2info
// Creation: Sat Jan 29 19:46:18 PST 2005