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

📄 elsurfload.cpp

📁 Finite element program for mechanical problem. It can solve various problem in solid problem
💻 CPP
字号:
#include "elsurfload.h"#include "intools.h"#include "mathem.h"#include <math.h>#include <string.h>/**  This constructor initializes data to the zero values*/elsurfload::elsurfload(){  nlc   = 0;  nsurf = 0;  lgcs  = NULL;  ndir  = 0;  f     = NULL;}/**  This destructor deallocates used memory*/elsurfload::~elsurfload(){  delete [] lgcs;  delete [] f;}/**  This function reads data element surface load from the text file given by the parameter in  Parameters :  @param in - pointer to the opned text file  @param lc - total number of load cases  Returns :  @retval 0 - on succes  @retval 1 - error reading load case number   @retval 2 - error reading number of surfaces  @retval 3 - error reading local/global coordinate system indicator*/long elsurfload::read(FILE *in, long lc){  getlong(in, nlc);  if ((nlc < 1) || (nlc > lc))    return(1);  getlong(in, nsurf);  if ((nsurf < 1) || (nsurf > 6))    return(2);  getlong(in, ndir);  long i, j;  lgcs = new long[nsurf];  f = new double [ndir*nsurf];  memset(f, 0, sizeof(*f)*ndir*nsurf);  for (i = 0; i < nsurf; i++)  {      lgcs[i] = -1;    getlong(in, lgcs[i]);    if ((lgcs[i] < 0) || (lgcs[i] > 2))      return(3);    if (lgcs[i] > 0)    {      for (j = i*ndir; j < i*ndir+ndir; j++)        getdouble(in, f[j]);    }  }  return(0);}

⌨️ 快捷键说明

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