Go to the documentation of this file.
10 #ifndef vtk_m_cont_Field_h
11 #define vtk_m_cont_Field_h
100 template <
typename T,
typename Storage>
123 return this->FieldAssociation == Association::WholeDataSet;
128 return this->FieldAssociation == Association::Partitions;
220 template <
typename T,
typename StorageTag>
228 virtual void PrintSummary(std::ostream& out,
bool full =
false)
const;
234 this->Data.ReleaseResourcesExecution();
235 this->
Range.ReleaseResourcesExecution();
244 mutable bool ModifiedFlag =
true;
247 template <
typename Functor,
typename... Args>
255 template <
typename T>
266 template <
typename T>
269 const std::vector<T>& data,
275 template <
typename T>
278 std::vector<T>&& data)
283 template <
typename T>
286 std::vector<T>&& data,
292 template <
typename T>
295 std::initializer_list<T>&& data)
303 template <
typename T,
typename S>
317 template <
typename T,
typename S>
342 struct DynamicTransformTraits<
vtkm::cont::Field>
344 using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
367 #endif //vtk_m_cont_Field_h
Manages an array-worth of data.
Definition: ArrayHandle.h:300
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Groups connected points that have the same field value.
Definition: Atomic.h:19
bool IsCellField() const
Return true if this field is associated with cells.
Definition: Field.h:117
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:38
vtkm::cont::Field make_Field(std::string name, Field::Association association, const T *data, vtkm::Id size, vtkm::CopyFlag copy)
Convenience functions to build fields from C style arrays and std::vector.
Definition: Field.h:257
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
vtkm::cont::ArrayHandle< vtkm::Range > Range
Definition: Field.h:243
vtkm::cont::ArrayHandleBasic< T > make_ArrayHandleMove(T *&array, vtkm::Id numberOfValues, vtkm::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, vtkm::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandle.
Definition: ArrayHandleBasic.h:294
std::string Name
name of field
Definition: Field.h:239
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:47
bool IsPartitionsField() const
Return true if this field is associated with partitions in a partitioned data set.
Definition: Field.h:126
Definition: Particle.h:351
const vtkm::cont::UnknownArrayHandle & GetData() const
Get the array of the data for the field.
Field(std::string name, Association association, const vtkm::cont::ArrayHandle< T, Storage > &data)
Create a field with the given name, association, and data.
Definition: Field.h:101
vtkm::cont::UnknownArrayHandle Data
Definition: Field.h:242
vtkm::cont::Field make_FieldCell(std::string name, const vtkm::cont::ArrayHandle< T, S > &data)
Convenience function to build cell fields from vtkm::cont::ArrayHandle.
Definition: Field.h:318
virtual void ReleaseResourcesExecution()
Remove the data from the device memory (but preserve the data on the host).
Definition: Field.h:232
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
@ Points
A field that applies to points.
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
bool IsGlobalField() const
Return true if this field is global.
Definition: Field.h:133
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
const std::string & GetName() const
Return the name of the field.
Definition: Field.h:143
bool IsWholeDataSetField() const
Return true if this field is associated with the whole data set.
Definition: Field.h:121
bool IsPointField() const
Return true if this field is associated with points.
Definition: Field.h:119
void SetData(const vtkm::cont::ArrayHandle< T, StorageTag > &newdata)
Definition: Field.h:221
@ Cells
A field that applies to cells.
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:17
vtkm::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, vtkm::Id numberOfValues, vtkm::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:270
vtkm::cont::Field make_FieldMove(std::string name, Field::Association association, std::vector< T > &&data)
Definition: Field.h:276
vtkm::cont::Field make_FieldPoint(std::string name, const vtkm::cont::ArrayHandle< T, S > &data)
Convenience function to build point fields from vtkm::cont::ArrayHandle.
Definition: Field.h:304
Association GetAssociation() const
Return the association of the field.
Definition: Field.h:145
vtkm::Id GetNumberOfValues() const
Return the number of values in the field array.
Definition: Field.h:140
Represent a continuous scalar range of values.
Definition: Range.h:31