@@ -312,18 +312,15 @@ int main (int argc, char** argv)
312312 stopTime = atof (argv [++ i ]);
313313 else if (!strcmp (argv [i ],"- check "))
314314 stopTime = -1.0 ;
315- else if (!infile )
315+ else if (infile )
316+ std ::cerr <<" ** Unknown option ignored: " << argv [i ] << std ::endl ;
317+ else if (strcasestr (infile = argv [i ],".xinp" ))
316318 {
317- infile = argv [i ];
318- if (strcasestr (infile ,".xinp" ))
319- {
320- if (!args .readXML (infile ,false))
321- return 1 ;
319+ if (args .readXML (infile ,false))
322320 i = 0 ; // start over and let command-line options override input file
323- }
321+ else
322+ return 1 ; // pre-parse failure
324323 }
325- else
326- std ::cerr <<" ** Unknown option ignored: " << argv [i ] << std ::endl ;
327324
328325 if (!infile )
329326 {
@@ -342,10 +339,10 @@ int main (int argc, char** argv)
342339 return 0 ;
343340 }
344341
345- if (IFEM ::getOptions ().discretization == ASM ::Spline && args .adaptive )
342+ if (IFEM ::getOptions ().discretization == ASM ::Spline && args .adap )
346343 IFEM ::getOptions ().discretization = ASM ::LRSpline ;
347344 else if (IFEM ::getOptions ().discretization < ASM ::LRSpline )
348- args .adaptive = false;
345+ args .adap = false;
349346
350347 IFEM ::cout <<"\nInput file: " << infile ;
351348 IFEM ::getOptions ().print (IFEM ::cout );
@@ -378,7 +375,7 @@ int main (int argc, char** argv)
378375 if (linear && args .algor > STATIC )
379376 {
380377 // Create the linear continuum model
381- if (args .twoD )
378+ if (args .dim == 2 )
382379 model = new SIMElasticity < SIM2D > (args .checkRHS );
383380 else
384381 model = new SIMElasticity < SIM3D > (args .checkRHS );
@@ -400,7 +397,7 @@ int main (int argc, char** argv)
400397 }
401398
402399 // Create the nonlinear continuum model
403- if (args .twoD )
400+ if (args .dim == 2 )
404401 model = new SIMFiniteDefEl < SIM2D > (args .checkRHS ,args .options );
405402 else
406403 model = new SIMFiniteDefEl < SIM3D > (args .checkRHS ,args .options );
@@ -409,15 +406,15 @@ int main (int argc, char** argv)
409406 case STATIC :
410407 {
411408 // Invoke the nonlinear quasi-static solver with fixed load increments
412- NonlinearDriver simulator (* model ,linear ,args .adaptive );
409+ NonlinearDriver simulator (* model ,linear ,args .adap );
413410 return runSimulator (simulator ,model ,infile ,ignoredPatches ,args .fixDup ,
414411 args .printMax ,dtDump ,stopTime ,zero_tol ,outPrec ,
415412 args .dNodeMap );
416413 }
417414 case ARCLEN :
418415 {
419416 // Invoke the nonlinear quasi-static arc-length solver
420- ArcLengthDriver simulator (* model ,args .adaptive );
417+ ArcLengthDriver simulator (* model ,args .adap );
421418 return runSimulator (simulator ,model ,infile ,ignoredPatches ,args .fixDup ,
422419 args .printMax ,dtDump ,stopTime ,zero_tol ,outPrec ,
423420 args .dNodeMap );
0 commit comments