Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ class DirectSolver_COO_MUMPS_Take : public DirectSolver

// Retrieves the stencil for the solver matrix at the given radial index.
const Stencil& getStencil(int i_r) const;

void nodeBuildSolverMatrixTake(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior,
SparseMatrixCOO<double>& solver_matrix, ConstVector<double>& arr,
ConstVector<double>& att, ConstVector<double>& art, ConstVector<double>& detDF,
ConstVector<double>& coeff_beta);
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ class DirectSolver_CSR_LU_Take : public DirectSolver
const Stencil& getStencil(int i_r) const;

int getStencilSize(int global_index) const;

void nodeBuildSolverMatrixTake(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior,
SparseMatrixCSR<double>& solver_matrix, ConstVector<double>& arr,
ConstVector<double>& att, ConstVector<double>& art, ConstVector<double>& detDF,
ConstVector<double>& coeff_beta);
};
35 changes: 13 additions & 22 deletions src/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ void DirectSolver_COO_MUMPS_Take::applySymmetryShiftInnerBoundary(Vector<double>
assert(level_cache_.cacheDensityProfileCoefficients());
assert(level_cache_.cacheDomainGeometry());

const auto& arr = level_cache_.arr();
const auto& att = level_cache_.att();
const auto& art = level_cache_.art();
ConstVector<double> arr = level_cache_.arr();
ConstVector<double> att = level_cache_.att();
ConstVector<double> art = level_cache_.art();

const int i_r = 1;

Expand Down Expand Up @@ -50,9 +50,9 @@ void DirectSolver_COO_MUMPS_Take::applySymmetryShiftOuterBoundary(Vector<double>
assert(level_cache_.cacheDensityProfileCoefficients());
assert(level_cache_.cacheDomainGeometry());

const auto& arr = level_cache_.arr();
const auto& att = level_cache_.att();
const auto& art = level_cache_.art();
ConstVector<double> arr = level_cache_.arr();
ConstVector<double> att = level_cache_.att();
ConstVector<double> art = level_cache_.art();

const int i_r = grid_.nr() - 2;

Expand Down Expand Up @@ -85,27 +85,18 @@ void DirectSolver_COO_MUMPS_Take::applySymmetryShift(Vector<double> x) const
assert(std::ssize(x) == grid_.numberOfNodes());
assert(grid_.nr() >= 4);

if (num_omp_threads_ == 1) {
/* Single-threaded execution */
if (DirBC_Interior_) {
applySymmetryShiftInnerBoundary(x);
}
applySymmetryShiftOuterBoundary(x);
}
else {
#pragma omp parallel sections num_threads(num_omp_threads_)
{
{
#pragma omp section
{
if (DirBC_Interior_) {
applySymmetryShiftInnerBoundary(x);
}
{
if (DirBC_Interior_) {
applySymmetryShiftInnerBoundary(x);
}
}

#pragma omp section
{
applySymmetryShiftOuterBoundary(x);
}
{
applySymmetryShiftOuterBoundary(x);
}
}
}
Expand Down
Loading