ABLATE Source Documentation  0.12.34
finiteElementSolver.hpp
1 #ifndef ABLATELIBRARY_FINITEELEMENTSOLVER_HPP
2 #define ABLATELIBRARY_FINITEELEMENTSOLVER_HPP
3 
4 #include <solver/timeStepper.hpp>
5 #include <string>
6 #include <vector>
7 #include "boundaryConditions/boundaryCondition.hpp"
8 #include "eos/eos.hpp"
9 #include "mathFunctions/fieldFunction.hpp"
10 #include "solver/solver.hpp"
11 
12 namespace ablate::finiteElement {
13 
15  private:
16  const std::vector<std::shared_ptr<boundaryConditions::BoundaryCondition>> boundaryConditions;
17  const std::vector<std::shared_ptr<mathFunctions::FieldFunction>> auxiliaryFieldsUpdaters;
18 
19  public:
20  FiniteElementSolver(std::string solverId, std::shared_ptr<domain::Region> region, std::shared_ptr<parameters::Parameters> options,
21  std::vector<std::shared_ptr<boundaryConditions::BoundaryCondition>> boundaryConditions, std::vector<std::shared_ptr<mathFunctions::FieldFunction>> auxiliaryFields);
22 
24  void Register(std::shared_ptr<ablate::domain::SubDomain> subDomain) override;
25  void Setup() override;
26  void Initialize() override;
27 
28  virtual void CompleteFlowInitialization(DM, Vec) = 0;
29 
33  static void UpdateAuxFields(TS ts, FiniteElementSolver& fe);
34 
36  PetscErrorCode ComputeIFunction(PetscReal time, Vec locX, Vec locX_t, Vec locF) override;
37  PetscErrorCode ComputeIJacobian(PetscReal time, Vec locX, Vec locX_t, PetscReal X_tShift, Mat Jac, Mat JacP) override;
38  PetscErrorCode ComputeBoundary(PetscReal time, Vec locX, Vec locX_t) override;
39 };
40 } // namespace ablate::finiteElement
41 
42 #endif // ABLATELIBRARY_FINITEVOLUME_HPP
Definition: finiteElementSolver.hpp:14
PetscErrorCode ComputeIFunction(PetscReal time, Vec locX, Vec locX_t, Vec locF) override
Definition: finiteElementSolver.cpp:88
void Register(std::shared_ptr< ablate::domain::SubDomain > subDomain) override
Definition: finiteElementSolver.cpp:33
void Setup() override
Definition: finiteElementSolver.cpp:35
static void UpdateAuxFields(TS ts, FiniteElementSolver &fe)
Definition: finiteElementSolver.cpp:62
Definition: boundaryFunction.hpp:8
Definition: iFunction.hpp:6
Definition: solver.hpp:17