Go to the documentation of this file.
18 #ifndef viskores_cont_CellSetStructured_h
19 #define viskores_cont_CellSetStructured_h
40 template <viskores::IdComponent DIMENSION>
41 class VISKORES_ALWAYS_EXPORT CellSetStructured final :
public CellSet
45 using InternalsType = viskores::internal::ConnectivityStructuredInternals<DIMENSION>;
68 this->Structure.SetPointDimensions(dimensions);
73 this->Structure.SetGlobalPointDimensions(dimensions);
78 this->Structure.SetGlobalPointIndexStart(start);
86 return this->Structure.GetGlobalPointDimensions();
95 return this->Structure.GetGlobalCellDimensions();
100 return this->Structure.GetGlobalPointIndexStart();
106 return this->Structure.GetNumberOfPointsInCell();
116 auto asVec = this->Structure.GetPointsOfCell(
id);
125 return std::make_shared<CellSetStructured>();
136 this->Structure = other->Structure;
139 template <
typename TopologyElement>
143 return this->Structure.GetSchedulingRange(TopologyElement());
146 template <
typename VisitTopology,
typename Inc
identTopology>
147 using ExecConnectivityType =
164 template <
typename VisitTopology,
typename Inc
identTopology>
167 VisitTopology visitTopology,
168 IncidentTopology incidentTopology,
173 (void)incidentTopology;
180 out <<
" StructuredCellSet:\n";
181 this->Structure.PrintSummary(out);
193 , Structure(src.Structure)
205 , Structure(std::move(src.Structure))
211 this->Structure = std::move(src.Structure);
219 #ifndef viskores_cont_CellSetStructured_cxx
235 template <viskores::IdComponent DIMENSION>
236 struct SerializableTypeString<viskores::cont::CellSetStructured<DIMENSION>>
240 static std::string name =
"CS_Structured<" + std::to_string(DIMENSION) +
">";
250 template <viskores::IdComponent DIMENSION>
251 struct Serialization<
viskores::cont::CellSetStructured<DIMENSION>>
257 static VISKORES_CONT void save(BinaryBuffer& bb,
const Type& cs)
259 viskoresdiy::save(bb, cs.GetPointDimensions());
260 viskoresdiy::save(bb, cs.GetGlobalPointDimensions());
261 viskoresdiy::save(bb, cs.GetGlobalPointIndexStart());
266 typename Type::SchedulingRangeType dims, gdims, start;
272 cs.SetPointDimensions(dims);
273 cs.SetGlobalPointDimensions(gdims);
274 cs.SetGlobalPointIndexStart(start);
281 #endif //viskores_cont_CellSetStructured_h
T load(const U &u, viskores::Id v)
Definition: FetchTagArrayDirectIn.h:44
viskores::Id GetNumberOfEdges() const override
Definition: CellSetStructured.h:60
viskores::internal::ConnectivityStructuredInternals< DIMENSION > InternalsType
Definition: CellSetStructured.h:45
typename InternalsType::SchedulingRangeType SchedulingRangeType
Definition: CellSetStructured.h:50
SchedulingRangeType GetCellDimensions() const
Get the dimensions of the cells.
Definition: CellSetStructured.h:91
CellSetStructured & operator=(CellSetStructured &&src) noexcept
Definition: CellSetStructured.h:209
void ReleaseResourcesExecution() override
Definition: CellSetStructured.h:63
void DeepCopy(const CellSet *src) override
Definition: CellSetStructured.h:128
This class is thrown when Viskores encounters data of a type that is incompatible with the current op...
Definition: ErrorBadType.h:33
CellSetStructured(const CellSetStructured &src)
Definition: CellSetStructured.h:191
void GetCellPointIds(viskores::Id id, viskores::Id *ptids) const override
Definition: CellSetStructured.h:114
CellSetStructured & operator=(const CellSetStructured &src)
Definition: CellSetStructured.h:197
#define viskoresNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:136
#define VISKORES_IS_TOPOLOGY_ELEMENT_TAG(type)
Definition: TopologyElementTag.h:100
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
ExecConnectivityType< VisitTopology, IncidentTopology > PrepareForInput(viskores::cont::DeviceAdapterId device, VisitTopology visitTopology, IncidentTopology incidentTopology, viskores::cont::Token &token) const
Prepares the data for a particular device and returns the execution object for it.
Definition: CellSetStructured.h:165
Definition: Particle.h:373
SchedulingRangeType GetSchedulingRange(TopologyElement) const
Definition: CellSetStructured.h:140
SchedulingRangeType GetPointDimensions() const
Get the dimensions of the points.
Definition: CellSetStructured.h:82
void PrintSummary(std::ostream &out) const override
Definition: CellSetStructured.h:178
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
CellSetStructured(CellSetStructured &&src) noexcept
Definition: CellSetStructured.h:203
viskores::IdComponent GetNumberOfPointsInCell(viskores::Id=0) const override
Definition: CellSetStructured.h:103
std::shared_ptr< CellSet > NewInstance() const override
Definition: CellSetStructured.h:123
SchedulingRangeType GetGlobalPointDimensions() const
Definition: CellSetStructured.h:84
SchedulingRangeType GetGlobalCellDimensions() const
Definition: CellSetStructured.h:93
viskores::Id GetNumberOfFaces() const override
Definition: CellSetStructured.h:58
viskores::UInt8 GetCellShape(viskores::Id=0) const override
Definition: CellSetStructured.h:109
viskores::Id GetNumberOfPoints() const override
Get the number of points in the topology.
Definition: CellSetStructured.h:56
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
Defines a 1-, 2-, or 3-dimensional structured grid of points.
Definition: CastAndCall.h:40
viskores::Id GetNumberOfCells() const override
Get the number of cells in the topology.
Definition: CellSetStructured.h:53
SchedulingRangeType GetGlobalPointIndexStart() const
Definition: CellSetStructured.h:98
void SetGlobalPointDimensions(SchedulingRangeType dimensions)
Definition: CellSetStructured.h:71
~CellSetStructured() override
Definition: CellSetStructured.h:187
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
void SetPointDimensions(SchedulingRangeType dimensions)
Set the dimensions of the structured array of points.
Definition: CellSetStructured.h:66
void SetGlobalPointIndexStart(SchedulingRangeType start)
Definition: CellSetStructured.h:76
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
A class holding information about topology connections.
Definition: ConnectivityStructured.h:38
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:36
InternalsType Structure
Definition: CellSetStructured.h:216