⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contactmat.cpp

📁 Finite element program for mechanical problem. It can solve various problem in solid problem
💻 CPP
字号:
#include "contactmat.h"#include "matrix.h"#include "vector.h"#include "stochdriver.h"#include "global.h"#include "intpoints.h"contactmat::contactmat (void){  slip = 0.0;  normal = 0.0;  limitn=0.0;  limits=0.0;}contactmat::~contactmat (void){}void contactmat::read (XFILE *in){  xfscanf (in,"%lf %lf %lf %lf",&slip,&normal,&limits,&limitn);}/**   function returns stiffness %matrix of material      @param d - stiffness %matrix of the material   JK, 11.6.2006*/void contactmat::matstiff (matrix &d,long ipp){  long i,n = Mm->ip[ipp].ncompstr;  vector eps(n),sig(n);  //  initial values  for (i=0;i<n;i++){    eps[i]=Mm->ip[ipp].strain[i];  }    sig[0]=eps[0]*normal;  if (sig[0]>limitn)    d[0][0]=limitn;  else    d[0][0]=normal;  sig[1]=eps[1]*slip;  if (sig[1]>limits)    d[1][1]=limits;  else    d[1][1]=slip;}/**   function computes nodal forces in contact problems   nodal forces are computed from difference of nodal displacements   at appropriate nodes   the name nlstresses is used only with respect to other   "classical" material models which work with stresses      @param ipp - integration point id      JK, 11.6.2006*/void contactmat::nlstresses (long ipp){  long i, n = Mm->ip[ipp].ncompstr;  vector eps(n),sig(n);    //  initial values  for (i=0;i<n;i++){    eps[i]=Mm->ip[ipp].strain[i];  }    sig[0]=eps[0]*normal;  if (sig[0]>limitn)    sig[0]=limitn;  sig[1]=eps[1]*slip;  if (sig[1]>limits)    sig[1]=limits;    for (i=0;i<n;i++){    Mm->ip[ipp].stress[i]=sig[i];  }  }void contactmat::changeparam (atsel &atm,vector &val){  long i;    for (i=0;i<atm.num;i++){    switch (atm.atrib[i]){    case 0:{      slip=val[i];      break;    }    case 1:{      normal=val[i];      break;    }    default:{      fprintf (stderr,"\n\n wrong number of atribute in function changeparam (%s, line %d).\n",__FILE__,__LINE__);    }    }  }}

⌨️ 快捷键说明

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