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
"
4
#include "
dirichlet_boundary_condition.hpp
"
5
6
#include <Eigen/Sparse>
7
#include <vector>
8
9
namespace
PressureCalculator
{
10
14
class
PressurePoissonEquation
{
15
public
:
16
PressurePoissonEquation
() =
default
;
17
18
PressurePoissonEquation
(
19
int
dimension
,
20
double
dt
,
21
double
relaxationCoefficient
,
22
double
compressibility
,
23
double
n0_forNumberDensity
,
24
double
n0_forLaplacian
,
25
double
lambda0
,
26
double
reForLaplacian
,
27
double
reForNumberDensity
28
);
29
36
void
setup
(
const
Particles
& particles,
const
DirichletBoundaryCondition
& dirichletBoundaryCondition);
37
42
std::vector<double>
solve
();
43
44
private
:
45
int
dimension
;
46
double
dt
;
47
double
relaxationCoefficient
;
48
double
compressibility
;
49
double
n0_forNumberDensity
;
50
double
n0_forLaplacian
;
51
double
lambda0
;
52
double
reForLaplacian
;
53
double
reForNumberDensity
;
54
size_t
particlesCount
;
55
56
std::vector<Eigen::Triplet<double>>
matrixTriplets
;
57
Eigen::SparseMatrix<double, Eigen::RowMajor>
58
coefficientMatrix
;
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
Particles
A collection of particles.
Definition
particles.hpp:10
PressureCalculator::DirichletBoundaryCondition
Dirichlet boundary condition.
Definition
dirichlet_boundary_condition.hpp:14
PressureCalculator::PressurePoissonEquation
Class for setting up and solving pressure Poisson equation.
Definition
pressure_poisson_equation.hpp:14
PressureCalculator::PressurePoissonEquation::relaxationCoefficient
double relaxationCoefficient
Definition
pressure_poisson_equation.hpp:47
PressureCalculator::PressurePoissonEquation::lambda0
double lambda0
Definition
pressure_poisson_equation.hpp:51
PressureCalculator::PressurePoissonEquation::reForLaplacian
double reForLaplacian
Definition
pressure_poisson_equation.hpp:52
PressureCalculator::PressurePoissonEquation::compressibility
double compressibility
Definition
pressure_poisson_equation.hpp:48
PressureCalculator::PressurePoissonEquation::reForNumberDensity
double reForNumberDensity
Definition
pressure_poisson_equation.hpp:53
PressureCalculator::PressurePoissonEquation::setSourceTerm
void setSourceTerm(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Set the source term for the pressure Poisson equation.
Definition
pressure_poisson_equation.cpp:73
PressureCalculator::PressurePoissonEquation::coefficientMatrix
Eigen::SparseMatrix< double, Eigen::RowMajor > coefficientMatrix
Coefficient matrix for pressure Poisson equation.
Definition
pressure_poisson_equation.hpp:58
PressureCalculator::PressurePoissonEquation::dt
double dt
Definition
pressure_poisson_equation.hpp:46
PressureCalculator::PressurePoissonEquation::resetEquation
void resetEquation()
Definition
pressure_poisson_equation.cpp:61
PressureCalculator::PressurePoissonEquation::solve
std::vector< double > solve()
Solve pressure Poisson equation.
Definition
pressure_poisson_equation.cpp:42
PressureCalculator::PressurePoissonEquation::PressurePoissonEquation
PressurePoissonEquation()=default
PressureCalculator::PressurePoissonEquation::setup
void setup(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Setup pressure Poisson equation.
Definition
pressure_poisson_equation.cpp:31
PressureCalculator::PressurePoissonEquation::dimension
int dimension
Definition
pressure_poisson_equation.hpp:45
PressureCalculator::PressurePoissonEquation::setMatrixTriplets
void setMatrixTriplets(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Set the matrix triplets for the pressure Poisson equation.
Definition
pressure_poisson_equation.cpp:99
PressureCalculator::PressurePoissonEquation::particlesCount
size_t particlesCount
Definition
pressure_poisson_equation.hpp:54
PressureCalculator::PressurePoissonEquation::sourceTerm
Eigen::VectorXd sourceTerm
Source term for pressure Poisson equation.
Definition
pressure_poisson_equation.hpp:59
PressureCalculator::PressurePoissonEquation::n0_forLaplacian
double n0_forLaplacian
Definition
pressure_poisson_equation.hpp:50
PressureCalculator::PressurePoissonEquation::matrixTriplets
std::vector< Eigen::Triplet< double > > matrixTriplets
Triplets for coefficient matrix.
Definition
pressure_poisson_equation.hpp:56
PressureCalculator::PressurePoissonEquation::n0_forNumberDensity
double n0_forNumberDensity
Definition
pressure_poisson_equation.hpp:49
dirichlet_boundary_condition.hpp
PressureCalculator
Definition
dirichlet_boundary_condition.hpp:5
particles.hpp
src
pressure_calculator
pressure_poisson_equation.hpp
Generated by
1.12.0