diff --git a/NumLib/ODESolver/NonlinearSolver-impl.h b/NumLib/ODESolver/NonlinearSolver.cpp similarity index 95% rename from NumLib/ODESolver/NonlinearSolver-impl.h rename to NumLib/ODESolver/NonlinearSolver.cpp index 7f34a5be5426ba61d6cf53cc9ab2c9796a172ef8..f41741504af9deb7c15491dd1dca7b78b89d15d5 100644 --- a/NumLib/ODESolver/NonlinearSolver-impl.h +++ b/NumLib/ODESolver/NonlinearSolver.cpp @@ -7,28 +7,28 @@ * */ -#include <logog/include/logog.hpp> +#include "NonlinearSolver.h" // for debugging // #include <iostream> +#include <logog/include/logog.hpp> + #include "BaseLib/ConfigTree.h" #include "BaseLib/Error.h" #include "MathLib/LinAlg/BLAS.h" #include "MathLib/LinAlg/VectorNorms.h" #include "NumLib/DOF/GlobalMatrixProviders.h" -#include "NonlinearSolver.h" - namespace NumLib { -inline void NonlinearSolver<NonlinearSolverTag::Picard>::assemble( +void NonlinearSolver<NonlinearSolverTag::Picard>::assemble( GlobalVector const& x) const { _equation_system->assembleMatricesPicard(x); } -inline bool NonlinearSolver<NonlinearSolverTag::Picard>::solve( +bool NonlinearSolver<NonlinearSolverTag::Picard>::solve( GlobalVector& x, std::function<void(unsigned, GlobalVector const&)> const& postIterationCallback) { @@ -143,7 +143,7 @@ inline bool NonlinearSolver<NonlinearSolverTag::Picard>::solve( return error_norms_met; } -inline void NonlinearSolver<NonlinearSolverTag::Newton>::assemble( +void NonlinearSolver<NonlinearSolverTag::Newton>::assemble( GlobalVector const& x) const { _equation_system->assembleResidualNewton(x); @@ -152,7 +152,7 @@ inline void NonlinearSolver<NonlinearSolverTag::Newton>::assemble( // equation every time and could not forget it. } -inline bool NonlinearSolver<NonlinearSolverTag::Newton>::solve( +bool NonlinearSolver<NonlinearSolverTag::Newton>::solve( GlobalVector& x, std::function<void(unsigned, GlobalVector const&)> const& postIterationCallback) { @@ -279,10 +279,9 @@ inline bool NonlinearSolver<NonlinearSolverTag::Newton>::solve( return error_norms_met; } -inline std::pair<std::unique_ptr<NonlinearSolverBase>, NonlinearSolverTag> -createNonlinearSolver( - MathLib::LinearSolver<GlobalMatrix, GlobalVector>& linear_solver, - BaseLib::ConfigTree const& config) +std::pair<std::unique_ptr<NonlinearSolverBase>, NonlinearSolverTag> +createNonlinearSolver(MathLib::LinearSolver<GlobalMatrix, GlobalVector>& linear_solver, + BaseLib::ConfigTree const& config) { using AbstractNLS = NonlinearSolverBase; diff --git a/NumLib/ODESolver/NonlinearSolver.h b/NumLib/ODESolver/NonlinearSolver.h index 140fe406c230c63dcbfee3c9941b8b2348327253..6d1ea83a749add7868ece5d5dcd18a544e40ab94 100644 --- a/NumLib/ODESolver/NonlinearSolver.h +++ b/NumLib/ODESolver/NonlinearSolver.h @@ -14,8 +14,6 @@ #include <utility> #include <logog/include/logog.hpp> -#include "MathLib/LinAlg/LinearSolver.h" - #include "NonlinearSystem.h" #include "Types.h" @@ -201,6 +199,4 @@ createNonlinearSolver( } // namespace NumLib -#include "NonlinearSolver-impl.h" - #endif // NUMLIB_NONLINEARSOLVER_H