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

📄 therisomat.cpp

📁 Finite element program for mechanical problem. It can solve various problem in solid problem
💻 CPP
字号:
#include "therisomat.h"#include "global.h"#include "matrix.h"#include "intpoints.h"therisomat::therisomat (void){  alpha=0.0;}therisomat::~therisomat (void){}void therisomat::read (XFILE *in){  xfscanf (in,"%lf",&alpha);}void therisomat::matdilat (matrix &d,strastrestate ssst){  switch (ssst){  case bar:{    matdilat_bar (d);    break;  }  case plbeam:{    matdilat_plbeam (d);    break;  }  case planestress:{    matdilat_plstress (d);    break;  }  case planestrain:{    matdilat_plstrain (d);    break;  }  case plate:{    matdilat_plate (d);    break;  }  case axisymm:{    matdilat_axi (d);    break;  }  case spacestress:{    matdilat_spacestr (d);    break;  }  default:{    fprintf (stderr,"\n unknown number of components of stress tensor is required");    fprintf (stderr,"\n in function therisomat::matdilat (%s, line %d).\n",__FILE__,__LINE__);  }  }}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for bar elements      d - thermal dilatancy matrix of the material      11.9.2001*/void therisomat::matdilat_bar (matrix &d){  d[0][0] = alpha;}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for plane beam elements      @param d - thermal dilatancy matrix of the material      11.9.2001*/void therisomat::matdilat_plbeam (matrix &d){  d[0][0] = alpha;  d[1][1] = 0.0;  d[2][2] = 0.0;//tady oprava  //d[2][2] = alpha;}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for 2D problems (plane stress)   @param d - thermal dilatancy matrix of the material   19.7.2001*/void therisomat::matdilat_plstress (matrix &d){  fillm(0.0,d);    d[0][0] = alpha;  d[0][1] = 0.0;    d[0][2] = 0.0;  d[1][0] = 0.0;    d[1][1] = alpha;  d[1][2] = 0.0;  d[2][0] = 0.0;    d[2][1] = 0.0;    d[2][2] = 0.0;}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for 2D problems (plane strain)   @param d - thermal dilatancy matrix of the material   19.7.2001*/void therisomat::matdilat_plstrain (matrix &d){  fillm(0.0,d);    d[0][0] = alpha;  d[0][1] = 0.0;     d[0][2] = 0.0;  d[1][0] = 0.0;    d[1][1] = alpha;   d[1][2] = 0.0;  d[2][0] = 0.0;    d[2][1] = 0.0;     d[2][2] = 0.0;}void therisomat::matdilat_axi (matrix &d){  fillm(0.0,d);    d[0][0]=alpha;  d[0][1]=0.0;    d[0][2]=0.0;  d[1][0]=0.0;    d[1][1]=alpha;  d[1][2]=0.0;  d[2][0]=0.0;    d[2][1]=0.0;    d[2][2]=alpha;  d[3][3]=0.0;}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for plate elements      @param d - thermal dilatancy matrix      19.7.2001*/void therisomat::matdilat_plate (matrix &d){  fillm(0.0,d);    d[0][0]=alpha;  d[1][1]=alpha;}/**   function creates thermal dilatancy matrix of the elastic   isotropic material for 3D problems      @param d - thermal dilatancy matrix of the material   19.7.2001*/void therisomat::matdilat_spacestr (matrix &d){  fillm(0.0,d);    d[0][0]=alpha;  d[1][1]=alpha;  d[2][2]=alpha;}/**   function computes eigenstrains caused by temperature changes   function assumes temperature changes in the array Mm->tempr   function is suitable for problems with constant temperature in time   @param ipp - integration point id      4.6.2005, JK*/void therisomat::temprstrains (long lcid,long ipp){  double dt;  strastrestate sss;    //  type of strain/stress state  sss = Mm->ip[ipp].ssst;    //  change of temperature  dt = Mm->tempr[ipp];  switch (sss){  case bar:{    Mm->tempstrains[ipp][0]=alpha*dt;    break;  }  case plbeam:{    Mm->tempstrains[ipp][0]=alpha*dt;    Mm->tempstrains[ipp][1]=0.0;    Mm->tempstrains[ipp][2]=0.0;//tady oprava    //Mm->tempstrains[ipp][2]=alpha*dt;    break;  }  case planestress:{    Mm->tempstrains[ipp][0]=alpha*dt;    Mm->tempstrains[ipp][1]=alpha*dt;    Mm->tempstrains[ipp][3]=alpha*dt;    break;  }  case planestrain:{    Mm->tempstrains[ipp][0]=alpha*dt;    Mm->tempstrains[ipp][1]=alpha*dt;    Mm->tempstrains[ipp][3]=alpha*dt;    break;  }  case axisymm:{    Mm->tempstrains[ipp][0]=alpha*dt;    Mm->tempstrains[ipp][1]=alpha*dt;    Mm->tempstrains[ipp][2]=alpha*dt;    break;  }  case spacestress:{    Mm->tempstrains[ipp][0]=alpha*dt;    Mm->tempstrains[ipp][1]=alpha*dt;    Mm->tempstrains[ipp][2]=alpha*dt;    break;  }  default:{    fprintf (stderr,"\n unknown strain/stress state is required in function therisomat::tempstrains (file %s, line %d)\n",	     __FILE__,__LINE__);  }  }  }

⌨️ 快捷键说明

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