Skip to content

Use [[maybe_unused]] attribute and fix compilation issues

Alexandra Liosi requested to merge fix/compilation_issues into master

1st Issue: When compiling against the latest Nektar master, boost throws an error for the ignore_unused command, which states that "ignore_unused is not a member of boost". The latest master in native nektar follows the C++17 convention, where the boost::ignore_unused is replaced by [[maybe_unused]]. This is employed for in this branch too, for the redesign-nektar.
Solution: Replaced ignore_unused with [[maybe_unused]] at the point of declaration of a variable.

2nd Issue: GetMaxIterations method has been removed from the AssemblyMap class in the native nektar++, hence the initialization of member m_maxIter inside Nektar::Operators::detail::OperatorsConjGradImpl... is not possible and gives a compilation error.
Solution: Introduced parameter "NekLinSysMaxIterations" which is read from the session file to initialize the member m_maxIter for the respective operator.

contfield->GetSession()->LoadParameter("NekLinSysMaxIterations", m_maxIter, 5000);

Feature: Initializing parameter m_tol based on the IterativeSolverTolerance parameter (if given), otherwise with the default value of 1e-9, as shown below:

contfield->GetSession()->LoadParameter("IterativeSolverTolerance", m_tol, 1.0E-09);

Edited by Alexandra Liosi

Merge request reports