-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdirectSolverGive.inl
More file actions
28 lines (24 loc) · 1.35 KB
/
directSolverGive.inl
File metadata and controls
28 lines (24 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#ifdef GMGPOLAR_USE_MUMPS
template <concepts::DomainGeometry DomainGeometry>
DirectSolver_COO_MUMPS_Give<DomainGeometry>::DirectSolver_COO_MUMPS_Give(
const PolarGrid& grid, const LevelCache<DomainGeometry>& level_cache, const DomainGeometry& domain_geometry,
const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, int num_omp_threads)
: DirectSolver<DomainGeometry>(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior,
num_omp_threads)
, mumps_solver_(buildSolverMatrix())
{
}
template <concepts::DomainGeometry DomainGeometry>
void DirectSolver_COO_MUMPS_Give<DomainGeometry>::solveInPlace(Vector<double> solution)
{
// Adjusts the right-hand side vector to account for symmetry corrections.
// This transforms the system matrixA * solution = rhs into the equivalent system:
// symmetric_DBc(matrixA) * solution = rhs - applySymmetryShift(rhs).
// The correction modifies the rhs to account for the influence of the Dirichlet boundary conditions,
// ensuring that the solution at the boundary is correctly adjusted and maintains the required symmetry.
applySymmetryShift(solution);
// Solves the adjusted system symmetric(matrixA) * solution = rhs using the MUMPS solver.
mumps_solver_.solveInPlace(solution);
}
#endif