1 #ifndef ABLATELIBRARY_SWARMACCESSOR_HPP
2 #define ABLATELIBRARY_SWARMACCESSOR_HPP
6 #include "accessor.hpp"
7 #include "particles/field.hpp"
8 #include "utilities/petscUtilities.hpp"
10 namespace ablate::particles::accessors {
20 const std::map<std::string, Field>& fieldsMap;
26 const PetscScalar* solutionValues{};
29 SwarmAccessor(
bool cachePointData,
const DM& swarmDm,
const std::map<std::string, Field>& fieldsMap, Vec solutionVec)
30 :
Accessor(cachePointData), swarmDm(swarmDm), fieldsMap(fieldsMap), solutionVec(solutionVec) {
59 const auto& field = fieldsMap.at(fieldName);
60 if (field.location == domain::FieldLocation::SOL) {
61 return {solutionValues, field};
69 const std::string name = field.name;
73 return {values, field};
Definition: accessor.hpp:17
void RegisterCleanupFunction(const std::function< void()> &function)
Definition: accessor.hpp:78
Definition: swarmAccessor.hpp:14
SwarmAccessor(const SwarmAccessor &)=delete
PetscInt GetNumberParticles() const
Definition: swarmAccessor.hpp:41
ConstPointData CreateData(const std::string &fieldName) override
Definition: swarmAccessor.hpp:58
static utilities::PetscUtilities::ErrorChecker checkError
Definition: petscUtilities.hpp:46
Definition: pointData.hpp:14