MPS-Basic
Loading...
Searching...
No Matches
pressure_poisson_equation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../particles.hpp"
5
6#include <Eigen/Sparse>
7#include <vector>
8
9namespace PressureCalculator {
10
15public:
17
19 int dimension,
20 double dt,
22 double compressibility,
24 double n0_forLaplacian,
25 double lambda0,
26 double reForLaplacian,
28 );
29
36 void setup(const Particles& particles, const DirichletBoundaryCondition& dirichletBoundaryCondition);
37
42 std::vector<double> solve();
43
44private:
46 double dt;
51 double lambda0;
55
56 std::vector<Eigen::Triplet<double>> matrixTriplets;
57 Eigen::SparseMatrix<double, Eigen::RowMajor>
59 Eigen::VectorXd sourceTerm;
60
61 void resetEquation();
62 void setSourceTerm(const Particles& particles, const DirichletBoundaryCondition& dirichletBoundaryCondition);
63 void setMatrixTriplets(const Particles& particles, const DirichletBoundaryCondition& dirichletBoundaryCondition);
64};
65
66} // namespace PressureCalculator
A collection of particles.
Definition particles.hpp:10
Class for setting up and solving pressure Poisson equation.
void setSourceTerm(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Set the source term for the pressure Poisson equation.
Eigen::SparseMatrix< double, Eigen::RowMajor > coefficientMatrix
Coefficient matrix for pressure Poisson equation.
std::vector< double > solve()
Solve pressure Poisson equation.
void setup(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Setup pressure Poisson equation.
void setMatrixTriplets(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Set the matrix triplets for the pressure Poisson equation.
Eigen::VectorXd sourceTerm
Source term for pressure Poisson equation.
std::vector< Eigen::Triplet< double > > matrixTriplets
Triplets for coefficient matrix.