Commit 00cfd8ad authored by hrchilds's avatar hrchilds
Browse files

Update from December 13, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@141 18c085ea-50e0-402c-830e-de6fd14e8384
parent 123400f3
......@@ -7,7 +7,7 @@ This document contains instructions for installing VisIt on both Unix and
Windows systems. The Unix installation instructions are first followed
by the Windows installation instructions.
Unix:
Unix and Mac OS X:
1. Run the visit-install script to install visit. Note that it can
create a new distribution directory or update an existing
......@@ -19,9 +19,9 @@ Unix:
"version" will be 1.2.5 for the current distribution.
"platform" will be one of the following: aix, irix6, linux, osf1,
or sunos5 depending on the machine. The one you use should match
the name of the accompanying distribution file.
"platform" will be one of the following: aix, darwin, irix6, linux,
osf1, or sunos5 depending on the machine. The one you use should
match the name of the accompanying distribution file.
"directory" is the directory you wish to install visit into.
If the directory doesn't exist the script will create it.
......@@ -78,16 +78,6 @@ Windows:
1. Copy the file visit1.2.5.exe to your desktop.
2. Right click on the visit1.2.5.exe icon using your mouse and selecting
"Extract to folder C:\...\Desktop\visit1.2.5" from the popup menu. A
window will popup as the file is extracted into the directory. Once
the process is complete a "visit1.2.5" directory icon should appear on
your desktop.
2. Double click on the visit1.2.5.exe icon to run the installer.
3. Double click on the "visit1.2.5" directory icon bringing up a file
system browsing window.
4. Double click on the SETUP icon with the computer display icon to run
InstallShield.
5. Follow the directions provided by InstallShield.
3. Follow the directions provided by the installer.
......@@ -1581,6 +1581,10 @@ RemoteProcess::CreateCommandLine(stringVector &args, const std::string &rHost,
// Jeremy Meredith, Thu Jul 3 15:01:25 PDT 2003
// Allowed disabling of PTYs even when they are available.
//
// Jeremy Meredith, Tue Dec 9 15:24:42 PST 2003
// Added code to close the PTY if we could not connect. Also attempt to
// kill the child process with a TERM.
//
// ****************************************************************************
void
......@@ -1649,6 +1653,12 @@ RemoteProcess::LaunchRemote(const stringVector &args)
}
CATCH(CouldNotConnectException)
{
// Close the file descriptor allocated for the PTY
close(ptyFileDescriptor);
// Kill the SSH proces
kill(remoteProgramPid, SIGTERM);
// Clean up memory
DestroySplitCommandLine(argv, argc);
......
......@@ -15,6 +15,8 @@
#include <vtkFloatArray.h>
#include <vtkIdList.h>
#include <vtkPointData.h>
#include <vtkPointDataToCellData.h>
#include <vtkRectilinearGrid.h>
#include <DebugStream.h>
#include <ExpressionException.h>
......@@ -26,11 +28,17 @@
// Programmer: Akira Haddox <Transferred by Hank Childs>
// Creation: August 18, 2002
//
// Modifications:
//
// Hank Childs, Sat Dec 13 10:57:57 PST 2003
// Added pd2cd.
//
// ****************************************************************************
avtGradientFilter::avtGradientFilter()
{
myFilter = vtkCellDataToPointData::New();
cd2pd = vtkCellDataToPointData::New();
pd2cd = vtkPointDataToCellData::New();
}
......@@ -40,18 +48,51 @@ avtGradientFilter::avtGradientFilter()
// Programmer: Akira Haddox <Transferred by Hank Childs>
// Creation: August 18, 2002
//
// Modifications:
//
// Hank Childs, Sat Dec 13 10:57:57 PST 2003
// Added pd2cd.
//
// ****************************************************************************
avtGradientFilter::~avtGradientFilter()
{
if (myFilter != NULL)
if (cd2pd != NULL)
{
cd2pd->Delete();
cd2pd = NULL;
}
if (pd2cd != NULL)
{
myFilter->Delete();
myFilter = NULL;
pd2cd->Delete();
pd2cd = NULL;
}
}
// ****************************************************************************
// Method: avtGradientFilter::ReleaseData
//
// Purpose:
// Releases the data associated with the gradient filter.
//
// Programmer: Hank Childs
// Creation: December 13, 2003
//
// ****************************************************************************
void
avtGradientFilter::ReleaseData(void)
{
avtSingleInputExpressionFilter::ReleaseData();
cd2pd->SetInput(NULL);
cd2pd->SetOutput(NULL);
pd2cd->SetInput(NULL);
pd2cd->SetOutput(NULL);
}
// ****************************************************************************
// Method: avtGradientFilter::DeriveVariable
//
......@@ -82,13 +123,22 @@ avtGradientFilter::~avtGradientFilter()
// Hank Childs, Tue Nov 25 17:12:17 PST 2003
// Do a better job of updating progress.
//
// Hank Childs, Sat Dec 13 10:46:55 PST 2003
// Optimize for rectilinear data. Also allow the cell data to stay as
// cell data in the output.
//
// ****************************************************************************
vtkDataArray *
avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
{
if (in_ds->GetDataObjectType() == VTK_RECTILINEAR_GRID)
{
return RectilinearGradient((vtkRectilinearGrid *) in_ds);
}
vtkDataArray *scalarValues = in_ds->GetPointData()->GetScalars();
bool deleteSVar = false;
bool recentered = false;
if (!scalarValues)
{
......@@ -98,16 +148,16 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
" be found.");
}
myFilter->SetInput(in_ds);
cd2pd->SetInput(in_ds);
vtkDataSet *ds = (vtkDataSet*)in_ds->NewInstance();
myFilter->SetOutput(ds);
cd2pd->SetOutput(ds);
ds->Update();
ds->SetSource(NULL);
scalarValues = ds->GetPointData()->GetScalars();
scalarValues->Register(NULL); // so we don't lose it
deleteSVar = true;
recentered = true;
ds->Delete();
}
......@@ -179,9 +229,30 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
results->SetTuple3(nodeId, xComponent, yComponent, zComponent);
}
if (deleteSVar)
if (recentered)
{
vtkDataSet *new_ds = (vtkDataSet*)in_ds->NewInstance();
new_ds->CopyStructure(in_ds);
new_ds->GetPointData()->SetVectors(results);
pd2cd->SetInput(new_ds);
vtkDataSet *ds = (vtkDataSet*)in_ds->NewInstance();
pd2cd->SetOutput(ds);
ds->Update();
ds->SetSource(NULL);
vtkDataArray *new_results = ds->GetCellData()->GetVectors();
new_results->Register(NULL); // so we don't lose it
results->Delete();
results = new_results;
new_ds->Delete();
ds->Delete();
scalarValues->Delete();
}
return results;
}
......@@ -334,3 +405,190 @@ float avtGradientFilter::EvaluateValue(float x, float y, float z,
}
return value;
}
// ****************************************************************************
// Method: avtGradientFilter::RectilinearGradient
//
// Purpose:
// Determines the gradient of a rectilinear dataset.
//
// Programmer: Hank Childs
// Creation: December 13, 2003
//
// ****************************************************************************
vtkDataArray *
avtGradientFilter::RectilinearGradient(vtkRectilinearGrid *rg)
{
int i, j, k;
vtkDataArray *xc = rg->GetXCoordinates();
vtkDataArray *yc = rg->GetYCoordinates();
vtkDataArray *zc = rg->GetZCoordinates();
float *x = (float *) xc->GetVoidPointer(0);
float *y = (float *) yc->GetVoidPointer(0);
float *z = (float *) zc->GetVoidPointer(0);
bool deleteX = false;
bool deleteY = false;
bool deleteZ = false;
int dims[3];
rg->GetDimensions(dims);
bool isNodal = true;
vtkDataArray *s = rg->GetPointData()->GetScalars();
if (s == NULL)
{
s = rg->GetCellData()->GetScalars();
isNodal = false;
dims[0] -= 1;
dims[1] -= 1;
dims[2] -= 1;
float *x_new = new float[dims[0]];
for (i = 0 ; i < dims[0] ; i++)
x_new[i] = (x[i] + x[i+1]) / 2.;
x = x_new;
deleteX = true;
float *y_new = new float[dims[1]];
for (i = 0 ; i < dims[1] ; i++)
y_new[i] = (y[i] + y[i+1]) / 2.;
y = y_new;
deleteY = true;
if (dims[2] > 1)
{
float *z_new = new float[dims[2]];
for (i = 0 ; i < dims[2] ; i++)
z_new[i] = (z[i] + z[i+1]) / 2.;
z = z_new;
deleteZ = true;
}
}
//
// Now come up with the divisors. A gradient is the change in variable
// value divided by the span (in space). Division is a killer when it
// comes to performance. Since we will be dividing by the same things
// repeatedly, calculate them once and then re-use them.
//
float *x_div = new float[dims[0]];
x_div[0] = 1. / (x[1] - x[0]);
x_div[dims[0]-1] = 1. / (x[dims[0]-1] - x[dims[0]-2]);
for (i = 1 ; i < dims[0]-1 ; i++)
x_div[i] = 1. / (x[i+1] - x[i-1]);
float *y_div = new float[dims[1]];
y_div[0] = 1. / (y[1] - y[0]);
y_div[dims[1]-1] = 1. / (y[dims[1]-1] - y[dims[1]-2]);
for (i = 1 ; i < dims[1]-1 ; i++)
y_div[i] = 1. / (y[i+1] - y[i-1]);
float *z_div = NULL;
if (dims[2] > 1)
{
z_div = new float[dims[2]];
z_div[0] = 1. / (z[1] - z[0]);
z_div[dims[2]-1] = 1. / (z[dims[2]-1] - z[dims[2]-2]);
for (i = 1 ; i < dims[2]-1 ; i++)
z_div[i] = 1. / (z[i+1] - z[i-1]);
}
vtkDataArray *out_array = s->NewInstance();
out_array->SetNumberOfComponents(3);
out_array->SetNumberOfTuples(s->GetNumberOfTuples());
float *in = (float *) s->GetVoidPointer(0);
float *out = (float *) out_array->GetVoidPointer(0);
const int dims0 = dims[0];
const int dims1 = dims[1];
const int dims2 = dims[2];
const int iskip = 1;
const int jskip = dims0;
const int kskip = dims0*dims1;
if (dims2 <= 1)
{
// Do all the cases where we have valid values on both sides.
for (j = 0 ; j < dims1 ; j++)
{
for (i = 0 ; i < dims0 ; i++)
{
int index = j*jskip + i*iskip;
int vec_index = 3*index;
if ((i > 0) && (i < (dims0-1)))
out[vec_index] = in[index+iskip] - in[index-iskip];
else if (i == 0)
out[vec_index] = in[index+iskip] - in[index];
else // i == dims0-1
out[vec_index] = in[index] - in[index-iskip];
out[vec_index++] *= x_div[i];
if ((j > 0) && (j < (dims1-1)))
out[vec_index] = in[index+jskip] - in[index-jskip];
else if (j == 0)
out[vec_index] = in[index+jskip] - in[index];
else // j == dims1-1
out[vec_index] = in[index] - in[index-jskip];
out[vec_index++] *= y_div[j];
out[vec_index++] = 0.;
}
}
}
else
{
// Do all the cases where we have valid values on both sides.
for (k = 0 ; k < dims2 ; k++)
{
for (j = 0 ; j < dims1 ; j++)
{
for (i = 0 ; i < dims0 ; i++)
{
int index = k*kskip + j*jskip + i*iskip;
int vec_index = 3*index;
if ((i > 0) && (i < (dims0-1)))
out[vec_index] = in[index+iskip]-in[index-iskip];
else if (i == 0)
out[vec_index] = in[index+iskip] - in[index];
else // i == dims0-1
out[vec_index] = in[index] - in[index-iskip];
out[vec_index++] *= x_div[i];
if ((j > 0) && (j < (dims1-1)))
out[vec_index] = in[index+jskip] - in[index-jskip];
else if (j == 0)
out[vec_index] = in[index+jskip] - in[index];
else // j == dims1-1
out[vec_index] = in[index] - in[index-jskip];
out[vec_index++] *= y_div[j];
if ((k > 0) && (k < (dims2-1)))
out[vec_index] = in[index+kskip] - in[index-kskip];
else if (k == 0)
out[vec_index] = in[index+kskip] - in[index];
else // k == dims2-1
out[vec_index] = in[index] - in[index-kskip];
out[vec_index++] *= z_div[k];
}
}
}
}
if (deleteX)
delete [] x;
if (deleteY)
delete [] y;
if (deleteZ)
delete [] z;
delete [] x_div;
delete [] y_div;
if (z_div != NULL)
delete [] z_div;
return out_array;
}
......@@ -14,6 +14,8 @@ class vtkCellDataToPointData;
class vtkDataArray;
class vtkDataSet;
class vtkIdList;
class vtkPointDataToCellData;
class vtkRectilinearGrid;
class vtkScalarData;
......@@ -24,9 +26,15 @@ class vtkScalarData;
// A filter that calculates the gradient at each node. Note uses simple
// definition of looking in the x,y, and z directions.
//
// Programmer: Matthew Haddox
// Programmer: Akira Haddox
// Creation: July 30, 2002
//
// Modifications:
//
// Hank Childs, Sat Dec 13 10:42:15 PST 2003
// Added support for rectilinear meshes. Also don't force cell data to be
// point data in the output. Added ReleaseData to avoid memory bloat.
//
// ****************************************************************************
class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
......@@ -39,10 +47,10 @@ class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
virtual const char *GetDescription(void)
{ return "Calculating Gradient of Each Node"; };
virtual void ReleaseData(void);
protected:
virtual vtkDataArray *DeriveVariable(vtkDataSet *);
virtual bool IsPointVariable(void) { return true; };
virtual int GetVariableDimension() { return 3; }
float EvaluateComponent(float, float, float, float,
......@@ -51,8 +59,10 @@ class EXPRESSION_API avtGradientFilter : public avtSingleInputExpressionFilter
vtkIdList *);
float EvaluateValue(float, float, float, vtkDataSet *,
vtkDataArray *,vtkIdList *,bool &);
vtkDataArray *RectilinearGradient(vtkRectilinearGrid *);
vtkCellDataToPointData *myFilter;
vtkCellDataToPointData *cd2pd;
vtkPointDataToCellData *pd2cd;
};
......
......@@ -135,6 +135,9 @@ avtExpressionEvaluatorFilter::AdditionalPipelineFilters(void)
// Added support for expressions of the form A=B. This involves the
// identity function and was causing a crash previously.
//
// Hank Childs, Sat Dec 13 15:55:31 PST 2003
// Don't be so quick to declare something a recursive function.
//
// ****************************************************************************
avtPipelineSpecification_p
......@@ -179,6 +182,7 @@ avtExpressionEvaluatorFilter::PerformRestriction(
// together, then put on a list in pipelineState for use in Execute().
debug5 << "EEF::PerformRestriction: Checking candidates" << endl;
pipelineState.SetDataObject(NULL);
int num_recursive_checks = 0;
while (!candidates.empty())
{
std::set<string>::iterator front = candidates.begin();
......@@ -192,10 +196,21 @@ avtExpressionEvaluatorFilter::PerformRestriction(
search = find(expr_list.begin(), expr_list.end(), var);
if (search != expr_list.end())
{
// We've seen this expression already.
char error[] = "Recursive expression.";
debug1 << error << endl;
EXCEPTION1(ImproperUseException, error);
// We were asked about an expression that we have seen before. This
// can happen under normal conditions. For example, we see an expr
// that is a vector. Later on, we get a magnitude expression that
// references the original vector. That would get us into this loop.
// And its not recursive. That said, this loop is entered when we
// get a recursive expression. So, if we come in 1000 times, we
// probably have a recursive expression.
num_recursive_checks++;
if (num_recursive_checks >= 1000)
{
// We've seen this expression already.
char error[] = "Recursive expression.";
debug1 << error << endl;
EXCEPTION1(ImproperUseException, error);
}
}
// Check if this is an expression or a real variable.
......
......@@ -850,6 +850,9 @@ CGetChunkByLabel(avtDataRepresentation & data, void *arg, bool &success)
// Hank Childs, Mon Sep 22 08:18:38 PDT 2003
// Account for tensors.
//
// Hank Childs, Sat Dec 13 16:06:07 PST 2003
// Set the dimension of the active variable.
//
// ****************************************************************************
void
......@@ -888,6 +891,7 @@ CSetActiveVariable(avtDataRepresentation &data, void *arg, bool &success)
pd->SetActiveVectors(args->varname);
else if (arr->GetNumberOfComponents() == 9)
pd->SetActiveTensors(args->varname);
args->activeVarDim = arr->GetNumberOfComponents();
}
arr = cd->GetArray(args->varname);
if (arr != NULL)
......@@ -898,6 +902,7 @@ CSetActiveVariable(avtDataRepresentation &data, void *arg, bool &success)
cd->SetActiveVectors(args->varname);
else if (arr->GetNumberOfComponents() == 9)
cd->SetActiveTensors(args->varname);
args->activeVarDim = arr->GetNumberOfComponents();
}
//
......
......@@ -77,6 +77,7 @@ typedef struct
bool hasPointVars;
bool hasCellVars;
bool activeIsPoint;
int activeVarDim;
} SetActiveVariableArgs;
typedef struct
......
......@@ -24,6 +24,11 @@
// Programmer: Hank Childs
// Creation: October 24, 2001
//
// Modifications:
//
// Hank Childs, Sat Dec 13 16:07:44 PST 2003
// Set the dimension of the output variable.
//
// ****************************************************************************
void
......@@ -34,6 +39,8 @@ avtDataObjectToDatasetFilter::OutputSetActiveVariable(const char *varname)
avtDataTree_p tree = GetDataTree();
bool success;
tree->Traverse(CSetActiveVariable, (void *) &args, success);
GetOutput()->GetInfo().GetAttributes().
SetVariableDimension(args.activeVarDim);
}
......@@ -383,6 +383,9 @@ avtPointToGlyphFilter::SetScaleByVariableEnabled(bool s)
// Hank Childs, Wed Mar 26 13:56:53 PST 2003
// Add early detection for the case where there are 0 input cells.
//
// Hank Childs, Sat Dec 13 21:34:05 PST 2003
// Do a better job of handling nodal and zonal point data.
//
// ****************************************************************************
vtkDataSet *
......@@ -463,11 +466,17 @@ avtPointToGlyphFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
vtkPointData *in_pd = ds->GetPointData();
int npts = output->GetNumberOfPoints();
out_pd->CopyAllocate(in_pd, npts);
for (int i = 0 ; i < npts ; i++)
int i;
for (i = 0 ; i < npts ; i++)
{
out_pd->CopyData(in_pd, ids->GetValue(i), i);
}
output->GetPointData()->ShallowCopy(out_pd);
for (i = 0 ; i < out_pd->GetNumberOfArrays() ; i++)
{
vtkDataArray *arr = out_pd->GetArray(i);
output->GetPointData()->AddArray(arr);
}
output->GetPointData()->RemoveArray("InputPointIds");
out_pd->Delete();
ids->Delete();
......
......@@ -439,7 +439,7 @@ avtText2DColleague::NoPlots(void)
// ****************************************************************************
void