Commit 49db7bb2 authored by hrchilds's avatar hrchilds

Update from February 14, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@619 18c085ea-50e0-402c-830e-de6fd14e8384
parent c46cb1d2
......@@ -4,6 +4,8 @@
#include <avtSIL.h>
#include <algorithm>
#include <avtSILCollection.h>
#include <avtSILNamespace.h>
#include <avtSILSet.h>
......
......@@ -5183,6 +5183,12 @@ avtGenericDatabase::ActivateTimestep(int stateIndex)
// Hank Childs, Mon Jun 27 16:24:23 PDT 2005
// Add argument to GetDataset.
//
// Hank Childs, Thu Feb 9 16:24:32 PST 2006
// If we have domain boundary information and we are doing reconstruction
// for mixed material zones, then we need to read in the materials for
// every domain, so the ghost zone communication routines can work
// correctly.
//
// ****************************************************************************
void
......@@ -5267,11 +5273,21 @@ avtGenericDatabase::ReadDataset(avtDatasetCollection &ds, intVector &domains,
src->DatabaseProgress(0, 0, progressString);
int nDomains = domains.size();
avtSILRestrictionTraverser trav(silr);
bool forceMIR = spec->MustDoMaterialInterfaceReconstruction();
if (spec->NeedMixedVariableReconstruction())
{
avtDatasetCollection emptyCollection(0);
intVector emptyDomainList;
avtDomainBoundaries *dbi = GetDomainBoundaryInformation(emptyCollection,
emptyDomainList, spec);
if (dbi != NULL)
forceMIR = true;
}
for (i = 0 ; i < nDomains ; i++)
{
stringVector labels;
stringVector matnames;
bool forceMIR = spec->MustDoMaterialInterfaceReconstruction();
bool doSelect = PrepareMaterialSelect(domains[i], forceMIR, trav,
matnames);
int nmats = matnames.size();
......
......@@ -13,6 +13,7 @@ class vtkDataArray;
class vtkDataSet;
class vtkIdList;
class vtkRectilinearGrid;
class vtkStructuredGrid;
// ****************************************************************************
......@@ -34,6 +35,10 @@ class vtkRectilinearGrid;
// Hank Childs, Fri Mar 4 08:21:04 PST 2005
// Removed data centering conversion modules.
//
// Hank Childs, Mon Feb 13 14:45:18 PST 2006
// Add support for logical gradients. Also add perform restriction, so we
// can request ghost zones.
//
// ****************************************************************************
class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
......@@ -42,11 +47,18 @@ class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
avtGradientFilter();
virtual ~avtGradientFilter();
void SetDoLogicalGradient(bool b)
{ doLogicalGradients = b; };
virtual const char *GetType(void) { return "avtGradientFilter"; };
virtual const char *GetDescription(void)
{ return "Calculating Gradient of Each Node"; };
{ return "Calculating Gradient"; };
virtual void PreExecute(void);
protected:
bool doLogicalGradients;
bool haveIssuedWarning;
virtual vtkDataArray *DeriveVariable(vtkDataSet *);
virtual int GetVariableDimension() { return 3; }
......@@ -57,6 +69,9 @@ class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
float EvaluateValue(float, float, float, vtkDataSet *,
vtkDataArray *,vtkIdList *,bool &);
vtkDataArray *RectilinearGradient(vtkRectilinearGrid *);
vtkDataArray *LogicalGradient(vtkStructuredGrid *);
virtual avtPipelineSpecification_p
PerformRestriction(avtPipelineSpecification_p);
};
......
......@@ -431,6 +431,9 @@ avtVectorExpr::CreateFilters(ExprPipelineState *state)
// Hank Childs, Sat Jan 21 14:43:45 PST 2006
// Added symm_eval_transform.
//
// Hank Childs, Tue Feb 14 14:03:47 PST 2006
// Added logical gradient.
//
// ****************************************************************************
void
avtFunctionExpr::CreateFilters(ExprPipelineState *state)
......@@ -523,6 +526,12 @@ avtFunctionExpr::CreateFilters(ExprPipelineState *state)
f = new avtMeshCoordinateFilter();
else if (functionName == "procid")
f = new avtProcessorIdFilter();
else if (functionName == "ijk_gradient" || functionName == "ij_gradient")
{
avtGradientFilter *g = new avtGradientFilter();
g->SetDoLogicalGradient(true);
f = g;
}
else if (functionName == "gradient")
f = new avtGradientFilter();
else if (functionName == "curl")
......
......@@ -211,6 +211,9 @@ avtWholeImageCompositerWithZ::~avtWholeImageCompositerWithZ()
// Jeremy Meredith, October 20, 2004
// Allowed for the use of an allreduce instead of a simple reduce.
//
// Hank Childs, Mon Feb 6 14:55:39 PST 2006
// Fix memory leak ['6829].
//
// ****************************************************************************
void
......@@ -265,7 +268,6 @@ avtWholeImageCompositerWithZ::Execute(void)
iorgb = zeroImageRep.GetRGBBuffer();
}
if (mpiRoot >= 0)
{
// only root allocates output AVT image (for a non-allreduce)
......@@ -291,7 +293,7 @@ avtWholeImageCompositerWithZ::Execute(void)
{
if (shouldOutputZBuffer)
{
avtImageRepresentation theOutput(mergedGlobalImage,rioz);
avtImageRepresentation theOutput(mergedGlobalImage,rioz,true);
SetOutputImage(theOutput);
}
else
......@@ -314,7 +316,7 @@ avtWholeImageCompositerWithZ::Execute(void)
{
if (shouldOutputZBuffer)
{
avtImageRepresentation theOutput(mergedLocalImage,ioz);
avtImageRepresentation theOutput(mergedLocalImage,ioz,true);
SetOutputImage(theOutput);
}
else
......@@ -327,16 +329,8 @@ avtWholeImageCompositerWithZ::Execute(void)
}
else
{
if (shouldOutputZBuffer)
{
avtImageRepresentation theOutput(zeroImageRep.GetImageVTK(),zeroImageRep.GetZBuffer());
SetOutputImage(theOutput);
}
else
{
avtImageRepresentation theOutput(zeroImageRep.GetImageVTK());
SetOutputImage(theOutput);
}
avtImageRepresentation theOutput(zeroImageRep);
SetOutputImage(theOutput);
}
}
}
......
......@@ -68,9 +68,15 @@ avtImageRepresentation::avtImageRepresentation(vtkImageData *d)
// Programmer: Hank Childs
// Creation: February 13, 2001
//
// Modifications:
//
// Hank Childs, Mon Feb 6 14:59:43 PST 2006
// Allow the z-buffer to be directly acquired instead of copied.
//
// ****************************************************************************
avtImageRepresentation::avtImageRepresentation(vtkImageData *d, float *z)
avtImageRepresentation::avtImageRepresentation(vtkImageData *d, float *z,
bool iNowOwn)
{
Initialize();
int width = 0;
......@@ -86,8 +92,13 @@ avtImageRepresentation::avtImageRepresentation(vtkImageData *d, float *z)
if (z != NULL)
{
zbuffer = new float[width * height];
memcpy(zbuffer, z, sizeof(float) * width * height);
if (iNowOwn)
zbuffer = z;
else
{
zbuffer = new float[width * height];
memcpy(zbuffer, z, sizeof(float) * width * height);
}
zbufferRef = new int(1);
}
}
......
......@@ -40,6 +40,10 @@ class vtkImageData;
//
// Mark C. Miller, Wed Nov 16 14:17:01 PST 2005
// Added additional compression related data members
//
// Hank Childs, Mon Feb 6 14:59:43 PST 2006
// Allow image to avoid copying the Z-buffer.
//
// ****************************************************************************
class PIPELINE_API avtImageRepresentation
......@@ -47,7 +51,7 @@ class PIPELINE_API avtImageRepresentation
public:
avtImageRepresentation();
avtImageRepresentation(vtkImageData *);
avtImageRepresentation(vtkImageData *, float *);
avtImageRepresentation(vtkImageData *, float *, bool = false);
avtImageRepresentation(char *, int);
avtImageRepresentation(const avtImageRepresentation &);
virtual ~avtImageRepresentation();
......
......@@ -56,6 +56,9 @@
// Hank Childs, Sun Jan 22 12:47:29 PST 2006
// Renamed comparison to relational. Added new category for comparison.
//
// Hank Childs, Tue Feb 14 14:06:20 PST 2006
// Added ijk_gradient.
//
// ****************************************************************************
struct ExprNameList
{
......@@ -203,6 +206,8 @@ const char *expr_misc[] = {
"curl",
"divergence",
"gradient",
"ij_gradient",
"ijk_gradient",
"Laplacian",
"recenter",
"resrad",
......
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