1 #ifndef ABLATELIBRARY_COUPLEDPARTICLESOLVER_HPP
2 #define ABLATELIBRARY_COUPLEDPARTICLESOLVER_HPP
4 #include "particleSolver.hpp"
5 #include "processes/coupledProcess.hpp"
6 #include "solver/rhsFunction.hpp"
8 namespace ablate::particles {
16 inline static const char PreviousPackedSolution[] =
"PreviousPackedSolution";
30 CoupledParticleSolver(std::string solverId, std::shared_ptr<domain::Region>, std::shared_ptr<parameters::Parameters> options, std::vector<FieldDescription>
fields,
31 std::vector<std::shared_ptr<processes::Process>>
processes, std::shared_ptr<initializers::Initializer>
initializer,
33 const std::vector<std::string>& coupledFields = {});
46 CoupledParticleSolver(std::string solverId, std::shared_ptr<domain::Region>, std::shared_ptr<parameters::Parameters> options,
const std::vector<std::shared_ptr<FieldDescription>>&
fields,
47 std::vector<std::shared_ptr<processes::Process>>
processes, std::shared_ptr<initializers::Initializer>
initializer,
49 const std::vector<std::string>& = {});
55 void Setup()
override;
66 PetscErrorCode
PreRHSFunction(TS ts, PetscReal time,
bool initialStage, Vec locX)
override;
85 std::vector<std::shared_ptr<processes::CoupledProcess>> coupledProcesses;
88 std::vector<std::string> coupledFieldsNames;
91 std::vector<std::string> coupledParticleFieldsNames;
94 std::vector<ablate::domain::Field> coupledFields;
97 Vec localEulerianSourceVec{};
100 Vec localEulerianVolumeFactor{};
103 void ComputeEulerianSource(PetscReal startTime, PetscReal endTime);
Definition: coupledParticleSolver.hpp:14
void MacroStepParticles(TS macroTS, bool swarmMigrate) override
Definition: coupledParticleSolver.cpp:184
PetscErrorCode ComputeRHSFunction(PetscReal time, Vec locX, Vec locF) override
Definition: coupledParticleSolver.cpp:90
~CoupledParticleSolver() override
cleanup any petsc objects
Definition: coupledParticleSolver.cpp:25
void Setup() override
Definition: coupledParticleSolver.cpp:97
CoupledParticleSolver(std::string solverId, std::shared_ptr< domain::Region >, std::shared_ptr< parameters::Parameters > options, std::vector< FieldDescription > fields, std::vector< std::shared_ptr< processes::Process >> processes, std::shared_ptr< initializers::Initializer > initializer, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> fieldInitialization, std::vector< std::shared_ptr< mathFunctions::FieldFunction >> exactSolutions={}, const std::vector< std::string > &coupledFields={})
Definition: coupledParticleSolver.cpp:7
PetscErrorCode PreRHSFunction(TS ts, PetscReal time, bool initialStage, Vec locX) override
Definition: coupledParticleSolver.cpp:40
void Initialize() override
Definition: coupledParticleSolver.cpp:136
Definition: particleSolver.hpp:12
std::vector< std::shared_ptr< processes::Process > > processes
the processes that add source terms to the particle and domain ts
Definition: particleSolver.hpp:53
std::vector< Field > fields
all fields in the particle solver
Definition: particleSolver.hpp:47
const std::vector< std::shared_ptr< mathFunctions::FieldFunction > > exactSolutions
store the exact solution if provided
Definition: particleSolver.hpp:62
const std::vector< std::shared_ptr< mathFunctions::FieldFunction > > fieldInitialization
initialize other particle variables
Definition: particleSolver.hpp:59
std::shared_ptr< particles::initializers::Initializer > initializer
Store the particle location and field initialization.
Definition: particleSolver.hpp:56
Definition: rhsFunction.hpp:7