Skip to content
Snippets Groups Projects
Commit 7aac11e5 authored by Emmanuel Labourasse's avatar Emmanuel Labourasse
Browse files

new mesh management

parent 637eed8c
No related branches found
No related tags found
No related merge requests found
...@@ -469,8 +469,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS ...@@ -469,8 +469,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS
const std::shared_ptr<const DiscreteFunctionVariant>& sigma_v, const std::shared_ptr<const DiscreteFunctionVariant>& sigma_v,
const std::vector<std::shared_ptr<const IBoundaryConditionDescriptor>>& bc_descriptor_list) const 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}); std::shared_ptr mesh_v = getCommonMesh({rho_v, aL_v, aT_v, u_v, sigma_v});
if (not i_mesh) { if (not mesh_v) {
throw NormalError("discrete functions are not defined on the same mesh"); throw NormalError("discrete functions are not defined on the same mesh");
} }
...@@ -478,7 +478,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS ...@@ -478,7 +478,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS
throw NormalError("hyperplastic solver expects P0 functions"); 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 DiscreteScalarFunction& rho = rho_v->get<DiscreteScalarFunction>();
const DiscreteVectorFunction& u = u_v->get<DiscreteVectorFunction>(); const DiscreteVectorFunction& u = u_v->get<DiscreteVectorFunction>();
const DiscreteScalarFunction& aL = aL_v->get<DiscreteScalarFunction>(); const DiscreteScalarFunction& aL = aL_v->get<DiscreteScalarFunction>();
...@@ -491,7 +491,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS ...@@ -491,7 +491,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS
parallel_for( parallel_for(
mesh.numberOfCells(), PUGS_LAMBDA(CellId j) { tensor_values3d[j] = sigma3d[j]; }); mesh.numberOfCells(), PUGS_LAMBDA(CellId j) { tensor_values3d[j] = sigma3d[j]; });
CellValue<const Rdxd> tensor_values = toDimension(mesh, tensor_values3d); 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); NodeValuePerCell<const Rdxd> Ajr = this->_computeAjr(solver_type, mesh, rho * aL, rho * aT);
...@@ -595,8 +595,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS ...@@ -595,8 +595,8 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS
const std::shared_ptr<const ItemValueVariant>& ur, const std::shared_ptr<const ItemValueVariant>& ur,
const std::shared_ptr<const SubItemValuePerItemVariant>& Fjr) const const std::shared_ptr<const SubItemValuePerItemVariant>& Fjr) const
{ {
std::shared_ptr i_mesh = getCommonMesh({rho, u, E}); std::shared_ptr mesh_v = getCommonMesh({rho, u, E});
if (not i_mesh) { if (not mesh_v) {
throw NormalError("discrete functions are not defined on the same mesh"); throw NormalError("discrete functions are not defined on the same mesh");
} }
...@@ -605,7 +605,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS ...@@ -605,7 +605,7 @@ class HyperplasticSolverHandler::HyperplasticSolver final : public HyperplasticS
} }
return this->apply_fluxes(dt, // return this->apply_fluxes(dt, //
*i_mesh->get<MeshType>(), // *mesh_v->get<MeshType>(), //
rho->get<DiscreteScalarFunction>(), // rho->get<DiscreteScalarFunction>(), //
u->get<DiscreteVectorFunction>(), // u->get<DiscreteVectorFunction>(), //
E->get<DiscreteScalarFunction>(), // E->get<DiscreteScalarFunction>(), //
...@@ -1029,9 +1029,9 @@ class HyperplasticSolverHandler::HyperplasticSolver<MeshType>::SymmetryBoundaryC ...@@ -1029,9 +1029,9 @@ class HyperplasticSolverHandler::HyperplasticSolver<MeshType>::SymmetryBoundaryC
~SymmetryBoundaryCondition() = default; ~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"); throw NormalError("discrete functions are not defined on the same mesh");
} }
...@@ -1044,5 +1044,5 @@ HyperplasticSolverHandler::HyperplasticSolverHandler(const std::shared_ptr<const ...@@ -1044,5 +1044,5 @@ HyperplasticSolverHandler::HyperplasticSolverHandler(const std::shared_ptr<const
throw NormalError("unexpected mesh type"); throw NormalError("unexpected mesh type");
} }
}, },
i_mesh->variant()); mesh_v->variant());
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment