![]() |
MechSys
1.0
Computing library for simulations in continuum and discrete mechanics
|
00001 /************************************************************************ 00002 * MechSys - Open Library for Mechanical Systems * 00003 * Copyright (C) 2005 Dorival M. Pedroso * 00004 * * 00005 * This program is free software: you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation, either version 3 of the License, or * 00008 * any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00017 ************************************************************************/ 00018 00019 namespace MPM { 00020 00021 inline void MPoints2D::_stress_update(double Dt, double & DsE) // 3) 00022 { 00023 // Stress/strain update 00024 DsE = 0.0; 00025 for (size_t p=0; p<_p.Size(); ++p) 00026 { 00027 if (_mdl[p]!=NULL) 00028 { 00029 // Variables 00030 STensor2 sp0; sp0 = _mdl[p]->Sig(); // initial point stress 00031 ATensor2 L; L = 0.0; // mat point velocity gradient 00032 00033 // Compute the velocity gradient 00034 int k = 0; 00035 for (int i=0; i<4; ++i) 00036 for (int j=0; j<4; ++j) 00037 { 00038 int n = _lbn[p]+((i*_g->nCol())+j); // grid node number 00039 DyadUp (_g->v(n), _sg[p].G[k], L); // L += v dyad G 00040 k++; 00041 } 00042 00043 // Compute the strain increment == rate of deformation D*Dt 00044 STensor2 de; Sym (Dt, L, de); // de = Dt*sym(L) 00045 00046 // Update the stress state 00047 _mdl[p]->Update (de); 00048 00049 // Strain energy 00050 double Vp = 4.0*_l[p](0)*_l[p](1); // particle volume 00051 DsE += 0.5*blitz::dot((sp0+_mdl[p]->Sig()),de)*Vp; // Strain Energy on points 00052 00053 // Update deformation gradient 00054 ATensor2 DF; DF = 1.0,1.0,1.0, 0.0,0.0,0.0, 0.0,0.0,0.0; // Delta F 00055 DF += L*Dt; // DF = I + L*Dt 00056 Dot (DF, _F[p], _F[p]); // F = DF*F 00057 } 00058 } 00059 } 00060 00061 }; // namespace MPM