Commit 46753482 authored by hrchilds's avatar hrchilds

Add time iterating expressions.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@6334 18c085ea-50e0-402c-830e-de6fd14e8384
parent 704ec290
......@@ -235,16 +235,19 @@
# Jeremy Meredith, Wed Feb 11 16:39:34 EST 2009
# Removed verdict-related stuff from MeshQuality into new third_party lib.
#
# Hank Childs, Mon Feb 16 07:34:34 PST 2009
# Added TimeIterators directory.
#
##############################################################################
@SET_MAKE@
@VARIABLES@
SUBDIRS=Abstract CMFE Conditional Derivations General ImageProcessing \
Management Math MeshQuality
Management Math MeshQuality TimeIterators
SRC=$(Abstract_src) $(CMFE_src) $(Conditional_src) $(Derivations_src) \
$(General_src) $(ImageProcessing_src) $(Management_src) $(Math_src) \
$(MeshQuality_src)
$(MeshQuality_src) $(TimeIterators_src)
Abstract_src= \
Abstract/avtBinaryMathExpression.C \
......@@ -428,6 +431,16 @@ MeshQuality_src= \
MeshQuality/avtVMetricWarpage.C \
MeshQuality/avtVerdictExpression.C
TimeIterators_src= \
TimeIterators/avtAverageOverTimeExpression.C \
TimeIterators/avtMinOverTimeExpression.C \
TimeIterators/avtMaxOverTimeExpression.C \
TimeIterators/avtSumOverTimeExpression.C \
TimeIterators/avtTimeIteratorDataTreeIteratorExpression.C \
TimeIterators/avtTimeIteratorExpression.C \
TimeIterators/avtValueAtExtremaExpression.C \
TimeIterators/avtWhenConditionIsTrueExpression.C
CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
......
......@@ -143,6 +143,12 @@
#include <avtExpressionComponentMacro.h>
#include <avtAbelInversionExpression.h>
#include <avtConservativeSmoothingExpression.h>
#include <avtAverageOverTimeExpression.h>
#include <avtMinOverTimeExpression.h>
#include <avtMaxOverTimeExpression.h>
#include <avtSumOverTimeExpression.h>
#include <avtWhenConditionIsTrueExpression.h>
#include <avtValueAtExtremaExpression.h>
#include <avtMeanFilterExpression.h>
#include <avtMedianFilterExpression.h>
#include <avtConnCMFEExpression.h>
......@@ -516,6 +522,9 @@ avtVectorExpr::CreateFilters(ExprPipelineState *state)
// Hank Childs, Mon Dec 29 13:57:53 PST 2008
// Added dominant_mat.
//
// Hank Childs, Mon Feb 16 15:00:30 PST 2009
// Added time iteration expressions.
//
// ****************************************************************************
avtExpressionFilter *
......@@ -946,6 +955,136 @@ avtFunctionExpr::CreateFilters(string functionName)
if (functionName == "point_constant")
return new avtConstantFunctionExpression(true);
if (functionName == "average_over_time")
return new avtAverageOverTimeExpression();
if (functionName == "min_over_time")
return new avtMinOverTimeExpression();
if (functionName == "max_over_time")
return new avtMaxOverTimeExpression();
if (functionName == "sum_over_time")
return new avtSumOverTimeExpression();
if (functionName == "first_time_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(true);
e->SetOutputType(WCT_OUTPUT_TIME);
return e;
}
if (functionName == "last_time_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(false);
e->SetOutputType(WCT_OUTPUT_TIME);
return e;
}
if (functionName == "first_cycle_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(true);
e->SetOutputType(WCT_OUTPUT_CYCLE);
return e;
}
if (functionName == "last_cycle_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(false);
e->SetOutputType(WCT_OUTPUT_CYCLE);
return e;
}
if (functionName == "first_time_index_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(true);
e->SetOutputType(WCT_OUTPUT_TIME_INDEX);
return e;
}
if (functionName == "last_time_index_when_condition_is_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(false);
e->SetOutputType(WCT_OUTPUT_TIME_INDEX);
return e;
}
if (functionName == "var_when_condition_is_first_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(true);
e->SetOutputType(WCT_OUTPUT_VARIABLE);
return e;
}
if (functionName == "var_when_condition_is_last_true")
{
avtWhenConditionIsTrueExpression *e =
new avtWhenConditionIsTrueExpression;
e->SetWhenConditionIsFirstTrue(false);
e->SetOutputType(WCT_OUTPUT_VARIABLE);
return e;
}
if (functionName == "time_at_minimum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(false);
e->SetOutputType(VE_OUTPUT_TIME);
return e;
}
if (functionName == "cycle_at_minimum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(false);
e->SetOutputType(VE_OUTPUT_CYCLE);
return e;
}
if (functionName == "time_index_at_minimum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(false);
e->SetOutputType(VE_OUTPUT_TIME_INDEX);
return e;
}
if (functionName == "value_at_minimum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(false);
e->SetOutputType(VE_OUTPUT_VARIABLE);
return e;
}
if (functionName == "time_at_maximum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(true);
e->SetOutputType(VE_OUTPUT_TIME);
return e;
}
if (functionName == "cycle_at_maximum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(true);
e->SetOutputType(VE_OUTPUT_CYCLE);
return e;
}
if (functionName == "time_index_at_maximum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(true);
e->SetOutputType(VE_OUTPUT_TIME_INDEX);
return e;
}
if (functionName == "value_at_maximum")
{
avtValueAtExtremaExpression *e = new avtValueAtExtremaExpression;
e->SetAtMaximum(true);
e->SetOutputType(VE_OUTPUT_VARIABLE);
return e;
}
return NULL;
}
......
../../../include/make-lib-subdir
\ No newline at end of file
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400152
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtAverageOverTimeExpression.C //
// ************************************************************************* //
#include <avtAverageOverTimeExpression.h>
#include <vtkDataArray.h>
// ****************************************************************************
// Method: avtAverageOverTimeExpression constructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtAverageOverTimeExpression::avtAverageOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtAverageOverTimeExpression destructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtAverageOverTimeExpression::~avtAverageOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtAverageOverTimeExpression::ExecuteDataset
//
// Purpose:
// Finds the average over time. This is the method that looks examines
// a single VTK data set.
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
void
avtAverageOverTimeExpression::ExecuteDataset(std::vector<vtkDataArray *> &inVars,
vtkDataArray *outVar, int ts)
{
vtkDataArray *iv = inVars[0];
int nvars = iv->GetNumberOfTuples();
for (int i = 0 ; i < nvars ; i++)
{
if (ts == 0)
outVar->SetTuple1(i, iv->GetTuple1(i)/numTimeSlicesToProcess);
else
{
double v1 = outVar->GetTuple1(i);
double v2 = iv->GetTuple1(i);
outVar->SetTuple1(i, v1+(v2/numTimeSlicesToProcess));
}
}
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtAverageOverTimeExpression.h //
// ************************************************************************* //
#ifndef AVT_AVERAGE_OVER_TIME_EXPRESSION_H
#define AVT_AVERAGE_OVER_TIME_EXPRESSION_H
#include <avtTimeIteratorDataTreeIteratorExpression.h>
// ****************************************************************************
// Class: avtAverageOverTimeExpression
//
// Purpose:
// A derived type of time iterator/data tree iterator that calculates the
// average over time.
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
class EXPRESSION_API avtAverageOverTimeExpression
: public avtTimeIteratorDataTreeIteratorExpression
{
public:
avtAverageOverTimeExpression();
virtual ~avtAverageOverTimeExpression();
virtual const char *GetType(void)
{ return "avtAverageOverTimeExpression"; };
virtual const char *GetDescription(void)
{ return "Calculating average over time"; };
protected:
virtual void ExecuteDataset(std::vector<vtkDataArray *> &,
vtkDataArray *, int ts);
virtual int NumberOfVariables(void) { return 1; };
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400152
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtMaxOverTimeExpression.C //
// ************************************************************************* //
#include <avtMaxOverTimeExpression.h>
#include <vtkDataArray.h>
// ****************************************************************************
// Method: avtMaxOverTimeExpression constructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtMaxOverTimeExpression::avtMaxOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtMaxOverTimeExpression destructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtMaxOverTimeExpression::~avtMaxOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtMaxOverTimeExpression::ExecuteDataset
//
// Purpose:
// Finds the maximum over time. This is the method that looks examines a
// single VTK data set.
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
void
avtMaxOverTimeExpression::ExecuteDataset(std::vector<vtkDataArray *> &inVars,
vtkDataArray *outVar, int ts)
{
vtkDataArray *iv = inVars[0];
int nvars = iv->GetNumberOfTuples();
for (int i = 0 ; i < nvars ; i++)
{
if (ts == 0)
outVar->SetTuple1(i, iv->GetTuple1(i));
else
{
double v1 = outVar->GetTuple1(i);
double v2 = iv->GetTuple1(i);
if (v2 > v1)
outVar->SetTuple1(i, v2);
}
}
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtMaxOverTimeExpression.h //
// ************************************************************************* //
#ifndef AVT_MAX_OVER_TIME_EXPRESSION_H
#define AVT_MAX_OVER_TIME_EXPRESSION_H
#include <avtTimeIteratorDataTreeIteratorExpression.h>
// ****************************************************************************
// Class: avtMaxOverTimeExpression
//
// Purpose:
// A derived type of time iterator/data tree iterator that calculates the
// maximum over time.
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
class EXPRESSION_API avtMaxOverTimeExpression
: public avtTimeIteratorDataTreeIteratorExpression
{
public:
avtMaxOverTimeExpression();
virtual ~avtMaxOverTimeExpression();
virtual const char *GetType(void)
{ return "avtMaxOverTimeExpression"; };
virtual const char *GetDescription(void)
{ return "Calculating max over time"; };
protected:
virtual void ExecuteDataset(std::vector<vtkDataArray *> &,
vtkDataArray *, int ts);
virtual int NumberOfVariables(void) { return 1; };
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400152
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtMinOverTimeExpression.C //
// ************************************************************************* //
#include <avtMinOverTimeExpression.h>
#include <vtkDataArray.h>
// ****************************************************************************
// Method: avtMinOverTimeExpression constructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtMinOverTimeExpression::avtMinOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtMinOverTimeExpression destructor
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
avtMinOverTimeExpression::~avtMinOverTimeExpression()
{
;
}
// ****************************************************************************
// Method: avtMinOverTimeExpression::ExecuteDataset
//
// Purpose:
// Finds the minimum over time. This is the method that looks examines a
// single VTK data set.
//
// Programmer: Hank Childs
// Creation: February 16, 2009
//
// ****************************************************************************
void
avtMinOverTimeExpression::ExecuteDataset(std::vector<vtkDataArray *> &inVars,
vtkDataArray *outVar, int ts)
{
vtkDataArray *iv = inVars[0];
int nvars = iv->GetNumberOfTuples();
for (int i = 0 ; i < nvars ; i++)
{
if (ts == 0)
outVar->SetTuple1(i, iv->GetTuple1(i));
else
{
double v1 = outVar->GetTuple1(i);
double v2 = iv->GetTuple1(i);
if (v2 < v1)
outVar->SetTuple1(i, v2);
}
}
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.