Index of Commands

The implementation of the most of the user commands are just a wrapping to the fortran operator.

Some other are more specific and do more things in Python.

DEBUT — Initialization of code_aster

The Starter starts the execution by initializing the code_aster memory manager (Jeveux). For this task, it parses the arguments through the ExecutionParameter object. By default, arguments are those read from the command line and those passed init(). If the command line arguments are not set for code_aster, they can be ignored with CA.init(..., noargv=True).

Some Python objects that have to be available from libaster are passed during the initialization to the ExecutionParameter.

class code_aster.CodeCommands.debut.ExecutionStarter[source]

Bases: object

Initialize the ExecutionParameter object for requests from the both sides Python/Fortran.

classmethod init(set_args_callback, argv=None, fcomm=0)[source]

Initialization of class attributes.

set_args_callback

Callback to assign parameters values after parsing arguments (but before the libaster initialization).

Type:

func

argv

List of command line arguments (defaults to sys.argv).

Type:

list[str], None

fcomm

Id of the MPI communicator.

Type:

int, optional

Returns:

True if the initialization has been done, False if the execution was already initialized.

Return type:

bool

class code_aster.CodeCommands.debut.Starter[source]

Bases: ExecuteCommand

Define the commands DEBUT/POURSUITE.

classmethod run(caller, **keywords)[source]

Run the Command.

Parameters:

keywords (dict) – User keywords

exec_(keywords)[source]

Execute the command.

Parameters:

keywords (dict) – User’s keywords.

_call_oper(syntax)[source]

Call fortran operator.

Parameters:

syntax (CommandSyntax) – Syntax description with user keywords.

code_aster.CodeCommands.debut.DEBUT(*, caller='DEBUT', **keywords)

Run the Command.

Parameters:

keywords (dict) – User keywords

code_aster.CodeCommands.debut.POURSUITE(*, caller='POURSUITE', **keywords)

Run the Command.

Parameters:

keywords (dict) – User keywords

code_aster.CodeCommands.debut.init(*argv, **kwargs)[source]

Initialize code_aster as DEBUT/POURSUITE command does + command line options.

If the code_aster study is embedded under another Python program, the “–slave” option may be useful to catch exceptions (even TimeLimitError) and try not to exit the Python interpreter.

Parameters:
  • argv (list) – List of command line arguments.

  • kwargs (dict) – Keywords arguments passed to ‘DEBUT’/’POURSUITE’ + ‘debug (bool)’ same as -g/–debug, ‘debugpy (int)’ to start a debugpy session on this port number, ‘noargv (bool)’ to ignore previously passed arguments, ‘comm (mpi4py.MPI.Comm)’ to select the MPI communicator.

FIN — Finalization of code_aster

The Closer finalizes the execution by closing the code_aster memory manager (Jeveux).

The objects existing in the context where FIN() is called are pickled while their Jeveux content is saved in glob.* databases. A call to the function saveObjects() is equivalent.

class code_aster.CodeCommands.fin.Closer[source]

Bases: ExecuteCommand

Command that closes the execution.

change_syntax(keywords)[source]

Adapt syntax before checking syntax.

Consume argument to force to exit after the command.

Parameters:

keywords (dict) – Keywords arguments of user’s keywords, changed in place.

classmethod run(**keywords)[source]

Run the Command.

Parameters:

keywords (dict) – User keywords

exec_(keywords)[source]

Execute the command.

Parameters:

keywords (dict) – User’s keywords.

_call_oper(dummy)[source]

Save objects that exist in the context of the caller.

The memory manager is closed when libaster is unloaded.

post_exec(keywords)[source]

Force to exit if exit=True option was passed.

Parameters:

keywords (dict) – Keywords arguments of user’s keywords.

code_aster.CodeCommands.fin.FIN(**keywords)

Run the Command.

Parameters:

keywords (dict) – User keywords

code_aster.CodeCommands.fin.close(**keywords)

Run the Command.

Parameters:

keywords (dict) – User keywords