1 #ifndef ABLATELIBRARY_POINTDATA_HPP
2 #define ABLATELIBRARY_POINTDATA_HPP
6 #include "particles/field.hpp"
7 #include "utilities/petscUtilities.hpp"
9 namespace ablate::particles::accessors {
13 template <
class DataType>
52 template <
class IndexType>
63 template <
class IndexType>
74 template <
class IndexType,
class DimType>
75 inline DataType&
operator()(IndexType particle, DimType dim) {
85 template <
class DestinationDataType,
class IndexType>
86 inline void CopyFrom(DestinationDataType* source, IndexType p)
const {
98 template <
class DestinationDataType,
class IndexType>
99 inline void AddFrom(DestinationDataType* source, IndexType p)
const {
111 template <
class DestinationDataType,
class IndexType>
112 inline void CopyAll(DestinationDataType* destination, IndexType np)
const {
113 for (IndexType p = 0; p < np; p++) {
124 using ConstPointData = Data<const PetscReal>;
125 using PointData = Data<PetscReal>;
Definition: pointData.hpp:14
DataType & operator()(IndexType particle)
Definition: pointData.hpp:64
PetscInt numberComponents
The number of the components.
Definition: pointData.hpp:19
void CopyFrom(DestinationDataType *source, IndexType p) const
Definition: pointData.hpp:86
void CopyAll(DestinationDataType *destination, IndexType np) const
Definition: pointData.hpp:112
Data(DataType *values, PetscInt numberComponents, PetscInt dataSizeIn=0, PetscInt offset=0)
Definition: pointData.hpp:39
PetscInt dataSize
The size of the component for this data.
Definition: pointData.hpp:22
DataType * values
the array for the solution values
Definition: pointData.hpp:16
DataType & operator()(IndexType particle, DimType dim)
Definition: pointData.hpp:75
Data(DataType *values, const ablate::particles::Field &field)
Definition: pointData.hpp:49
PetscInt offset
The offset in the local array, 0 for aux, computed for sol.
Definition: pointData.hpp:25
void AddFrom(DestinationDataType *source, IndexType p) const
Definition: pointData.hpp:99
DataType * operator[](IndexType particle) const
Inline function to compute the memory address at this particle.
Definition: pointData.hpp:53