Skip to content
Snippets Groups Projects
Commit 6c148306 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

some classes in NumLib/DOF had MathLib namespace

parent 621db3e3
No related branches found
No related tags found
No related merge requests found
Showing
with 99 additions and 97 deletions
......@@ -37,7 +37,7 @@ struct LinearSolverLibrarySetup final
~LinearSolverLibrarySetup()
{
MathLib::cleanupGlobalMatrixProviders();
NumLib::cleanupGlobalMatrixProviders();
PetscFinalize();
MPI_Finalize();
}
......@@ -56,7 +56,7 @@ struct LinearSolverLibrarySetup final
~LinearSolverLibrarySetup()
{
MathLib::cleanupGlobalMatrixProviders();
NumLib::cleanupGlobalMatrixProviders();
lis_finalize();
}
};
......@@ -69,7 +69,7 @@ struct LinearSolverLibrarySetup final
LinearSolverLibrarySetup(int /*argc*/, char* /*argv*/[]) {}
~LinearSolverLibrarySetup()
{
MathLib::cleanupGlobalMatrixProviders();
NumLib::cleanupGlobalMatrixProviders();
}
};
} // ApplicationsLib
......
......@@ -83,7 +83,7 @@ void UncoupledProcessesTimeLoop::setInitialConditions(
// append a solution vector of suitable size
_process_solutions.emplace_back(
&MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
&NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
ode_sys.getMatrixSpecifications()));
auto& x0 = *_process_solutions[pcs_idx];
......@@ -235,7 +235,7 @@ bool UncoupledProcessesTimeLoop::loop(ProjectData& project)
UncoupledProcessesTimeLoop::~UncoupledProcessesTimeLoop()
{
for (auto* x : _process_solutions)
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*x);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*x);
}
} // namespace ApplicationsLib
......@@ -18,10 +18,10 @@
// Initializes the static members of the structs in the header file
// associated with this file.
#define INITIALIZE_GLOBAL_MATRIX_VECTOR_PROVIDER(MAT, VEC, VARNAME) \
static std::unique_ptr<MathLib::SimpleMatrixVectorProvider<MAT, VEC>> VARNAME{ \
new MathLib::SimpleMatrixVectorProvider<MAT, VEC>}; \
static std::unique_ptr<NumLib::SimpleMatrixVectorProvider<MAT, VEC>> VARNAME{ \
new NumLib::SimpleMatrixVectorProvider<MAT, VEC>}; \
\
namespace MathLib { \
namespace NumLib { \
template<> \
VectorProvider<VEC>& GlobalVectorProvider<VEC>::provider = *(VARNAME); \
\
......@@ -42,7 +42,7 @@ INITIALIZE_GLOBAL_MATRIX_VECTOR_PROVIDER(GlobalMatrix, GlobalVector,
globalSetupGlobalMatrixVectorProvider)
namespace MathLib
namespace NumLib
{
void cleanupGlobalMatrixProviders()
{
......
......@@ -7,12 +7,12 @@
*
*/
#ifndef MATHLIB_GLOBAL_MATRIX_PROVIDERS
#define MATHLIB_GLOBAL_MATRIX_PROVIDERS
#ifndef NUMLIB_GLOBAL_MATRIX_PROVIDERS
#define NUMLIB_GLOBAL_MATRIX_PROVIDERS
#include "MatrixProviderUser.h"
namespace MathLib
namespace NumLib
{
template<typename Vector>
......@@ -31,4 +31,4 @@ void cleanupGlobalMatrixProviders();
} // MathLib
#endif // MATHLIB_GLOBAL_MATRIX_PROVIDERS
#endif // NUMLIB_GLOBAL_MATRIX_PROVIDERS
......@@ -7,20 +7,20 @@
*
*/
#ifndef MATHLIB_MATRIX_PROVIDER_USER_H
#define MATHLIB_MATRIX_PROVIDER_USER_H
#ifndef NUMLIB_MATRIX_PROVIDER_USER_H
#define NUMLIB_MATRIX_PROVIDER_USER_H
#include <cstddef>
#include "MathLib/LinAlg/MatrixSpecifications.h"
namespace MathLib
namespace NumLib
{
class MatrixSpecificationsProvider
{
public:
virtual MatrixSpecifications getMatrixSpecifications() const = 0;
virtual MathLib::MatrixSpecifications getMatrixSpecifications() const = 0;
virtual ~MatrixSpecificationsProvider() = default;
};
......@@ -67,11 +67,11 @@ public:
virtual Vector& getVector(Vector const& x, std::size_t& id) = 0;
//! Get a vector according to the given specifications.
virtual Vector& getVector(MatrixSpecifications const& ms) = 0;
virtual Vector& getVector(MathLib::MatrixSpecifications const& ms) = 0;
//! Get a vector according to the given specifications in the storage
//! of the vector with the given \c id.
virtual Vector& getVector(MatrixSpecifications const& ms, std::size_t& id) = 0;
virtual Vector& getVector(MathLib::MatrixSpecifications const& ms, std::size_t& id) = 0;
//! Release the given vector.
//!
......@@ -103,11 +103,11 @@ public:
virtual Matrix& getMatrix(Matrix const& A, std::size_t& id) = 0;
//! Get a matrix according to the given specifications.
virtual Matrix& getMatrix(MatrixSpecifications const& ms) = 0;
virtual Matrix& getMatrix(MathLib::MatrixSpecifications const& ms) = 0;
//! Get a matrix according to the given specifications in the storage
//! of the matrix with the given \c id.
virtual Matrix& getMatrix(MatrixSpecifications const& ms, std::size_t& id) = 0;
virtual Matrix& getMatrix(MathLib::MatrixSpecifications const& ms, std::size_t& id) = 0;
//! Release the given matrix.
//!
......@@ -118,6 +118,6 @@ public:
virtual ~MatrixProvider() = default;
};
} // namespace MathLib
} // namespace NumLib
#endif // MATHLIB_MATRIX_PROVIDER_USER_H
#endif // NUMLIB_MATRIX_PROVIDER_USER_H
......@@ -15,6 +15,8 @@
#include "MathLib/LinAlg/MatrixVectorTraits.h"
#include "SimpleMatrixVectorProvider.h"
namespace LinAlg = MathLib::LinAlg;
namespace detail
{
......@@ -51,7 +53,7 @@ transfer(std::map<MatVec*, std::size_t>& from_used,
} // detail
namespace MathLib
namespace NumLib
{
template<typename Matrix, typename Vector>
......@@ -80,7 +82,7 @@ get_(std::size_t& id,
// not searched or not found, so create a new one
id = _next_id++;
auto res = used_map.emplace(
MatrixVectorTraits<MatVec>::newInstance(std::forward<Args>(args)...).release(),
MathLib::MatrixVectorTraits<MatVec>::newInstance(std::forward<Args>(args)...).release(),
id);
assert(res.second && "Emplacement failed.");
return { res.first->first, true };
......@@ -116,7 +118,7 @@ getMatrix(std::size_t& id)
template<typename Matrix, typename Vector>
Matrix&
SimpleMatrixVectorProvider<Matrix, Vector>::
getMatrix(MatrixSpecifications const& ms)
getMatrix(MathLib::MatrixSpecifications const& ms)
{
std::size_t id = 0u;
return *getMatrix_<false>(id, ms).first;
......@@ -126,7 +128,7 @@ getMatrix(MatrixSpecifications const& ms)
template<typename Matrix, typename Vector>
Matrix&
SimpleMatrixVectorProvider<Matrix, Vector>::
getMatrix(MatrixSpecifications const& ms, std::size_t& id)
getMatrix(MathLib::MatrixSpecifications const& ms, std::size_t& id)
{
return *getMatrix_<true>(id, ms).first;
// TODO assert that the returned object always is of the right size
......@@ -198,7 +200,7 @@ getVector(std::size_t& id)
template<typename Matrix, typename Vector>
Vector&
SimpleMatrixVectorProvider<Matrix, Vector>::
getVector(MatrixSpecifications const& ms)
getVector(MathLib::MatrixSpecifications const& ms)
{
std::size_t id = 0u;
return *getVector_<false>(id, ms).first;
......@@ -208,7 +210,7 @@ getVector(MatrixSpecifications const& ms)
template<typename Matrix, typename Vector>
Vector&
SimpleMatrixVectorProvider<Matrix, Vector>::
getVector(MatrixSpecifications const& ms, std::size_t& id)
getVector(MathLib::MatrixSpecifications const& ms, std::size_t& id)
{
return *getVector_<true>(id, ms).first;
// TODO assert that the returned object always is of the right size
......
......@@ -7,15 +7,15 @@
*
*/
#ifndef MATHLIB_SIMPLE_MATRIX_PROVIDER_H
#define MATHLIB_SIMPLE_MATRIX_PROVIDER_H
#ifndef NUMLIB_SIMPLE_MATRIX_PROVIDER_H
#define NUMLIB_SIMPLE_MATRIX_PROVIDER_H
#include<map>
#include<memory>
#include <map>
#include <memory>
#include "MatrixProviderUser.h"
namespace MathLib
namespace NumLib
{
/*! Manages storage for matrices and vectors.
......@@ -43,8 +43,8 @@ public:
Vector& getVector(Vector const& x) override;
Vector& getVector(Vector const& x, std::size_t& id) override;
Vector& getVector(MatrixSpecifications const& ms) override;
Vector& getVector(MatrixSpecifications const& ms, std::size_t& id) override;
Vector& getVector(MathLib::MatrixSpecifications const& ms) override;
Vector& getVector(MathLib::MatrixSpecifications const& ms, std::size_t& id) override;
void releaseVector(Vector const& x) override;
......@@ -54,8 +54,8 @@ public:
Matrix& getMatrix(Matrix const& A) override;
Matrix& getMatrix(Matrix const& A, std::size_t& id) override;
Matrix& getMatrix(MatrixSpecifications const& ms) override;
Matrix& getMatrix(MatrixSpecifications const& ms, std::size_t& id) override;
Matrix& getMatrix(MathLib::MatrixSpecifications const& ms) override;
Matrix& getMatrix(MathLib::MatrixSpecifications const& ms, std::size_t& id) override;
void releaseMatrix(Matrix const& A) override;
......@@ -88,8 +88,8 @@ private:
} // namespace MathLib
} // namespace NumLib
#include "SimpleMatrixVectorProvider-impl.h"
#endif // MATHLIB_SIMPLE_MATRIX_PROVIDER_H
#endif // NUMLIB_SIMPLE_MATRIX_PROVIDER_H
......@@ -53,7 +53,7 @@ public:
MathLib::MatrixSpecifications const& matrix_specs,
NumLib::LocalToGlobalIndexMap const& dof_table)
: _nodal_values(
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
matrix_specs))
#ifndef USE_PETSC
,
......@@ -102,7 +102,7 @@ public:
~LocalLinearLeastSquaresExtrapolator()
{
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
_nodal_values);
}
......
......@@ -28,7 +28,7 @@ enum class IterationResult : char
/*! Collection of basic methods every equation system must provide.
*
*/
class EquationSystem : public MathLib::MatrixSpecificationsProvider
class EquationSystem : public NumLib::MatrixSpecificationsProvider
{
public:
/*! Check whether this is actually a linear equation system.
......
......@@ -32,13 +32,13 @@ void MatrixTranslatorGeneral<ODESystemTag::FirstOrderImplicitQuasilinear>::
{
namespace LinAlg = MathLib::LinAlg;
auto& tmp = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
auto& tmp = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
_time_disc.getWeightedOldX(tmp);
// rhs = M * weighted_old_x + b
LinAlg::matMultAdd(M, tmp, b, rhs);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
}
void MatrixTranslatorGeneral<ODESystemTag::FirstOrderImplicitQuasilinear>::
......@@ -84,7 +84,7 @@ void MatrixTranslatorForwardEuler<ODESystemTag::FirstOrderImplicitQuasilinear>::
{
namespace LinAlg = MathLib::LinAlg;
auto& tmp = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
auto& tmp = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
_fwd_euler.getWeightedOldX(tmp);
auto const& x_old = _fwd_euler.getXOld();
......@@ -94,7 +94,7 @@ void MatrixTranslatorForwardEuler<ODESystemTag::FirstOrderImplicitQuasilinear>::
LinAlg::aypx(rhs, -1.0, b); // rhs = b - K * x_old
LinAlg::matMultAdd(M, tmp, rhs, rhs); // rhs += M * weighted_old_x
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
}
void MatrixTranslatorForwardEuler<ODESystemTag::FirstOrderImplicitQuasilinear>::
......@@ -145,7 +145,7 @@ void MatrixTranslatorCrankNicolson<
{
namespace LinAlg = MathLib::LinAlg;
auto& tmp = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
auto& tmp = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_tmp_id);
_crank_nicolson.getWeightedOldX(tmp);
auto const theta = _crank_nicolson.getTheta();
......@@ -158,7 +158,7 @@ void MatrixTranslatorCrankNicolson<
LinAlg::matMultAdd(_M_bar, tmp, rhs, rhs); // rhs += _M_bar * weighted_old_x
LinAlg::axpy(rhs, -1.0, _b_bar); // rhs -= b
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(tmp);
}
void MatrixTranslatorCrankNicolson<
......
......@@ -218,18 +218,18 @@ public:
*/
MatrixTranslatorCrankNicolson(CrankNicolson const& timeDisc)
: _crank_nicolson(timeDisc),
_M_bar(MathLib::GlobalMatrixProvider<GlobalMatrix>::provider
_M_bar(NumLib::GlobalMatrixProvider<GlobalMatrix>::provider
.getMatrix()),
_b_bar(
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
{
}
~MatrixTranslatorCrankNicolson()
{
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(
_M_bar);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
_b_bar);
}
......
......@@ -36,11 +36,11 @@ bool NonlinearSolver<NonlinearSolverTag::Picard>::solve(
auto& sys = *_equation_system;
auto& A =
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(_A_id);
auto& rhs = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(_A_id);
auto& rhs = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_rhs_id);
auto& x_new =
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_x_new_id);
bool error_norms_met = false;
......@@ -136,9 +136,9 @@ bool NonlinearSolver<NonlinearSolverTag::Picard>::solve(
_maxiter);
}
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(A);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(rhs);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(x_new);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(A);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(rhs);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(x_new);
return error_norms_met;
}
......@@ -159,13 +159,13 @@ bool NonlinearSolver<NonlinearSolverTag::Newton>::solve(
namespace LinAlg = MathLib::LinAlg;
auto& sys = *_equation_system;
auto& res = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
auto& res = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_res_id);
auto& minus_delta_x =
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_minus_delta_x_id);
auto& J =
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(_J_id);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(_J_id);
bool error_norms_met = false;
......@@ -202,7 +202,7 @@ bool NonlinearSolver<NonlinearSolverTag::Newton>::solve(
// cf.
// http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecWAXPY.html
auto& x_new =
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
x, _x_new_id);
LinAlg::axpy(x_new, -_alpha, minus_delta_x);
......@@ -224,7 +224,7 @@ bool NonlinearSolver<NonlinearSolverTag::Newton>::solve(
"iteration"
" has to be repeated.");
// TODO introduce some onDestroy hook.
MathLib::GlobalVectorProvider<GlobalVector>::provider
NumLib::GlobalVectorProvider<GlobalVector>::provider
.releaseVector(x_new);
continue; // That throws the iteration result away.
}
......@@ -232,7 +232,7 @@ bool NonlinearSolver<NonlinearSolverTag::Newton>::solve(
// TODO could be done via swap. Note: that also requires swapping
// the ids. Same for the Picard scheme.
LinAlg::copy(x_new, x); // copy new solution to x
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
x_new);
}
......@@ -271,9 +271,9 @@ bool NonlinearSolver<NonlinearSolverTag::Newton>::solve(
_maxiter);
}
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(J);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(res);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(J);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(res);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(
minus_delta_x);
return error_norms_met;
......
......@@ -208,13 +208,13 @@ class BackwardEuler final : public TimeDiscretization
{
public:
BackwardEuler()
: _x_old(MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
: _x_old(NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
{
}
~BackwardEuler()
{
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
}
void setInitialState(const double t0, GlobalVector const& x0) override
......@@ -257,13 +257,13 @@ class ForwardEuler final : public TimeDiscretization
{
public:
ForwardEuler()
: _x_old(MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
: _x_old(NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
{
}
~ForwardEuler()
{
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
}
void setInitialState(const double t0, GlobalVector const& x0) override
......@@ -332,13 +332,13 @@ public:
*/
explicit CrankNicolson(const double theta)
: _theta(theta),
_x_old(MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
_x_old(NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector())
{
}
~CrankNicolson()
{
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(_x_old);
}
void setInitialState(const double t0, GlobalVector const& x0) override
......@@ -426,14 +426,14 @@ public:
~BackwardDifferentiationFormula()
{
for (auto* x : _xs_old)
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*x);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*x);
}
void setInitialState(const double t0, GlobalVector const& x0) override
{
_t = t0;
_xs_old.push_back(
&MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x0));
&NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x0));
}
void pushState(const double, GlobalVector const& x,
......@@ -446,7 +446,7 @@ public:
if (_xs_old.size() < _num_steps)
{
_xs_old.push_back(
&MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x));
&NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x));
}
else
{
......
......@@ -44,13 +44,13 @@ TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
_time_disc(time_discretization),
_mat_trans(createMatrixTranslator<ODETag>(time_discretization))
{
_Jac = &MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_Jac = &NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_ode.getMatrixSpecifications(), _Jac_id);
_M = &MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_M = &NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_ode.getMatrixSpecifications(), _M_id);
_K = &MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_K = &NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_ode.getMatrixSpecifications(), _K_id);
_b = &MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_b = &NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_ode.getMatrixSpecifications(), _b_id);
}
......@@ -58,10 +58,10 @@ TimeDiscretizedODESystem<
ODESystemTag::FirstOrderImplicitQuasilinear,
NonlinearSolverTag::Newton>::~TimeDiscretizedODESystem()
{
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_Jac);
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_M);
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_K);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*_b);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_Jac);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_M);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_K);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*_b);
}
void TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
......@@ -95,7 +95,7 @@ void TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
auto const dxdot_dx = _time_disc.getNewXWeight();
auto const dx_dx = _time_disc.getDxDx();
auto& xdot = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_xdot_id);
auto& xdot = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_xdot_id);
_time_disc.getXdot(x_new_timestep, xdot);
_Jac->setZero();
......@@ -104,7 +104,7 @@ void TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
MathLib::LinAlg::finalizeAssembly(*_Jac);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(xdot);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(xdot);
}
void TimeDiscretizedODESystem<
......@@ -115,12 +115,12 @@ void TimeDiscretizedODESystem<
// TODO Maybe the duplicate calculation of xdot here and in assembleJacobian
// can be optimuized. However, that would make the interface a bit more
// fragile.
auto& xdot = MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_xdot_id);
auto& xdot = NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(_xdot_id);
_time_disc.getXdot(x_new_timestep, xdot);
_mat_trans->computeResidual(*_M, *_K, *_b, x_new_timestep, xdot, res);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(xdot);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(xdot);
}
void TimeDiscretizedODESystem<
......@@ -169,11 +169,11 @@ TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
_time_disc(time_discretization),
_mat_trans(createMatrixTranslator<ODETag>(time_discretization))
{
_M = &MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_M = &NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
ode.getMatrixSpecifications(), _M_id);
_K = &MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
_K = &NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.getMatrix(
ode.getMatrixSpecifications(), _K_id);
_b = &MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
_b = &NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(
ode.getMatrixSpecifications(), _b_id);
}
......@@ -181,9 +181,9 @@ TimeDiscretizedODESystem<
ODESystemTag::FirstOrderImplicitQuasilinear,
NonlinearSolverTag::Picard>::~TimeDiscretizedODESystem()
{
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_M);
MathLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_K);
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*_b);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_M);
NumLib::GlobalMatrixProvider<GlobalMatrix>::provider.releaseMatrix(*_K);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(*_b);
}
void TimeDiscretizedODESystem<ODESystemTag::FirstOrderImplicitQuasilinear,
......
......@@ -82,7 +82,7 @@ bool TimeLoopSingleODE<NLTag>::loop(const double t0, GlobalVector const& x0,
{
// solution vector
GlobalVector& x =
MathLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x0);
NumLib::GlobalVectorProvider<GlobalVector>::provider.getVector(x0);
auto& time_disc = _ode_sys.getTimeDiscretization();
......@@ -120,7 +120,7 @@ bool TimeLoopSingleODE<NLTag>::loop(const double t0, GlobalVector const& x0,
post_timestep(t_cb, x_cb);
}
MathLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(x);
NumLib::GlobalVectorProvider<GlobalVector>::provider.releaseVector(x);
if (!nl_slv_succeeded)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment