Perl-To-Python Conversion

This section documents the capabilities of the Tosca Python Control to interpret the CONFIG-command of the Tosca Perl Control.

General Information and Limitations

Certain limitations exist on this functionality:

  • Perl syntax must be valid;
  • Only single-line statements are processed with the simple semantics <key> = <value>, where <value> is not analyzed nor parsed;
  • Only specific statements are supported (see table below);
  • Unsupported statements lead to an error in the Tosca Python Control execution.

Supported Statements

The Tosca Python Control is capable of interpreting a limited subset of statements found in a CONFIG-command.

The following table lists all supported Perl-variables. Some example code for each variable is provided together with a Python equivalent to facilitate the migration from Perl to Python.

Perl Variable

Perl Syntax

Python Equivalent

fe_solver_exe

${fe_solver_exe} = "E:\FE_APP\SIMULIA\Abaqus\Commands\abq6143.bat";

driver.Solver.Path = r'E:\FE_APP\SIMULIA\Abaqus\Commands\abq6143.bat'

fe_solver_add_cal

${fe_solver_add_call} = "cpus=8 memory=90%";

driver.Solver.AddCallArgs = [ 'cpus=8', 'memory=90%' ]

fem_modif_add_call

${fem_modif_add_call} = "--format_matrices FIL";

driver.Modules[ ToscaModules.FEM_MODIF ].AddCallArgs = [ '--format_matrices', 'FIL' ]

res2vtm_add_call

${res2vtm_add_call} = "--format_matrices FIL";

driver.Modules[ ToscaModules.RES_2_VTM ].AddCallArgs = [ '--format_matrices', 'FIL' ]

driver.Modules[ ToscaModules.ODB_2_VTM ].AddCallArgs = [ '--format_matrices', 'FIL' ]

add_move_per_iter_list

add_move_per_iter_list("0,1,last", "SAVE.odb", "*.odb");

driver.registerSaveRule( UpdateRules.COPY, CheckPoints.ITER_COMPLETE, EventTimes.FIRST_LAST, [ '*.odb' ], 'SAVE.odb', '_%i' )

driver.registerSaveRule( UpdateRules.COPY, CheckPoints.ITER_COMPLETE, (EventTimes.NTH, 1), [ '*.odb' ], 'SAVE.odb', '_%i' )