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

📄 mechprep.cpp

📁 Finite element program for mechanical problem. It can solve various problem in solid problem
💻 CPP
字号:
#define EXTERN#include "global.h"#include "globmat.h"#include "genfile.h"#include "input.h"#include "output.h"#include "globprep.h"#include "elemhead.h"#include "iotools.h"#include <stdio.h>int main (int argc,char *argv[]){  XFILE *in;  long err;  descrip *d;  fprintf (stdout,"\n\n *** MEFEL PREPROCESSOR ***\n");  fprintf (stdout," --------------------------\n");  Mp  = new probdesc;  Gtm = new gtopology;  Top = new siftop;  Mt  = new mechtop;  Mm  = new mechmat;  Mc  = new mechcrsec;  Mb  = new mechbclc;  Outdm = new outdriverm;  Bar2d = new barel2d;  Bar3d = new barel3d;  Beam2d = new beamel2d;  Beam3d = new beamel3d;  Spring = new springel;  Pelt = new planeelemlt;  Peqt = new planeelemqt;  Perlt = new planeelemrotlt;  Pelq = new planeelemlq;  Peqq = new planeelemqq;  Perlq = new planeelemrotlq;  Pesqt = new planeelemsubqt;  Cct = new cctelem;  Dkt = new dktelem;  Dst = new dstelem;  Q4pl = new q4plate;  Asymlq = new axisymlq;  Asymqq = new axisymqq;  Asymlt = new axisymlt;  Shtr = new shelltr;  Shq = new shellq;  Ltet = new lintet;  Lhex = new linhex;  Qhex = new quadhex;  Spltr = new soilplatetr;  Splq = new soilplateq;    if (argc < 3){    fprintf (stderr,"\n Wrong number of command line parameters.");    fprintf (stderr,"\n Use : mechprep input_file_name output_file name\n\n");    delete Mp;  delete Mt;  delete Mm;  delete Mc;  delete Mb;    return(1);  }  in = xfopen(argv[1],"r");  if (in==NULL){    fprintf (stderr,"\n Input file has not been specified.");    fprintf (stderr,"\n Try it again!\n\n");    delete Mp;  delete Mt;  delete Mm;  delete Mc;  delete Mb;    return(2);  }  in->maxlnsize = 1024;  in->warrning = 1;  in->kwdmode = ignore;  //in->kwdmode = sequent_mode;  in->ignorecase = 1;     d = new descrip;  // reading line with topology file name  xfscanf(in, "%a", d->t3df);  // reading line with material database file name  xfscanf(in, "%a", d->matf);  // reading line with cross-section database file name  xfscanf(in, "%a", d->crf);  // reading line with topology file format indicator,  xfscanf(in, "%ld", &d->t3d);  d->seq = 1;  // reading line with edge number indicator  xfscanf(in, "%ld", &d->redgn);  // reading problem description  in->kwdmode = sequent_mode;  xfscanf(in, "%k", "begin");  in->kwdmode = ignore;  Mp->read(in);  in->kwdmode = sequent_mode;  xfscanf(in, "%k", "end");  in->kwdmode = ignore;  // main input of properties  err = input(in, d);  Mt->alloc_prep(Top->nodes, Top->elements);  if(err)  {    xfclose(in);    fprintf (stderr,"\n\n Error in the programe.\n");    return(err);  }  // reading output description  in->kwdmode = sequent_mode;  xfscanf(in, "%k", "begin");  in->kwdmode = ignore;  if (Mp->tprob == growing_mech_structure){    Gtm->read_gf (in);  }  Outdm->read(in);  xfclose(in);  FILE *out = fopen(argv[2], "wt");  if (out==NULL){    fprintf (stderr,"\n Output file couldn't be opened.");    fprintf (stderr,"\n Try it again!\n\n");    return(7);  }  fprintf(stdout, "\nTopology export . . .");  Top->exporttop(Gtm);  fprintf(stdout, " O.K.\n");  fprintf(stdout, "\nProblem description output . . .");  Mp->print(out);  fprintf(stdout, " O.K.\n");  output(out, d);  if (Mp->tprob == growing_mech_structure)  {      fprintf(stdout, "\nTime function output . . .");    Gtm->print_gf(out);    fprintf(stdout, " O.K.\n");  }  fprintf(stdout, "\nOutdriver description output . . .");  Outdm->print(out);  fprintf(stdout, " O.K.\n");  fclose(out);  printf ("\n");  fprintf(stdout, "\n");  fprintf(stderr, "\n");  delete d;  delete Mp;  delete Mt;  delete Gtm;  delete Mm;  delete Mc;  delete Mb;  return(0);} 

⌨️ 快捷键说明

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