1 #ifndef ABLATELIBRARY_EULERIANSOURCEACCESSOR_HPP
2 #define ABLATELIBRARY_EULERIANSOURCEACCESSOR_HPP
6 #include "accessor.hpp"
7 #include "domain/subDomain.hpp"
8 #include "particles/field.hpp"
9 #include "swarmAccessor.hpp"
10 #include "utilities/petscUtilities.hpp"
12 namespace ablate::particles::accessors {
20 inline static const char CoupledSourceTermPostfix[] =
"_CoupledSourceTerm";
27 const std::map<std::string, Field>& fieldsMap;
30 EulerianSourceAccessor(
bool cachePointData,
const DM& swarmDm,
const std::map<std::string, Field>& fieldsMap) :
Accessor(cachePointData), swarmDm(swarmDm), fieldsMap(fieldsMap) {}
38 const auto& field = fieldsMap.at(fieldName + CoupledSourceTermPostfix);
39 if (field.location == domain::FieldLocation::SOL) {
40 throw std::invalid_argument(
"Eulerian Source Fields should not be SOL fields");
48 const std::string name = field.name;
52 return {values, field};
Definition: accessor.hpp:17
void RegisterCleanupFunction(const std::function< void()> &function)
Definition: accessor.hpp:78
Definition: eulerianSourceAccessor.hpp:17
PointData CreateData(const std::string &fieldName) override
Definition: eulerianSourceAccessor.hpp:37
EulerianSourceAccessor(const EulerianSourceAccessor &)=delete
static utilities::PetscUtilities::ErrorChecker checkError
Definition: petscUtilities.hpp:46
Definition: pointData.hpp:14