11 #ifndef vtk_m_filter_flow_internal_DataSetIntegratorSteadyState_h
12 #define vtk_m_filter_flow_internal_DataSetIntegratorSteadyState_h
26 class DataSetIntegratorSteadyState
27 :
public vtkm::filter::flow::internal::DataSetIntegrator<DataSetIntegratorSteadyState>
32 const FieldNameType& fieldName,
36 :
vtkm::filter::flow::internal::DataSetIntegrator<DataSetIntegratorSteadyState>(id,
45 VTKM_CONT inline void DoAdvect(DSIHelperInfo<vtkm::Particle>& b,
49 VTKM_CONT inline void DoAdvect(DSIHelperInfo<vtkm::ChargedParticle>& b,
54 template <
typename ArrayType>
58 if (this->FieldName.IsType<VelocityFieldNameType>())
60 const auto& fieldNm = this->FieldName.Get<VelocityFieldNameType>();
61 auto assoc = this->DataSet.GetField(fieldNm).GetAssociation();
71 template <
typename ArrayType>
75 if (this->FieldName.IsType<ElectroMagneticFieldNameType>())
77 const auto& fieldNm = this->FieldName.Get<ElectroMagneticFieldNameType>();
78 const auto& electric = fieldNm.first;
79 const auto& magnetic = fieldNm.second;
80 auto eAssoc = this->DataSet.GetField(electric).GetAssociation();
81 auto bAssoc = this->DataSet.GetField(magnetic).GetAssociation();
87 ArrayType eField, bField;
114 template <
typename FieldType,
typename ParticleType>
120 static void Advect(
const FieldType& vecField,
133 vecField, ds, seedArray, stepSize, maxSteps, result);
140 vecField, ds, seedArray, stepSize, maxSteps, result);
146 static void Advect(
const FieldType& vecField,
159 vecField, ds, seedArray, stepSize, maxSteps, result);
166 vecField, ds, seedArray, stepSize, maxSteps, result);
172 template <
typename WorkletType,
177 static void DoAdvect(
const FieldType& vecField,
182 ResultType<ParticleType>& result)
188 SteadyStateGridEvalType eval(ds, vecField);
189 StepperType stepper(eval, stepSize);
190 result = worklet.Run(stepper, seedArray, maxSteps);
195 VTKM_CONT inline void DataSetIntegratorSteadyState::DoAdvect(DSIHelperInfo<vtkm::Particle>& b,
208 this->GetVelocityField(vecField);
210 using AHType = internal::AdvectHelper<internal::VelocityFieldType, vtkm::Particle>;
212 if (this->IsParticleAdvectionResult())
216 vecField, this->DataSet, seedArray, stepSize, maxSteps, this->SolverType, result);
217 this->UpdateResult(result, b);
219 else if (this->IsStreamlineResult())
223 vecField, this->DataSet, seedArray, stepSize, maxSteps, this->SolverType, result);
224 this->UpdateResult(result, b);
233 VTKM_CONT inline void DataSetIntegratorSteadyState::DoAdvect(
234 DSIHelperInfo<vtkm::ChargedParticle>& b,
247 this->GetElectroMagneticField(ebField);
249 using AHType = internal::AdvectHelper<internal::EBFieldType, vtkm::ChargedParticle>;
251 if (this->IsParticleAdvectionResult())
255 ebField, this->DataSet, seedArray, stepSize, maxSteps, this->SolverType, result);
256 this->UpdateResult(result, b);
258 else if (this->IsStreamlineResult())
262 ebField, this->DataSet, seedArray, stepSize, maxSteps, this->SolverType, result);
263 this->UpdateResult(result, b);
277 #endif //vtk_m_filter_flow_internal_DataSetIntegratorSteadyState_h