VTK-m
2.0
|
A Field
encapsulates an array on some piece of the mesh, such as the points, a cell set, a point logical dimension, or the whole mesh.
More...
#include <Field.h>
Public Types | |
enum | Association { Association::Any, Association::WholeDataSet, Association::Points, Association::Cells, Association::Partitions, Association::Global } |
Public Member Functions | |
VTKM_CONT | Field ()=default |
VTKM_CONT | Field (std::string name, Association association, const vtkm::cont::UnknownArrayHandle &data) |
template<typename T , typename Storage > | |
VTKM_CONT | Field (std::string name, Association association, const vtkm::cont::ArrayHandle< T, Storage > &data) |
Field (const vtkm::cont::Field &src) | |
Field (vtkm::cont::Field &&src) noexcept | |
virtual VTKM_CONT | ~Field () |
VTKM_CONT Field & | operator= (const vtkm::cont::Field &src) |
VTKM_CONT Field & | operator= (vtkm::cont::Field &&src) noexcept |
VTKM_CONT bool | IsCellField () const |
VTKM_CONT bool | IsPointField () const |
VTKM_CONT bool | IsWholeDataSetField () const |
VTKM_CONT bool | IsPartitionsField () const |
VTKM_CONT bool | IsGlobalField () const |
VTKM_CONT bool | IsSupportedType () const |
Returns true if the array of the field has a value type that matches something in VTKM_FIELD_TYPE_LIST and a storage that matches something in VTKM_FIELD_STORAGE_LIST . More... | |
VTKM_CONT vtkm::Id | GetNumberOfValues () const |
const VTKM_CONT std::string & | GetName () const |
VTKM_CONT Association | GetAssociation () const |
const vtkm::cont::UnknownArrayHandle & | GetData () const |
vtkm::cont::UnknownArrayHandle & | GetData () |
const VTKM_CONT vtkm::cont::ArrayHandle< vtkm::Range > & | GetRange () const |
VTKM_CONT void | GetRange (vtkm::Range *range) const |
VTKM_CONT vtkm::cont::UnknownArrayHandle | GetDataAsDefaultFloat () const |
Get the data as an array with vtkm::FloatDefault components. More... | |
VTKM_CONT vtkm::cont::UnknownArrayHandle | GetDataWithExpectedTypes () const |
Get the data as an array of an expected type. More... | |
VTKM_CONT void | ConvertToExpected () |
Convert this field to use an array of an expected type. More... | |
VTKM_CONT void | SetData (const vtkm::cont::UnknownArrayHandle &newdata) |
template<typename T , typename StorageTag > | |
VTKM_CONT void | SetData (const vtkm::cont::ArrayHandle< T, StorageTag > &newdata) |
virtual VTKM_CONT void | PrintSummary (std::ostream &out) const |
virtual VTKM_CONT void | ReleaseResourcesExecution () |
Private Attributes | |
std::string | Name |
name of field More... | |
Association | FieldAssociation = Association::Any |
vtkm::cont::UnknownArrayHandle | Data |
vtkm::cont::ArrayHandle< vtkm::Range > | Range |
bool | ModifiedFlag = true |
A Field
encapsulates an array on some piece of the mesh, such as the points, a cell set, a point logical dimension, or the whole mesh.
|
strong |
|
default |
VTKM_CONT vtkm::cont::Field::Field | ( | std::string | name, |
Association | association, | ||
const vtkm::cont::UnknownArrayHandle & | data | ||
) |
|
inline |
vtkm::cont::Field::Field | ( | const vtkm::cont::Field & | src | ) |
|
noexcept |
|
virtual |
VTKM_CONT void vtkm::cont::Field::ConvertToExpected | ( | ) |
Convert this field to use an array of an expected type.
Copies the internal data, as necessary, to an array that (probably) has a value type that matches something in VTKM_FIELD_TYPE_LIST
and a storage that matches something in VTKM_FIELD_STORAGE_LIST
. If the field already has a value type and storage that match VTKM_FIELD_TYPE_LIST
and VTKM_FIELD_STORAGE_LIST
respectively, then nothing in the field is changed. If something does not match, then the data are copied to a vtkm::cont::ArrayHandleBasic
with a value type component of vtkm::FloatDefault
.
Note that the returned array is likely to be compatible with VTKM_FIELD_TYPE_LIST
, but not guaranteed. In particular, if this field contains Vec
s, the returned array will also contain Vec
s of the same size. For example, if the field contains vtkm::Vec2i_16
values, they will (likely) be converted to vtkm::Vec2f
. Howver, vtkm::Vec2f
may still not be in VTKM_FIELD_TYPE_LIST
.
|
inline |
vtkm::cont::UnknownArrayHandle& vtkm::cont::Field::GetData | ( | ) |
const vtkm::cont::UnknownArrayHandle& vtkm::cont::Field::GetData | ( | ) | const |
VTKM_CONT vtkm::cont::UnknownArrayHandle vtkm::cont::Field::GetDataAsDefaultFloat | ( | ) | const |
Get the data as an array with vtkm::FloatDefault
components.
Returns a vtkm::cont::UnknownArrayHandle
that contains an array that either contains values of type vtkm::FloatDefault
or contains Vec
s with components of type vtkm::FloatDefault
. If the array has value types that do not match this type, then it will be copied into an array that does.
Additionally, the returned array will have a storage that is compatible with something in VTKM_FIELD_STORAGE_LIST
. If this condition is not met, then the array will be copied.
If the array contained in the field already matches the required criteria, the array will be returned without copying.
VTKM_CONT vtkm::cont::UnknownArrayHandle vtkm::cont::Field::GetDataWithExpectedTypes | ( | ) | const |
Get the data as an array of an expected type.
Returns a vtkm::cont::UnknownArrayHandle
that contains an array that (probably) has a value type that matches something in VTKM_FIELD_TYPE_LIST
and a storage that matches something in VTKM_FIELD_STORAGE_LIST
. If the array has a value type and storage that match VTKM_FIELD_TYPE_LIST
and VTKM_FIELD_STORAGE_LIST
respectively, then the same array is returned. If something does not match, then the data are copied to a vtkm::cont::ArrayHandleBasic
with a value type component of vtkm::FloatDefault
.
Note that the returned array is likely to be compatible with VTKM_FIELD_TYPE_LIST
, but not guaranteed. In particular, if this field contains Vec
s, the returned array will also contain Vec
s of the same size. For example, if the field contains vtkm::Vec2i_16
values, they will (likely) be converted to vtkm::Vec2f
. Howver, vtkm::Vec2f
may still not be in VTKM_FIELD_TYPE_LIST
.
|
inline |
const VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range>& vtkm::cont::Field::GetRange | ( | ) | const |
VTKM_CONT void vtkm::cont::Field::GetRange | ( | vtkm::Range * | range | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
VTKM_CONT bool vtkm::cont::Field::IsSupportedType | ( | ) | const |
Returns true if the array of the field has a value type that matches something in VTKM_FIELD_TYPE_LIST
and a storage that matches something in VTKM_FIELD_STORAGE_LIST
.
|
inline |
VTKM_CONT Field& vtkm::cont::Field::operator= | ( | const vtkm::cont::Field & | src | ) |
|
noexcept |
|
virtual |
Reimplemented in vtkm::cont::CoordinateSystem.
|
inlinevirtual |
Reimplemented in vtkm::cont::CoordinateSystem.
|
inline |
VTKM_CONT void vtkm::cont::Field::SetData | ( | const vtkm::cont::UnknownArrayHandle & | newdata | ) |
|
private |
|
private |
|
mutableprivate |
|
private |
name of field
|
mutableprivate |