FreeFEM のパッチ 下記を目的とした修正です。 1) save() で実数を出力したときは複素数にしないようにする 2) intt[] が intt(0)[] と同じになってしまうバグの修正 3) iter(expr) が定数しか受け付けないバグの修正 4) エラーメセージが見当違いのキーワードを教えるバグの修正 私的な変更は含んでいません。 平林 浩一 *** ORGdisk.cxx Tue Sep 22 15:53:50 1998 --- disk.cxx Tue Sep 22 15:53:41 1998 *************** *** 336,342 **** { ofstream file (path, ios::out | ios::app); // file.seekoff(0,ios::end,0); ! file << f << "\n"; file.close (); return 0; } --- 336,345 ---- { ofstream file (path, ios::out | ios::app); // file.seekoff(0,ios::end,0); ! if (flag.complexe == 0) ! file << realpart(f) << endl; ! else ! file << f << "\n"; file.close (); return 0; } *** ORGfem.cxx Mon Aug 31 09:44:39 1998 --- fem.cxx Mon Aug 31 09:46:44 1998 *************** *** 1189,1197 **** --- 1189,1203 ---- integrale += ginteg_t(k, f, g, quadra); return integrale; } + #if 0 if (ref1 == 0) for (k = 0;k < nt;k++) integrale += ginteg_t(k, f, g, quadra); + #else + if (ref1 == -1) + for (k = 0;k < nt;k++) + integrale += ginteg_t(k, f, g, quadra); + #endif else if (ref2 == 0) for (k = 0;k < nt;k++) { *** ORGsyntaxic.cxx Mon Aug 31 09:44:13 1998 --- syntaxic.cxx Tue Sep 22 15:57:21 1998 *************** *** 118,128 **** char errbuf[1024]; // 1024 seems to be big enough to hold the messages var variables; int waitm = 1; ! char *mesg[102] = {"'('", "')'", "'{'", "'}'", "'constant'", "'new variable'", "'old variable'", "'+'", "'-'", "'*'", "'/'", "'%'","'<'", "'<='", "'>'", "'>='", ! "'=='", "'!='", "','", "';'", "'sin'", "'cos'", "'log'", "'exp'", "'sqrt'", "'abs'", "'^'", "'acos'", "'asin'", "'tan'", "'and'", "'cosh'", "sinh'", "'tanh'", "'or'", "'min'", "'max'", "'dx'", "'dy'", "'if'", --- 118,128 ---- char errbuf[1024]; // 1024 seems to be big enough to hold the messages var variables; int waitm = 1; ! char *mesg[103] = {"'('", "')'", "'{'", "'}'", "'constant'", "'new variable'", "'old variable'", "'+'", "'-'", "'*'", "'/'", "'%'","'<'", "'<='", "'>'", "'>='", ! "'=='", "'!='", "','", "';'", ":", "'sin'", "'cos'", "'log'", "'exp'", "'sqrt'", "'abs'", "'^'", "'acos'", "'asin'", "'tan'", "'and'", "'cosh'", "sinh'", "'tanh'", "'or'", "'min'", "'max'", "'dx'", "'dy'", "'if'", *************** *** 134,141 **** "'dy'", "'convect'", "'evalfct'", "'exec'", "'saveall'", "'user'", "'Re'", "'Im'", "'system'", "'pde'", "'id_bdy'", "'dnu_bdy'", "'dxx'", "'dyy'", "'dxy'", "'dyx'", "'complex'", "'precise'" ! ,"'scal'", "'nx'", "'ny'", "'one'", "'wait'", "'nowait'", "'rhsconvect'", ! "'adaptmesh'","'polygon'","'intt'","'int'","']'","'['", "'varsolve'","'penal'","':'"}; /* syntaxic.c prototypes for routines not used elsewhere */ void plante (arbre *, Symbol, creal, long, ident *, char *, noeud *, noeud *, noeud *, noeud *); --- 134,141 ---- "'dy'", "'convect'", "'evalfct'", "'exec'", "'saveall'", "'user'", "'Re'", "'Im'", "'system'", "'pde'", "'id_bdy'", "'dnu_bdy'", "'dxx'", "'dyy'", "'dxy'", "'dyx'", "'complex'", "'precise'" ! ,"'scal'", "'one'", "'wait'", "'nowait'", "nographics", "'rhsconvect'", ! "'adaptmesh'","'polygon'","'intt'","'int'","']'","'['", "'varsolve'","'penal'"}; /* syntaxic.c prototypes for routines not used elsewhere */ void plante (arbre *, Symbol, creal, long, ident *, char *, noeud *, noeud *, noeud *, noeud *); *************** *** 1092,1102 **** --- 1092,1109 ---- case loop: nextsym (); match (lpar); + #if 0 thecst = curcst; match (cste); match (rpar); l1 = instruction (); plante (&res, loop, thecst, 0, NULL, pt, l1, NULL, NULL, NULL); + #else + l1 = expr (); + match (rpar); + l2 = instruction (); + plante (&res, loop, thecst, 0, NULL, pt, l1, l2, NULL, NULL); + #endif break; case newvar: *************** *** 3036,3042 **** --- 3043,3053 ---- case gint: if(s->name) tableaddr = s->name->table; else tableaddr = NULL; if (s->l1 == NULL) + #if 0 return ginteg(0, + #else + return ginteg(-1, + #endif 0, 0, s->l4->name->table, *************** *** 3244,3249 **** --- 3255,3261 ---- case loop: { + #if 0 int i; NumOfIterations = (int)realpart (s->value); // for xgfem for (i = 1; i <= realpart (s->value); i++) *************** *** 3251,3256 **** --- 3263,3277 ---- Iter = i; eval (s->l1); } + #else + int i, j; + NumOfIterations = j = (int)realpart (eval(s->l1)); // for xgfem + for (i = 1; i <= j; i++) + { + Iter = i; + eval (s->l2); + } + #endif } break; ---< cut >---