TRACE control file (controlfile)

TRACE control file

Associated Modules

tracecommandlistClass

TRACE control file environment

tracecommandClass

Definition of one TRACE command

membershipClass

Description which block(s) will be concerned by the command

executionmodeClass

Description how the command will be executed

Usage

This class will read in a TRACE control file:

#########################################################
#
# TRACE control file
#
# TRACE 8.0.032
#
#########################################################

all immediate StartZonalDebug
group 0 iteration 999 writeProbeData 10 1000
block 12 periodic 4 5 writeRadialDistribution ../output/radial/bd_radial

#all immediate StartWriteBlockResidual

This module is imported using:

from mojo.traceSuiteControl.controlfile import TraceCommandList

example:

myTraceCommand = TraceCommandList()
myTraceCommand.convertCommandFile()
myTraceCommand.writeCommandFile("goofy.input")

Modules

TRACE control file environment

class TraceCommandList(name='TRACE_control', filename='TRACE_control.input', version='', comment='')[source]

TRACE control file environment

Parameters
  • name (str) – name of TRACE command list

  • filename (str) – name of TRACE control file

activateCommandLine(name)[source]

Activates a command present in the TRACE command list given by its name.

Parameters
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

Return
  • (bool) flag whether activation setting is changed

addCommand(name, active=True, ensemble='all', ensembleNumber=- 1, execution='immediate', stepNumber=- 1, periodicity=- 1, options=None)[source]

Add a Trace command line to the TRACE command list.

Parameters
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

  • active (bool): activation setting for TRACE command

  • ensemble (str): membership type

  • ensembleNumber (int): related index

  • execution (str): execution mode

  • stepNumber (int): iteration number for execution

  • periodicity (int): repetition rate

  • options (list of strings): additional option list

Return
  • (bool) flag whether TRACE command has been added

addCommandLine(tracecommandLine)[source]

Add a Trace command line to the TRACE command list.

Parameters
  • tracecommandLine (str): Trace command to be added

addCommandList(tracecommandlist)[source]

Add a Trace command line to the TRACE command list.

Parameters
  • tracecommandlist (traceCommandList): TraceCommandList to be concatenated.

changeExecutionmode(name, execution, stepNumber=- 1, periodicity=- 1, ind=0)[source]

[tcommand.name for tcommand in self.listofcommands] Change attributes of execution mode

Parameters:
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

  • execution (str): execution mode

  • stepNumber (int): iteration number for execution

  • periodicity (int): repetition rate

changeMembership(name, ensemble, ensembleNumber=- 1, ind=0)[source]

Change attributes of membership

Parameters:
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

  • ensemble (str): membership type

  • ensembleNumber (int): related index

changeOptions(name, options=None)[source]

Change option list

Parameters:
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

  • options (list of strings): additional option list

convertCommandFile(filename='')[source]

Read commands from a TRACE control file and add them to the command list

Parameters
  • filename (str): name of the TRACE control file

deactivateCommandLine(name)[source]

Deactivates a command present in the TRACE command list given by its name.

Parameters
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

Return
  • (bool) flag whether activation setting is changed

getCommand(name)[source]

Return command

Parameters:
  • name (str): name of the TRACE command (e.g “WriteSurfaceData”)

Return
  • (Tracecommand instance or None) searched TRACE command

removeCommandItem(name, ind=- 1)[source]

Remove a command from the TRACE command list.

Parameters
  • name (str): name of the TraceCommand (e.g “WriteSurfaceData”)

  • id (str): index of removed settings (default: -1)

Return
  • (bool) flag whether TRACE command has been removed

removeCommandLine(name)[source]

Remove a command from the TRACE command list.

Parameters
  • name (str): name of the TraceCommand (e.g “WriteSurfaceData”)

Return
  • (bool) flag whether TRACE command has been removed

writeCommandFile(filename='')[source]

Create a TRACE control file containing the listOfTracecommand directly usable by TRACE.

Parameters
  • filename (str): name of the TRACE control file

Definition of one TRACE command

class Tracecommand(active=True, name='', ensemble='', ensembleNumber=- 1, execution='', stepNumber=- 1, periodicity=- 1, options=None)[source]

Class used to define one TRACE command.

Parameters
  • active (bool) – status of command

  • name (str) – name of TRACE command

  • options (list of strings) – list of additional options

addCommandFromString(tracecommandLine)[source]

Fill Trace command settings from a string

Parameters
  • tracecommandLine (str): Trace command to be added

addCommandSettings(active=True, ensemble='all', ensembleNumber=- 1, execution='immediate', stepNumber=- 1, periodicity=- 1, options=None)[source]

Add command settings to the related lists

changeExecutionmode(execution, stepNumber=- 1, periodicity=- 1, ind=0)[source]

Change attributes of execution mode

Parameters:
  • execution (str): execution mode

  • stepNumber (int): iteration number for execution

  • periodicity (int): repetition rate

Return
  • (bool) flag whether attributes have been changed

changeMembership(ensemble, ensembleNumber=- 1, ind=0)[source]

Change attributes of membership

Parameters:
  • ensemble (str): membership type

  • ensembleNumber (int): related index

Return
  • (bool) flag whether attributes have been changed

changeOptions(options, ind=0)[source]

Change option list

Parameters:
  • options (list of strings): additional option list

  • id (integer): index of options

checkTracecommandAttributes()[source]

to be written :-)

getOptions(ind=0)[source]

Return option list for specified index

Parameters:
  • id (integer): index of options

ordonateTraceCommand()[source]
Returns the string corresponding to the TraceCommand directly usable by TRACE.
  • create the string with the right sequence of arguments (+ in/activated as #).

removeAllSettings()[source]
removeSettings(setId)[source]

Description which block(s) will be concerned by the command

class Membership(ensemble='', ensembleNumber=- 1)[source]

Class used to describe which block(s) will be concerned by the command.

changeAttributes(ensemble, ensembleNumber=- 1)[source]

Change attributes

Parameters
  • ensemble (str): membership type

  • ensembleNumber (int): related index

Return
  • (bool) flag whether attributes have been changed

commandLineString()[source]

Description how the command will be executed

class ExecutionMode(execution='', stepNumber=- 1, periodicity=- 1)[source]

Class used to describe how the command will be executed.

Parameters
  • execution (str) – execution mode

  • stepNumber (int) – iteration number for execution (used for ‘iteration’, ‘periodic’, and ‘group’)

  • periodicity (int) – repetition rate (used for ‘periodic’ only)

changeAttributes(execution, stepNumber=- 1, periodicity=- 1)[source]

Change attributes

Parameters
  • execution (str): execution mode

  • stepNumber (int): iteration number for execution

  • periodicity (int): repetition rate

Return
  • (bool) flag whether attributes have been changed