Skip to content

Commit

Permalink
discretization: avoid hiding virtual functions with other functions w…
Browse files Browse the repository at this point in the history
…ith the same name
  • Loading branch information
andrea-iob committed Jun 7, 2024
1 parent 9fe262b commit 3302bc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/discretization/stencil_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class DiscretizationStencilSolver : public solver_kernel_t {

using solver_kernel_t::solver_kernel_t;

void clear(bool release = false);
void clear() override;

template<typename stencil_container_t = std::vector<stencil_t>>
void assembly(const stencil_container_t &stencils);
Expand Down
12 changes: 2 additions & 10 deletions src/discretization/stencil_solver.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,21 +1014,13 @@ const stencil_t & DiscretizationStencilSolverAssembler<stencil_t, solver_kernel_

/*!
* Clear the stencil solver
*
* \param release if it's true the memory hold by the stencil solver will be
* released, otherwise the stencil solver will be cleared but its memory will
* not be relased
*/
template<typename stencil_t, typename solver_kernel_t>
void DiscretizationStencilSolver<stencil_t, solver_kernel_t>::clear(bool release)
void DiscretizationStencilSolver<stencil_t, solver_kernel_t>::clear()
{
solver_kernel_t::clear();

if (release) {
std::vector<double>().swap(m_constants);
} else {
m_constants.clear();
}
std::vector<double>().swap(m_constants);
}

#if BITPIT_ENABLE_MPI==1
Expand Down

0 comments on commit 3302bc7

Please sign in to comment.