/** * @file material_marigo_inline_impl.cc * * @author Guillaume Anciaux * @author Marion Estelle Chambart * @author Nicolas Richart * * @date creation: Wed Aug 04 2010 * @date last modification: Thu Oct 15 2015 * * @brief Implementation of the inline functions of the material marigo * * @section LICENSE * * Copyright (©) 2010-2012, 2014, 2015 EPFL (Ecole Polytechnique Fédérale de * Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des * Solides) * * 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 . * */ /* -------------------------------------------------------------------------- */ template inline void MaterialMarigo::computeStressOnQuad(Matrix & grad_u, Matrix & sigma, Real & dam, Real & Y, Real &Ydq) { MaterialElastic::computeStressOnQuad(grad_u, sigma); Y = 0; for (UInt i = 0; i < spatial_dimension; ++i) { for (UInt j = 0; j < spatial_dimension; ++j) { Y += sigma(i,j) * (grad_u(i, j) + grad_u(j, i))/2.; } } Y *= 0.5; if(damage_in_y) Y *= (1 - dam); if(yc_limit) Y = std::min(Y, Yc); if(!this->is_non_local) { computeDamageAndStressOnQuad(sigma, dam, Y, Ydq); } } /* -------------------------------------------------------------------------- */ template inline void MaterialMarigo::computeDamageAndStressOnQuad(Matrix & sigma, Real & dam, Real & Y, Real &Ydq) { Real Fd = Y - Ydq - Sd * dam; if (Fd > 0) dam = (Y - Ydq) / Sd; dam = std::min(dam, Real(1.)); sigma *= 1-dam; } /* -------------------------------------------------------------------------- */ template inline UInt MaterialMarigo::getNbDataForElements(const Array & elements, SynchronizationTag tag) const { AKANTU_DEBUG_IN(); UInt size = 0; if(tag == _gst_smm_init_mat) { size += sizeof(Real) * this->getModel().getNbIntegrationPoints(elements); } size += MaterialDamage::getNbDataForElements(elements, tag); AKANTU_DEBUG_OUT(); return size; } /* -------------------------------------------------------------------------- */ template inline void MaterialMarigo::packElementData(CommunicationBuffer & buffer, const Array & elements, SynchronizationTag tag) const { AKANTU_DEBUG_IN(); if(tag == _gst_smm_init_mat) { this->packElementDataHelper(Yd, buffer, elements); } MaterialDamage::packElementData(buffer, elements, tag); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template inline void MaterialMarigo::unpackElementData(CommunicationBuffer & buffer, const Array & elements, SynchronizationTag tag) { AKANTU_DEBUG_IN(); if(tag == _gst_smm_init_mat) { this->unpackElementDataHelper(Yd, buffer, elements); } MaterialDamage::unpackElementData(buffer, elements, tag); AKANTU_DEBUG_OUT(); }