Viskores  1.0
LagrangianStructures.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_flow_LagrangianStructures_h
20 #define viskores_filter_flow_LagrangianStructures_h
21 
22 #include <viskores/filter/Filter.h>
25 
26 namespace viskores
27 {
28 namespace filter
29 {
30 namespace flow
31 {
32 
39 class VISKORES_FILTER_FLOW_EXPORT LagrangianStructures : public viskores::filter::Filter
40 {
41 public:
43  bool CanThread() const override { return false; }
44 
51  void SetStepSize(viskores::FloatDefault s) { this->StepSize = s; }
53  viskores::FloatDefault GetStepSize() { return this->StepSize; }
54 
58  void SetNumberOfSteps(viskores::Id n) { this->NumberOfSteps = n; }
60  viskores::Id GetNumberOfSteps() { return this->NumberOfSteps; }
61 
67  {
68  this->AdvectionTime = advectionTime;
69  }
71  viskores::FloatDefault GetAdvectionTime() { return this->AdvectionTime; }
72 
80  void SetUseAuxiliaryGrid(bool useAuxiliaryGrid) { this->UseAuxiliaryGrid = useAuxiliaryGrid; }
82  bool GetUseAuxiliaryGrid() { return this->UseAuxiliaryGrid; }
83 
89  {
90  this->AuxiliaryDims = auxiliaryDims;
91  }
93  viskores::Id3 GetAuxiliaryGridDimensions() { return this->AuxiliaryDims; }
94 
100  void SetUseFlowMapOutput(bool useFlowMapOutput) { this->UseFlowMapOutput = useFlowMapOutput; }
102  bool GetUseFlowMapOutput() { return this->UseFlowMapOutput; }
103 
107  void SetOutputFieldName(std::string outputFieldName) { this->OutputFieldName = outputFieldName; }
109  std::string GetOutputFieldName() { return this->OutputFieldName; }
110 
113  {
114  this->FlowMapOutput = flowMap;
115  }
118  {
119  return this->FlowMapOutput;
120  }
121 
122 private:
123  VISKORES_CONT viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& inData) override;
124 
128  std::string OutputFieldName = "FTLE";
129  viskores::FloatDefault StepSize = 1.0f;
130  viskores::Id NumberOfSteps = 0;
131  bool UseAuxiliaryGrid = false;
132  bool UseFlowMapOutput = false;
133 };
134 
135 }
136 }
137 } // namespace viskores
138 
139 #endif // viskores_filter_flow_LagrangianStructures_h
viskores::filter::flow::LagrangianStructures::SetAuxiliaryGridDimensions
void SetAuxiliaryGridDimensions(viskores::Id3 auxiliaryDims)
Specify the dimensions of the auxiliary grid for FTLE calculation.
Definition: LagrangianStructures.h:88
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::flow::LagrangianStructures::SetStepSize
void SetStepSize(viskores::FloatDefault s)
Specifies the step size used for the numerical integrator.
Definition: LagrangianStructures.h:51
viskores::filter::flow::LagrangianStructures::GetStepSize
viskores::FloatDefault GetStepSize()
Specifies the step size used for the numerical integrator.
Definition: LagrangianStructures.h:53
viskores::filter::flow::LagrangianStructures::GetOutputFieldName
std::string GetOutputFieldName()
Specify the name of the output field in the data set returned.
Definition: LagrangianStructures.h:109
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::flow::LagrangianStructures::CanThread
bool CanThread() const override
Returns whether the filter can execute on partitions in concurrent threads.
Definition: LagrangianStructures.h:43
viskores::filter::flow::LagrangianStructures::GetUseFlowMapOutput
bool GetUseFlowMapOutput()
Specify whether to use flow maps instead of advection.
Definition: LagrangianStructures.h:102
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::filter::flow::LagrangianStructures::SetNumberOfSteps
void SetNumberOfSteps(viskores::Id n)
Specify the maximum number of steps each particle is allowed to traverse.
Definition: LagrangianStructures.h:58
viskores_filter_flow_export.h
viskores::filter::flow::LagrangianStructures::GetAuxiliaryGridDimensions
viskores::Id3 GetAuxiliaryGridDimensions()
Specify the dimensions of the auxiliary grid for FTLE calculation.
Definition: LagrangianStructures.h:93
viskores::filter::flow::LagrangianStructures::GetFlowMapOutput
viskores::cont::ArrayHandle< viskores::Vec3f > GetFlowMapOutput()
Specify the array representing the flow map output to be used for FTLE calculation.
Definition: LagrangianStructures.h:117
viskores::filter::flow::LagrangianStructures::SetUseFlowMapOutput
void SetUseFlowMapOutput(bool useFlowMapOutput)
Specify whether to use flow maps instead of advection.
Definition: LagrangianStructures.h:100
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores::filter::flow::LagrangianStructures::FlowMapOutput
viskores::cont::ArrayHandle< viskores::Vec3f > FlowMapOutput
Definition: LagrangianStructures.h:127
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::flow::LagrangianStructures::AdvectionTime
viskores::FloatDefault AdvectionTime
Definition: LagrangianStructures.h:125
viskores::filter::flow::LagrangianStructures::SetAdvectionTime
void SetAdvectionTime(viskores::FloatDefault advectionTime)
Specify the time interval for the advection.
Definition: LagrangianStructures.h:66
viskores::filter::flow::LagrangianStructures
Compute the finite time Lyapunov exponent (FTLE) of a vector field.
Definition: LagrangianStructures.h:39
viskores::filter::flow::LagrangianStructures::GetAdvectionTime
viskores::FloatDefault GetAdvectionTime()
Specify the time interval for the advection.
Definition: LagrangianStructures.h:71
viskores::FloatDefault
viskores::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:244
viskores::filter::flow::LagrangianStructures::GetUseAuxiliaryGrid
bool GetUseAuxiliaryGrid()
Specify whether to use an auxiliary grid.
Definition: LagrangianStructures.h:82
viskores::filter::flow::LagrangianStructures::GetNumberOfSteps
viskores::Id GetNumberOfSteps()
Specify the maximum number of steps each particle is allowed to traverse.
Definition: LagrangianStructures.h:60
viskores::filter::flow::LagrangianStructures::AuxiliaryDims
viskores::Id3 AuxiliaryDims
Definition: LagrangianStructures.h:126
FlowTypes.h
viskores::filter::flow::LagrangianStructures::SetOutputFieldName
void SetOutputFieldName(std::string outputFieldName)
Specify the name of the output field in the data set returned.
Definition: LagrangianStructures.h:107
viskores::Vec< viskores::Id, 3 >
viskores::filter::flow::LagrangianStructures::SetFlowMapOutput
void SetFlowMapOutput(viskores::cont::ArrayHandle< viskores::Vec3f > &flowMap)
Specify the array representing the flow map output to be used for FTLE calculation.
Definition: LagrangianStructures.h:112
viskores::filter::flow::LagrangianStructures::SetUseAuxiliaryGrid
void SetUseAuxiliaryGrid(bool useAuxiliaryGrid)
Specify whether to use an auxiliary grid.
Definition: LagrangianStructures.h:80
Filter.h