diff --git a/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.cc b/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.cc index 6628e7748..8447bae2c 100644 --- a/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.cc +++ b/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.cc @@ -1,64 +1,70 @@ /** * Copyright (©) 2016-2023 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * This file is part of Akantu * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see <http://www.gnu.org/licenses/>. */ /* -------------------------------------------------------------------------- */ #include "material_cohesive_linear_stable.hh" #include "solid_mechanics_model_cohesive.hh" namespace akantu { /* -------------------------------------------------------------------------- */ template <Int dim> MaterialCohesiveLinearStable<dim>::MaterialCohesiveLinearStable( SolidMechanicsModel & model, const ID & id): MaterialParent(model, id), previous_delta(this->template registerInternal<Real, CohesiveInternalField>("previous_delta", 1)), softening_overshoot(this->template registerInternal<Real, CohesiveInternalField>("softening_overshoot", 1)), contact_overshoot(this->template registerInternal<Real, CohesiveInternalField>("contact_overshoot", 1)), initial_unstable_state(this->template registerInternal<Real, CohesiveInternalField>("initial_unstable_state", 1)) { + + AKANTU_DEBUG_IN(); this->registerParam("allow_dissipation_contact", allow_dissipation_contact, true, _pat_parsable | _pat_readable, "Allow dissipation contact"); + + this->registerParam("stable_damage", stable_damage, Real(0.), + _pat_parsable | _pat_readable | _pat_modifiable, "Stable damage"); + AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template <Int dim> void MaterialCohesiveLinearStable<dim>::computeTraction(ElementType el_type, GhostType ghost_type) { AKANTU_DEBUG_IN(); for (auto && args : getArguments(el_type, ghost_type)) { this->computeTractionOnQuad(args); } AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template class MaterialCohesiveLinearStable<1>; template class MaterialCohesiveLinearStable<2>; template class MaterialCohesiveLinearStable<3>; const bool material_is_allocated_cohesive_linear_stable [[maybe_unused]] = instantiateMaterial<MaterialCohesiveLinearStable>("cohesive_linear_stable"); } // namespace akantu \ No newline at end of file diff --git a/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.hh b/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.hh index e9641d84e..6ad99f9cb 100644 --- a/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.hh +++ b/src/model/solid_mechanics/solid_mechanics_model_cohesive/materials/constitutive_laws/material_cohesive_linear_stable.hh @@ -1,102 +1,105 @@ /** * Copyright (©) 2010-2023 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * This file is part of Akantu * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see <http://www.gnu.org/licenses/>. */ /* -------------------------------------------------------------------------- */ #include "material_cohesive_linear.hh" /* -------------------------------------------------------------------------- */ #ifndef AKANTU_MATERIAL_COHESIVE_LINEAR_STABLE_HH_ #define AKANTU_MATERIAL_COHESIVE_LINEAR_STABLE_HH_ /* -------------------------------------------------------------------------- */ namespace akantu { /** * Cohesive material linear with numerical stabilization * * parameters in the material files : * - TO ADD */ template <Int dim> class MaterialCohesiveLinearStable : public MaterialCohesiveLinear<dim> { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ using MaterialParent = MaterialCohesiveLinear<dim>; public: MaterialCohesiveLinearStable(SolidMechanicsModel & model, const ID & id = ""); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ protected: /// constitutive law void computeTraction(ElementType el_type, GhostType ghost_type = _not_ghost) override; inline decltype(auto) getArguments(ElementType element_type, GhostType ghost_type) { using namespace tuple; return zip_append(MaterialParent::getArguments(element_type, ghost_type), "previous_delta"_n = this->previous_delta(element_type, ghost_type), "softening_overshoot"_n = this->softening_overshoot(element_type, ghost_type), "contact_overshoot"_n = this->contact_overshoot(element_type, ghost_type), "initial_unstable_state"_n = this->initial_unstable_state(element_type, ghost_type)); } //template <typename Args> void computeTractionOnQuad(Args && args); template <typename Args> inline void computeTractionOnQuad(Args && args); /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ protected: /// delta of the previous step CohesiveInternalField<Real> & previous_delta; /// Internal containing a flag indicating if a softening overshoot has been detected CohesiveInternalField<Real> & softening_overshoot; /// Internal containing a flag indicating if a contact overshoot has been detected (entering or leaving contact) CohesiveInternalField<Real> & contact_overshoot; /// Internal containing a flag indicating if an element is in the cohesive initial unstable state CohesiveInternalField<Real> & initial_unstable_state; /// variable preventing artificial dissipation for cohesive contact bool allow_dissipation_contact{}; + + /// variable storing the stable damage state + Real stable_damage{}; }; } // namespace akantu #include "material_cohesive_linear_stable_inline_impl.hh" #endif /* AKANTU_MATERIAL_COHESIVE_LINEAR_STABLE_HH_ */