ABLATE Source Documentation  0.12.34
arbitrarySource.hpp
1 #ifndef ABLATELIBRARY_ARBITRARYSOURCE_HPP
2 #define ABLATELIBRARY_ARBITRARYSOURCE_HPP
3 
4 #include "process.hpp"
5 namespace ablate::finiteVolume::processes {
9 class ArbitrarySource : public Process {
11  const std::map<std::string, std::shared_ptr<ablate::mathFunctions::MathFunction>> functions;
12 
17  static PetscErrorCode ComputeArbitrarySource(PetscInt dim, PetscReal time, const PetscFVCellGeom* cg, const PetscInt uOff[], const PetscScalar u[], const PetscInt aOff[], const PetscScalar a[],
18  PetscScalar f[], void* ctx);
19 
21  struct PetscFunctionStruct {
22  mathFunctions::PetscFunction petscFunction;
23  void* petscContext;
24  PetscInt fieldSize;
25  };
26 
28  std::vector<PetscFunctionStruct> petscFunctions;
29 
30  public:
31  explicit ArbitrarySource(std::map<std::string, std::shared_ptr<ablate::mathFunctions::MathFunction>> functions);
32 
37  void Setup(ablate::finiteVolume::FiniteVolumeSolver& fvmSolver) override;
38 };
39 
40 } // namespace ablate::finiteVolume::processes
41 
42 #endif // ABLATELIBRARY_ARBITRARYSOURCE_HPP
Definition: finiteVolumeSolver.hpp:28
Definition: arbitrarySource.hpp:9
void Setup(ablate::finiteVolume::FiniteVolumeSolver &fvmSolver) override
Definition: arbitrarySource.cpp:5