diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.inl index d703621e..2d77016f 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/applySymmetryShift.inl @@ -6,13 +6,13 @@ /* Boundary Symmetry Shift */ /* ----------------------- */ -template -void DirectSolver_COO_MUMPS_Give::applySymmetryShiftInnerBoundary(Vector x) const +template +void DirectSolver_COO_MUMPS_Give::applySymmetryShiftInnerBoundary(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; - assert(DirectSolver::DirBC_Interior_); + assert(DirectSolver::DirBC_Interior_); int i_r; double r; @@ -67,11 +67,11 @@ void DirectSolver_COO_MUMPS_Give::applySymmetryShiftInnerBoundar } } -template -void DirectSolver_COO_MUMPS_Give::applySymmetryShiftOuterBoundary(Vector x) const +template +void DirectSolver_COO_MUMPS_Give::applySymmetryShiftOuterBoundary(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; int i_r; double r; @@ -126,11 +126,11 @@ void DirectSolver_COO_MUMPS_Give::applySymmetryShiftOuterBoundar } } -template -void DirectSolver_COO_MUMPS_Give::applySymmetryShift(Vector x) const +template +void DirectSolver_COO_MUMPS_Give::applySymmetryShift(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(std::ssize(x) == grid.numberOfNodes()); assert(grid.nr() >= 4); diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/buildSolverMatrix.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/buildSolverMatrix.inl index 4c7cb0c1..fd91291b 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/buildSolverMatrix.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/buildSolverMatrix.inl @@ -15,8 +15,8 @@ static inline void updateMatrixElement(SparseMatrixCOO& matrix, int ptr, } // namespace direct_solver_coo_mumps_give -template -void DirectSolver_COO_MUMPS_Give::nodeBuildSolverMatrixGive(int i_r, int i_theta, const PolarGrid& grid, +template +void DirectSolver_COO_MUMPS_Give::nodeBuildSolverMatrixGive(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, SparseMatrixCOO& solver_matrix, double arr, double att, double art, @@ -779,13 +779,13 @@ void DirectSolver_COO_MUMPS_Give::nodeBuildSolverMatrixGive(int } } -template -void DirectSolver_COO_MUMPS_Give::buildSolverMatrixCircleSection(const int i_r, +template +void DirectSolver_COO_MUMPS_Give::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO& solver_matrix) { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const double r = grid.radius(i_r); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { @@ -800,13 +800,13 @@ void DirectSolver_COO_MUMPS_Give::buildSolverMatrixCircleSection } } -template -void DirectSolver_COO_MUMPS_Give::buildSolverMatrixRadialSection(const int i_theta, +template +void DirectSolver_COO_MUMPS_Give::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO& solver_matrix) { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const double theta = grid.theta(i_theta); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { @@ -821,11 +821,11 @@ void DirectSolver_COO_MUMPS_Give::buildSolverMatrixRadialSection } } -template -SparseMatrixCOO DirectSolver_COO_MUMPS_Give::buildSolverMatrix() +template +SparseMatrixCOO DirectSolver_COO_MUMPS_Give::buildSolverMatrix() { - const PolarGrid& grid = DirectSolver::grid_; - const int num_omp_threads = DirectSolver::num_omp_threads_; + const PolarGrid& grid = DirectSolver::grid_; + const int num_omp_threads = DirectSolver::num_omp_threads_; const int n = grid.numberOfNodes(); const int nnz = getNonZeroCountSolverMatrix(); diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.h b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.h index a03474c4..81c1726e 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.h +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.h @@ -4,12 +4,12 @@ #ifdef GMGPOLAR_USE_MUMPS -template -class DirectSolver_COO_MUMPS_Give : public DirectSolver +template +class DirectSolver_COO_MUMPS_Give : public DirectSolver { public: - explicit DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // Note: The rhs (right-hand side) vector gets overwritten during the solution process. void solveInPlace(Vector solution) override; diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.inl index f505ccf2..5fcb7c6e 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/directSolverGive.inl @@ -2,17 +2,17 @@ #ifdef GMGPOLAR_USE_MUMPS -template -DirectSolver_COO_MUMPS_Give::DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, - const LevelCache& level_cache, +template +DirectSolver_COO_MUMPS_Give::DirectSolver_COO_MUMPS_Give(const PolarGrid& grid, + const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) - : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) + : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) , mumps_solver_(buildSolverMatrix()) { } -template -void DirectSolver_COO_MUMPS_Give::solveInPlace(Vector solution) +template +void DirectSolver_COO_MUMPS_Give::solveInPlace(Vector solution) { // Adjusts the right-hand side vector to account for symmetry corrections. // This transforms the system matrixA * solution = rhs into the equivalent system: diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/matrixStencil.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/matrixStencil.inl index 3eaa2981..aff960ba 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Give/matrixStencil.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Give/matrixStencil.inl @@ -2,11 +2,11 @@ #ifdef GMGPOLAR_USE_MUMPS -template -const Stencil& DirectSolver_COO_MUMPS_Give::getStencil(int i_r) const +template +const Stencil& DirectSolver_COO_MUMPS_Give::getStencil(int i_r) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(0 <= i_r && i_r < grid.nr()); assert(grid.nr() >= 4); @@ -29,11 +29,11 @@ const Stencil& DirectSolver_COO_MUMPS_Give::getStencil(int i_r) throw std::out_of_range("Invalid index for stencil"); } -template -int DirectSolver_COO_MUMPS_Give::getNonZeroCountSolverMatrix() const +template +int DirectSolver_COO_MUMPS_Give::getNonZeroCountSolverMatrix() const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 6 : 9; @@ -50,11 +50,11 @@ int DirectSolver_COO_MUMPS_Give::getNonZeroCountSolverMatrix() c /* ----------------------------------------------------------------- */ /* If the indexing is not smoother-based, please adjust the indexing */ -template -int DirectSolver_COO_MUMPS_Give::getSolverMatrixIndex(const int i_r, const int i_theta) const +template +int DirectSolver_COO_MUMPS_Give::getSolverMatrixIndex(const int i_r, const int i_theta) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 6 : 9; diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.inl index 5d1e9aba..2985a66b 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/applySymmetryShift.inl @@ -6,13 +6,13 @@ /* Boundary Symmetry Shift */ /* ----------------------- */ -template -void DirectSolver_COO_MUMPS_Take::applySymmetryShiftInnerBoundary(Vector x) const +template +void DirectSolver_COO_MUMPS_Take::applySymmetryShiftInnerBoundary(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; - assert(DirectSolver::DirBC_Interior_); + assert(DirectSolver::DirBC_Interior_); assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -47,11 +47,11 @@ void DirectSolver_COO_MUMPS_Take::applySymmetryShiftInnerBoundar } } -template -void DirectSolver_COO_MUMPS_Take::applySymmetryShiftOuterBoundary(Vector x) const +template +void DirectSolver_COO_MUMPS_Take::applySymmetryShiftOuterBoundary(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -86,11 +86,11 @@ void DirectSolver_COO_MUMPS_Take::applySymmetryShiftOuterBoundar } } -template -void DirectSolver_COO_MUMPS_Take::applySymmetryShift(Vector x) const +template +void DirectSolver_COO_MUMPS_Take::applySymmetryShift(Vector x) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(std::ssize(x) == grid.numberOfNodes()); assert(grid.nr() >= 4); diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/buildSolverMatrix.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/buildSolverMatrix.inl index 6b52e876..9f952eb8 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/buildSolverMatrix.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/buildSolverMatrix.inl @@ -15,8 +15,8 @@ static inline void updateMatrixElement(SparseMatrixCOO& matrix, int ptr, } // namespace direct_solver_coo_mumps_take -template -void DirectSolver_COO_MUMPS_Take::nodeBuildSolverMatrixTake( +template +void DirectSolver_COO_MUMPS_Take::nodeBuildSolverMatrixTake( int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, SparseMatrixCOO& solver_matrix, ConstVector& arr, ConstVector& att, ConstVector& art, ConstVector& detDF, ConstVector& coeff_beta) @@ -458,13 +458,13 @@ void DirectSolver_COO_MUMPS_Take::nodeBuildSolverMatrixTake( } } -template -SparseMatrixCOO DirectSolver_COO_MUMPS_Take::buildSolverMatrix() +template +SparseMatrixCOO DirectSolver_COO_MUMPS_Take::buildSolverMatrix() { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const int num_omp_threads = DirectSolver::num_omp_threads_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const int num_omp_threads = DirectSolver::num_omp_threads_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int n = grid.numberOfNodes(); const int nnz = getNonZeroCountSolverMatrix(); diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.h b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.h index 40334fc7..a79f0e31 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.h +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.h @@ -4,12 +4,12 @@ #ifdef GMGPOLAR_USE_MUMPS -template -class DirectSolver_COO_MUMPS_Take : public DirectSolver +template +class DirectSolver_COO_MUMPS_Take : public DirectSolver { public: - explicit DirectSolver_COO_MUMPS_Take(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit DirectSolver_COO_MUMPS_Take(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // Note: The rhs (right-hand side) vector gets overwritten during the solution process. void solveInPlace(Vector solution) override; diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.inl index 4da6f250..cdbcbc0f 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/directSolverTake.inl @@ -2,17 +2,17 @@ #ifdef GMGPOLAR_USE_MUMPS -template -DirectSolver_COO_MUMPS_Take::DirectSolver_COO_MUMPS_Take(const PolarGrid& grid, - const LevelCache& level_cache, +template +DirectSolver_COO_MUMPS_Take::DirectSolver_COO_MUMPS_Take(const PolarGrid& grid, + const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) - : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) + : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) , mumps_solver_(buildSolverMatrix()) { } -template -void DirectSolver_COO_MUMPS_Take::solveInPlace(Vector solution) +template +void DirectSolver_COO_MUMPS_Take::solveInPlace(Vector solution) { // Adjusts the right-hand side vector to account for symmetry corrections. // This transforms the system matrixA * solution = rhs into the equivalent system: diff --git a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/matrixStencil.inl b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/matrixStencil.inl index 78bc4cde..985bef6e 100644 --- a/include/DirectSolver/DirectSolver-COO-MUMPS-Take/matrixStencil.inl +++ b/include/DirectSolver/DirectSolver-COO-MUMPS-Take/matrixStencil.inl @@ -2,11 +2,11 @@ #ifdef GMGPOLAR_USE_MUMPS -template -const Stencil& DirectSolver_COO_MUMPS_Take::getStencil(int i_r) const +template +const Stencil& DirectSolver_COO_MUMPS_Take::getStencil(int i_r) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(0 <= i_r && i_r < grid.nr()); assert(grid.nr() >= 4); @@ -29,11 +29,11 @@ const Stencil& DirectSolver_COO_MUMPS_Take::getStencil(int i_r) throw std::out_of_range("Invalid index for stencil"); } -template -int DirectSolver_COO_MUMPS_Take::getNonZeroCountSolverMatrix() const +template +int DirectSolver_COO_MUMPS_Take::getNonZeroCountSolverMatrix() const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 6 : 9; @@ -50,11 +50,11 @@ int DirectSolver_COO_MUMPS_Take::getNonZeroCountSolverMatrix() c /* ----------------------------------------------------------------- */ /* If the indexing is not smoother-based, please adjust the indexing */ -template -int DirectSolver_COO_MUMPS_Take::getSolverMatrixIndex(const int i_r, const int i_theta) const +template +int DirectSolver_COO_MUMPS_Take::getSolverMatrixIndex(const int i_r, const int i_theta) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 6 : 9; diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Give/buildSolverMatrix.inl b/include/DirectSolver/DirectSolver-CSR-LU-Give/buildSolverMatrix.inl index dc1511a7..55cdb111 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Give/buildSolverMatrix.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Give/buildSolverMatrix.inl @@ -11,8 +11,8 @@ static inline void updateMatrixElement(SparseMatrixCSR& matrix, int offs } // namespace direct_solver_csr_lu_give -template -void DirectSolver_CSR_LU_Give::nodeBuildSolverMatrixGive(int i_r, int i_theta, const PolarGrid& grid, +template +void DirectSolver_CSR_LU_Give::nodeBuildSolverMatrixGive(int i_r, int i_theta, const PolarGrid& grid, const bool DirBC_Interior, SparseMatrixCSR& solver_matrix, double arr, double att, double art, @@ -742,13 +742,13 @@ void DirectSolver_CSR_LU_Give::nodeBuildSolverMatrixGive(int i_r } } -template -void DirectSolver_CSR_LU_Give::buildSolverMatrixCircleSection(const int i_r, +template +void DirectSolver_CSR_LU_Give::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR& solver_matrix) { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const double r = grid.radius(i_r); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { @@ -763,13 +763,13 @@ void DirectSolver_CSR_LU_Give::buildSolverMatrixCircleSection(co } } -template -void DirectSolver_CSR_LU_Give::buildSolverMatrixRadialSection(const int i_theta, +template +void DirectSolver_CSR_LU_Give::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR& solver_matrix) { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const double theta = grid.theta(i_theta); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { @@ -784,11 +784,11 @@ void DirectSolver_CSR_LU_Give::buildSolverMatrixRadialSection(co } } -template -SparseMatrixCSR DirectSolver_CSR_LU_Give::buildSolverMatrix() +template +SparseMatrixCSR DirectSolver_CSR_LU_Give::buildSolverMatrix() { - const PolarGrid& grid = DirectSolver::grid_; - const int num_omp_threads = DirectSolver::num_omp_threads_; + const PolarGrid& grid = DirectSolver::grid_; + const int num_omp_threads = DirectSolver::num_omp_threads_; const int n = grid.numberOfNodes(); diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGive.inl b/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGive.inl index 84faa1b3..6d2b6018 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGive.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGive.inl @@ -1,17 +1,17 @@ #pragma once -template -DirectSolver_CSR_LU_Give::DirectSolver_CSR_LU_Give(const PolarGrid& grid, - const LevelCache& level_cache, +template +DirectSolver_CSR_LU_Give::DirectSolver_CSR_LU_Give(const PolarGrid& grid, + const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) - : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) + : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) { solver_matrix_ = buildSolverMatrix(); lu_solver_ = SparseLUSolver(solver_matrix_); } -template -void DirectSolver_CSR_LU_Give::solveInPlace(Vector solution) +template +void DirectSolver_CSR_LU_Give::solveInPlace(Vector solution) { lu_solver_.solveInPlace(solution); } diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGiveCustomLU.h b/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGiveCustomLU.h index 9ba98075..2e902808 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGiveCustomLU.h +++ b/include/DirectSolver/DirectSolver-CSR-LU-Give/directSolverGiveCustomLU.h @@ -2,12 +2,12 @@ #include "../directSolver.h" -template -class DirectSolver_CSR_LU_Give : public DirectSolver +template +class DirectSolver_CSR_LU_Give : public DirectSolver { public: - explicit DirectSolver_CSR_LU_Give(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit DirectSolver_CSR_LU_Give(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // Note: The rhs (right-hand side) vector gets overwritten with the solution. void solveInPlace(Vector solution) override; diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Give/matrixStencil.inl b/include/DirectSolver/DirectSolver-CSR-LU-Give/matrixStencil.inl index ed40801c..8e65f71f 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Give/matrixStencil.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Give/matrixStencil.inl @@ -1,10 +1,10 @@ #pragma once -template -int DirectSolver_CSR_LU_Give::getStencilSize(int global_index) const +template +int DirectSolver_CSR_LU_Give::getStencilSize(int global_index) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; int i_r, i_theta; grid.multiIndex(global_index, i_r, i_theta); @@ -33,11 +33,11 @@ int DirectSolver_CSR_LU_Give::getStencilSize(int global_index) c throw std::out_of_range("Invalid index for stencil"); } -template -const Stencil& DirectSolver_CSR_LU_Give::getStencil(int i_r) const +template +const Stencil& DirectSolver_CSR_LU_Give::getStencil(int i_r) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(0 <= i_r && i_r < grid.nr()); assert(grid.nr() >= 4); @@ -60,11 +60,11 @@ const Stencil& DirectSolver_CSR_LU_Give::getStencil(int i_r) con throw std::out_of_range("Invalid index for stencil"); } -template -int DirectSolver_CSR_LU_Give::getNonZeroCountSolverMatrix() const +template +int DirectSolver_CSR_LU_Give::getNonZeroCountSolverMatrix() const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 9 : 9; diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Take/buildSolverMatrix.inl b/include/DirectSolver/DirectSolver-CSR-LU-Take/buildSolverMatrix.inl index 2082cc37..b9a31e36 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Take/buildSolverMatrix.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Take/buildSolverMatrix.inl @@ -11,8 +11,8 @@ static inline void updateMatrixElement(SparseMatrixCSR& matrix, int offs } // namespace direct_solver_csr_lu_take -template -void DirectSolver_CSR_LU_Take::nodeBuildSolverMatrixTake( +template +void DirectSolver_CSR_LU_Take::nodeBuildSolverMatrixTake( int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, SparseMatrixCSR& solver_matrix, ConstVector& arr, ConstVector& att, ConstVector& art, ConstVector& detDF, ConstVector& coeff_beta) @@ -246,13 +246,13 @@ void DirectSolver_CSR_LU_Take::nodeBuildSolverMatrixTake( } } -template -SparseMatrixCSR DirectSolver_CSR_LU_Take::buildSolverMatrix() +template +SparseMatrixCSR DirectSolver_CSR_LU_Take::buildSolverMatrix() { - const PolarGrid& grid = DirectSolver::grid_; - const LevelCache& level_cache = DirectSolver::level_cache_; - const int num_omp_threads = DirectSolver::num_omp_threads_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const LevelCacheType& level_cache = DirectSolver::level_cache_; + const int num_omp_threads = DirectSolver::num_omp_threads_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int n = grid.numberOfNodes(); diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTake.inl b/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTake.inl index f4bd7412..e3bf0b1d 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTake.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTake.inl @@ -1,17 +1,17 @@ #pragma once -template -DirectSolver_CSR_LU_Take::DirectSolver_CSR_LU_Take(const PolarGrid& grid, - const LevelCache& level_cache, +template +DirectSolver_CSR_LU_Take::DirectSolver_CSR_LU_Take(const PolarGrid& grid, + const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) - : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) + : DirectSolver(grid, level_cache, DirBC_Interior, num_omp_threads) { solver_matrix_ = buildSolverMatrix(); lu_solver_ = SparseLUSolver(solver_matrix_); } -template -void DirectSolver_CSR_LU_Take::solveInPlace(Vector solution) +template +void DirectSolver_CSR_LU_Take::solveInPlace(Vector solution) { lu_solver_.solveInPlace(solution); } diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTakeCustomLU.h b/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTakeCustomLU.h index 4a9fece1..a387371c 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTakeCustomLU.h +++ b/include/DirectSolver/DirectSolver-CSR-LU-Take/directSolverTakeCustomLU.h @@ -2,12 +2,12 @@ #include "../directSolver.h" -template -class DirectSolver_CSR_LU_Take : public DirectSolver +template +class DirectSolver_CSR_LU_Take : public DirectSolver { public: - explicit DirectSolver_CSR_LU_Take(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit DirectSolver_CSR_LU_Take(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // Note: The rhs (right-hand side) vector gets overwritten with the solution. void solveInPlace(Vector solution) override; diff --git a/include/DirectSolver/DirectSolver-CSR-LU-Take/matrixStencil.inl b/include/DirectSolver/DirectSolver-CSR-LU-Take/matrixStencil.inl index 6c7de3d4..cb160569 100644 --- a/include/DirectSolver/DirectSolver-CSR-LU-Take/matrixStencil.inl +++ b/include/DirectSolver/DirectSolver-CSR-LU-Take/matrixStencil.inl @@ -1,10 +1,10 @@ #pragma once -template -int DirectSolver_CSR_LU_Take::getStencilSize(int global_index) const +template +int DirectSolver_CSR_LU_Take::getStencilSize(int global_index) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; int i_r, i_theta; grid.multiIndex(global_index, i_r, i_theta); @@ -33,11 +33,11 @@ int DirectSolver_CSR_LU_Take::getStencilSize(int global_index) c throw std::out_of_range("Invalid index for stencil"); } -template -const Stencil& DirectSolver_CSR_LU_Take::getStencil(int i_r) const +template +const Stencil& DirectSolver_CSR_LU_Take::getStencil(int i_r) const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; assert(0 <= i_r && i_r < grid.nr()); assert(grid.nr() >= 4); @@ -60,11 +60,11 @@ const Stencil& DirectSolver_CSR_LU_Take::getStencil(int i_r) con throw std::out_of_range("Invalid index for stencil"); } -template -int DirectSolver_CSR_LU_Take::getNonZeroCountSolverMatrix() const +template +int DirectSolver_CSR_LU_Take::getNonZeroCountSolverMatrix() const { - const PolarGrid& grid = DirectSolver::grid_; - const bool DirBC_Interior = DirectSolver::DirBC_Interior_; + const PolarGrid& grid = DirectSolver::grid_; + const bool DirBC_Interior = DirectSolver::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 7; const int size_stencil_next_inner_boundary = DirBC_Interior ? 9 : 9; diff --git a/include/DirectSolver/directSolver.h b/include/DirectSolver/directSolver.h index 9106b91c..fbe11a3e 100644 --- a/include/DirectSolver/directSolver.h +++ b/include/DirectSolver/directSolver.h @@ -4,14 +4,6 @@ #include #include -#include "../InputFunctions/domainGeometry.h" - -template -class LevelCache; -template -class Level; - -#include "../Level/level.h" #include "../PolarGrid/polargrid.h" #include "../Definitions/global_definitions.h" #include "../LinearAlgebra/Vector/vector.h" @@ -27,11 +19,11 @@ class Level; #include "mpi.h" #endif -template +template class DirectSolver { public: - explicit DirectSolver(const PolarGrid& grid, const LevelCache& level_cache, bool DirBC_Interior, + explicit DirectSolver(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) : grid_(grid) , level_cache_(level_cache) @@ -47,7 +39,7 @@ class DirectSolver protected: const PolarGrid& grid_; - const LevelCache& level_cache_; + const LevelCacheType& level_cache_; const bool DirBC_Interior_; const int num_omp_threads_; }; diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/applyAscOrtho.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/applyAscOrtho.inl index 8fa47707..6ef9cbbb 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/applyAscOrtho.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/applyAscOrtho.inl @@ -892,13 +892,13 @@ static inline void nodeApplyAscOrthoRadialGive(int i_r, int i_theta, const Polar } // namespace extrapolated_smoother_give -template -void ExtrapolatedSmootherGive::applyAscOrthoCircleSection(int i_r, SmootherColor smoother_color, +template +void ExtrapolatedSmootherGive::applyAscOrthoCircleSection(int i_r, SmootherColor smoother_color, ConstVector x, ConstVector rhs, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const LevelCache& level_cache = ExtrapolatedSmoother::level_cache_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmoother::level_cache_; assert(i_r >= 0 && i_r < grid.numberSmootherCircles() + 1); @@ -913,18 +913,18 @@ void ExtrapolatedSmootherGive::applyAscOrthoCircleSection(int i_ // Apply Asc Ortho at the current node extrapolated_smoother_give::nodeApplyAscOrthoCircleGive( - i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, smoother_color, x, rhs, temp, + i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); } } -template -void ExtrapolatedSmootherGive::applyAscOrthoRadialSection(int i_theta, SmootherColor smoother_color, +template +void ExtrapolatedSmootherGive::applyAscOrthoRadialSection(int i_theta, SmootherColor smoother_color, ConstVector x, ConstVector rhs, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const LevelCache& level_cache = ExtrapolatedSmoother::level_cache_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmoother::level_cache_; const double theta = grid.theta(i_theta); @@ -938,7 +938,7 @@ void ExtrapolatedSmootherGive::applyAscOrthoRadialSection(int i_ // Apply Asc Ortho at the current node extrapolated_smoother_give::nodeApplyAscOrthoRadialGive( - i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, smoother_color, x, rhs, temp, + i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); } } \ No newline at end of file diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.inl index 5b0c4af1..f5310376 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.inl @@ -35,8 +35,8 @@ static inline void updateCOOCSRMatrixElement(SparseMatrixCSR& matrix, in } // namespace extrapolated_smoother_give -template -void ExtrapolatedSmootherGive::nodeBuildAscGive( +template +void ExtrapolatedSmootherGive::nodeBuildAscGive( int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, MatrixType& inner_boundary_circle_matrix, BatchedTridiagonalSolver& circle_tridiagonal_solver, BatchedTridiagonalSolver& radial_tridiagonal_solver, double arr, double att, double art, double detDF, @@ -1210,11 +1210,11 @@ void ExtrapolatedSmootherGive::nodeBuildAscGive( } } -template -void ExtrapolatedSmootherGive::buildAscCircleSection(const int i_r) +template +void ExtrapolatedSmootherGive::buildAscCircleSection(const int i_r) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const LevelCache& level_cache = ExtrapolatedSmoother::level_cache_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmoother::level_cache_; const double r = grid.radius(i_r); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { @@ -1225,17 +1225,17 @@ void ExtrapolatedSmootherGive::buildAscCircleSection(const int i level_cache.obtainValues(i_r, i_theta, global_index, r, theta, coeff_beta, arr, att, art, detDF); // Build Asc at the current node - nodeBuildAscGive(i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, + nodeBuildAscGive(i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, inner_boundary_circle_matrix_, circle_tridiagonal_solver_, radial_tridiagonal_solver_, arr, att, art, detDF, coeff_beta); } } -template -void ExtrapolatedSmootherGive::buildAscRadialSection(const int i_theta) +template +void ExtrapolatedSmootherGive::buildAscRadialSection(const int i_theta) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const LevelCache& level_cache = ExtrapolatedSmoother::level_cache_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmoother::level_cache_; const double theta = grid.theta(i_theta); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { @@ -1246,14 +1246,14 @@ void ExtrapolatedSmootherGive::buildAscRadialSection(const int i level_cache.obtainValues(i_r, i_theta, global_index, r, theta, coeff_beta, arr, att, art, detDF); // Build Asc at the current node - nodeBuildAscGive(i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, + nodeBuildAscGive(i_r, i_theta, grid, ExtrapolatedSmoother::DirBC_Interior_, inner_boundary_circle_matrix_, circle_tridiagonal_solver_, radial_tridiagonal_solver_, arr, att, art, detDF, coeff_beta); } } -template -void ExtrapolatedSmootherGive::buildAscMatrices() +template +void ExtrapolatedSmootherGive::buildAscMatrices() { /* -------------------------------------- */ /* Part 1: Allocate Asc Smoother matrices */ @@ -1261,9 +1261,9 @@ void ExtrapolatedSmootherGive::buildAscMatrices() // BatchedTridiagonalSolvers allocations are handled in the SmootherTake constructor. // circle_tridiagonal_solver_[batch_index=0] is unitialized. Use inner_boundary_circle_matrix_ instead. - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; #ifdef GMGPOLAR_USE_MUMPS // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h index 63305277..df31ca82 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h @@ -51,14 +51,14 @@ // - Dirichlet boundary contributions in radial matrices are shifted // into the right-hand side to make A_sc symmetric. -template -class ExtrapolatedSmootherGive : public ExtrapolatedSmoother +template +class ExtrapolatedSmootherGive : public ExtrapolatedSmoother { public: // Constructs the coupled circle-radial extrapolated smoother. // Builds the A_sc smoother matrices and prepares the solvers. - explicit ExtrapolatedSmootherGive(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit ExtrapolatedSmootherGive(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // If MUMPS is enabled, this cleans up the inner boundary solver. ~ExtrapolatedSmootherGive() override; diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.inl index 1f1956b5..734f163f 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.inl @@ -1,10 +1,10 @@ #pragma once -template -ExtrapolatedSmootherGive::ExtrapolatedSmootherGive(const PolarGrid& grid, - const LevelCache& level_cache, +template +ExtrapolatedSmootherGive::ExtrapolatedSmootherGive(const PolarGrid& grid, + const LevelCacheType& level_cache, const bool DirBC_Interior, const int num_omp_threads) - : ExtrapolatedSmoother(grid, level_cache, DirBC_Interior, num_omp_threads) + : ExtrapolatedSmoother(grid, level_cache, DirBC_Interior, num_omp_threads) , circle_tridiagonal_solver_(grid.ntheta(), grid.numberSmootherCircles(), true) , radial_tridiagonal_solver_(grid.lengthSmootherRadial(), grid.ntheta(), false) { @@ -16,8 +16,8 @@ ExtrapolatedSmootherGive::ExtrapolatedSmootherGive(const PolarGr #endif } -template -ExtrapolatedSmootherGive::~ExtrapolatedSmootherGive() +template +ExtrapolatedSmootherGive::~ExtrapolatedSmootherGive() { #ifdef GMGPOLAR_USE_MUMPS finalizeMumpsSolver(inner_boundary_mumps_solver_); @@ -46,15 +46,15 @@ ExtrapolatedSmootherGive::~ExtrapolatedSmootherGive() // - First, temp is updated with f_sc − A_sc^ortho * u_sc^ortho. // - The system is then solved in-place in temp, and the results // are copied back to x. -template -void ExtrapolatedSmootherGive::extrapolatedSmoothing(Vector x, ConstVector rhs, +template +void ExtrapolatedSmootherGive::extrapolatedSmoothing(Vector x, ConstVector rhs, Vector temp) { assert(x.size() == rhs.size()); assert(temp.size() == rhs.size()); - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; #pragma omp parallel num_threads(num_omp_threads) { diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.inl index 79982185..1f939b07 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.inl @@ -2,8 +2,8 @@ #ifdef GMGPOLAR_USE_MUMPS -template -void ExtrapolatedSmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, +template +void ExtrapolatedSmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) { /* @@ -104,8 +104,8 @@ void ExtrapolatedSmootherGive::initializeMumpsSolver(DMUMPS_STRU } } -template -void ExtrapolatedSmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +template +void ExtrapolatedSmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) { mumps_solver.job = JOB_END; dmumps_c(&mumps_solver); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.inl index ea0341f2..5e30d27d 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.inl @@ -1,10 +1,10 @@ #pragma once -template -const Stencil& ExtrapolatedSmootherGive::getStencil(int i_r, int i_theta) const +template +const Stencil& ExtrapolatedSmootherGive::getStencil(int i_r, int i_theta) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // Stencils are only used to obtain offsets to index into COO/CSR matrices. @@ -32,11 +32,11 @@ const Stencil& ExtrapolatedSmootherGive::getStencil(int i_r, int } } -template -int ExtrapolatedSmootherGive::getNonZeroCountCircleAsc(const int i_r) const +template +int ExtrapolatedSmootherGive::getNonZeroCountCircleAsc(const int i_r) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // The number of nonzero elements is only needed to construct COO matrices. @@ -59,11 +59,11 @@ int ExtrapolatedSmootherGive::getNonZeroCountCircleAsc(const int } } -template -int ExtrapolatedSmootherGive::getCircleAscIndex(const int i_r, const int i_theta) const +template +int ExtrapolatedSmootherGive::getCircleAscIndex(const int i_r, const int i_theta) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // getCircleAscIndex accumulates all stencil sizes within a line up to, but excluding the current node. diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/solveAscSystem.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/solveAscSystem.inl index e299aa35..e17e6278 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/solveAscSystem.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/solveAscSystem.inl @@ -1,10 +1,10 @@ #pragma once -template -void ExtrapolatedSmootherGive::solveBlackCircleSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherGive::solveBlackCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -47,11 +47,11 @@ void ExtrapolatedSmootherGive::solveBlackCircleSection(Vector -void ExtrapolatedSmootherGive::solveWhiteCircleSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherGive::solveWhiteCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -94,11 +94,11 @@ void ExtrapolatedSmootherGive::solveWhiteCircleSection(Vector -void ExtrapolatedSmootherGive::solveBlackRadialSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherGive::solveBlackRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); @@ -117,11 +117,11 @@ void ExtrapolatedSmootherGive::solveBlackRadialSection(Vector -void ExtrapolatedSmootherGive::solveWhiteRadialSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherGive::solveWhiteRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/applyAscOrtho.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/applyAscOrtho.inl index f59ecc33..7686504c 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/applyAscOrtho.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/applyAscOrtho.inl @@ -460,17 +460,17 @@ static inline void nodeApplyAscOrthoRadialTake(int i_r, int i_theta, const Polar } // namespace extrapolated_smoother_take -template -void ExtrapolatedSmootherTake::applyAscOrthoBlackCircleSection(ConstVector x, +template +void ExtrapolatedSmootherTake::applyAscOrthoBlackCircleSection(ConstVector x, ConstVector rhs, Vector temp) { using extrapolated_smoother_take::nodeApplyAscOrthoCircleTake; - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -493,17 +493,17 @@ void ExtrapolatedSmootherTake::applyAscOrthoBlackCircleSection(C } } -template -void ExtrapolatedSmootherTake::applyAscOrthoWhiteCircleSection(ConstVector x, +template +void ExtrapolatedSmootherTake::applyAscOrthoWhiteCircleSection(ConstVector x, ConstVector rhs, Vector temp) { using extrapolated_smoother_take::nodeApplyAscOrthoCircleTake; - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -526,17 +526,17 @@ void ExtrapolatedSmootherTake::applyAscOrthoWhiteCircleSection(C } } -template -void ExtrapolatedSmootherTake::applyAscOrthoBlackRadialSection(ConstVector x, +template +void ExtrapolatedSmootherTake::applyAscOrthoBlackRadialSection(ConstVector x, ConstVector rhs, Vector temp) { using extrapolated_smoother_take::nodeApplyAscOrthoRadialTake; - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -556,17 +556,17 @@ void ExtrapolatedSmootherTake::applyAscOrthoBlackRadialSection(C } } -template -void ExtrapolatedSmootherTake::applyAscOrthoWhiteRadialSection(ConstVector x, +template +void ExtrapolatedSmootherTake::applyAscOrthoWhiteRadialSection(ConstVector x, ConstVector rhs, Vector temp) { using extrapolated_smoother_take::nodeApplyAscOrthoRadialTake; - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildInnerBoundaryAsc.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildInnerBoundaryAsc.inl index 9faa7a76..373a5c74 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildInnerBoundaryAsc.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildInnerBoundaryAsc.inl @@ -24,8 +24,8 @@ static inline void update_CSR_COO_MatrixElement(SparseMatrixCSR& matrix, } // namespace extrapolated_smoother_take -template -void ExtrapolatedSmootherTake::nodeBuildInteriorBoundarySolverMatrix( +template +void ExtrapolatedSmootherTake::nodeBuildInteriorBoundarySolverMatrix( int i_theta, const PolarGrid& grid, bool DirBC_Interior, InnerBoundaryMatrix& matrix, ConstVector& arr, ConstVector& att, ConstVector& art, ConstVector& detDF, ConstVector& coeff_beta) { @@ -152,14 +152,14 @@ void ExtrapolatedSmootherTake::nodeBuildInteriorBoundarySolverMa } } -template -typename ExtrapolatedSmootherTake::InnerBoundaryMatrix -ExtrapolatedSmootherTake::buildInteriorBoundarySolverMatrix() +template +typename ExtrapolatedSmootherTake::InnerBoundaryMatrix +ExtrapolatedSmootherTake::buildInteriorBoundarySolverMatrix() { - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; const int i_r = 0; const int ntheta = grid.ntheta(); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildTridiagonalAsc.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildTridiagonalAsc.inl index 3f7efaaa..d487aa00 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildTridiagonalAsc.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildTridiagonalAsc.inl @@ -16,8 +16,8 @@ static inline void updateMatrixElement(BatchedTridiagonalSolver& solver, } // namespace extrapolated_smoother_take -template -void ExtrapolatedSmootherTake::nodeBuildTridiagonalSolverMatrices( +template +void ExtrapolatedSmootherTake::nodeBuildTridiagonalSolverMatrices( int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, BatchedTridiagonalSolver& circle_tridiagonal_solver, BatchedTridiagonalSolver& radial_tridiagonal_solver, ConstVector& arr, ConstVector& att, @@ -515,13 +515,13 @@ void ExtrapolatedSmootherTake::nodeBuildTridiagonalSolverMatrice } } -template -void ExtrapolatedSmootherTake::buildTridiagonalSolverMatrices() +template +void ExtrapolatedSmootherTake::buildTridiagonalSolverMatrices() { - const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; - const LevelCache& level_cache = ExtrapolatedSmootherTake::level_cache_; - const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; - const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmootherTake::grid_; + const LevelCacheType& level_cache = ExtrapolatedSmootherTake::level_cache_; + const bool DirBC_Interior = ExtrapolatedSmootherTake::DirBC_Interior_; + const int num_omp_threads = ExtrapolatedSmootherTake::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h index c3036983..7bae6996 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h @@ -51,14 +51,14 @@ // - Dirichlet boundary contributions in radial matrices are shifted // into the right-hand side to make A_sc symmetric. -template -class ExtrapolatedSmootherTake : public ExtrapolatedSmoother +template +class ExtrapolatedSmootherTake : public ExtrapolatedSmoother { public: // Constructs the coupled circle-radial extrapolated smoother. // Builds the A_sc smoother matrices and prepares the solvers. - explicit ExtrapolatedSmootherTake(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads); + explicit ExtrapolatedSmootherTake(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads); // Performs one full coupled extrapolated smoothing sweep: // BC -> WC -> BR -> WR diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.inl index 19c90aae..444f562b 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.inl @@ -1,10 +1,10 @@ #pragma once -template -ExtrapolatedSmootherTake::ExtrapolatedSmootherTake(const PolarGrid& grid, - const LevelCache& level_cache, +template +ExtrapolatedSmootherTake::ExtrapolatedSmootherTake(const PolarGrid& grid, + const LevelCacheType& level_cache, const bool DirBC_Interior, const int num_omp_threads) - : ExtrapolatedSmoother(grid, level_cache, DirBC_Interior, num_omp_threads) + : ExtrapolatedSmoother(grid, level_cache, DirBC_Interior, num_omp_threads) , circle_tridiagonal_solver_(grid.ntheta(), grid.numberSmootherCircles(), true) , radial_tridiagonal_solver_(grid.lengthSmootherRadial(), grid.ntheta(), false) #ifdef GMGPOLAR_USE_MUMPS @@ -42,8 +42,8 @@ ExtrapolatedSmootherTake::ExtrapolatedSmootherTake(const PolarGr // - The system is then solved in-place in temp, and the results // are copied back to x. -template -void ExtrapolatedSmootherTake::extrapolatedSmoothing(Vector x, ConstVector rhs, +template +void ExtrapolatedSmootherTake::extrapolatedSmoothing(Vector x, ConstVector rhs, Vector temp) { assert(x.size() == rhs.size()); diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.inl index 579b8769..95c58e55 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.inl @@ -1,10 +1,10 @@ #pragma once -template -const Stencil& ExtrapolatedSmootherTake::getStencil(int i_r, int i_theta) const +template +const Stencil& ExtrapolatedSmootherTake::getStencil(int i_r, int i_theta) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // Stencils are only used to obtain offsets to index into COO/CSR matrices. @@ -32,11 +32,11 @@ const Stencil& ExtrapolatedSmootherTake::getStencil(int i_r, int } } -template -int ExtrapolatedSmootherTake::getNonZeroCountCircleAsc(int i_r) const +template +int ExtrapolatedSmootherTake::getNonZeroCountCircleAsc(int i_r) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // The number of nonzero elements is only needed to construct COO matrices. @@ -59,11 +59,11 @@ int ExtrapolatedSmootherTake::getNonZeroCountCircleAsc(int i_r) } } -template -int ExtrapolatedSmootherTake::getCircleAscIndex(int i_r, int i_theta) const +template +int ExtrapolatedSmootherTake::getCircleAscIndex(int i_r, int i_theta) const { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const bool DirBC_Interior = ExtrapolatedSmoother::DirBC_Interior_; // Only i_r = 0 is implemented. // getCircleAscIndex accumulates all stencil sizes within a line up to, but excluding the current node. diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/solveAscSystem.inl b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/solveAscSystem.inl index 2ea092cc..5b677e18 100644 --- a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/solveAscSystem.inl +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/solveAscSystem.inl @@ -1,10 +1,10 @@ #pragma once -template -void ExtrapolatedSmootherTake::solveBlackCircleSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherTake::solveBlackCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -36,11 +36,11 @@ void ExtrapolatedSmootherTake::solveBlackCircleSection(Vector -void ExtrapolatedSmootherTake::solveWhiteCircleSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherTake::solveWhiteCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -72,11 +72,11 @@ void ExtrapolatedSmootherTake::solveWhiteCircleSection(Vector -void ExtrapolatedSmootherTake::solveBlackRadialSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherTake::solveBlackRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); @@ -95,11 +95,11 @@ void ExtrapolatedSmootherTake::solveBlackRadialSection(Vector -void ExtrapolatedSmootherTake::solveWhiteRadialSection(Vector x, Vector temp) +template +void ExtrapolatedSmootherTake::solveWhiteRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = ExtrapolatedSmoother::grid_; - const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; + const PolarGrid& grid = ExtrapolatedSmoother::grid_; + const int num_omp_threads = ExtrapolatedSmoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); diff --git a/include/ExtrapolatedSmoother/extrapolatedSmoother.h b/include/ExtrapolatedSmoother/extrapolatedSmoother.h index abf8aee3..bb555a5e 100644 --- a/include/ExtrapolatedSmoother/extrapolatedSmoother.h +++ b/include/ExtrapolatedSmoother/extrapolatedSmoother.h @@ -4,16 +4,6 @@ #include #include -#include "../InputFunctions/domainGeometry.h" -#include "../InputFunctions/densityProfileCoefficients.h" - -template -class LevelCache; - -template -class Level; - -#include "../Level/level.h" #include "../PolarGrid/polargrid.h" #include "../Definitions/global_definitions.h" #include "../LinearAlgebra/Vector/vector.h" @@ -30,12 +20,12 @@ class Level; #include "mpi.h" #endif -template +template class ExtrapolatedSmoother { public: - explicit ExtrapolatedSmoother(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, int num_omp_threads) + explicit ExtrapolatedSmoother(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, + int num_omp_threads) : grid_(grid) , level_cache_(level_cache) , DirBC_Interior_(DirBC_Interior) @@ -48,7 +38,7 @@ class ExtrapolatedSmoother protected: const PolarGrid& grid_; - const LevelCache& level_cache_; + const LevelCacheType& level_cache_; const bool DirBC_Interior_; const int num_omp_threads_; }; diff --git a/include/Level/level.h b/include/Level/level.h index 6bb43b1b..8a981fa7 100644 --- a/include/Level/level.h +++ b/include/Level/level.h @@ -1,13 +1,13 @@ #pragma once // Required to prevent circular dependencies. -template +template class DirectSolver; -template +template class Residual; -template +template class Smoother; -template +template class ExtrapolatedSmoother; #include @@ -45,18 +45,21 @@ class LevelCache; template class Level { +public: + using LevelCacheType = LevelCache; + public: // ----------- // // Constructor // explicit Level(const int level_depth, std::unique_ptr grid, - std::unique_ptr> level_cache, const ExtrapolationType extrapolation, + std::unique_ptr level_cache, const ExtrapolationType extrapolation, const bool FMG, const bool PCG_FMG = false); // ---------------- // // Getter Functions // int level_depth() const; const PolarGrid& grid() const; - const LevelCache& levelCache() const; + const LevelCacheType& levelCache() const; Vector rhs(); ConstVector rhs() const; @@ -96,12 +99,12 @@ class Level private: const int level_depth_; std::unique_ptr grid_; - std::unique_ptr> level_cache_; + std::unique_ptr level_cache_; - std::unique_ptr> op_directSolver_; - std::unique_ptr> op_residual_; - std::unique_ptr> op_smoother_; - std::unique_ptr> op_extrapolated_smoother_; + std::unique_ptr> op_directSolver_; + std::unique_ptr> op_residual_; + std::unique_ptr> op_smoother_; + std::unique_ptr> op_extrapolated_smoother_; Vector rhs_; Vector solution_; diff --git a/include/Level/level.inl b/include/Level/level.inl index 17008c63..0a1ea11b 100644 --- a/include/Level/level.inl +++ b/include/Level/level.inl @@ -102,17 +102,16 @@ ConstVector Level::error_correction() const // -------------- // // Apply Residual // template -void Level::initializeResidual(const bool DirBC_Interior, - const int num_omp_threads, +void Level::initializeResidual(const bool DirBC_Interior, const int num_omp_threads, const StencilDistributionMethod stencil_distribution_method) { if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { - op_residual_ = std::make_unique>(*grid_, *level_cache_, - DirBC_Interior, num_omp_threads); + op_residual_ = + std::make_unique>(*grid_, *level_cache_, DirBC_Interior, num_omp_threads); } else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { - op_residual_ = std::make_unique>(*grid_, *level_cache_, - DirBC_Interior, num_omp_threads); + op_residual_ = + std::make_unique>(*grid_, *level_cache_, DirBC_Interior, num_omp_threads); } if (!op_residual_) throw std::runtime_error("Failed to initialize Residual."); @@ -136,27 +135,26 @@ void Level::applySystemOperator(Vector result, ConstVect // ------------------- // // Solve coarse System // template -void Level::initializeDirectSolver(const bool DirBC_Interior, - const int num_omp_threads, +void Level::initializeDirectSolver(const bool DirBC_Interior, const int num_omp_threads, const StencilDistributionMethod stencil_distribution_method) { #ifdef GMGPOLAR_USE_MUMPS if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { - op_directSolver_ = std::make_unique>( + op_directSolver_ = std::make_unique>( *grid_, *level_cache_, DirBC_Interior, num_omp_threads); } else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { - op_directSolver_ = std::make_unique>( + op_directSolver_ = std::make_unique>( *grid_, *level_cache_, DirBC_Interior, num_omp_threads); } #else if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { - op_directSolver_ = std::make_unique>( - *grid_, *level_cache_, DirBC_Interior, num_omp_threads); + op_directSolver_ = std::make_unique>(*grid_, *level_cache_, + DirBC_Interior, num_omp_threads); } else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { - op_directSolver_ = std::make_unique>( - *grid_, *level_cache_, DirBC_Interior, num_omp_threads); + op_directSolver_ = std::make_unique>(*grid_, *level_cache_, + DirBC_Interior, num_omp_threads); } #endif if (!op_directSolver_) @@ -174,17 +172,16 @@ void Level::directSolveInPlace(Vector x) const // --------------- // // Apply Smoothing // template -void Level::initializeSmoothing(const bool DirBC_Interior, - const int num_omp_threads, +void Level::initializeSmoothing(const bool DirBC_Interior, const int num_omp_threads, const StencilDistributionMethod stencil_distribution_method) { if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { - op_smoother_ = std::make_unique>(*grid_, *level_cache_, - DirBC_Interior, num_omp_threads); + op_smoother_ = + std::make_unique>(*grid_, *level_cache_, DirBC_Interior, num_omp_threads); } else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { - op_smoother_ = std::make_unique>(*grid_, *level_cache_, - DirBC_Interior, num_omp_threads); + op_smoother_ = + std::make_unique>(*grid_, *level_cache_, DirBC_Interior, num_omp_threads); } if (!op_smoother_) throw std::runtime_error("Failed to initialize Smoother."); @@ -205,11 +202,11 @@ void Level::initializeExtrapolatedSmoothing(const bool DirBC_Int const StencilDistributionMethod stencil_distribution_method) { if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { - op_extrapolated_smoother_ = std::make_unique>( + op_extrapolated_smoother_ = std::make_unique>( *grid_, *level_cache_, DirBC_Interior, num_omp_threads); } else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { - op_extrapolated_smoother_ = std::make_unique>( + op_extrapolated_smoother_ = std::make_unique>( *grid_, *level_cache_, DirBC_Interior, num_omp_threads); } if (!op_extrapolated_smoother_) diff --git a/include/Residual/ResidualGive/applyAGive.inl b/include/Residual/ResidualGive/applyAGive.inl index f998595f..2802e0ef 100644 --- a/include/Residual/ResidualGive/applyAGive.inl +++ b/include/Residual/ResidualGive/applyAGive.inl @@ -3,10 +3,10 @@ namespace residual_give { -template +template static inline void node_apply_a_give(int i_r, int i_theta, double r, double theta, const PolarGrid& grid, - const LevelCache& level_cache, bool DirBC_Interior, - Vector& result, ConstVector& x) + const LevelCacheType& level_cache, bool DirBC_Interior, Vector& result, + ConstVector& x) { /* ---------------------------------------- */ /* Compute or retrieve stencil coefficients */ @@ -291,33 +291,33 @@ static inline void node_apply_a_give(int i_r, int i_theta, double r, double thet } // namespace residual_give -template -void ResidualGive::applyCircleSection(const int i_r, Vector result, ConstVector x) const +template +void ResidualGive::applyCircleSection(const int i_r, Vector result, ConstVector x) const { using residual_give::node_apply_a_give; - const PolarGrid& grid = Residual::grid_; + const PolarGrid& grid = Residual::grid_; const double r = grid.radius(i_r); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { const double theta = grid.theta(i_theta); - node_apply_a_give(i_r, i_theta, r, theta, grid, Residual::level_cache_, - Residual::DirBC_Interior_, result, x); + node_apply_a_give(i_r, i_theta, r, theta, grid, Residual::level_cache_, + Residual::DirBC_Interior_, result, x); } } -template -void ResidualGive::applyRadialSection(const int i_theta, Vector result, +template +void ResidualGive::applyRadialSection(const int i_theta, Vector result, ConstVector x) const { using residual_give::node_apply_a_give; - const PolarGrid& grid = Residual::grid_; + const PolarGrid& grid = Residual::grid_; const double theta = grid.theta(i_theta); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { const double r = grid.radius(i_r); - node_apply_a_give(i_r, i_theta, r, theta, grid, Residual::level_cache_, - Residual::DirBC_Interior_, result, x); + node_apply_a_give(i_r, i_theta, r, theta, grid, Residual::level_cache_, + Residual::DirBC_Interior_, result, x); } } diff --git a/include/Residual/ResidualGive/residualGive.h b/include/Residual/ResidualGive/residualGive.h index 452e8408..dfc4fcd5 100644 --- a/include/Residual/ResidualGive/residualGive.h +++ b/include/Residual/ResidualGive/residualGive.h @@ -2,12 +2,12 @@ #include "../residual.h" -template -class ResidualGive : public Residual +template +class ResidualGive : public Residual { public: - explicit ResidualGive(const PolarGrid& grid, const LevelCache& level_cache, - const bool DirBC_Interior, const int num_omp_threads); + explicit ResidualGive(const PolarGrid& grid, const LevelCacheType& level_cache, const bool DirBC_Interior, + const int num_omp_threads); ~ResidualGive() override = default; void computeResidual(Vector result, ConstVector rhs, ConstVector x) const final; diff --git a/include/Residual/ResidualGive/residualGive.inl b/include/Residual/ResidualGive/residualGive.inl index 2c96141d..bc50f620 100644 --- a/include/Residual/ResidualGive/residualGive.inl +++ b/include/Residual/ResidualGive/residualGive.inl @@ -1,10 +1,9 @@ #pragma once -template -ResidualGive::ResidualGive(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, - int num_omp_threads) - : Residual(grid, level_cache, DirBC_Interior, num_omp_threads) +template +ResidualGive::ResidualGive(const PolarGrid& grid, const LevelCacheType& level_cache, + bool DirBC_Interior, int num_omp_threads) + : Residual(grid, level_cache, DirBC_Interior, num_omp_threads) { } @@ -12,16 +11,16 @@ ResidualGive::ResidualGive(const PolarGrid& grid, const LevelCac /* result = A*x */ // clang-format off -template -void ResidualGive::applySystemOperator(Vector result, ConstVector x) const +template +void ResidualGive::applySystemOperator(Vector result, ConstVector x) const { assert(result.size() == x.size()); assign(result, 0.0); - const PolarGrid& grid = Residual::grid_; + const PolarGrid& grid = Residual::grid_; - const int num_omp_threads = Residual::num_omp_threads_; + const int num_omp_threads = Residual::num_omp_threads_; /* Single-threaded execution */ if (num_omp_threads == 1) { @@ -109,8 +108,8 @@ void ResidualGive::applySystemOperator(Vector result, Co /* ------------------ */ /* result = rhs - A*x */ -template -void ResidualGive::computeResidual(Vector result, ConstVector rhs, +template +void ResidualGive::computeResidual(Vector result, ConstVector rhs, ConstVector x) const { assert(result.size() == x.size()); @@ -119,7 +118,7 @@ void ResidualGive::computeResidual(Vector result, ConstV // Subtract A*x from rhs to get the residual. const int n = result.size(); - const int num_omp_threads = Residual::num_omp_threads_; + const int num_omp_threads = Residual::num_omp_threads_; #pragma omp parallel for num_threads(num_omp_threads) for (int i = 0; i < n; i++) { result[i] = rhs[i] - result[i]; diff --git a/include/Residual/ResidualTake/applyATake.inl b/include/Residual/ResidualTake/applyATake.inl index ca57027a..38cbe669 100644 --- a/include/Residual/ResidualTake/applyATake.inl +++ b/include/Residual/ResidualTake/applyATake.inl @@ -115,43 +115,43 @@ static inline void node_apply_a_take(int i_r, int i_theta, const PolarGrid& grid } // namespace residual_take -template -void ResidualTake::applyCircleSection(const int i_r, Vector result, ConstVector x) const +template +void ResidualTake::applyCircleSection(const int i_r, Vector result, ConstVector x) const { using residual_take::node_apply_a_take; - assert(Residual::level_cache_.cacheDensityProfileCoefficients()); - assert(Residual::level_cache_.cacheDomainGeometry()); + assert(Residual::level_cache_.cacheDensityProfileCoefficients()); + assert(Residual::level_cache_.cacheDomainGeometry()); - const PolarGrid& grid = Residual::grid_; - const bool DirBC_Interior = Residual::DirBC_Interior_; - ConstVector arr = Residual::level_cache_.arr(); - ConstVector att = Residual::level_cache_.att(); - ConstVector art = Residual::level_cache_.art(); - ConstVector detDF = Residual::level_cache_.detDF(); - ConstVector coeff_beta = Residual::level_cache_.coeff_beta(); + const PolarGrid& grid = Residual::grid_; + const bool DirBC_Interior = Residual::DirBC_Interior_; + ConstVector arr = Residual::level_cache_.arr(); + ConstVector att = Residual::level_cache_.att(); + ConstVector art = Residual::level_cache_.art(); + ConstVector detDF = Residual::level_cache_.detDF(); + ConstVector coeff_beta = Residual::level_cache_.coeff_beta(); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { node_apply_a_take(i_r, i_theta, grid, DirBC_Interior, result, x, arr, att, art, detDF, coeff_beta); } } -template -void ResidualTake::applyRadialSection(const int i_theta, Vector result, +template +void ResidualTake::applyRadialSection(const int i_theta, Vector result, ConstVector x) const { using residual_take::node_apply_a_take; - assert(Residual::level_cache_.cacheDensityProfileCoefficients()); - assert(Residual::level_cache_.cacheDomainGeometry()); + assert(Residual::level_cache_.cacheDensityProfileCoefficients()); + assert(Residual::level_cache_.cacheDomainGeometry()); - const PolarGrid& grid = Residual::grid_; - const bool DirBC_Interior = Residual::DirBC_Interior_; - ConstVector arr = Residual::level_cache_.arr(); - ConstVector att = Residual::level_cache_.att(); - ConstVector art = Residual::level_cache_.art(); - ConstVector detDF = Residual::level_cache_.detDF(); - ConstVector coeff_beta = Residual::level_cache_.coeff_beta(); + const PolarGrid& grid = Residual::grid_; + const bool DirBC_Interior = Residual::DirBC_Interior_; + ConstVector arr = Residual::level_cache_.arr(); + ConstVector att = Residual::level_cache_.att(); + ConstVector art = Residual::level_cache_.art(); + ConstVector detDF = Residual::level_cache_.detDF(); + ConstVector coeff_beta = Residual::level_cache_.coeff_beta(); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { node_apply_a_take(i_r, i_theta, grid, DirBC_Interior, result, x, arr, att, art, detDF, coeff_beta); diff --git a/include/Residual/ResidualTake/residualTake.h b/include/Residual/ResidualTake/residualTake.h index 8a7c106f..231743f2 100644 --- a/include/Residual/ResidualTake/residualTake.h +++ b/include/Residual/ResidualTake/residualTake.h @@ -2,12 +2,12 @@ #include "../residual.h" -template -class ResidualTake : public Residual +template +class ResidualTake : public Residual { public: - explicit ResidualTake(const PolarGrid& grid, const LevelCache& level_cache, - const bool DirBC_Interior, const int num_omp_threads); + explicit ResidualTake(const PolarGrid& grid, const LevelCacheType& level_cache, const bool DirBC_Interior, + const int num_omp_threads); ~ResidualTake() override = default; void computeResidual(Vector result, ConstVector rhs, ConstVector x) const override; diff --git a/include/Residual/ResidualTake/residualTake.inl b/include/Residual/ResidualTake/residualTake.inl index b935e763..c6916277 100644 --- a/include/Residual/ResidualTake/residualTake.inl +++ b/include/Residual/ResidualTake/residualTake.inl @@ -1,26 +1,25 @@ #pragma once -template -ResidualTake::ResidualTake(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, - int num_omp_threads) - : Residual(grid, level_cache, DirBC_Interior, num_omp_threads) +template +ResidualTake::ResidualTake(const PolarGrid& grid, const LevelCacheType& level_cache, + bool DirBC_Interior, int num_omp_threads) + : Residual(grid, level_cache, DirBC_Interior, num_omp_threads) { } /* ------------ */ /* result = A*x */ -template -void ResidualTake::applySystemOperator(Vector result, ConstVector x) const +template +void ResidualTake::applySystemOperator(Vector result, ConstVector x) const { assert(result.size() == x.size()); - const int num_omp_threads = Residual::num_omp_threads_; + const int num_omp_threads = Residual::num_omp_threads_; - assert(Residual::level_cache_.cacheDensityProfileCoefficients()); - assert(Residual::level_cache_.cacheDomainGeometry()); + assert(Residual::level_cache_.cacheDensityProfileCoefficients()); + assert(Residual::level_cache_.cacheDomainGeometry()); - const PolarGrid& grid = Residual::grid_; + const PolarGrid& grid = Residual::grid_; #pragma omp parallel num_threads(num_omp_threads) { @@ -40,13 +39,13 @@ void ResidualTake::applySystemOperator(Vector result, Co /* ------------------ */ /* result = rhs - A*x */ -template -void ResidualTake::computeResidual(Vector result, ConstVector rhs, +template +void ResidualTake::computeResidual(Vector result, ConstVector rhs, ConstVector x) const { assert(result.size() == x.size()); - const int num_omp_threads = Residual::num_omp_threads_; + const int num_omp_threads = Residual::num_omp_threads_; applySystemOperator(result, x); diff --git a/include/Residual/residual.h b/include/Residual/residual.h index f71e12b1..bde5f4e3 100644 --- a/include/Residual/residual.h +++ b/include/Residual/residual.h @@ -4,25 +4,16 @@ #include #include -#include "../InputFunctions/domainGeometry.h" - -template -class LevelCache; - -template -class Level; - -#include "../Level/level.h" #include "../PolarGrid/polargrid.h" #include "../Definitions/global_definitions.h" #include "../LinearAlgebra/Vector/vector.h" #include "../LinearAlgebra/Vector/vector_operations.h" -template +template class Residual { public: - explicit Residual(const PolarGrid& grid, const LevelCache& level_cache, const bool DirBC_Interior, + explicit Residual(const PolarGrid& grid, const LevelCacheType& level_cache, const bool DirBC_Interior, const int num_omp_threads) : grid_(grid) , level_cache_(level_cache) @@ -40,7 +31,7 @@ class Residual /* ------------------- */ /* Constructor members */ const PolarGrid& grid_; - const LevelCache& level_cache_; + const LevelCacheType& level_cache_; const bool DirBC_Interior_; const int num_omp_threads_; }; diff --git a/include/Smoother/SmootherGive/applyAscOrtho.inl b/include/Smoother/SmootherGive/applyAscOrtho.inl index 7beac8ae..63bfef95 100644 --- a/include/Smoother/SmootherGive/applyAscOrtho.inl +++ b/include/Smoother/SmootherGive/applyAscOrtho.inl @@ -425,15 +425,15 @@ static inline void nodeApplyAscOrthoRadialGive(int i_r, int i_theta, const Polar } // namespace smoother_give -template -void SmootherGive::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, +template +void SmootherGive::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, ConstVector x, ConstVector rhs, Vector temp) { using smoother_give::nodeApplyAscOrthoCircleGive; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; assert(i_r >= 0 && i_r < grid.numberSmootherCircles() + 1); @@ -447,20 +447,20 @@ void SmootherGive::applyAscOrthoCircleSection(const int i_r, con level_cache.obtainValues(i_r, i_theta, index, r, theta, coeff_beta, arr, att, art, detDF); // Apply Asc Ortho at the current node - nodeApplyAscOrthoCircleGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, smoother_color, x, + nodeApplyAscOrthoCircleGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); } } -template -void SmootherGive::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, +template +void SmootherGive::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, ConstVector x, ConstVector rhs, Vector temp) { using smoother_give::nodeApplyAscOrthoRadialGive; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; const double theta = grid.theta(i_theta); @@ -474,7 +474,7 @@ void SmootherGive::applyAscOrthoRadialSection(const int i_theta, level_cache.obtainValues(i_r, i_theta, index, r, theta, coeff_beta, arr, att, art, detDF); // Apply Asc Ortho at the current node - nodeApplyAscOrthoRadialGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, smoother_color, x, + nodeApplyAscOrthoRadialGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); } } diff --git a/include/Smoother/SmootherGive/buildMatrix.inl b/include/Smoother/SmootherGive/buildMatrix.inl index 999ed520..7a77fc1c 100644 --- a/include/Smoother/SmootherGive/buildMatrix.inl +++ b/include/Smoother/SmootherGive/buildMatrix.inl @@ -35,8 +35,8 @@ static inline void updateCOOCSRMatrixElement(SparseMatrixCSR& matrix, in } // namespace smoother_give -template -void SmootherGive::nodeBuildAscGive(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, +template +void SmootherGive::nodeBuildAscGive(int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, MatrixType& inner_boundary_circle_matrix, BatchedTridiagonalSolver& circle_tridiagonal_solver, BatchedTridiagonalSolver& radial_tridiagonal_solver, @@ -636,11 +636,11 @@ void SmootherGive::nodeBuildAscGive(int i_r, int i_theta, const } } -template -void SmootherGive::buildAscCircleSection(const int i_r) +template +void SmootherGive::buildAscCircleSection(const int i_r) { - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; const double r = grid.radius(i_r); for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { @@ -651,16 +651,16 @@ void SmootherGive::buildAscCircleSection(const int i_r) level_cache.obtainValues(i_r, i_theta, global_index, r, theta, coeff_beta, arr, att, art, detDF); // Build Asc at the current node - nodeBuildAscGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, inner_boundary_circle_matrix_, + nodeBuildAscGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, inner_boundary_circle_matrix_, circle_tridiagonal_solver_, radial_tridiagonal_solver_, arr, att, art, detDF, coeff_beta); } } -template -void SmootherGive::buildAscRadialSection(const int i_theta) +template +void SmootherGive::buildAscRadialSection(const int i_theta) { - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; const double theta = grid.theta(i_theta); for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { @@ -671,13 +671,13 @@ void SmootherGive::buildAscRadialSection(const int i_theta) level_cache.obtainValues(i_r, i_theta, global_index, r, theta, coeff_beta, arr, att, art, detDF); // Build Asc at the current node - nodeBuildAscGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, inner_boundary_circle_matrix_, + nodeBuildAscGive(i_r, i_theta, grid, Smoother::DirBC_Interior_, inner_boundary_circle_matrix_, circle_tridiagonal_solver_, radial_tridiagonal_solver_, arr, att, art, detDF, coeff_beta); } } -template -void SmootherGive::buildAscMatrices() +template +void SmootherGive::buildAscMatrices() { /* -------------------------------------- */ /* Part 1: Allocate Asc Smoother matrices */ @@ -685,9 +685,9 @@ void SmootherGive::buildAscMatrices() // BatchedTridiagonalSolvers allocations are handled in the SmootherTake constructor. // circle_tridiagonal_solver_[batch_index=0] is unitialized. Use inner_boundary_circle_matrix_ instead. - const PolarGrid& grid = Smoother::grid_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; #ifdef GMGPOLAR_USE_MUMPS // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. diff --git a/include/Smoother/SmootherGive/initializeMumps.inl b/include/Smoother/SmootherGive/initializeMumps.inl index cabde43f..11b3a967 100644 --- a/include/Smoother/SmootherGive/initializeMumps.inl +++ b/include/Smoother/SmootherGive/initializeMumps.inl @@ -2,8 +2,8 @@ #ifdef GMGPOLAR_USE_MUMPS -template -void SmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, +template +void SmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) { /* @@ -104,8 +104,8 @@ void SmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_s } } -template -void SmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +template +void SmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) { mumps_solver.job = JOB_END; dmumps_c(&mumps_solver); diff --git a/include/Smoother/SmootherGive/matrixStencil.inl b/include/Smoother/SmootherGive/matrixStencil.inl index a54d0b61..91fbb290 100644 --- a/include/Smoother/SmootherGive/matrixStencil.inl +++ b/include/Smoother/SmootherGive/matrixStencil.inl @@ -1,7 +1,7 @@ #pragma once -template -const Stencil& SmootherGive::getStencil(int i_r) const +template +const Stencil& SmootherGive::getStencil(int i_r) const { // Only i_r = 0 is implemented. // Stencils are only used to obtain offsets to index into COO/CSR matrices. @@ -9,12 +9,12 @@ const Stencil& SmootherGive::getStencil(int i_r) const // because it has an additional across-origin coupling. assert(i_r == 0); - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; return DirBC_Interior ? stencil_DB_ : circle_stencil_across_origin_; } -template -int SmootherGive::getNonZeroCountCircleAsc(int i_r) const +template +int SmootherGive::getNonZeroCountCircleAsc(int i_r) const { // Only i_r = 0 is implemented. // The number of nonzero elements is only needed to construct COO matrices. @@ -22,14 +22,14 @@ int SmootherGive::getNonZeroCountCircleAsc(int i_r) const // because it has an additional across-origin coupling. assert(i_r == 0); - const PolarGrid& grid = Smoother::grid_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const PolarGrid& grid = Smoother::grid_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 4; return size_stencil_inner_boundary * grid.ntheta(); } -template -int SmootherGive::getCircleAscIndex(int i_r, int i_theta) const +template +int SmootherGive::getCircleAscIndex(int i_r, int i_theta) const { // Only i_r = 0 is implemented. // getCircleAscIndex accumulates all stencil sizes within a line up to, but excluding the current node. @@ -38,7 +38,7 @@ int SmootherGive::getCircleAscIndex(int i_r, int i_theta) const // because it has an additional across-origin coupling. assert(i_r == 0); - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 4; return size_stencil_inner_boundary * i_theta; } diff --git a/include/Smoother/SmootherGive/smootherGive.h b/include/Smoother/SmootherGive/smootherGive.h index 638520f9..8c77e65d 100644 --- a/include/Smoother/SmootherGive/smootherGive.h +++ b/include/Smoother/SmootherGive/smootherGive.h @@ -44,13 +44,13 @@ // - Dirichlet boundary contributions in radial matrices are shifted // into the right-hand side to make A_sc symmetric. -template -class SmootherGive : public Smoother +template +class SmootherGive : public Smoother { public: // Constructs the coupled circle-radial smoother. // Builds the A_sc smoother matrices and prepares the solvers. - explicit SmootherGive(const PolarGrid& grid, const LevelCache& level_cache, bool DirBC_Interior, + explicit SmootherGive(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads); // If MUMPS is enabled, this cleans up the inner boundary solver. diff --git a/include/Smoother/SmootherGive/smootherGive.inl b/include/Smoother/SmootherGive/smootherGive.inl index 009e472a..686b8458 100644 --- a/include/Smoother/SmootherGive/smootherGive.inl +++ b/include/Smoother/SmootherGive/smootherGive.inl @@ -1,10 +1,9 @@ #pragma once -template -SmootherGive::SmootherGive(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, - int num_omp_threads) - : Smoother(grid, level_cache, DirBC_Interior, num_omp_threads) +template +SmootherGive::SmootherGive(const PolarGrid& grid, const LevelCacheType& level_cache, + bool DirBC_Interior, int num_omp_threads) + : Smoother(grid, level_cache, DirBC_Interior, num_omp_threads) , circle_tridiagonal_solver_(grid.ntheta(), grid.numberSmootherCircles(), true) , radial_tridiagonal_solver_(grid.lengthSmootherRadial(), grid.ntheta(), false) { @@ -16,8 +15,8 @@ SmootherGive::SmootherGive(const PolarGrid& grid, const LevelCac #endif } -template -SmootherGive::~SmootherGive() +template +SmootherGive::~SmootherGive() { #ifdef GMGPOLAR_USE_MUMPS finalizeMumpsSolver(inner_boundary_mumps_solver_); @@ -46,16 +45,16 @@ SmootherGive::~SmootherGive() // - First, temp is updated with f_sc − A_sc^ortho * u_sc^ortho. // - The system is then solved in-place in temp, and the results // are copied back to x. -template -void SmootherGive::smoothing(Vector x, ConstVector rhs, Vector temp) +template +void SmootherGive::smoothing(Vector x, ConstVector rhs, Vector temp) { assert(x.size() == rhs.size()); assert(temp.size() == rhs.size()); Kokkos::deep_copy(temp, rhs); - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; /* Multi-threaded execution */ const int num_smoother_circles = grid.numberSmootherCircles(); diff --git a/include/Smoother/SmootherGive/solveAscSystem.inl b/include/Smoother/SmootherGive/solveAscSystem.inl index da2f38dc..37c7a2d3 100644 --- a/include/Smoother/SmootherGive/solveAscSystem.inl +++ b/include/Smoother/SmootherGive/solveAscSystem.inl @@ -1,10 +1,10 @@ #pragma once -template -void SmootherGive::solveBlackCircleSection(Vector x, Vector temp) +template +void SmootherGive::solveBlackCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -42,11 +42,11 @@ void SmootherGive::solveBlackCircleSection(Vector x, Vec } } -template -void SmootherGive::solveWhiteCircleSection(Vector x, Vector temp) +template +void SmootherGive::solveWhiteCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -84,11 +84,11 @@ void SmootherGive::solveWhiteCircleSection(Vector x, Vec } } -template -void SmootherGive::solveBlackRadialSection(Vector x, Vector temp) +template +void SmootherGive::solveBlackRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); @@ -107,11 +107,11 @@ void SmootherGive::solveBlackRadialSection(Vector x, Vec } } -template -void SmootherGive::solveWhiteRadialSection(Vector x, Vector temp) +template +void SmootherGive::solveWhiteRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); diff --git a/include/Smoother/SmootherTake/applyAscOrtho.inl b/include/Smoother/SmootherTake/applyAscOrtho.inl index 889a45ed..80427635 100644 --- a/include/Smoother/SmootherTake/applyAscOrtho.inl +++ b/include/Smoother/SmootherTake/applyAscOrtho.inl @@ -214,16 +214,16 @@ static inline void nodeApplyAscOrthoRadialTake(int i_r, int i_theta, const Polar } // namespace smoother_take -template -void SmootherTake::applyAscOrthoBlackCircleSection(ConstVector x, ConstVector rhs, +template +void SmootherTake::applyAscOrthoBlackCircleSection(ConstVector x, ConstVector rhs, Vector temp) { using smoother_take::nodeApplyAscOrthoCircleTake; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -246,16 +246,16 @@ void SmootherTake::applyAscOrthoBlackCircleSection(ConstVector -void SmootherTake::applyAscOrthoWhiteCircleSection(ConstVector x, ConstVector rhs, +template +void SmootherTake::applyAscOrthoWhiteCircleSection(ConstVector x, ConstVector rhs, Vector temp) { using smoother_take::nodeApplyAscOrthoCircleTake; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -278,16 +278,16 @@ void SmootherTake::applyAscOrthoWhiteCircleSection(ConstVector -void SmootherTake::applyAscOrthoBlackRadialSection(ConstVector x, ConstVector rhs, +template +void SmootherTake::applyAscOrthoBlackRadialSection(ConstVector x, ConstVector rhs, Vector temp) { using smoother_take::nodeApplyAscOrthoRadialTake; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); @@ -307,16 +307,16 @@ void SmootherTake::applyAscOrthoBlackRadialSection(ConstVector -void SmootherTake::applyAscOrthoWhiteRadialSection(ConstVector x, ConstVector rhs, +template +void SmootherTake::applyAscOrthoWhiteRadialSection(ConstVector x, ConstVector rhs, Vector temp) { using smoother_take::nodeApplyAscOrthoRadialTake; - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); diff --git a/include/Smoother/SmootherTake/buildInnerBoundaryAsc.inl b/include/Smoother/SmootherTake/buildInnerBoundaryAsc.inl index 8446d57d..978acdc2 100644 --- a/include/Smoother/SmootherTake/buildInnerBoundaryAsc.inl +++ b/include/Smoother/SmootherTake/buildInnerBoundaryAsc.inl @@ -24,8 +24,8 @@ static inline void update_CSR_COO_MatrixElement(SparseMatrixCSR& matrix, } // namespace smoother_take -template -void SmootherTake::nodeBuildInteriorBoundarySolverMatrix( +template +void SmootherTake::nodeBuildInteriorBoundarySolverMatrix( int i_theta, const PolarGrid& grid, bool DirBC_Interior, InnerBoundaryMatrix& matrix, ConstVector& arr, ConstVector& att, ConstVector& art, ConstVector& detDF, ConstVector& coeff_beta) { @@ -130,14 +130,14 @@ void SmootherTake::nodeBuildInteriorBoundarySolverMatrix( } } -template -typename SmootherTake::InnerBoundaryMatrix -SmootherTake::buildInteriorBoundarySolverMatrix() +template +typename SmootherTake::InnerBoundaryMatrix +SmootherTake::buildInteriorBoundarySolverMatrix() { - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; const int i_r = 0; const int ntheta = grid.ntheta(); diff --git a/include/Smoother/SmootherTake/buildTridiagonalAsc.inl b/include/Smoother/SmootherTake/buildTridiagonalAsc.inl index e5c7384c..7134b2ae 100644 --- a/include/Smoother/SmootherTake/buildTridiagonalAsc.inl +++ b/include/Smoother/SmootherTake/buildTridiagonalAsc.inl @@ -16,8 +16,8 @@ static inline void updateMatrixElement(BatchedTridiagonalSolver& solver, } // namespace smoother_take -template -void SmootherTake::nodeBuildTridiagonalSolverMatrices( +template +void SmootherTake::nodeBuildTridiagonalSolverMatrices( int i_r, int i_theta, const PolarGrid& grid, bool DirBC_Interior, BatchedTridiagonalSolver& circle_tridiagonal_solver, BatchedTridiagonalSolver& radial_tridiagonal_solver, ConstVector& arr, ConstVector& att, @@ -302,13 +302,13 @@ void SmootherTake::nodeBuildTridiagonalSolverMatrices( } } -template -void SmootherTake::buildTridiagonalSolverMatrices() +template +void SmootherTake::buildTridiagonalSolverMatrices() { - const PolarGrid& grid = Smoother::grid_; - const LevelCache& level_cache = Smoother::level_cache_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const LevelCacheType& level_cache = Smoother::level_cache_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; + const int num_omp_threads = Smoother::num_omp_threads_; assert(level_cache.cacheDensityProfileCoefficients()); assert(level_cache.cacheDomainGeometry()); diff --git a/include/Smoother/SmootherTake/matrixStencil.inl b/include/Smoother/SmootherTake/matrixStencil.inl index 96eb37a3..a2135d66 100644 --- a/include/Smoother/SmootherTake/matrixStencil.inl +++ b/include/Smoother/SmootherTake/matrixStencil.inl @@ -1,7 +1,7 @@ #pragma once -template -const Stencil& SmootherTake::getStencil(int i_r) const +template +const Stencil& SmootherTake::getStencil(int i_r) const { // Only i_r = 0 is implemented. // Stencils are only used to obtain offsets to index into COO/CSR matrices. @@ -9,13 +9,13 @@ const Stencil& SmootherTake::getStencil(int i_r) const // because it has an additional across-origin coupling. assert(i_r == 0); - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; return DirBC_Interior ? stencil_DB_ : circle_stencil_across_origin_; } -template -int SmootherTake::getNonZeroCountCircleAsc(int i_r) const +template +int SmootherTake::getNonZeroCountCircleAsc(int i_r) const { // Only i_r = 0 is implemented. // The number of nonzero elements is only needed to construct COO matrices. @@ -23,15 +23,15 @@ int SmootherTake::getNonZeroCountCircleAsc(int i_r) const // because it has an additional across-origin coupling. assert(i_r == 0); - const PolarGrid& grid = Smoother::grid_; - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const PolarGrid& grid = Smoother::grid_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 4; return size_stencil_inner_boundary * grid.ntheta(); } -template -int SmootherTake::getCircleAscIndex(int i_r, int i_theta) const +template +int SmootherTake::getCircleAscIndex(int i_r, int i_theta) const { // Only i_r = 0 is implemented. // getCircleAscIndex accumulates all stencil sizes within a line up to, but excluding the current node. @@ -40,7 +40,7 @@ int SmootherTake::getCircleAscIndex(int i_r, int i_theta) const // because it has an additional across-origin coupling. assert(i_r == 0); - const bool DirBC_Interior = Smoother::DirBC_Interior_; + const bool DirBC_Interior = Smoother::DirBC_Interior_; const int size_stencil_inner_boundary = DirBC_Interior ? 1 : 4; return size_stencil_inner_boundary * i_theta; diff --git a/include/Smoother/SmootherTake/smootherTake.h b/include/Smoother/SmootherTake/smootherTake.h index d3041d79..16a0ea21 100644 --- a/include/Smoother/SmootherTake/smootherTake.h +++ b/include/Smoother/SmootherTake/smootherTake.h @@ -44,13 +44,13 @@ // - Dirichlet boundary contributions in radial matrices are shifted // into the right-hand side to make A_sc symmetric. -template -class SmootherTake : public Smoother +template +class SmootherTake : public Smoother { public: // Constructs the coupled circle-radial smoother. // Builds the A_sc smoother matrices and prepares the solvers. - explicit SmootherTake(const PolarGrid& grid, const LevelCache& level_cache, bool DirBC_Interior, + explicit SmootherTake(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads); // Performs one full coupled smoothing sweep: diff --git a/include/Smoother/SmootherTake/smootherTake.inl b/include/Smoother/SmootherTake/smootherTake.inl index 15f2932d..42cbf84b 100644 --- a/include/Smoother/SmootherTake/smootherTake.inl +++ b/include/Smoother/SmootherTake/smootherTake.inl @@ -1,10 +1,9 @@ #pragma once -template -SmootherTake::SmootherTake(const PolarGrid& grid, const LevelCache& level_cache, - bool DirBC_Interior, - int num_omp_threads) - : Smoother(grid, level_cache, DirBC_Interior, num_omp_threads) +template +SmootherTake::SmootherTake(const PolarGrid& grid, const LevelCacheType& level_cache, + bool DirBC_Interior, int num_omp_threads) + : Smoother(grid, level_cache, DirBC_Interior, num_omp_threads) , circle_tridiagonal_solver_(grid.ntheta(), grid.numberSmootherCircles(), true) , radial_tridiagonal_solver_(grid.lengthSmootherRadial(), grid.ntheta(), false) #ifdef GMGPOLAR_USE_MUMPS @@ -41,8 +40,8 @@ SmootherTake::SmootherTake(const PolarGrid& grid, const LevelCac // - First, temp is updated with f_sc − A_sc^ortho * u_sc^ortho. // - The system is then solved in-place in temp, and the results // are copied back to x. -template -void SmootherTake::smoothing(Vector x, ConstVector rhs, Vector temp) +template +void SmootherTake::smoothing(Vector x, ConstVector rhs, Vector temp) { assert(x.size() == rhs.size()); assert(temp.size() == rhs.size()); diff --git a/include/Smoother/SmootherTake/solveAscSystem.inl b/include/Smoother/SmootherTake/solveAscSystem.inl index 1e8bc966..6d149b15 100644 --- a/include/Smoother/SmootherTake/solveAscSystem.inl +++ b/include/Smoother/SmootherTake/solveAscSystem.inl @@ -1,10 +1,10 @@ #pragma once -template -void SmootherTake::solveBlackCircleSection(Vector x, Vector temp) +template +void SmootherTake::solveBlackCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -31,11 +31,11 @@ void SmootherTake::solveBlackCircleSection(Vector x, Vec } } -template -void SmootherTake::solveWhiteCircleSection(Vector x, Vector temp) +template +void SmootherTake::solveWhiteCircleSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = 0; int end = grid.numberCircularSmootherNodes(); @@ -62,11 +62,11 @@ void SmootherTake::solveWhiteCircleSection(Vector x, Vec } } -template -void SmootherTake::solveBlackRadialSection(Vector x, Vector temp) +template +void SmootherTake::solveBlackRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); @@ -85,11 +85,11 @@ void SmootherTake::solveBlackRadialSection(Vector x, Vec } } -template -void SmootherTake::solveWhiteRadialSection(Vector x, Vector temp) +template +void SmootherTake::solveWhiteRadialSection(Vector x, Vector temp) { - const PolarGrid& grid = Smoother::grid_; - const int num_omp_threads = Smoother::num_omp_threads_; + const PolarGrid& grid = Smoother::grid_; + const int num_omp_threads = Smoother::num_omp_threads_; int start = grid.numberCircularSmootherNodes(); int end = grid.numberOfNodes(); diff --git a/include/Smoother/smoother.h b/include/Smoother/smoother.h index d6d18ab5..a1e90715 100644 --- a/include/Smoother/smoother.h +++ b/include/Smoother/smoother.h @@ -4,15 +4,6 @@ #include #include -#include "../InputFunctions/domainGeometry.h" - -template -class LevelCache; - -template -class Level; - -#include "../Level/level.h" #include "../PolarGrid/polargrid.h" #include "../Definitions/global_definitions.h" #include "../LinearAlgebra/Vector/vector.h" @@ -29,11 +20,11 @@ class Level; #include "mpi.h" #endif -template +template class Smoother { public: - explicit Smoother(const PolarGrid& grid, const LevelCache& level_cache, bool DirBC_Interior, + explicit Smoother(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior, int num_omp_threads) : grid_(grid) , level_cache_(level_cache) @@ -47,7 +38,7 @@ class Smoother protected: const PolarGrid& grid_; - const LevelCache& level_cache_; + const LevelCacheType& level_cache_; const bool DirBC_Interior_; const int num_omp_threads_; }; diff --git a/tests/DirectSolver/directSolver.cpp b/tests/DirectSolver/directSolver.cpp index 362b7539..61c5df7b 100644 --- a/tests/DirectSolver/directSolver.cpp +++ b/tests/DirectSolver/directSolver.cpp @@ -78,10 +78,10 @@ TEST(DirectSolverTest, directSolver_DirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Take directSolverGive_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); - DirectSolver_COO_MUMPS_Give directSolverTake_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take directSolverGive_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give directSolverTake_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); @@ -133,10 +133,10 @@ TEST(DirectSolverTest, directSolver_AcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Give directSolverGive_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); - DirectSolver_COO_MUMPS_Take directSolverTake_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give directSolverGive_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take directSolverTake_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); @@ -190,9 +190,8 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_Cir std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -234,9 +233,8 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_Circu std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -278,9 +276,8 @@ TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_Circu std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -322,9 +319,8 @@ TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Circula std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -371,9 +367,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeo std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -416,9 +411,8 @@ TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeome std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -466,9 +460,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -512,9 +505,8 @@ TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -560,9 +552,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -604,9 +595,8 @@ TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -660,9 +650,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_ std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -704,9 +693,8 @@ TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2 std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -749,9 +737,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverDirBC_Interior std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -793,9 +780,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_C std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -837,9 +823,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_C std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -881,9 +866,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_Cir std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -930,9 +914,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_Shafrano std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -975,9 +958,8 @@ TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovG std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1025,9 +1007,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeome std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1071,9 +1052,8 @@ TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometr std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1119,9 +1099,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeome std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1163,9 +1142,8 @@ TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometr std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1217,9 +1195,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); @@ -1261,9 +1238,8 @@ TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecis std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_COO_MUMPS_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("sol", rhs.size()); diff --git a/tests/DirectSolver/directSolverNoMumps.cpp b/tests/DirectSolver/directSolverNoMumps.cpp index 9ac9c87b..7dd34c2c 100644 --- a/tests/DirectSolver/directSolverNoMumps.cpp +++ b/tests/DirectSolver/directSolverNoMumps.cpp @@ -77,10 +77,10 @@ TEST(DirectSolverTestNoMumps, directSolver_DirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take directSolverGive_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); - DirectSolver_CSR_LU_Give directSolverTake_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take directSolverGive_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); + DirectSolver_CSR_LU_Give directSolverTake_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); @@ -133,10 +133,10 @@ TEST(DirectSolverTestNoMumps, directSolver_AcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give directSolverGive_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); - DirectSolver_CSR_LU_Take directSolverTake_operator(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give directSolverGive_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); + DirectSolver_CSR_LU_Take directSolverTake_operator(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); @@ -190,9 +190,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverDirBC_Inter std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -234,9 +233,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverDirBC_Interio std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -278,9 +276,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverAcrossOrigi std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -322,9 +319,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverAcrossOrigin_ std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -372,9 +368,8 @@ TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverDirBC_Interior_Shafr std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -418,9 +413,8 @@ TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverAcrossOrigin_Shafran std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -469,9 +463,8 @@ TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGe std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -516,9 +509,8 @@ TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeom std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -564,9 +556,8 @@ TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGe std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -608,9 +599,8 @@ TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeom std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -664,9 +654,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPre std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -708,9 +697,8 @@ TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPre std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -753,9 +741,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverDirBC_ std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -797,9 +784,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverDirBC_In std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -841,9 +827,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverAcross std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -885,9 +870,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverAcrossOr std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -935,9 +919,8 @@ TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverDirBC_Interior_ std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -981,9 +964,8 @@ TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverAcrossOrigin_Sh std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1032,9 +1014,8 @@ TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverDirBC_Interior_Cza std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1079,9 +1060,8 @@ TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverAcrossOrigin_Czarn std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1127,9 +1107,8 @@ TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverDirBC_Interior_Cul std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1171,9 +1150,8 @@ TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverAcrossOrigin_Culha std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1225,9 +1203,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigh std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); @@ -1269,9 +1246,8 @@ TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigh std::unique_ptr source_term = std::make_unique(level.grid(), Rmax); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector solution("solution", rhs.size()); diff --git a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp index 4caad3ff..7dfd4b9a 100644 --- a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp +++ b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp @@ -61,10 +61,8 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_DirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); Vector start = generate_random_sample_data(level.grid(), 24); @@ -122,10 +120,8 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); Vector start = generate_random_sample_data(level.grid(), 24); @@ -151,7 +147,7 @@ TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) } /* Test 2/2: */ -/* Does the smoother converge to the DirectSolver_CSR_LU_Give solution? */ +/* Does the smoother converge to the DirectSolver_CSR_LU_Give solution? */ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior) { @@ -185,11 +181,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -269,11 +264,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -353,11 +347,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -439,11 +432,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -524,11 +516,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior_Smal std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -609,11 +600,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior_Smalle std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -694,11 +684,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin_Smalle std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -777,11 +766,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin_Smallest std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -863,11 +851,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -949,11 +936,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1033,11 +1019,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1117,11 +1102,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1200,11 +1184,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior_ std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1283,11 +1266,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior_Sm std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1366,11 +1348,10 @@ TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin_Sm std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1449,11 +1430,10 @@ TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin_Smal std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), - DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Take solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), DirBC_Interior, + maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp index 46d88ded..69abb02b 100644 --- a/tests/Residual/residual.cpp +++ b/tests/Residual/residual.cpp @@ -55,10 +55,8 @@ TEST(OperatorATest, applyA_DirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - ResidualGive residualGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residualTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + ResidualGive residualGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residualTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector x = generate_random_sample_data(level.grid(), 42); Vector rhs = generate_random_sample_data(level.grid(), 69); @@ -111,10 +109,8 @@ TEST(OperatorATest, applyA_AcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - ResidualGive residualGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualTake residualTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + ResidualGive residualGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualTake residualTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector x = generate_random_sample_data(level.grid(), 42); Vector rhs = generate_random_sample_data(level.grid(), 69); diff --git a/tests/Smoother/smoother.cpp b/tests/Smoother/smoother.cpp index e733da89..40769642 100644 --- a/tests/Smoother/smoother.cpp +++ b/tests/Smoother/smoother.cpp @@ -60,10 +60,8 @@ TEST(SmootherTest, smoother_DirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - SmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - SmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + SmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); Vector start = generate_random_sample_data(level.grid(), 24); @@ -120,10 +118,8 @@ TEST(SmootherTest, smoother_AcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - SmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - SmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); + SmootherGive smootherGive_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smootherTake_operator(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); Vector rhs = generate_random_sample_data(level.grid(), 69); Vector start = generate_random_sample_data(level.grid(), 24); @@ -182,10 +178,9 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -259,10 +254,9 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -336,10 +330,9 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -413,10 +406,9 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -489,10 +481,9 @@ TEST(SmootherTest, SequentialSmootherDirBC_Interior_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -565,10 +556,9 @@ TEST(SmootherTest, ParallelSmootherDirBC_Interior_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -641,10 +631,9 @@ TEST(SmootherTest, SequentialSmootherAcrossOrigin_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -717,10 +706,9 @@ TEST(SmootherTest, ParallelSmootherAcrossOrigin_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -796,10 +784,9 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -873,10 +860,9 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -950,10 +936,9 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1027,10 +1012,9 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1103,10 +1087,9 @@ TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1179,10 +1162,9 @@ TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1255,10 +1237,9 @@ TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size()); @@ -1331,10 +1312,9 @@ TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin_SmallestGrid) std::unique_ptr source_term = std::make_unique(level.grid(), Rmax, kappa_eps, delta_e); - DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, - maxOpenMPThreads); - ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); - SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + DirectSolver_CSR_LU_Give solver_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), DirBC_Interior, maxOpenMPThreads); ConstVector rhs = generate_random_sample_data(level.grid(), 42); Vector discrete_solution("discrete_solution", rhs.size());