From 7aac11e5a7c96e3b48c50adc883ca8c14819a5c4 Mon Sep 17 00:00:00 2001 From: labourasse <labourassee@gmail.com> Date: Thu, 10 Oct 2024 11:47:37 +0200 Subject: [PATCH] new mesh management --- src/scheme/HyperplasticSolver.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/scheme/HyperplasticSolver.cpp b/src/scheme/HyperplasticSolver.cpp index 91aeedf88..5dd0ce599 100644 --- a/src/scheme/HyperplasticSolver.cpp +++ b/src/scheme/HyperplasticSolver.cpp @@ -469,8 +469,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS const std::shared_ptr<const DiscreteFunctionVariant>& sigma_v, const std::vector<std::shared_ptr<const IBoundaryConditionDescriptor>>& bc_descriptor_list) const { - std::shared_ptr i_mesh = getCommonMesh({rho_v, aL_v, aT_v, u_v, sigma_v}); - if (not i_mesh) { + std::shared_ptr mesh_v = getCommonMesh({rho_v, aL_v, aT_v, u_v, sigma_v}); + if (not mesh_v) { throw NormalError("discrete functions are not defined on the same mesh"); } @@ -478,7 +478,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS throw NormalError("hyperplastic solver expects P0 functions"); } - const MeshType& mesh = *i_mesh->get<MeshType>(); + const MeshType& mesh = *mesh_v->get<MeshType>(); const DiscreteScalarFunction& rho = rho_v->get<DiscreteScalarFunction>(); const DiscreteVectorFunction& u = u_v->get<DiscreteVectorFunction>(); const DiscreteScalarFunction& aL = aL_v->get<DiscreteScalarFunction>(); @@ -491,7 +491,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS parallel_for( mesh.numberOfCells(), PUGS_LAMBDA(CellId j) { tensor_values3d[j] = sigma3d[j]; }); CellValue<const Rdxd> tensor_values = toDimension(mesh, tensor_values3d); - DiscreteTensorFunction sigma(i_mesh, tensor_values); + DiscreteTensorFunction sigma(mesh_v, tensor_values); NodeValuePerCell<const Rdxd> Ajr = this->_computeAjr(solver_type, mesh, rho * aL, rho * aT); @@ -595,8 +595,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS const std::shared_ptr<const ItemValueVariant>& ur, const std::shared_ptr<const SubItemValuePerItemVariant>& Fjr) const { - std::shared_ptr i_mesh = getCommonMesh({rho, u, E}); - if (not i_mesh) { + std::shared_ptr mesh_v = getCommonMesh({rho, u, E}); + if (not mesh_v) { throw NormalError("discrete functions are not defined on the same mesh"); } @@ -605,7 +605,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS } return this->apply_fluxes(dt, // - *i_mesh->get<MeshType>(), // + *mesh_v->get<MeshType>(), // rho->get<DiscreteScalarFunction>(), // u->get<DiscreteVectorFunction>(), // E->get<DiscreteScalarFunction>(), // @@ -1029,9 +1029,9 @@ class HyperplasticSolverHandler::HyperplasticSolver<MeshType>::SymmetryBoundaryC ~SymmetryBoundaryCondition() = default; }; -HyperplasticSolverHandler::HyperplasticSolverHandler(const std::shared_ptr<const MeshVariant>& i_mesh) +HyperplasticSolverHandler::HyperplasticSolverHandler(const std::shared_ptr<const MeshVariant>& mesh_v) { - if (not i_mesh) { + if (not mesh_v) { throw NormalError("discrete functions are not defined on the same mesh"); } @@ -1044,5 +1044,5 @@ HyperplasticSolverHandler::HyperplasticSolverHandler(const std::shared_ptr<const throw NormalError("unexpected mesh type"); } }, - i_mesh->variant()); + mesh_v->variant()); } -- GitLab