Go to the documentation of this file.
18 #ifndef viskores_cont_Field_h
19 #define viskores_cont_Field_h
39 class VISKORES_CONT_EXPORT
Field
108 template <
typename T,
typename Storage>
131 return this->FieldAssociation == Association::WholeDataSet;
136 return this->FieldAssociation == Association::Partitions;
228 template <
typename T,
typename StorageTag>
236 virtual void PrintSummary(std::ostream& out,
bool full =
false)
const;
242 this->Data.ReleaseResourcesExecution();
243 this->
Range.ReleaseResourcesExecution();
252 mutable bool ModifiedFlag =
true;
255 template <
typename Functor,
typename... Args>
259 field.
GetData(), std::forward<Functor>(f), std::forward<Args>(args)...);
264 template <
typename T>
276 template <
typename T>
279 const std::vector<T>& data,
285 template <
typename T>
288 std::vector<T>&& data)
294 template <
typename T>
297 std::vector<T>&& data,
303 template <
typename T>
306 std::initializer_list<T>&& data)
314 template <
typename T,
typename S>
329 template <
typename T,
typename S>
355 struct DynamicTransformTraits<
viskores::cont::Field>
357 using DynamicTag = viskores::cont::internal::DynamicTransformTagCastAndCall;
371 struct VISKORES_CONT_EXPORT Serialization<
viskores::cont::Field>
380 #endif //viskores_cont_Field_h
T load(const U &u, viskores::Id v)
Definition: FetchTagArrayDirectIn.h:44
Association GetAssociation() const
Return the association of the field.
Definition: Field.h:153
viskores::cont::Field make_FieldMove(std::string name, Field::Association association, std::vector< T > &&data)
Definition: Field.h:286
viskores::cont::UnknownArrayHandle Data
Definition: Field.h:250
bool IsPartitionsField() const
Return true if this field is associated with partitions in a partitioned data set.
Definition: Field.h:134
bool IsGlobalField() const
Return true if this field is global.
Definition: Field.h:141
viskores::cont::Field make_FieldCell(std::string name, const viskores::cont::ArrayHandle< T, S > &data)
Convenience function to build cell fields from viskores::cont::ArrayHandle.
Definition: Field.h:330
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:46
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:55
Field(std::string name, Association association, const viskores::cont::ArrayHandle< T, Storage > &data)
Create a field with the given name, association, and data.
Definition: Field.h:109
#define viskoresNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:136
const viskores::cont::UnknownArrayHandle & GetData() const
Get the array of the data for the field.
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::cont::ArrayHandleBasic< T > make_ArrayHandleMove(T *&array, viskores::Id numberOfValues, viskores::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, viskores::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandle.
Definition: ArrayHandleBasic.h:310
@ Cells
A field that applies to cells.
Definition: Particle.h:373
bool IsPointField() const
Return true if this field is associated with points.
Definition: Field.h:127
viskores::cont::Field make_FieldPoint(std::string name, const viskores::cont::ArrayHandle< T, S > &data)
Convenience function to build point fields from viskores::cont::ArrayHandle.
Definition: Field.h:315
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
Groups connected points that have the same field value.
Definition: Atomic.h:27
void SetData(const viskores::cont::ArrayHandle< T, StorageTag > &newdata)
Definition: Field.h:229
viskores::cont::Field make_Field(std::string name, Field::Association association, const T *data, viskores::Id size, viskores::CopyFlag copy)
Convenience functions to build fields from C style arrays and std::vector.
Definition: Field.h:266
virtual void ReleaseResourcesExecution()
Remove the data from the device memory (but preserve the data on the host).
Definition: Field.h:240
viskores::cont::ArrayHandle< viskores::Range > Range
Definition: Field.h:251
const std::string & GetName() const
Return the name of the field.
Definition: Field.h:151
Represent a continuous scalar range of values.
Definition: Range.h:39
viskores::Id GetNumberOfValues() const
Return the number of values in the field array.
Definition: Field.h:148
std::string Name
name of field
Definition: Field.h:247
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:451
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:25
bool IsCellField() const
Return true if this field is associated with cells.
Definition: Field.h:125
@ Points
A field that applies to points.
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:39
viskores::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, viskores::Id numberOfValues, viskores::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:285
bool IsWholeDataSetField() const
Return true if this field is associated with the whole data set.
Definition: Field.h:129