1 /*! 2 * \file mfront/src/AsterStressFreeExpansionHandler.cxx 3 * \brief 4 * \author Thomas Helfer 5 * \brief 04 mars 2014 6 * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights 7 * reserved. 8 * This project is publicly released under either the GNU GPL Licence 9 * or the CECILL-A licence. A copy of thoses licences are delivered 10 * with the sources of TFEL. CEA or EDF may also distribute this 11 * project under specific licensing conditions. 12 */ 13 14 #include<cmath> 15 #include"MFront/Aster/AsterStressFreeExpansionHandler.hxx" 16 17 namespace aster 18 { 19 AsterStandardSmallStrainStressFreeExpansionHandler(AsterReal * const e,AsterReal * const de,const AsterReal * const s0,const AsterReal * const s1,const AsterInt d)20 void AsterStandardSmallStrainStressFreeExpansionHandler(AsterReal * const e, 21 AsterReal * const de, 22 const AsterReal *const s0, 23 const AsterReal *const s1, 24 const AsterInt d) 25 { 26 using namespace std; 27 static const AsterReal cste = AsterReal(2)/sqrt(AsterReal(2)); 28 e[0] -= s0[0]; 29 e[1] -= s0[1]; 30 e[2] -= s0[2]; 31 de[0] -= (s1[0]-s0[0]); 32 de[1] -= (s1[1]-s0[1]); 33 de[2] -= (s1[2]-s0[2]); 34 if(d==2){ 35 e[3] -= s0[3]*cste; 36 de[3] -= (s1[3]-s0[3])*cste; 37 } 38 if(d==3){ 39 e[3] -= s0[3]*cste; 40 e[4] -= s0[3]*cste; 41 e[5] -= s0[5]*cste; 42 de[3] -= (s1[3]-s0[3])*cste; 43 de[4] -= (s1[4]-s0[4])*cste; 44 de[5] -= (s1[5]-s0[5])*cste; 45 } 46 } // end of AsterStandardSmallStrainStressFreeExpansionHandler 47 48 } // end of namespace aster 49