Skip to content

Commit fe4579d

Browse files
committed
Rename DirectSolver classes
1 parent 05c809e commit fe4579d

File tree

25 files changed

+197
-193
lines changed

25 files changed

+197
-193
lines changed

include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
#include "dmumps_c.h"
88
#include "mpi.h"
99

10-
class DirectSolverGive : public DirectSolver
10+
class DirectSolver_COO_MUMPS_Give : public DirectSolver
1111
{
1212
public:
13-
explicit DirectSolverGive(const PolarGrid& grid, const LevelCache& level_cache,
14-
const DomainGeometry& domain_geometry,
15-
const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior,
16-
int num_omp_threads);
13+
explicit DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, const LevelCache& level_cache,
14+
const DomainGeometry& domain_geometry,
15+
const DensityProfileCoefficients& density_profile_coefficients,
16+
bool DirBC_Interior, int num_omp_threads);
1717

18-
~DirectSolverGive() override;
18+
~DirectSolver_COO_MUMPS_Give() override;
1919
// Note: The rhs (right-hand side) vector gets overwritten during the solution process.
2020
void solveInPlace(Vector<double> solution) override;
2121

include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
#include "dmumps_c.h"
88
#include "mpi.h"
99

10-
class DirectSolverTake : public DirectSolver
10+
class DirectSolver_COO_MUMPS_Take : public DirectSolver
1111
{
1212
public:
13-
explicit DirectSolverTake(const PolarGrid& grid, const LevelCache& level_cache,
14-
const DomainGeometry& domain_geometry,
15-
const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior,
16-
int num_omp_threads);
13+
explicit DirectSolver_COO_MUMPS_Take(const PolarGrid& grid, const LevelCache& level_cache,
14+
const DomainGeometry& domain_geometry,
15+
const DensityProfileCoefficients& density_profile_coefficients,
16+
bool DirBC_Interior, int num_omp_threads);
1717

18-
~DirectSolverTake() override;
18+
~DirectSolver_COO_MUMPS_Take() override;
1919
// Note: The rhs (right-hand side) vector gets overwritten during the solution process.
2020
void solveInPlace(Vector<double> solution) override;
2121

include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGiveCustomLU.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#include "../directSolver.h"
44
#include <Kokkos_Core.hpp>
55

6-
class DirectSolverGiveCustomLU : public DirectSolver
6+
class DirectSolver_CSR_LU_Give : public DirectSolver
77
{
88
public:
9-
explicit DirectSolverGiveCustomLU(const PolarGrid& grid, const LevelCache& level_cache,
9+
explicit DirectSolver_CSR_LU_Give(const PolarGrid& grid, const LevelCache& level_cache,
1010
const DomainGeometry& domain_geometry,
1111
const DensityProfileCoefficients& density_profile_coefficients,
1212
bool DirBC_Interior, int num_omp_threads);
1313

14-
~DirectSolverGiveCustomLU() override;
14+
~DirectSolver_CSR_LU_Give() override;
1515
// Note: The rhs (right-hand side) vector gets overwritten with the solution.
1616
void solveInPlace(Vector<double> solution) override;
1717

include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTakeCustomLU.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
#include "../directSolver.h"
44

5-
class DirectSolverTakeCustomLU : public DirectSolver
5+
class DirectSolver_CSR_LU_Take : public DirectSolver
66
{
77
public:
8-
explicit DirectSolverTakeCustomLU(const PolarGrid& grid, const LevelCache& level_cache,
8+
explicit DirectSolver_CSR_LU_Take(const PolarGrid& grid, const LevelCache& level_cache,
99
const DomainGeometry& domain_geometry,
1010
const DensityProfileCoefficients& density_profile_coefficients,
1111
bool DirBC_Interior, int num_omp_threads);
1212

13-
~DirectSolverTakeCustomLU() override;
13+
~DirectSolver_CSR_LU_Take() override;
1414
// Note: The rhs (right-hand side) vector gets overwritten with the solution.
1515
void solveInPlace(Vector<double> solution) override;
1616

src/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/* Boundary Symmetry Shift */
1111
/* ----------------------- */
1212

13-
void DirectSolverGive::applySymmetryShiftInnerBoundary(Vector<double> x) const
13+
void DirectSolver_COO_MUMPS_Give::applySymmetryShiftInnerBoundary(Vector<double> x) const
1414
{
1515
assert(DirBC_Interior_);
1616

@@ -67,7 +67,7 @@ void DirectSolverGive::applySymmetryShiftInnerBoundary(Vector<double> x) const
6767
}
6868
}
6969

70-
void DirectSolverGive::applySymmetryShiftOuterBoundary(Vector<double> x) const
70+
void DirectSolver_COO_MUMPS_Give::applySymmetryShiftOuterBoundary(Vector<double> x) const
7171
{
7272
int i_r;
7373
double r;
@@ -123,7 +123,7 @@ void DirectSolverGive::applySymmetryShiftOuterBoundary(Vector<double> x) const
123123
}
124124

125125
// clang-format off
126-
void DirectSolverGive::applySymmetryShift(Vector<double> x) const
126+
void DirectSolver_COO_MUMPS_Give::applySymmetryShift(Vector<double> x) const
127127
{
128128
assert(std::ssize(x) == grid_.numberOfNodes());
129129
assert(grid_.nr() >= 4);

src/DirectSolver/DirectSolver-COO-MUMPS-Give/buildSolverMatrix.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@
765765
} \
766766
} while (0)
767767

768-
void DirectSolverGive::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO<double>& solver_matrix)
768+
void DirectSolver_COO_MUMPS_Give::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO<double>& solver_matrix)
769769
{
770770
const double r = grid_.radius(i_r);
771771
for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) {
@@ -781,7 +781,8 @@ void DirectSolverGive::buildSolverMatrixCircleSection(const int i_r, SparseMatri
781781
}
782782
}
783783

784-
void DirectSolverGive::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO<double>& solver_matrix)
784+
void DirectSolver_COO_MUMPS_Give::buildSolverMatrixRadialSection(const int i_theta,
785+
SparseMatrixCOO<double>& solver_matrix)
785786
{
786787
const double theta = grid_.theta(i_theta);
787788
for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) {
@@ -801,7 +802,7 @@ void DirectSolverGive::buildSolverMatrixRadialSection(const int i_theta, SparseM
801802

802803
/* ------------------------------------------------------------------------ */
803804
/* If the indexing is not smoother-based, please adjust the access patterns */
804-
SparseMatrixCOO<double> DirectSolverGive::buildSolverMatrix()
805+
SparseMatrixCOO<double> DirectSolver_COO_MUMPS_Give::buildSolverMatrix()
805806
{
806807
const int n = grid_.numberOfNodes();
807808
const int nnz = getNonZeroCountSolverMatrix();

src/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
#ifdef GMGPOLAR_USE_MUMPS
44

5-
DirectSolverGive::DirectSolverGive(const PolarGrid& grid, const LevelCache& level_cache,
6-
const DomainGeometry& domain_geometry,
7-
const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior,
8-
int num_omp_threads)
5+
DirectSolver_COO_MUMPS_Give::DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, const LevelCache& level_cache,
6+
const DomainGeometry& domain_geometry,
7+
const DensityProfileCoefficients& density_profile_coefficients,
8+
bool DirBC_Interior, int num_omp_threads)
99
: DirectSolver(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads)
1010
{
1111
solver_matrix_ = buildSolverMatrix();
1212
initializeMumpsSolver(mumps_solver_, solver_matrix_);
1313
}
1414

15-
void DirectSolverGive::solveInPlace(Vector<double> solution)
15+
void DirectSolver_COO_MUMPS_Give::solveInPlace(Vector<double> solution)
1616
{
1717
// Adjusts the right-hand side vector to account for symmetry corrections.
1818
// This transforms the system matrixA * solution = rhs into the equivalent system:
@@ -24,7 +24,7 @@ void DirectSolverGive::solveInPlace(Vector<double> solution)
2424
solveWithMumps(solution);
2525
}
2626

27-
DirectSolverGive::~DirectSolverGive()
27+
DirectSolver_COO_MUMPS_Give::~DirectSolver_COO_MUMPS_Give()
2828
{
2929
finalizeMumpsSolver(mumps_solver_);
3030
}

src/DirectSolver/DirectSolver-COO-MUMPS-Give/initializeMumps.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
#ifdef GMGPOLAR_USE_MUMPS
44

5-
void DirectSolverGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO<double>& solver_matrix)
5+
void DirectSolver_COO_MUMPS_Give::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver,
6+
SparseMatrixCOO<double>& solver_matrix)
67
{
78
/*
89
* MUMPS (a parallel direct solver) uses 1-based indexing,
@@ -102,7 +103,7 @@ void DirectSolverGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, Spars
102103
}
103104
}
104105

105-
void DirectSolverGive::solveWithMumps(Vector<double> result_rhs)
106+
void DirectSolver_COO_MUMPS_Give::solveWithMumps(Vector<double> result_rhs)
106107
{
107108
mumps_solver_.job = JOB_COMPUTE_SOLUTION;
108109
mumps_solver_.nrhs = 1;
@@ -115,7 +116,7 @@ void DirectSolverGive::solveWithMumps(Vector<double> result_rhs)
115116
}
116117
}
117118

118-
void DirectSolverGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver)
119+
void DirectSolver_COO_MUMPS_Give::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver)
119120
{
120121
mumps_solver.job = JOB_END;
121122
dmumps_c(&mumps_solver);

src/DirectSolver/DirectSolver-COO-MUMPS-Give/matrixStencil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#ifdef GMGPOLAR_USE_MUMPS
44

5-
const Stencil& DirectSolverGive::getStencil(int i_r) const
5+
const Stencil& DirectSolver_COO_MUMPS_Give::getStencil(int i_r) const
66
{
77
assert(0 <= i_r && i_r < grid_.nr());
88
assert(grid_.nr() >= 4);
@@ -25,7 +25,7 @@ const Stencil& DirectSolverGive::getStencil(int i_r) const
2525
throw std::out_of_range("Invalid index for stencil");
2626
}
2727

28-
int DirectSolverGive::getNonZeroCountSolverMatrix() const
28+
int DirectSolver_COO_MUMPS_Give::getNonZeroCountSolverMatrix() const
2929
{
3030
const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7;
3131
const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9;
@@ -42,7 +42,7 @@ int DirectSolverGive::getNonZeroCountSolverMatrix() const
4242

4343
/* ----------------------------------------------------------------- */
4444
/* If the indexing is not smoother-based, please adjust the indexing */
45-
int DirectSolverGive::getSolverMatrixIndex(const int i_r, const int i_theta) const
45+
int DirectSolver_COO_MUMPS_Give::getSolverMatrixIndex(const int i_r, const int i_theta) const
4646
{
4747
const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7;
4848
const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9;

src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/* Boundary Symmetry Shift */
99
/* ----------------------- */
1010

11-
void DirectSolverTake::applySymmetryShiftInnerBoundary(Vector<double> x) const
11+
void DirectSolver_COO_MUMPS_Take::applySymmetryShiftInnerBoundary(Vector<double> x) const
1212
{
1313
assert(DirBC_Interior_);
1414

@@ -45,7 +45,7 @@ void DirectSolverTake::applySymmetryShiftInnerBoundary(Vector<double> x) const
4545
}
4646
}
4747

48-
void DirectSolverTake::applySymmetryShiftOuterBoundary(Vector<double> x) const
48+
void DirectSolver_COO_MUMPS_Take::applySymmetryShiftOuterBoundary(Vector<double> x) const
4949
{
5050
assert(level_cache_.cacheDensityProfileCoefficients());
5151
assert(level_cache_.cacheDomainGeometry());
@@ -80,7 +80,7 @@ void DirectSolverTake::applySymmetryShiftOuterBoundary(Vector<double> x) const
8080
}
8181
}
8282

83-
void DirectSolverTake::applySymmetryShift(Vector<double> x) const
83+
void DirectSolver_COO_MUMPS_Take::applySymmetryShift(Vector<double> x) const
8484
{
8585
assert(std::ssize(x) == grid_.numberOfNodes());
8686
assert(grid_.nr() >= 4);

0 commit comments

Comments
 (0)