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

📄 dloadpd.cpp

📁 Finite element program for mechanical problem. It can solve various problem in solid problem
💻 CPP
字号:
#include "dloadpd.h"#include "global.h"#include "intools.h"/**  This constructor initializes class attributes to the zero values*/dloadpd::dloadpd(){  eq = NULL;  var = NULL;  expr[0] = '\0';  ampl = 0.0;}/**  This destructor deallocates used memory.*/dloadpd::~dloadpd(){  delete eq;  delete var;}/**  This function reads data for the dynamical prescribed displacements from the opened text file  given by the parameter in.  @param in - pointer to the opened text file  @retval 0 - on success.  @retval 1 - error parsing string expression*/long dloadpd::read(XFILE *in){  Parser par;  xfscanf(in, "%le", &ampl);  getnexttxt(in->file);  fgets(expr, 255, in->file);  eq = par.TextToTree(expr);  if (eq == NULL)  {    fprintf(stderr, "\nError parsing expression\n");    return(1);  }  var = eq->Variables.at(0);  return(0);}/**  This function return value of the dynamical prescribed displacement  for the time given by the parameter t.  @param t - desired value of time.  @retval The function returns value of the dynamical prescribed displacement for the given time.*/double dloadpd::getval(double t){  double ret;  var->Value = t;  ret = ampl * eq->Evaluate();  return(ret);}

⌨️ 快捷键说明

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