11 #ifndef vtk_m_filter_flow_worklet_LagrangianStructures_h
12 #define vtk_m_filter_flow_worklet_LagrangianStructures_h
29 template <vtkm::IdComponent dimensions>
49 template <
typename Po
intArray>
51 const PointArray& input,
52 const PointArray& output,
58 auto xin1 = input.Get(neighborIndices[0]);
59 auto xin2 = input.Get(neighborIndices[1]);
60 auto yin1 = input.Get(neighborIndices[2]);
61 auto yin2 = input.Get(neighborIndices[3]);
63 Scalar xDiff = 1.0f / (xin2[0] - xin1[0]);
64 Scalar yDiff = 1.0f / (yin2[1] - yin1[1]);
66 auto xout1 = output.Get(neighborIndices[0]);
67 auto xout2 = output.Get(neighborIndices[1]);
68 auto yout1 = output.Get(neighborIndices[2]);
69 auto yout2 = output.Get(neighborIndices[3]);
72 Scalar f1x = (xout2[0] - xout1[0]) * xDiff;
73 Scalar f1y = (yout2[0] - yout1[0]) * yDiff;
76 Scalar f2x = (xout2[1] - xout1[1]) * xDiff;
77 Scalar f2y = (yout2[1] - yout1[1]) * yDiff;
83 vtkm::filter::flow::internal::ComputeLeftCauchyGreenTensor(jacobian);
86 vtkm::filter::flow::internal::Jacobi(jacobian, eigenValues);
88 Scalar delta = eigenValues[0];
105 vtkm::filter::flow::internal::GridMetaData
GridData;
128 template <
typename Po
intArray>
130 const PointArray& input,
131 const PointArray& output,
132 Scalar& outputField)
const
136 auto xin1 = input.Get(neighborIndices[0]);
137 auto xin2 = input.Get(neighborIndices[1]);
138 auto yin1 = input.Get(neighborIndices[2]);
139 auto yin2 = input.Get(neighborIndices[3]);
140 auto zin1 = input.Get(neighborIndices[4]);
141 auto zin2 = input.Get(neighborIndices[5]);
143 Scalar xDiff = 1.0f / (xin2[0] - xin1[0]);
144 Scalar yDiff = 1.0f / (yin2[1] - yin1[1]);
145 Scalar zDiff = 1.0f / (zin2[2] - zin1[2]);
147 auto xout1 = output.Get(neighborIndices[0]);
148 auto xout2 = output.Get(neighborIndices[1]);
149 auto yout1 = output.Get(neighborIndices[2]);
150 auto yout2 = output.Get(neighborIndices[3]);
151 auto zout1 = output.Get(neighborIndices[4]);
152 auto zout2 = output.Get(neighborIndices[5]);
155 Scalar f1x = (xout2[0] - xout1[0]) * xDiff;
156 Scalar f1y = (yout2[0] - yout1[0]) * yDiff;
157 Scalar f1z = (zout2[0] - zout1[0]) * zDiff;
160 Scalar f2x = (xout2[1] - xout1[1]) * xDiff;
161 Scalar f2y = (yout2[1] - yout1[1]) * yDiff;
162 Scalar f2z = (zout2[1] - zout1[1]) * zDiff;
165 Scalar f3x = (xout2[2] - xout1[2]) * xDiff;
166 Scalar f3y = (yout2[2] - yout1[2]) * yDiff;
167 Scalar f3z = (zout2[2] - zout1[2]) * zDiff;
174 vtkm::filter::flow::internal::ComputeLeftCauchyGreenTensor(jacobian);
177 vtkm::filter::flow::internal::Jacobi(jacobian, eigenValues);
179 Scalar delta = eigenValues[0];
182 outputField =
vtkm::Log(delta) / (
static_cast<Scalar>(2.0f) * EndTime);
189 vtkm::filter::flow::internal::GridMetaData
GridData;
196 #endif //vtk_m_filter_flow_worklet_LagrangianStructures_h