1 #ifndef ABLATELIBRARY_RHSACCESSOR_HPP
2 #define ABLATELIBRARY_RHSACCESSOR_HPP
6 #include "accessor.hpp"
7 #include "particles/field.hpp"
8 #include "utilities/petscUtilities.hpp"
10 namespace ablate::particles::accessors {
17 const std::map<std::string, Field>& fieldsMap;
23 PetscScalar* rhsValues{};
26 RhsAccessor(
bool cachePointData,
const std::map<std::string, Field>& fieldsMap, Vec rhsVec) :
Accessor(cachePointData), fieldsMap(fieldsMap), rhsVec(rhsVec) {
43 const auto& field = fieldsMap.at(fieldName);
44 if (field.location == domain::FieldLocation::SOL) {
45 return {rhsValues, field};
47 throw std::invalid_argument(
"The field " + std::string(fieldName) +
" is not a solution variable");
49 }
catch (std::exception& exception) {
50 throw std::invalid_argument(
"Unable to locate particle field " + fieldName);
Definition: accessor.hpp:17
Definition: rhsAccessor.hpp:14
RhsAccessor(const RhsAccessor &)=delete
~RhsAccessor() override
Definition: rhsAccessor.hpp:34
PointData CreateData(const std::string &fieldName) override
Definition: rhsAccessor.hpp:41
static utilities::PetscUtilities::ErrorChecker checkError
Definition: petscUtilities.hpp:46
Definition: pointData.hpp:14