Commit f636c791 authored by cyrush's avatar cyrush
Browse files

added logic for ccl for input datasets that only have ghost zones and an extra...

added logic for ccl for input datasets that only have ghost zones and an extra sanity check for the 'if' expression

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@3349 18c085ea-50e0-402c-830e-de6fd14e8384
parent 161fafbc
......@@ -110,6 +110,10 @@ avtConditionalExpression::~avtConditionalExpression()
// Hank Childs, Tue Mar 13 10:02:16 PDT 2007
// Improve error message.
//
// Cyrus Harrison, Wed Feb 27 16:47:41 PST 2008
// Test to make sure input data arrays have the same number of tuples and
// issue an error message if this happens.
//
// ****************************************************************************
vtkDataArray *
......@@ -174,6 +178,18 @@ avtConditionalExpression::DeriveVariable(vtkDataSet *in_ds)
EXCEPTION2(ExpressionException, outputVariableName, msg);
}
// sanity check: make sure the input arrays have the same # of tuples
int d1_nvals = data1->GetNumberOfTuples();
int d2_nvals = data2->GetNumberOfTuples();
int d3_nvals = data2->GetNumberOfTuples();
if ( d1_nvals != d2_nvals || d2_nvals != d3_nvals )
{
std::string msg = " the input datasets for the \"if\" expression "
" do not have the same number of tuples!";
EXCEPTION2(ExpressionException, outputVariableName, msg.c_str());
}
//
// Set up a VTK variable reflecting the calculated variable
//
......
......@@ -263,6 +263,9 @@ avtConnComponentsExpression::GetNumberOfComponents()
// Cyrus Harrison, Thu Aug 23 08:53:25 PDT 2007
// Support enable ghost neighbors option.
//
// Cyrus Harrison, Wed Feb 27 16:23:56 PST 2008
// Special logic for datasets that only contain ghost zones.
//
// ****************************************************************************
void
avtConnComponentsExpression::Execute()
......@@ -374,8 +377,10 @@ avtConnComponentsExpression::Execute()
result_arrays[i] = res_array;
result_sets[i] = res_set;
// add result as new leaf
leaves[i] = new avtDataTree(res_set,domain_ids[i]);
if(res_array->GetNumberOfTuples() > 0) // add result as new leaf
leaves[i] = new avtDataTree(res_set,domain_ids[i]);
else // if the dataset only contained ghost zones we could end up here
leaves[i] = NULL;
// update progress
UpdateProgress(currentProgress++,totalSteps);
......
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