geoelast.cpp

来自「Finite element program for mechanical pr」· C++ 代码 · 共 72 行

CPP
72
字号
#include "geoelast.h"#include "matrix.h"#include "vector.h"#include "global.h"#include "intpoints.h"#include "vecttens.h"#include "tensor.h"geoelastmat::geoelastmat (void){  keu = 0.0;}geoelastmat::~geoelastmat (void){}void geoelastmat::read (XFILE *in){  xfscanf (in,"%lf", &keu);}void geoelastmat::matstiff (matrix &d, long ipp,long ido){  Mm->matstiff(d, ipp, 1, ido);}void geoelastmat::nlstresses (long ipp, long im, long ido){  long i, n = Mm->ip[ipp].ncompstr;  vector eps(n),sig(n);  matrix d(n,n), sigt(3,3);  double i1s;    // compute plasticity  Mm->computenlstresses(ipp, im+1, ido+1);  // extract computed stresses  Mm->givestress (0, ipp, sig);  vector_tensor (sig, sigt, Mm->ip[ipp].ssst, stress);  i1s = first_invar (sigt)/3;  if (i1s <= Mm->ip[ipp].eqother[ido])  // loading state  {    Mm->storestress(0, ipp, sig);    // update reached pressure    Mm->ip[ipp].other[ido]=i1s;  }  else  // unloading state  {    // assembling unloading matrix    cmulm(keu, d);    // give total strains    Mm->givestrain(0, ipp, eps);    // elastic strain = total strain - plastic strain    for (i=0; i<n; i++)      eps[i] -= Mm->ip[ipp].eqother[ido+1+i];    mxv(d, eps, sig);    Mm->storestress(0, ipp, sig);    // copy reached pressure to current state    Mm->ip[ipp].other[ido] = Mm->ip[ipp].eqother[ido];  }}void geoelastmat::updateval (long ipp, long im, long ido){  // update reached pressure  Mm->ip[ipp].eqother[ido] = Mm->ip[ipp].other[ido];    // update values of plasticity model  Mm->updateipvalmat (ipp,im+1,ido+1);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?