00001 #include "../SRC/pglobal.h"
00002 #include "../SRC/seqfile.h"
00003 #include "../SRC/paral.h"
00004 #include "../../MEFEL/PREP/input.h"
00005 #include <stdio.h>
00006 #include <string.h>
00007 #include "mpi.h"
00008
00009 probdesc *Mp;
00010 pprobdesc *Pmp;
00011 mechtop *Mt;
00012 paral *Plg;
00013 mechmat *Mm;
00014 mechcrsec *Mc;
00015 mechbclc *Mb;
00016
00017 densemat *Sm_dm,*Mm_dm;
00018 skyline *Sm_sky,*Mm_sky;
00019 comprow *Sm_cr,*Mm_cr;
00020 symcomprow *Sm_scr,*Mm_scr;
00021 lhsrhs *Lsrs;
00022
00023 barel2d *Bar2d=NULL;
00024 planestresslt *Pslt=NULL;
00025 planestressqt *Psqt=NULL;
00026 planestressrotlt *Psrlt=NULL;
00027 planestresslq *Pslq=NULL;
00028 planestressqq *Psqq=NULL;
00029 planestressrotlq *Psrlq=NULL;
00030 cctelem *Cct=NULL;
00031 axisymlq *Asymlq=NULL;
00032 lintet *Ltet=NULL;
00033 linhex *Lhex=NULL;
00034 quadhex *Qhex=NULL;
00035
00036 int Nproc,Myrank,Ndom;
00037 long Ndof,Indof,Mespr;
00038 long *Domproc;
00039 FILE *Out;
00040
00041 int main (int argc,char *argv[])
00042 {
00043 FILE *in, *tmpf;
00044 descrip *d;
00045
00046 fprintf (stderr,"\n\n *** PARMEFEL PREPROCESSOR ***\n");
00047 fprintf (stderr," -----------------------------\n");
00048
00049 Mp = new probdesc;
00050 Pmp = new pprobdesc;
00051 Mt = new mechtop;
00052 Mm = new mechmat;
00053 Mc = new mechcrsec;
00054 Mb = new mechbclc;
00055
00056 if (argc < 3){
00057 fprintf (stderr,"\n Wrong number of command line parameters.");
00058 fprintf (stderr,"\n Use : mechprep input_file_name output_file name\n\n");
00059 delete Mp; delete Mt; delete Mm; delete Mc; delete Mb;
00060 return(1);
00061 }
00062 in = fopen(argv[1],"r");
00063 if (in==NULL){
00064 fprintf (stderr,"\n Input file has not been specified.");
00065 fprintf (stderr,"\n Try it again!\n\n");
00066 delete Mp; delete Mt; delete Mm; delete Mc; delete Mb;
00067 return(2);
00068 }
00069
00070 d = new descrip;
00071
00072 getstring(in, d->t3df, 1024);
00073
00074 getstring(in, d->matf, 1024);
00075
00076 getstring(in, d->crf, 1024);
00077
00078 getlong(in,d->t3d);
00079 d->seq = 0;
00080
00081 tmpf = cleancommblock(in);
00082 if (tmpf == NULL)
00083 {
00084 fprintf(stderr, "\n\nError - unable to open temporary file");
00085 fprintf(stderr, "\n in function main() (mechprep.cpp)\n");
00086 return (1);
00087 }
00088 Pmp->read(tmpf);
00089 fclose(tmpf);
00090 Mp->tprob = Pmp->tprob;
00091 Mp->nlcsip = Pmp->nlcsip;
00092 Mp->nstrcomp = Pmp->nstrcomp;
00093
00094 input(in, d);
00095 fclose(in);
00096
00097 FILE *out = fopen(argv[2], "wt");
00098 if (out==NULL){
00099 fprintf (stderr,"\n Output file couldn't be opened.");
00100 fprintf (stderr,"\n Try it again!\n\n");
00101 return(7);
00102 }
00103 Pmp->print(out);
00104 output(out, d);
00105 fclose(out);
00106
00107 fprintf(stderr, "\n");
00108
00109 delete d;
00110 delete Pmp; delete Mp; delete Mt; delete Mm; delete Mc; delete Mb;
00111 return(0);
00112 }