diff --git a/packages/30_extra_materials.cmake b/packages/30_extra_materials.cmake index 21d3585b6..922dcea1c 100644 --- a/packages/30_extra_materials.cmake +++ b/packages/30_extra_materials.cmake @@ -1,99 +1,102 @@ #=============================================================================== # @file extra_materials.cmake # # @author Nicolas Richart # # @date Wed Oct 31 16:24:42 2012 # # @brief package description for extra materials list # # @section LICENSE # # Copyright (©) 2010-2011 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 . # #=============================================================================== option(AKANTU_EXTRA_MATERIALS "Add the extra list of materials in Akantu" OFF) add_external_package_dependencies(extra_materials lapack) set(AKANTU_EXTRA_MATERIALS_FILES model/solid_mechanics/materials/material_neohookean.cc model/solid_mechanics/materials/material_viscoelastic/material_stiffness_proportional.cc model/solid_mechanics/materials/material_elastic_linear_anisotropic.cc model/solid_mechanics/materials/material_elastic_orthotropic.cc model/solid_mechanics/materials/material_damage/material_marigo.cc + model/solid_mechanics/materials/material_damage/material_brittle.cc model/solid_mechanics/materials/material_damage/material_mazars.cc model/solid_mechanics/materials/material_damage/material_damage_linear.cc model/solid_mechanics/materials/material_extra_includes.hh model/solid_mechanics/materials/material_viscoelastic/material_stiffness_proportional.hh model/solid_mechanics/materials/material_elastic_linear_anisotropic.hh model/solid_mechanics/materials/material_elastic_orthotropic.hh model/solid_mechanics/materials/material_neohookean.hh model/solid_mechanics/materials/material_damage/material_damage.hh model/solid_mechanics/materials/material_damage/material_damage_tmpl.hh model/solid_mechanics/materials/material_damage/material_marigo.hh + model/solid_mechanics/materials/material_damage/material_brittle.hh model/solid_mechanics/materials/material_damage/material_mazars.hh model/solid_mechanics/materials/material_damage/material_damage_linear.hh model/solid_mechanics/materials/material_damage/material_vreepeerlings.hh model/solid_mechanics/materials/material_neohookean_inline_impl.cc model/solid_mechanics/materials/material_damage/material_marigo_inline_impl.cc + model/solid_mechanics/materials/material_damage/material_brittle_inline_impl.cc model/solid_mechanics/materials/material_damage/material_mazars_inline_impl.cc model/solid_mechanics/materials/material_damage/material_damage_linear_inline_impl.cc model/solid_mechanics/materials/material_damage/material_vreepeerlings_inline_impl.cc model/solid_mechanics/materials/material_damage/material_vreepeerlings_tmpl.hh model/solid_mechanics/materials/material_viscoelastic/material_standard_linear_solid_deviatoric.cc model/solid_mechanics/materials/material_viscoelastic/material_standard_linear_solid_deviatoric.hh model/solid_mechanics/materials/material_finite_deformation.cc model/solid_mechanics/materials/material_finite_deformation/material_plastic.cc model/solid_mechanics/materials/material_finite_deformation.hh model/solid_mechanics/materials/material_finite_deformation/material_plastic.hh model/solid_mechanics/materials/material_finite_deformation/material_plastic_inline_impl.cc model/solid_mechanics/materials/material_finite_deformation_inline_impl.cc model/solid_mechanics/materials/material_plasticityinc/material_plasticityinc.hh model/solid_mechanics/materials/material_plasticityinc/material_plasticityinc.cc model/solid_mechanics/materials/material_plasticityinc/material_plasticityinc_inline_impl.cc model/solid_mechanics/materials/material_viscoplasticity/material_viscoplasticity.hh model/solid_mechanics/materials/material_viscoplasticity/material_viscoplasticity.cc model/solid_mechanics/materials/material_viscoplasticity/material_viscoplasticity_inline_impl.cc ) set(AKANTU_EXTRA_MATERIALS_TESTS test_material_standard_linear_solid_deviatoric_relaxation test_material_standard_linear_solid_deviatoric_relaxation_tension test_material_plasticity test_material_damage ) set(AKANTU_EXTRA_MATERIALS_DOC manual/manual-extra_materials.tex ) set(AKANTU_EXTRA_MATERIALS_MANUAL_FILES manual-extra_materials.tex figures/stress_strain_neo.pdf figures/stress_strain_visco.pdf figures/visco_elastic_law.pdf ) \ No newline at end of file diff --git a/src/model/solid_mechanics/materials/material_damage/material_brittle.cc b/src/model/solid_mechanics/materials/material_damage/material_brittle.cc new file mode 100644 index 000000000..0b6d8a3b0 --- /dev/null +++ b/src/model/solid_mechanics/materials/material_damage/material_brittle.cc @@ -0,0 +1,135 @@ +/** + * @file material_brittle_inline_impl.cc + * + * @author Josué Aranda + * @author Daniel Pino Muñoz + * + * @date Wed Feb 12 11:09:36 2014 + * + * @brief Specialization of the material class for the brittle material + * + * @section LICENSE + * + * Copyright (©) 2010-2011 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 . + * + */ + +/* -------------------------------------------------------------------------- */ +#include "material_brittle.hh" +#include "solid_mechanics_model.hh" + +__BEGIN_AKANTU__ + +/* -------------------------------------------------------------------------- */ +template +MaterialBrittle::MaterialBrittle(SolidMechanicsModel & model, + const ID & id): + Material(model, id), + MaterialDamage(model, id), + strain_rate_brittle("strain_rate_brittle", *this){ + AKANTU_DEBUG_IN(); + + this->registerParam("S_0", S_0, 157e6, ParamAccessType(_pat_parsable | _pat_modifiable)); + this->registerParam("E_0", E_0, 27e3, _pat_parsable, "Strain rate threshold"); + this->registerParam("A", A, 1.622e-5, _pat_parsable, "Polynome cubic constant"); + this->registerParam("B", B, -1.3274, _pat_parsable, "Polynome quadratic constant"); + this->registerParam("C", C, 3.6544e4, _pat_parsable, "Polynome linear constant"); + this->registerParam("D", D, -181.38e6, _pat_parsable, "Polynome constant"); + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +template +void MaterialBrittle::initMaterial() { + AKANTU_DEBUG_IN(); + MaterialDamage::initMaterial(); + + this->strain_rate_brittle.initialize(spatial_dimension * spatial_dimension); + + updateInternalParameters(); + + //this->Yd.resize(); + // const Mesh & mesh = this->model->getFEM().getMesh(); + + // Mesh::type_iterator it = mesh.firstType(spatial_dimension); + // Mesh::type_iterator last_type = mesh.lastType(spatial_dimension); + + // for(; it != last_type; ++it) { + // UInt nb_element = this->element_filter(*it).getSize(); + // UInt nb_quad = this->model->getFEM().getNbQuadraturePoints(*it); + + // Array & Yd_rand_vec = Yd_rand(*it); + // for(UInt e = 0; e < nb_element; ++e) { + // Real rand_part = (2 * drand48()-1) * Yd_randomness * Yd; + + // for(UInt q = 0; q < nb_quad; ++q) + // Yd_rand_vec(nb_quad*e+q,0) = Yd + rand_part; + // } + // } + + AKANTU_DEBUG_OUT(); +} + + +/* -------------------------------------------------------------------------- */ +template +void MaterialBrittle::updateInternalParameters() { + MaterialDamage::updateInternalParameters(); +} + +/* -------------------------------------------------------------------------- */ +template +void MaterialBrittle::computeStress(ElementType el_type, + GhostType ghost_type) { + AKANTU_DEBUG_IN(); + + Real * dam = this->damage(el_type, ghost_type).storage(); + + Array & velocity = this->model->getVelocity(); + Array & strain_rate_brittle = this->strain_rate_brittle(el_type, ghost_type); + Array & elem_filter = this->element_filter(el_type, ghost_type); + + this->model->getFEM().gradientOnQuadraturePoints(velocity, strain_rate_brittle, + spatial_dimension, + el_type, ghost_type, elem_filter); + + Array::iterator< Matrix > strain_rate_it = + this->strain_rate_brittle(el_type, ghost_type).begin(spatial_dimension, spatial_dimension); + + + MATERIAL_STRESS_QUADRATURE_POINT_LOOP_BEGIN(el_type, ghost_type); + + Real sigma_equivalent = 0; + Matrix & grad_v = *strain_rate_it; + + computeStressOnQuad(grad_u, grad_v, sigma, *dam, sigma_equivalent); + + ++strain_rate_it; + ++dam; + + MATERIAL_STRESS_QUADRATURE_POINT_LOOP_END; + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ + +INSTANSIATE_MATERIAL(MaterialBrittle); + + +__END_AKANTU__ diff --git a/src/model/solid_mechanics/materials/material_damage/material_brittle.hh b/src/model/solid_mechanics/materials/material_damage/material_brittle.hh new file mode 100644 index 000000000..af61a41b7 --- /dev/null +++ b/src/model/solid_mechanics/materials/material_damage/material_brittle.hh @@ -0,0 +1,138 @@ +/** + * @file material_brittle.hh + * + * @author Josué Aranda + * @author Daniel Pino Muñoz + * + * @date Wed Feb 12 11:09:36 2014 + * + * @brief Brittle damage law + * + * @section LICENSE + * + * Copyright (©) 2010-2011 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 . + * + */ + +/* -------------------------------------------------------------------------- */ +#include "aka_common.hh" +#include "material_damage.hh" +#include "material.hh" +/* -------------------------------------------------------------------------- */ + +#ifndef __AKANTU_MATERIAL_BRITTLE_HH__ +#define __AKANTU_MATERIAL_BRITTLE_HH__ + +__BEGIN_AKANTU__ + +/** + * Material brittle + * + * parameters in the material files : + * - S_0 : Critical stress at low strain rate (default: 157e6) + * - E_0 : Low strain rate threshold (default: 27e3) + * - A,B,C,D : Fitting parameters for the critical stress at high strain rates + * (default: 1.622e-11, -1.3274e-6, 3.6544e-2, -181.38) + */ +template +class MaterialBrittle : public MaterialDamage { + /* ------------------------------------------------------------------------ */ + /* Constructors/Destructors */ + /* ------------------------------------------------------------------------ */ +public: + + MaterialBrittle(SolidMechanicsModel & model, const ID & id = ""); + + virtual ~MaterialBrittle() {}; + + /* ------------------------------------------------------------------------ */ + /* Methods */ + /* ------------------------------------------------------------------------ */ +public: + + void initMaterial(); + + virtual void updateInternalParameters(); + + /// constitutive law for all element of a type + void computeStress(ElementType el_type, GhostType ghost_type = _not_ghost); + +protected: + /// constitutive law for a given quadrature point + inline void computeStressOnQuad(Matrix & grad_u, + Matrix & grad_v, + Matrix & sigma, + Real & dam, + Real & sigma_equivalent); + + inline void computeDamageAndStressOnQuad(Matrix & sigma, + Real & dam, + Real & sigma_c, + Real & fracture_stress); + + /* ------------------------------------------------------------------------ */ + /* DataAccessor inherited members */ + /* ------------------------------------------------------------------------ */ +public: + + inline virtual UInt getNbDataForElements(const Array & elements, + SynchronizationTag tag) const; + + inline virtual void packElementData(CommunicationBuffer & buffer, + const Array & elements, + SynchronizationTag tag) const; + + inline virtual void unpackElementData(CommunicationBuffer & buffer, + const Array & elements, + SynchronizationTag tag); + + /* ------------------------------------------------------------------------ */ + /* Accessors */ + /* ------------------------------------------------------------------------ */ +public: + + /* ------------------------------------------------------------------------ */ + /* Class Members */ + /* ------------------------------------------------------------------------ */ +protected: + + /// strain rate arrays ordered by element types + InternalField strain_rate_brittle; + + //polynome constants for critical stress value + Real A; + Real B; + Real C; + Real D; + + //minimum strain rate + Real E_0; + + //Critical stress at low strain rates + Real S_0; + +}; + +/* -------------------------------------------------------------------------- */ +/* inline functions */ +/* -------------------------------------------------------------------------- */ + +#include "material_brittle_inline_impl.cc" + +__END_AKANTU__ + +#endif /* __AKANTU_MATERIAL_brittle_HH__ */ diff --git a/src/model/solid_mechanics/materials/material_damage/material_brittle_inline_impl.cc b/src/model/solid_mechanics/materials/material_damage/material_brittle_inline_impl.cc new file mode 100644 index 000000000..0dc5dd689 --- /dev/null +++ b/src/model/solid_mechanics/materials/material_damage/material_brittle_inline_impl.cc @@ -0,0 +1,150 @@ +/** + * @file material_brittle_inline_impl.cc + * + * @author Josué Aranda + * @author Daniel Pino Muñoz + * + * @date Wed Feb 12 11:09:36 2014 + * + * @brief Implementation of the inline functions of the material brittle + * + * @section LICENSE + * + * Copyright (©) 2010-2011 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 + MaterialBrittle::computeStressOnQuad(Matrix & grad_u, + Matrix & grad_v, + Matrix & sigma, + Real & dam, + Real & sigma_equivalent) { + MaterialElastic::computeStressOnQuad(grad_u, sigma); + + Real equiv_strain_rate=0.; + Real volume_change_rate=grad_v.trace(); + if(spatial_dimension==2){ + if(this->plane_stress){ + Real e_dot_33 = this->lambda*(volume_change_rate)/(2. * this->mu - this->lambda); + volume_change_rate+=e_dot_33; + equiv_strain_rate+=2./3.*pow( e_dot_33 - volume_change_rate/3. , 2. ); + } + else + equiv_strain_rate+=2./3.*pow( volume_change_rate/3. , 2. ); + } + + for(UInt i=0; iE_0) + fracture_stress=A*pow(equiv_strain_rate,3)+B*pow(equiv_strain_rate,2)+C*equiv_strain_rate+D; + + Vector principal_stress(spatial_dimension); + sigma.eig(principal_stress); + Real sigma_c = principal_stress(0); + for(UInt i=1; iis_non_local) { + computeDamageAndStressOnQuad(sigma, dam, sigma_c, fracture_stress); + } +} + +/* -------------------------------------------------------------------------- */ +template +inline void +MaterialBrittle::computeDamageAndStressOnQuad(Matrix & sigma, + Real & dam, + Real & sigma_c, + Real & fracture_stress) { + if ( sigma_c > fracture_stress ) + dam = 1.; + + dam = std::min(dam,1.); + + sigma *= 1-dam; +} + +/* -------------------------------------------------------------------------- */ +template +inline UInt MaterialBrittle::getNbDataForElements(const Array & elements, + SynchronizationTag tag) const { + AKANTU_DEBUG_IN(); + + UInt size = 0; + if(tag == _gst_smm_init_mat) { + size += sizeof(Real) * this->getModel().getNbQuadraturePoints(elements); + } + + size += MaterialDamage::getNbDataForElements(elements, tag); + + AKANTU_DEBUG_OUT(); + return size; +} + +/* -------------------------------------------------------------------------- */ +template +inline void MaterialBrittle::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 MaterialBrittle::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(); +} diff --git a/src/model/solid_mechanics/materials/material_extra_includes.hh b/src/model/solid_mechanics/materials/material_extra_includes.hh index 5227b4e4a..a3df64742 100644 --- a/src/model/solid_mechanics/materials/material_extra_includes.hh +++ b/src/model/solid_mechanics/materials/material_extra_includes.hh @@ -1,68 +1,70 @@ /** * @file material_extra_includes.hh * * @author Nicolas Richart * * @date Wed Oct 31 16:24:42 2012 * * @brief Extra list of materials * * @section LICENSE * * Copyright (©) 2010-2011 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 . * */ /* -------------------------------------------------------------------------- */ // visco-elastic materials #include "material_stiffness_proportional.hh" #include "material_standard_linear_solid_deviatoric.hh" // elastic materials #include "material_neohookean.hh" #include "material_elastic_orthotropic.hh" #include "material_elastic_linear_anisotropic.hh" // damage materials #include "material_marigo.hh" +#include "material_brittle.hh" #include "material_mazars.hh" #include "material_damage_linear.hh" #include "material_vreepeerlings.hh" // plasticity #include "material_plastic.hh" #include "material_plasticityinc.hh" #include "material_viscoplasticity.hh" #define AKANTU_EXTRA_MATERIAL_LIST \ ((2, (damage_linear , MaterialDamageLinear ))) \ ((2, (marigo , MaterialMarigo ))) \ + ((2, (brittle , MaterialBrittle ))) \ ((2, (mazars , MaterialMazars ))) \ ((2, (vreepeerlings , MaterialVreePeerlings ))) \ ((2, (ve_stiffness_prop , MaterialStiffnessProportional ))) \ ((2, (sls_deviatoric , MaterialStandardLinearSolidDeviatoric))) \ ((2, (neohookean , MaterialNeohookean ))) \ ((2, (elastic_orthotropic, MaterialElasticOrthotropic ))) \ ((2, (anisotropic , MaterialElasticLinearAnisotropic ))) \ ((2, (plastic , MaterialPlastic ))) \ ((2, (plasticity , MaterialPlasticityinc ))) \ ((2, (viscoplasticity , MaterialViscoPlasticity )))