From f378a5f715a5e38902e44a4657b2314899e6ebea Mon Sep 17 00:00:00 2001 From: labourasse <labourassee@gmail.com> Date: Wed, 1 Feb 2023 14:30:37 +0100 Subject: [PATCH] interface for the language --- src/language/modules/SchemeModule.cpp | 50 +++++++++++++++++++++++++++ src/scheme/HyperelasticSolver.cpp | 1 + 2 files changed, 51 insertions(+) diff --git a/src/language/modules/SchemeModule.cpp b/src/language/modules/SchemeModule.cpp index b111e8510..0f5de1a9b 100644 --- a/src/language/modules/SchemeModule.cpp +++ b/src/language/modules/SchemeModule.cpp @@ -370,6 +370,56 @@ SchemeModule::SchemeModule() )); + this->_addBuiltinFunction("hyperelastic_eucclhyd_solver", + std::function( + + [](const std::shared_ptr<const IDiscreteFunction>& rho, + const std::shared_ptr<const IDiscreteFunction>& u, + const std::shared_ptr<const IDiscreteFunction>& E, + const std::shared_ptr<const IDiscreteFunction>& CG, + const std::shared_ptr<const IDiscreteFunction>& aL, + const std::shared_ptr<const IDiscreteFunction>& aT, + const std::shared_ptr<const IDiscreteFunction>& sigma, + const std::vector<std::shared_ptr<const IBoundaryConditionDescriptor>>& + bc_descriptor_list, + const double& dt) + -> std::tuple<std::shared_ptr<const IMesh>, std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>> { + return HyperelasticSolverHandler{getCommonMesh({rho, u, E, CG, aL, aT, sigma})} + .solver() + .apply(HyperelasticSolverHandler::SolverType::Eucclhyd, dt, rho, u, E, CG, aL, aT, + sigma, bc_descriptor_list); + } + + )); + + this->_addBuiltinFunction("hyperelastic_glace_solver", + std::function( + + [](const std::shared_ptr<const IDiscreteFunction>& rho, + const std::shared_ptr<const IDiscreteFunction>& u, + const std::shared_ptr<const IDiscreteFunction>& E, + const std::shared_ptr<const IDiscreteFunction>& CG, + const std::shared_ptr<const IDiscreteFunction>& aL, + const std::shared_ptr<const IDiscreteFunction>& aT, + const std::shared_ptr<const IDiscreteFunction>& sigma, + const std::vector<std::shared_ptr<const IBoundaryConditionDescriptor>>& + bc_descriptor_list, + const double& dt) + -> std::tuple<std::shared_ptr<const IMesh>, std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>, + std::shared_ptr<const IDiscreteFunction>> { + return HyperelasticSolverHandler{getCommonMesh({rho, u, E, CG, aL, aT, sigma})} + .solver() + .apply(HyperelasticSolverHandler::SolverType::Glace, dt, rho, u, E, CG, aL, aT, sigma, + bc_descriptor_list); + } + + )); + this->_addBuiltinFunction("apply_acoustic_fluxes", std::function( diff --git a/src/scheme/HyperelasticSolver.cpp b/src/scheme/HyperelasticSolver.cpp index 962e133fc..b54a221a1 100644 --- a/src/scheme/HyperelasticSolver.cpp +++ b/src/scheme/HyperelasticSolver.cpp @@ -78,6 +78,7 @@ class HyperelasticSolverHandler::HyperelasticSolver final : public HyperelasticS class FixedBoundaryCondition; class PressureBoundaryCondition; + class NormalStressBoundaryCondition; class SymmetryBoundaryCondition; class VelocityBoundaryCondition; -- GitLab