Internal API#
Python 3#
These modules are intended purely for use in Python 3. They do not need to be Abaqus Python compatible.
scons_extensions#
Provide common SCons builders wrapping the Turbo-Turtle command-line interface.
- turbo_turtle.scons_extensions.cli_builder(
 - program: str = 'turbo-turtle',
 - subcommand: str = '',
 - required: str = '',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a generic Turbo-Turtle CLI builder.
This builder provides a template action for the Turbo-Turtle CLI. The default behavior will not do anything unless the
subcommandargument is updated to one of the Turbo-Turtle CLI Sub-commands.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.This builder and any builders created from this template will be most useful if the
optionsargument places SCons substitution variables in the action string, e.g.--argument ${argument}, such that the task definitions can modify the options on a per-task basis. Any option set in this manner must be provided by the task definition.Builder/Task keyword arguments
program: The Turbo-Turtle command line executable absolute or relative pathsubcommand: A Turbo-Turtle subcommandrequired: A space delimited string of subcommand required argumentsoptions: A space delimited string of subcommand optional argumentsabaqus_command: The Abaqus command line executable absolute or relative path. When provided as a task keyword argument, this must be a space delimited string, not a list.cubit_command: The Cubit command line executable absolute or relative path. When provided as a task keyword argument, this must be a space delimited string, not a list.backend: The backend software, e.g. Abaqus or Cubit.cd_action_prefix: Advanced behavior. Most users should accept the defaults.redirect_action_postfix: Advanced behavior. Most users should accept the defaults.
action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend {backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleCLIBuilder": turbo_turtle.scons_extensions.cli_builder( program=env["turbo_turtle], subcommand="geometry", required="--input-file ${SOURCES.abspath} --output-file ${TARGET.abspath}" ) }) env.TurboTurtleCLIBuilder( target=["target.cae"], source=["source.csv"], )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- Returns:
 SCons Turbo-Turtle CLI builder
- turbo_turtle.scons_extensions.cylinder(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'cylinder',
 - required: str = '--output-file ${TARGET.abspath} --inner-radius ${inner_radius} --outer-radius ${outer_radius} --height ${height}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle cylinder subcommand CLI builder.
See the cylinder CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.Unless the
requiredargument is overridden, the following task keyword arguments are required:inner_radiusouter_radiusheight
action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleCylinder": turbo_turtle.scons_extensions.cylinder( program=env["turbo_turtle] ) }) env.TurboTurtleCylinder( target=["target.cae"], source=["SConstruct"], inner_radius=1., outer_radius=2., height=1. )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.export(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'export',
 - required: str = '--input-file ${SOURCE.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle export subcommand CLI builder.
See the export CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleExport": turbo_turtle.scons_extensions.export( program=env["turbo_turtle] ) }) env.TurboTurtleExport( target=["target.inp"], source=["source.cae"], )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.geometry(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'geometry',
 - required: str = '--input-file ${SOURCES.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle geometry subcommand CLI builder.
See the geometry CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleGeometry": turbo_turtle.scons_extensions.geometry( program=env["turbo_turtle], options="--part-name ${part_name}" ) }) env.TurboTurtleGeometry( target=["target.cae"], source=["source1.csv", "source2.csv"], part_name="source1 source2" )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.geometry_xyplot(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'geometry-xyplot',
 - required: str = '--input-file ${SOURCES.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle geometry-xyplot subcommand CLI builder.
See the geometry-xyplot CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleGeometryXYPlot": turbo_turtle.scons_extensions.geometry_xyplot( program=env["turbo_turtle], options="--part-name ${part_name}" ) }) env.TurboTurtleGeometryXYPlot( target=["target.png"], source=["source1.csv", "source2.csv"], part_name="source1 source2" )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.image(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'image',
 - required: str = '--input-file ${SOURCE.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle image subcommand CLI builder.
See the image CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleImage": turbo_turtle.scons_extensions.image( program=env["turbo_turtle] ) }) env.TurboTurtleImage( target=["target.png"], source=["source.cae"], )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.merge(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'merge',
 - required: str = '--input-file ${SOURCES.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle merge subcommand CLI builder.
See the merge CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleMerge": turbo_turtle.scons_extensions.merge( program=env["turbo_turtle] ) }) env.TurboTurtleMerge( target=["target.cae"], source=["source1.cae", "source2.cae"], )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.mesh(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'mesh',
 - required: str = '--input-file ${SOURCE.abspath} --output-file ${TARGET.abspath} --element-type ${element_type}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle mesh subcommand CLI builder.
See the mesh CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.Unless the
requiredargument is overridden, the following task keyword arguments are required:element_type
action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleMesh": turbo_turtle.scons_extensions.mesh( program=env["turbo_turtle] ) }) env.TurboTurtleMesh( target=["target.cae"], source=["source.cae"], element_type="C3D8R" )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.partition(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'partition',
 - required: str = '--input-file ${SOURCE.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle partition subcommand CLI builder.
See the partition CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtlePartition": turbo_turtle.scons_extensions.partition( program=env["turbo_turtle] ) }) env.TurboTurtlePartition( target=["target.cae"], source=["source.cae"], )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.sets(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'sets',
 - required: str = '--input-file ${SOURCE.abspath} --output-file ${TARGET.abspath}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle sets subcommand CLI builder.
See the sets CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.One of the following options must be added to the
optionsstring or the subcommand will return an error:--face-set--edge-set--vertex-set
action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleSets": turbo_turtle.scons_extensions.sets( program=env["turbo_turtle], options="${face_sets} ${edge_sets} ${vertex_sets}", ) }) env.TurboTurtleSets( target=["target.cae"], source=["source.cae"], face_sets="--face-set top '[#1 ]' --face-set bottom '[#2 ]'", edge_sets="", vertex_sets="--vertex-set origin '[#1 ]'" )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
- turbo_turtle.scons_extensions.sphere(
 - program: str = 'turbo-turtle',
 - subcommand: str = 'sphere',
 - required: str = '--output-file ${TARGET.abspath} --inner-radius ${inner_radius} --outer-radius ${outer_radius}',
 - options: str = '',
 - abaqus_command: list[str] = ['abaqus', 'abq2024'],
 - cubit_command: list[str] = ['cubit'],
 - backend: str = 'abaqus',
 Return a Turbo-Turtle sphere subcommand CLI builder.
See the sphere CLI documentation for detailed subcommand usage and options. Builds subcommand specific options for the
turbo_turtle.scons_extensions.cli_builder()function.At least one target must be specified. The first target determines the working directory for the builder’s action. The action changes the working directory to the first target’s parent directory prior to execution.
The emitter will assume all emitted targets build in the current build directory. If the target(s) must be built in a build subdirectory, e.g. in a parameterized target build, then the first target must be provided with the build subdirectory, e.g.
parameter_set1/my_target.ext. When in doubt, provide a STDOUT redirect file as a target, e.g.target.stdout.Unless the
requiredargument is overridden, the following task keyword arguments are required:inner_radiusouter_radius
action string construction#${cd_action_prefix} ${program} ${subcommand} ${required} ${options} --abaqus-command ${abaqus_command} --cubit-command ${cubit_command} --backend ${backend} ${redirect_action_postfix}SConstruct#import waves import turbo_turtle env = Environment() env["turbo_turtle"] = waves.scons_extensions.add_program(env, ["turbo-turtle"]) env.Append(BUILDERS={ "TurboTurtleSphere": turbo_turtle.scons_extensions.sphere( program=env["turbo_turtle] ) }) env.TurboTurtleSphere( target=["target.cae"], source=["SConstruct"], inner_radius=1., outer_radius=2. )
- Parameters:
 program (str) – The Turbo-Turtle command line executable absolute or relative path
subcommand (str) – A Turbo-Turtle subcommand
required (str) – A space delimited string of subcommand required arguments
options (str) – A space delimited string of subcommand optional arguments
abaqus_command (list) – The Abaqus command line executable absolute or relative path options
cubit_command (list) – The Cubit command line executable absolute or relative path options
backend (str) – The backend software
_main#
- turbo_turtle._main._print_abaqus_path_location() None[source]#
 Print the absolute path to the Turbo Turtle Abaqus Python package directory.
Exits with a non-zero exit code if the settings variable
_abaqus_python_parent_abspathdoes not exist.
- turbo_turtle._main.add_abaqus_and_cubit(parsers: list[ArgumentParser]) None[source]#
 Add the Abaqus and Cubit command arguments to each parser in the parsers list.
- Parameters:
 parsers (list) – List of parsers to run
add_argumentfor the command options
- turbo_turtle._main.append_cubit_description(
 - text: str,
 - append: str = 'Defaults to Abaqus, but can optionally run Cubit (Gmsh implementation is a work-in-progress). Cubit and Gmsh backends replace hyphens with underscores in part name(s) for ACIS compatibility. Cubit backend ignores model/assembly name arguments.',
 Append common long description with optional Cubit text.
- Parameters:
 text (str) – original text
append (str) – new text
- Returns:
 appended text
- Return type:
 str
_abaqus_wrappers#
- turbo_turtle._abaqus_wrappers.cylinder(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.cylinder_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.export(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.export_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.geometry(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.geometry_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.image(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.image_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.merge(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.merge_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.mesh(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.mesh_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.partition(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.partition_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.sets(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.sets_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
- turbo_turtle._abaqus_wrappers.sphere(args: Namespace, command: str) None[source]#
 Python 3 wrapper around the Abaqus Python
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.sphere_parser()CLI.- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – abaqus executable path
_cubit_wrappers#
Unpack command-line argparse namespace into full function interfaces.
The wrapper functions must have the API form
def wrapper(args: argparse.Namespace, command: str) -> None:
    pass
The command argument is required for compatibility with turbo_turtle._abaqus_wrappers.
- turbo_turtle._cubit_wrappers.cylinder(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.cylinder().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path, unused. Kept for API compatibility with
turbo_turtle._abaqus_wrappers()
- turbo_turtle._cubit_wrappers.export(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.export().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path
- turbo_turtle._cubit_wrappers.geometry(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.geometry().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path, unused. Kept for API compatibility with
turbo_turtle._abaqus_wrappers()
- turbo_turtle._cubit_wrappers.image(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.image().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path.
- turbo_turtle._cubit_wrappers.merge(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.merge().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path
- turbo_turtle._cubit_wrappers.mesh(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.mesh().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path, unused. Kept for API compatibility with
turbo_turtle._abaqus_wrappers()
- turbo_turtle._cubit_wrappers.partition(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.partition().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path
- turbo_turtle._cubit_wrappers.sets(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.sets().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path
- turbo_turtle._cubit_wrappers.sphere(args: Namespace, command: str) None[source]#
 Python 3 wrapper around Cubit calling
turbo_turtle._cubit_python.sphere().Unpack the argument namespace into the full function interface
- Parameters:
 args (argparse.Namespace) – namespace of parsed arguments
command (str) – cubit executable path, unused. Kept for API compatibility with
turbo_turtle._abaqus_wrappers()
_cubit_python#
Python 3 module that imports cubit.
Which requires that Cubit’s bin directory is found on PYTHONPATH, either directly by the end user or from a successful
turbo_turtle._utilities.find_cubit_bin() call and internal sys.path modification. This module does not
perform sys.path manipulation, so the importing/calling module/script must verify that Cubit will import correctly
first.
- turbo_turtle._cubit_python._create_new_block(volumes: list) int[source]#
 Create a new block for all volumes in list.
Sheet bodies are added to block as surfaces. Volumes are added as volumes.
- Parameters:
 volumes – list of Cubit volume objects
- Returns:
 new block ID
- turbo_turtle._cubit_python._create_volume_from_surfaces(surfaces: Sequence | ndarray, keep: bool = True)[source]#
 Create a volume from the provided surfaces. Surfaces must create a closed volume.
- Parameters:
 surfaces – List of Cubit surface objects
keep – Keep the original surface objects/sheet bodies
- Returns:
 Cubit volume object
- Return type:
 cubit.Volume
- turbo_turtle._cubit_python._create_volume_name_block(name: str) int[source]#
 Create a new block with all volumes prefixed by name.
- Parameters:
 name – Name for new block and prefix for volume search
- Returns:
 New block ID
- turbo_turtle._cubit_python._draw_surface(
 - lines: list[tuple[tuple[float, float], tuple[float, float]]] | list[ndarray],
 - splines: list[Sequence[tuple[float, float]]] | list[ndarray],
 Given ordered lists of line/spline coordinates, create a Cubit surface object.
- Parameters:
 lines – list of [2, 2] shaped arrays of (x, y) coordinates defining a line segment
splines – list of [N, 2] shaped arrays of (x, y) coordinates defining a spline
- Returns:
 Cubit surface defined by the lines and splines input
- Return type:
 cubit.Surface
- turbo_turtle._cubit_python._export_abaqus(output_file: Path, part_name: str) None[source]#
 Create a part-named block, add all volumes/surfaces with name prefix, export an Abaqus orphan mesh file.
- Parameters:
 output_file – Abaqus file to write
part_name – part/volume name to create as blocks from all volumes with a matching prefix
- turbo_turtle._cubit_python._export_abaqus_list(part_name: list[str], element_type: list[str | None], destination: Path) None[source]#
 Export one Abaqus orphan mesh per part in the destination directory.
- Parameters:
 part_name – list of part/volume names to create as blocks from all volumes with a matching prefix
element_type – List of element type strings
destination – Parent directory for orphan mesh files
- turbo_turtle._cubit_python._export_genesis(
 - output_file: Path,
 - part_name: list[str],
 - element_type: list[str | None],
 - output_type: Literal['genesis', 'genesis-normal', 'genesis-hdf5'] = 'genesis',
 Export all volumes with part name prefix to the output file.
Always creates new blocks named after the part/volume prefix.
- Parameters:
 output_file – Genesis file to write
part_name – list of part/volume names to create as blocks from all volumes with a matching prefix
element_type – list of element type strings
output_type – String identifying genesis output type: genesis (large format), genesis-normal, genesis-hdf5
- turbo_turtle._cubit_python._feature_seeds(feature: str, name_number: Sequence[tuple[str, str | int | float]]) None[source]#
 Create mesh seeds on features by name.
If the number is an integer, seed by interval. If the number is a float, seed by size
- Parameters:
 feature – Cubit feature name
name_number – Feature seed tuples (name, number)
- turbo_turtle._cubit_python._get_volumes_from_name(names: list[str]) list[source]#
 Return all volume objects with a prefix from the
nameslist.- Parameters:
 names – Name(s) prefix to search for with
cubit.get_all_ids_from_name- Returns:
 list of Cubit volumes with name prefix
- Return type:
 list of cubit.Volume objects
- turbo_turtle._cubit_python._mesh(
 - element_type: str,
 - part_name: str,
 - global_seed: float,
 - edge_seeds: Sequence[tuple[str, str | int | float]] | None,
 Mesh Cubit volumes and sheet bodies by part/volume name.
- Parameters:
 element_type – Cubit scheme “trimesh” or “tetmesh”. Else ignored.
part_name – part/volume name prefix
global_seed – The global mesh seed size
edge_seeds – Edge seed tuples (name, number)
- turbo_turtle._cubit_python._mesh_multiple_volumes(volumes: list, global_seed: float, element_type: str | None = None) None[source]#
 Mesh
cubit.Volumeobjects as volumes or sheet bodies.- Parameters:
 volumes – list of Cubit volume objects to mesh
- turbo_turtle._cubit_python._mesh_sheet_body(volume, global_seed: float, element_type: str | None = None) None[source]#
 Mesh a volume that is a sheet body.
Assumes
cubit.is_sheet_body(volume.id())isTrue.- Parameters:
 volume (cubit.Volume) – Cubit volume to mesh as a sheet body
global_seed – Seed size, e.g.
cubit.cmd(surface {} size {global_seed}element_type – Cubit meshing scheme. Accepts ‘trimesh’ or is ignored.
- turbo_turtle._cubit_python._mesh_volume(volume, global_seed: float, element_type: str | None = None) None[source]#
 Mesh a volume.
- Parameters:
 volume (cubit.Volume) – Cubit volume to mesh
global_seed – Seed size, e.g.
cubit.cmd(volume {} size {global_seed}element_type – Cubit meshing scheme. Accepts ‘tetmesh’ or is ignored.
- turbo_turtle._cubit_python._partition(
 - center: tuple[float, float, float] | ndarray = [0.0, 0.0, 0.0],
 - xvector: tuple[float, float, float] | ndarray = [1.0, 0.0, 0.0],
 - zvector: tuple[float, float, float] | ndarray = [0.0, 0.0, 1.0],
 - part_name: list[str] = ['Part-1'],
 - big_number: float = 1000000.0,
 Partition Cubit files with pyramidal body intersections defined by a cube’s center and vertices and with local coordinate planes.
- Parameters:
 center – center location of the geometry
xvector – Local x-axis vector defined in global coordinates
zvector – Local z-axis vector defined in global coordinates
part_name – part/volume name prefixes
big_number – Number larger than the outer radius of the part to partition.
- turbo_turtle._cubit_python._rename_and_sweep(
 - surface,
 - part_name: str,
 - center: tuple[float, float, float] | ndarray = (0.0, 0.0, 0.0),
 - planar: bool = False,
 - revolution_angle: float = 360.0,
 Recover body or volume from body surface, sweep part if required, and rename body/volume by part name.
Hyphens are replaced by underscores to make the ACIS engine happy.
- Parameters:
 surface (cubit.Surface) – Cubit surface object to rename and conditionally sweep
part_name – name of the part being created
planar – switch to indicate that 2D model dimensionality is planar, not axisymmetric
revolution_angle – angle of solid revolution for
3Dgeometries. Ignore when planar is True.
- Returns:
 Cubit volume object
- Return type:
 cubit.Volume
- turbo_turtle._cubit_python._set_from_mask(feature: str, name_mask: Sequence[tuple[str, str | int]]) None[source]#
 Create named features, with associated node and sidesets, by feature ID.
- Parameters:
 feature – Cubit feature name
name_mask – Feature set tuples (name, ID string)
- turbo_turtle._cubit_python._set_genesis_output_type(output_type: Literal['genesis', 'genesis-normal', 'genesis-hdf5']) None[source]#
 Set Cubit exodus/genesis output type.
- Parameters:
 output_type – String identifying genesis output type: genesis (large format), genesis-normal, genesis-hdf5
- turbo_turtle._cubit_python._sets(
 - face_sets: Sequence[tuple[str, str | int]] | None = None,
 - edge_sets: Sequence[tuple[str, str | int]] | None = None,
 - vertex_sets: Sequence[tuple[str, str | int]] | None = None,
 Create named features, with associated node and sidesets, by feature ID.
- Parameters:
 face_sets – Face set tuples (name, mask)
edge_sets – Edge set tuples (name, mask)
vertex_sets – Vertex set tuples (name, mask)
- turbo_turtle._cubit_python._sphere(
 - inner_radius: float,
 - outer_radius: float,
 - quadrant: Literal['upper', 'lower', 'both'] = 'both',
 - revolution_angle: float = 360.0,
 - center: tuple[float, float] = (0.0, 0.0),
 - part_name: str = 'Part-1',
 Create a sphere geometry without file I/O.
- Parameters:
 inner_radius – inner radius (size of hollow)
outer_radius – outer radius (size of sphere)
quadrant – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
center – tuple of floats (X, Y) location for the center of the sphere
part_name – name of the part to be created in the Abaqus model
- turbo_turtle._cubit_python._surface_centroids(surfaces: list) list[ndarray][source]#
 Return a list of 3D surface centroids from the provided list of surface objects.
- Parameters:
 surfaces – list of Cubit surface objects
- Returns:
 list of surface centroids
- turbo_turtle._cubit_python._surface_numbers(surfaces: Sequence | ndarray) list[int][source]#
 Return a list of surface IDs from the provided list of surface objects.
- Parameters:
 surfaces – list of Cubit surface objects
- Returns:
 list of surface IDs
- turbo_turtle._cubit_python._surfaces_by_vector(
 - surfaces: list,
 - principal_vector: ndarray,
 - center: tuple[float, float, float] | ndarray = (0.0, 0.0, 0.0),
 Return a flat list of Cubit surface objects that meet the requirement of a positive dot product between a given vector and the vector between two points: a user provided center point and a surface object centroid.
- Parameters:
 surfaces – list of Cubit surface objects
principal_vector – Local principal axis vector defined in global coordinates
center – center location of the geometry
- Returns:
 numpy.array of Cubit surface objects
- turbo_turtle._cubit_python._surfaces_for_volumes(volumes: list) list[source]#
 Return a flat list of surface objects for a list of volumes.
- Parameters:
 volumes – list of Cubit volume objects
- Returns:
 list of Cubit surface objects
- Return type:
 list of cubit.Surface
- turbo_turtle._cubit_python.create_arc_from_coordinates(
 - center: tuple[float, float, float] | ndarray,
 - point1: tuple[float, float, float] | ndarray,
 - point2: tuple[float, float, float] | ndarray,
 Create a circular arc cubit.Curve object from center and points on the curve.
- Parameters:
 center – tuple of floats (X, Y, Z) location for the center of the circle arc
point1 – tuple of floats (X, Y, Z) location for the first point on the arc
point2 – tuple of floats (X, Y, Z) location for the second point on the arc
- Returns:
 cubit curve object
- Return type:
 curbit.Curve
- turbo_turtle._cubit_python.create_curve_from_coordinates(point1: tuple[float, float, float], point2: tuple[float, float, float])[source]#
 Create a curve from 2 three-dimensional coordinates.
- Parameters:
 point1 (tuple) – First set of coordinates (x1, y1, z1)
point2 (tuple) – Second set of coordinates (x2, y2, z2)
- Returns:
 Cubit curve object defining a line segment
- Return type:
 cubit.Curve
- turbo_turtle._cubit_python.create_pyramid_partitions(
 - center: tuple[float, float, float] | ndarray,
 - xvector: tuple[float, float, float] | ndarray,
 - zvector: tuple[float, float, float] | ndarray,
 - size: float,
 - names: list[str],
 Partition all volumes with a prefix in the
nameslist with the size pyramids defined by a cube.- Parameters:
 center – center location of the geometry
xvector – Local x-axis vector defined in global coordinates
zvector – Local z-axis vector defined in global coordinates
size – Half-length of the cube diagonals (length of the pyramid tip to corner)
names – Volume name prefix(es) to search for with
cubit.get_all_ids_from_name
- Returns:
 list of Cubit volumes
- Return type:
 list of cubit.Volume objects
- turbo_turtle._cubit_python.create_pyramid_volumes(
 - center: tuple[float, float, float] | ndarray,
 - xvector: tuple[float, float, float] | ndarray,
 - zvector: tuple[float, float, float] | ndarray,
 - size: float,
 Return the six (6) four-sided pyramid volumes defined by a cube’s center point and six outer faces.
- Parameters:
 center (list) – center location of the geometry
xvector (list) – Local x-axis vector defined in global coordinates
zvector (list) – Local z-axis vector defined in global coordinates
size (float) – Half-length of the cube diagonals (length of the pyramid tip to corner)
- Returns:
 list of Cubit volumes
- Return type:
 list of cubit.Volume objects
- turbo_turtle._cubit_python.create_spline_from_coordinates(coordinates: Sequence[tuple[float, float, float]] | ndarray)[source]#
 Create a spline from a list of coordinates.
- Parameters:
 coordinates – [N, 3] array of coordinates (x, y, z)
- Returns:
 Cubit curve object defining a spline
- Return type:
 cubit.Curve
- turbo_turtle._cubit_python.create_surface_from_coordinates(coordinates: Sequence[tuple[float, float, float]] | ndarray)[source]#
 Create a surface from an [N, 3] array of coordinates.
Each row of the array represents a coordinate in 3D space. Must have at least 3 rows or a RuntimeError is raised. Coordinates are connected in pairs to create curves. First and last coordinate connected for final curve. Curves must defind a closed perimeter to generate a surface.
- Parameters:
 coordinates – [N, 3] array of 3D coordinates where N > 2.
- Returns:
 Cubit surface object
- Return type:
 cubit.surface
- turbo_turtle._cubit_python.cubit_command_or_exception(command: str) bool[source]#
 Thin wrapper around
cubit.cmdto raise an exception when returning False.Cubit returns True/False on
cubit.cmd("")calls, but does not raise an exception. This method will raise a RuntimeError when the command returns False.- Parameters:
 command – Cubit APREPRO command to execute
- turbo_turtle._cubit_python.cylinder(
 - inner_radius: float,
 - outer_radius: float,
 - height: float,
 - output_file: str | Path,
 - part_name: str = 'Part-1',
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 Accept dimensions of a right circular cylinder and generate an axisymmetric revolved geometry.
Centroid of cylinder is located on the global coordinate origin by default.
- Parameters:
 inner_radius – Radius of the hollow center
outer_radius – Outer radius of the cylinder
height – Height of the cylinder
output_file – Cubit
*.cubdatabase to save the part(s)part_name – name(s) of the part(s) being created
revolution_angle – angle of solid revolution for
3Dgeometriesy_offset – vertical offset along the global Y-axis
- turbo_turtle._cubit_python.export(
 - input_file: str | Path,
 - part_name: list[str] = ['Part-1'],
 - element_type: list[str | None] = [None],
 - destination: str | Path = '/home/runner/work/turbo-turtle/turbo-turtle',
 - output_type: Literal['abaqus', 'genesis', 'genesis-normal', 'genesis-hdf5'] = 'abaqus',
 Open a Cubit
*.cubfile and exportpart_nameprefixed volumes aspart_name.inp.- Parameters:
 input_file – Cubit
*.cubfile to open that already contains meshed parts/volumespart_name – list of part/volume name prefix to export
element_type – list of element types, one per part name or one global replacement for every part name
destination – write output orphan mesh files to this output directory
output_type – String identifying genesis output type: abaqus, genesis (large format), genesis-normal, genesis-hdf5
- turbo_turtle._cubit_python.geometry(
 - input_file: Sequence[str | Path],
 - output_file: str | Path,
 - planar: bool = False,
 - part_name: str = [None],
 - unit_conversion: float = 1.0,
 - euclidean_distance: float = 4.0,
 - delimiter: str = ',',
 - header_lines: int = 0,
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 - rtol: float = None,
 - atol: float = None,
 Create 2D planar, 2D axisymmetric, or 3D revolved geometry from an array of XY coordinates.
Note that 2D axisymmetric sketches and sketches for 3D bodies of revolution about the global Y-axis must lie entirely on the positive-X side of the global Y-axis.
This function can create multiple sheet bodies or volumes in the same Cubit
*.cubfile. If no part (body/volume) names are provided, the body/volume will be named after the input file base name.- Parameters:
 input_file (str) – input text file(s) with coordinates to draw
output_file (str) – Cubit
*.cubdatabase to save the part(s)planar (bool) – switch to indicate that 2D model dimensionality is planar, not axisymmetric
part_name (list) – name(s) of the part(s) being created
unit_conversion (float) – multiplication factor applies to all coordinates
euclidean_distance (float) – if the distance between two coordinates is greater than this, draw a straight line. Distance should be provided in units after the unit conversion
delimiter (str) – character to use as a delimiter when reading the input file
header_lines (int) – number of lines in the header to skip when reading the input file
revolution_angle (float) – angle of solid revolution for
3Dgeometries. Ignore when planar is True.y_offset (float) – vertical offset along the global Y-axis. Offset should be provided in units after the unit conversion.
rtol (float) – relative tolerance for vertical/horizontal line checks
atol (float) – absolute tolerance for vertical/horizontal line checks
- Returns:
 writes
{output_file}.cub
- turbo_turtle._cubit_python.image(
 - input_file: str | Path,
 - output_file: str | Path,
 - cubit_command: str,
 - x_angle: float = 0.0,
 - y_angle: float = 0.0,
 - z_angle: float = 0.0,
 - image_size: tuple[int, int] = [1920, 1080],
 Open a Cubit
*.cubfile and save an image.Uses the Cubit APREPRO hardcopy command, which accepts jpg, gif, bmp, pnm, tiff, and eps file extensions. This command only works in batch mode from Cubit APREPRO journal files, so an
input_file.jou is created for execution.- Parameters:
 input_file (str) – Cubit
*.cubfile to open that already contains parts/volumes to be meshedoutput_file (str) – Screenshot file to write
x_angle (float) – Rotation about ‘world’ X-axis in degrees
y_angle (float) – Rotation about ‘world’ Y-axis in degrees
z_angle (float) – Rotation about ‘world’ Z-axis in degrees
image_size (tuple) – Image size in pixels (width, height)
- turbo_turtle._cubit_python.imprint_and_merge(names: list[str]) None[source]#
 Imprint and merge all volume objects with a prefix from the
nameslist.- Parameters:
 names – Name(s) prefix to search for with
cubit.get_all_ids_from_name
- turbo_turtle._cubit_python.merge(input_file: Sequence[str | Path], output_file: str | Path) None[source]#
 Merge Cubit
*.cubfiles with forced unique block IDs and save to output file.- Parameters:
 input_file – List of Cubit
*.cubfile(s) to mergeoutput_file – Cubit
*.cubfile to write
- turbo_turtle._cubit_python.mesh(
 - input_file: str | Path,
 - element_type: str,
 - output_file: str | Path | None = None,
 - part_name: str | None = 'Part-1',
 - global_seed: float = 1.0,
 - edge_seeds: Sequence[tuple[str, str | int | float]] | None = None,
 Mesh Cubit volumes and sheet bodies by part/volume name.
- Parameters:
 input_file – Cubit
*.cubfile to open that already contains parts/volumes to be meshedelement_type – Cubit scheme “trimesh” or “tetmesh”. Else ignored.
output_file – Cubit
*.cubfile to writepart_name – part/volume name prefix
global_seed – The global mesh seed size
edge_seeds – Edge seed tuples (name, number)
- turbo_turtle._cubit_python.partition(
 - input_file: str | Path,
 - output_file: str | Path = None,
 - center: tuple[float, float, float] | ndarray = [0.0, 0.0, 0.0],
 - xvector: tuple[float, float, float] | ndarray = [1.0, 0.0, 0.0],
 - zvector: tuple[float, float, float] | ndarray = [0.0, 0.0, 1.0],
 - part_name: list[str] = ['Part-1'],
 - big_number: float = 1000000.0,
 Partition Cubit files with pyramidal body intersections defined by a cube’s center and vertices and with local coordinate planes.
- Parameters:
 input_file – Cubit
*.cubfile to open that already contains parts/volumes to be meshedoutput_file – Cubit
*.cubfile to writecenter – center location of the geometry
xvector – Local x-axis vector defined in global coordinates
zvector – Local z-axis vector defined in global coordinates
part_name – part/volume name prefixes
big_number – Number larger than the outer radius of the part to partition.
- turbo_turtle._cubit_python.sets(
 - input_file: str | Path,
 - output_file: str | Path | None = None,
 - part_name: str | None = 'Part-1',
 - face_sets: Sequence[tuple[str, str | int]] | None = None,
 - edge_sets: Sequence[tuple[str, str | int]] | None = None,
 - vertex_sets: Sequence[tuple[str, str | int]] | None = None,
 Create Cubit sidesets and nodesets from feature numbers.
- Parameters:
 input_file – Cubit
*.cubfile to open that already contains parts/volumes to be meshedoutput_file – Cubit
*.cubfile to writepart_name – part/volume name prefix
face_sets – Face set tuples (name, mask)
edge_sets – Edge set tuples (name, mask)
vertex_sets – Vertex set tuples (name, mask)
- turbo_turtle._cubit_python.sphere(
 - inner_radius: float,
 - outer_radius: float,
 - output_file: str | Path,
 - input_file: str | Path | None = None,
 - quadrant: Literal['upper', 'lower', 'both'] = 'both',
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 - part_name: str = 'Part-1',
 Create a sphere geometry with file I/O handling.
- Parameters:
 inner_radius – inner radius (size of hollow)
outer_radius – outer radius (size of sphere)
output_file – output file name. Will be stripped of the extension and
.cubwill be used.input_file – input file name. Will be stripped of the extension and
.cubwill be used.quadrant – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
y_offset – vertical offset along the global Y-axis
part_name – name of the part to be created in the Abaqus model
- turbo_turtle._cubit_python.webcut_local_coordinate_primary_planes(
 - center: tuple[float, float, float] | ndarray,
 - xvector: tuple[float, float, float] | ndarray,
 - zvector: tuple[float, float, float] | ndarray,
 - names: list[str],
 Webcut all volumes with a prefix in the
nameslist on the local coordinate system primary planes.- Parameters:
 center – center location of the geometry
xvector – Local x-axis vector defined in global coordinates
zvector – Local z-axis vector defined in global coordinates
names – Volume name prefix(es) to search for with
cubit.get_all_ids_from_name
- Returns:
 list of Cubit volumes with name prefix(es)
- Return type:
 list of cubit.Volume objects
_gmsh_python#
Python 3 module that imports python-gmsh.
- turbo_turtle._gmsh_python._create_arc_from_coordinates(
 - center: tuple[float, float, float] | ndarray,
 - point1: tuple[float, float, float] | ndarray,
 - point2: tuple[float, float, float] | ndarray,
 Create a circle arc Gmsh object from center and points on the curve.
- Parameters:
 center – tuple of floats (X, Y, Z) location for the center of the circle arc
point1 – tuple of floats (X, Y, Z) location for the first point on the arc
point2 – tuple of floats (X, Y, Z) location for the second point on the arc
- Returns:
 Gmsh curve tag
- turbo_turtle._gmsh_python._create_line_from_coordinates(point1: tuple[float, float, float], point2: tuple[float, float, float]) int[source]#
 Create a curve from 2 three-dimensional coordinates.
- Parameters:
 point1 – First set of coordinates (x1, y1, z1)
point2 – Second set of coordinates (x2, y2, z2)
- Returns:
 Gmsh 1D entity tag
- turbo_turtle._gmsh_python._create_spline_from_coordinates(coordinates: Sequence[tuple[float, float, float]] | ndarray) int[source]#
 Create a spline from a sequence of coordinates.
- Parameters:
 coordinates – [N, 3] array of coordinates (x, y, z)
- Returns:
 Gmsh 1D entity tag
- turbo_turtle._gmsh_python._draw_surface(lines_and_splines: list[ndarray]) int[source]#
 Given ordered lists of line/spline coordinates, create a Gmsh 2D surface object.
- Parameters:
 lines_and_splines – list of [N, 2] shaped arrays of (x, y) coordinates defining a line (N=2) or spline (N>2)
- Returns:
 Gmsh 2D entity tag
- turbo_turtle._gmsh_python._rename_and_sweep(
 - surface: int,
 - part_name: str,
 - center: tuple[float, float, float] | ndarray = (0.0, 0.0, 0.0),
 - planar: bool = False,
 - revolution_angle: float = 360.0,
 Recover surface, sweep part if required, and rename surface/volume by part name.
Hyphens are replaced by underscores to make the ACIS engine happy.
- Parameters:
 surface – Gmsh surface tag to rename and conditionally sweep
part_name – name(s) of the part(s) being created
center – coordinate location for the center of axisymmetric sweep
planar – switch to indicate that 2D model dimensionality is planar, not axisymmetric
revolution_angle – angle of solid revolution for
3Dgeometries. Ignore when planar is True.
- Returns:
 Gmsh dimTag (dimension, tag)
- turbo_turtle._gmsh_python._sphere(
 - inner_radius: float,
 - outer_radius: float,
 - quadrant: str = 'both',
 - revolution_angle: float = 360.0,
 - center: tuple[float, float] = (0.0, 0.0),
 - part_name: str = 'Part-1',
 Create a sphere geometry without file I/O handling.
- Parameters:
 inner_radius – inner radius (size of hollow)
outer_radius – outer radius (size of sphere)
quadrant – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
center – tuple of floats (X, Y) location for the center of the sphere
part_name – name of the part to be created in the Abaqus model
- turbo_turtle._gmsh_python.cylinder(
 - inner_radius: float,
 - outer_radius: float,
 - height: float,
 - output_file: str | Path,
 - model_name: str = 'Model-1',
 - part_name: str = 'Part-1',
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 Accept dimensions of a right circular cylinder and generate an axisymmetric revolved geometry.
Centroid of cylinder is located on the global coordinate origin by default.
- Parameters:
 inner_radius – Radius of the hollow center
outer_radius – Outer radius of the cylinder
height – Height of the cylinder
output_file – Gmsh
*.stepfile to save the part(s)model_name – name of the Gmsh model in which to create the part
part_name – name(s) of the part(s) being created
revolution_angle – angle of solid revolution for
3Dgeometriesy_offset – vertical offset along the global Y-axis
- turbo_turtle._gmsh_python.geometry(
 - input_file: Sequence[str | Path],
 - output_file: str | Path,
 - planar: bool = False,
 - model_name: str = 'Model-1',
 - part_name: str = [None],
 - unit_conversion: float = 1.0,
 - euclidean_distance: float = 4.0,
 - delimiter: str = ',',
 - header_lines: int = 0,
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 - rtol: float = None,
 - atol: float = None,
 Create 2D planar, 2D axisymmetric, or 3D revolved geometry from an array of XY coordinates.
Note that 2D axisymmetric sketches and sketches for 3D bodies of revolution about the global Y-axis must lie entirely on the positive-X side of the global Y-axis.
This function can create multiple surfaces or volumes in the same Gmsh
*.stepfile. If no part (body/volume) names are provided, the body/volume will be named after the input file base name.- Parameters:
 input_file – input text file(s) with coordinates to draw
output_file – Gmsh
*.stepdatabase to save the part(s)planar – switch to indicate that 2D model dimensionality is planar, not axisymmetric
model_name – name of the Gmsh model in which to create the part
part_name – name(s) of the part(s) being created
unit_conversion – multiplication factor applies to all coordinates
euclidean_distance – if the distance between two coordinates is greater than this, draw a straight line. Distance should be provided in units after the unit conversion
delimiter – character to use as a delimiter when reading the input file
header_lines – number of lines in the header to skip when reading the input file
revolution_angle – angle of solid revolution for
3Dgeometries. Ignore when planar is True.y_offset – vertical offset along the global Y-axis. Offset should be provided in units after the unit conversion.
rtol – relative tolerance for vertical/horizontal line checks
atol – absolute tolerance for vertical/horizontal line checks
- Returns:
 writes
{output_file}.step
- turbo_turtle._gmsh_python.image(
 - input_file: str | Path,
 - output_file: str | Path,
 - x_angle: float = 0.0,
 - y_angle: float = 0.0,
 - z_angle: float = 0.0,
 - image_size: tuple[int, int] = [1920, 1080],
 Open a Gmsh geometry or mesh file and save an image.
Uses the Gmsh
writecommand, which accepts gif, jpg, tex, pdf, png, pgf, ps, ppm, svg, tikz, and yuv file extensions.- Parameters:
 input_file (str) – Gmsh input file to open
output_file (str) – Screenshot file to write
x_angle (float) – Rotation about ‘world’ X-axis in degrees
y_angle (float) – Rotation about ‘world’ Y-axis in degrees
z_angle (float) – Rotation about ‘world’ Z-axis in degrees
image_size (tuple) – Image size in pixels (width, height)
- turbo_turtle._gmsh_python.mesh(
 - input_file: str | Path,
 - element_type: str,
 - output_file: str | Path | None = None,
 - model_name: str | None = 'Model-1',
 - part_name: str | None = 'Part-1',
 - global_seed: float = 1.0,
 - edge_seeds: Sequence[tuple[str, str | int | float]] | None = None,
 Mesh Gmsh physical entities by part name.
- Parameters:
 input_file – Gmsh
*.stepfile to open that already contains physical entities to be meshedelement_type – Gmsh scheme.
output_file – Gmsh mesh file to write
model_name – name of the Gmsh model in which to create the part
part_name – physical entity name prefix
global_seed – The global mesh seed size
edge_seeds – Edge seed tuples (name, number)
- turbo_turtle._gmsh_python.sphere(
 - inner_radius: float,
 - outer_radius: float,
 - output_file: str | Path,
 - input_file: str | Path | None = None,
 - quadrant: Literal['upper', 'lower', 'both'] = 'both',
 - revolution_angle: float = 360.0,
 - y_offset: float = 0.0,
 - model_name: str = 'Model-1',
 - part_name: str = 'Part-1',
 Create a sphere geometry with file I/O handling.
- Parameters:
 inner_radius – inner radius (size of hollow)
outer_radius – outer radius (size of sphere)
output_file – output file name. Will be stripped of the extension and
.stepwill be used.input_file – input file name. Will be stripped of the extension and
.stepwill be used.quadrant – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
y_offset – vertical offset along the global Y-axis
model_name – name of the Gmsh model in which to create the part
part_name – name of the part to be created in the Abaqus model
_utilities#
- class turbo_turtle._utilities.NamedTemporaryFileCopy(input_file: str | Path, *args, **kwargs)[source]#
 Create a temporary file copy.
Thin wrapper around
tempfile.NamedTemporaryFile(*args, delete=False, **kwargs)to provide Windows handlingProvides Windows compatible temporary file handling.
delete=Falseis required until Python 3.12delete_on_close=Falseoption can be made a minimum runtime dependence.- Parameters:
 input_file – The input file to copy into a temporary file
- turbo_turtle._utilities.character_delimited_list(sequence: Iterable, character: str = ' ') str[source]#
 Map a list of non-strings to a character delimited string.
- Parameters:
 sequence – Sequence to turn into a character delimited string
character – Character(s) to use when joining sequence elements
- Returns:
 string delimited by specified character
- turbo_turtle._utilities.construct_append_options(option: str, array: Sequence[Sequence]) str[source]#
 Construct a command string to match the argparse append action.
Build the repeated option string for argparse appending options that accept more than one value
python script.py --option 1 2 --option 3 4
>>> option = "--option" >>> array = [[1, 2], [3, 4]] >>> construct_append_options(option, array) "--option 1 2 --option 3 4"
- Parameters:
 option – Text for the option, e.g.
--optionarray – 2D iterable of tuple arguments
- turbo_turtle._utilities.cubit_os_bin() str[source]#
 Return the OS specific Cubit bin directory name.
Making Cubit importable requires putting the Cubit bin directory on PYTHONPATH. On MacOS, the directory is “MacOS”. On other systems it is “bin”.
- Returns:
 bin directory name, e.g. “bin” or “MacOS”
- turbo_turtle._utilities.find_command(options: Iterable[str]) str[source]#
 Return first found command in list of options.
- Parameters:
 options – alternate command options
- Returns:
 command absolute path
- Raises:
 FileNotFoundError if no command is found
- turbo_turtle._utilities.find_cubit_bin(options: Iterable[str], bin_directory: str | None = None) Path[source]#
 Search for the bin directory provided a few options for the Cubit executable.
Recommend first checking to see if cubit will import.
If the Cubit command or bin directory is not found, raise a FileNotFoundError.
- Parameters:
 options – Cubit command options
bin_directory – Cubit’s bin directory name. Override the bin directory returned by
turbo_turtle._utilities.cubit_os_bin().
- Returns:
 Cubit bin directory absolute path
- turbo_turtle._utilities.import_cubit() ModuleType[source]#
 Intermediate Cubit import function.
Allows better CLI error reporting and Cubit package mocking during unit tests
- turbo_turtle._utilities.import_gmsh() ModuleType[source]#
 Intermediate gmsh import function.
Allows better CLI error reporting and gmsh package mocking during unit tests
- turbo_turtle._utilities.run_command(command: str) None[source]#
 Split command on whitespace, execute shell command, raise RuntimeError with any error message.
- Parameters:
 command – String to run on the shell
- turbo_turtle._utilities.search_commands(options: Iterable[str]) str | None[source]#
 Return the first found command in the list of options. Return None if none are found.
- Parameters:
 options – executable path(s) to test
- Returns:
 command absolute path
- turbo_turtle._utilities.set_wrappers_and_command(args: Namespace) tuple[ModuleType, Path | None][source]#
 Read an argument namespace and set the wrappers and command appropriately.
- Parameters:
 args – namespace of parsed arguments from
turbo_turtle._main.get_parser()- Returns:
 _wrappers, command. Wrapper module, executable command string.
Python 3 tests#
These modules are intended purely for use in Python 3. They do not need to be Abaqus Python compatible, but they may have corresponding Abaqus Python tests.
Python 3 unit test files may be executed with the pytest command directly, where the Abaqus Python test exclusions
is handled by the default pytest options in pyproject.toml. For example from the project root directory
$ pytest
The test execution is also available as an SCons alias: pytest, which is collected under the aliases: unittest
and regression. These aliases may provide additional pytest command line options which are not or can not be set
in pyproject.toml.
test_main#
Test turbo_turtle._main.
test_cubit_python#
test_fetch#
Test turbo_turtle._fetch.
- turbo_turtle._tests.test_fetch.platform_check() tuple[bool, str][source]#
 Check platform and set platform specific variables.
- Returns:
 tuple (root_fs, testing_windows)
- Return type:
 (str, bool)
- turbo_turtle._tests.test_fetch.test_available_files(
 - root_directory: str,
 - relative_paths: list[str],
 - is_file_side_effect: list[bool],
 - is_dir_side_effect: list[bool],
 - rglob_side_effect: list[list[Path]],
 - expected_files: list[Path],
 - expected_missing: list[Path],
 - mock_rglob_argument: str,
 Test
turbo_turtle._fetch.available_files().
- turbo_turtle._tests.test_fetch.test_build_copy_tuples(
 - destination: str,
 - requested_paths_resolved: list[Path],
 - overwrite: bool,
 - build_destination_files_side_effect: tuple[list[Path], list[Path]],
 - expected_copy_tuples: list,
 Test
turbo_turtle._fetch.build_copy_tuples().
- turbo_turtle._tests.test_fetch.test_build_destination_files(
 - destination: str,
 - requested_paths: list[Path],
 - exists_side_effect: list[bool],
 - expected_destination_files: list[Path],
 - expected_existing_files: list[Path],
 Test
turbo_turtle._fetch.build_destination_files().
- turbo_turtle._tests.test_fetch.test_build_source_files(
 - root_directory: str,
 - relative_paths: list[str],
 - exclude_patterns: list[str],
 - available_files_side_effect: tuple[list[Path], list],
 - expected_source_files: list[Path],
 Test
turbo_turtle._fetch.build_source_files().
- turbo_turtle._tests.test_fetch.test_conditional_copy(
 - copy_tuples: list[tuple[Path, Path]],
 - exists_side_effect: list[bool],
 - filecmp_side_effect: list[bool],
 - copyfile_call: tuple[Path, Path],
 Test
turbo_turtle._fetch.conditional_copy().
- turbo_turtle._tests.test_fetch.test_longest_common_path_prefix(
 - file_list: str | Path | list[Path],
 - expected_path: Path,
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._fetch.longest_common_path_prefix().
test_utilities#
Test the turbo_turtle._utilities module.
- turbo_turtle._tests.test_utilities.test_character_delimited_list(sequence: Sequence, character: str, expected: str) None[source]#
 
- turbo_turtle._tests.test_utilities.test_construct_append_options(option: str, array: Sequence, expected: str) None[source]#
 
- turbo_turtle._tests.test_utilities.test_find_command(
 - options: list[str],
 - found: str | None,
 - outcome: nullcontext | RaisesExc,
 
test_geometry_xyplot.py#
test_parsers.py#
Test turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.
- turbo_turtle._tests.test_parsers.test_construct_prog(basename: str, expected_prog: str) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.construct_prog().
- turbo_turtle._tests.test_parsers.test_positive_float(
 - input_string: str,
 - expected_float: float | None,
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.positive_float().
- turbo_turtle._tests.test_parsers.test_positive_int(
 - input_string: str,
 - expected_int: int | None,
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.positive_int().
- turbo_turtle._tests.test_parsers.test_subcommand_parser(subcommand: str, required_argv: list[str], exclude_keys: list[str]) None[source]#
 Test the default value assignments in the subcommand parsers.
- Parameters:
 subcommand (str) – the subcommand parser to test
required_argv (list) – the argv list of strings for parser positional (required) arguments that have no default(s)
exclude_keys (list) – keys that aren’t used or set by the parser, but are included in the defaults dictionary. These are excluded from the key: value argparse.Namespace tests.
test_scons_extensions.py#
Test Turbo-Turtle SCons builders and support functions.
- turbo_turtle._tests.test_scons_extensions.check_nodes(
 - nodes: NodeList,
 - post_action: list[str],
 - node_count: int,
 - action_count: int,
 - expected_string: str,
 - expected_env_kwargs: dict[str, str],
 Verify the expected action string against a builder’s target nodes.
- Parameters:
 nodes – Target node list returned by a builder
post_action (list) – list of post action strings passed to builder
node_count (int) – expected length of
nodesaction_count (int) – expected length of action list for each node
expected_string (str) – the builder’s action string.
expected_env_kwargs (dict) – the builder’s expected environment keyword arguments
Note
The method of interrogating a node’s action list results in a newline separated string instead of a list of actions. The
expected_stringshould contain all elements of the expected action list as a single, newline separated string. Theaction_countshould be set to1until this method is updated to search for the finalized action list.
- turbo_turtle._tests.test_scons_extensions.test_builders(
 - builder: str,
 - kwargs: dict,
 - node_count: int,
 - action_count: int,
 - source_list: list[str],
 - target_list: list[str],
 - builder_env: dict[str, str],
 Test
turbo_turtle.scons_extensionsbuilders.
test_system.py#
The system tests are not included in the default pytest options. They are marked with a systemtest marker and may be
executed with pytest -m systemtest. They are also collected under the SCons alias systemtest which contains
additional pytest command line options to control test failure output more convenient to the system test execution.
System test wrapper for executing shell commands with pytest results reporting.
All tests should be marked pytest.mark.systemtest (handled in the test function markers).
All tests that require a third-party software unavailable on conda-forge should be marked as
pytest.mark.require_third_party.
All tests should use string template substitution instead of f-strings, if possible. See test_system() for
available substitutions.
- turbo_turtle._tests.test_system.run_commands(
 - commands: list[str | Template],
 - build_directory: str | Path | TemporaryDirectory,
 - template_substitution: dict | None = None,
 Run shell commands with a dedicated test shell environment in a temporary working directory.
- turbo_turtle._tests.test_system.setup_cylinder_commands(model: str, revolution_angle: float, backend: str) list[Template][source]#
 Return system test cylinder commands.
- turbo_turtle._tests.test_system.setup_geometry_commands(
 - model: str,
 - input_file: list[Path],
 - revolution_angle: float,
 - y_offset: float,
 - backend: str,
 Return system test geometry commands.
- turbo_turtle._tests.test_system.setup_geometry_xyplot_commands(model: str, input_file: list[Path], backend: str) list[Template][source]#
 Return system test geometry xyplot commands.
- turbo_turtle._tests.test_system.setup_merge_commands(part_name: str, backend: str) list[Template][source]#
 Return system test merge commands.
- turbo_turtle._tests.test_system.setup_sets_commands(
 - model: str,
 - input_file: Path,
 - revolution_angle: float,
 - face_sets: Sequence[tuple[str, str]] | None,
 - edge_sets: Sequence[tuple[str, str]] | None,
 - edge_seeds: Sequence[tuple[str, str]] | None,
 - element_type: str,
 - backend: str,
 Return system test sets commands.
- turbo_turtle._tests.test_system.setup_sphere_commands(
 - model: str,
 - inner_radius: float,
 - outer_radius: float,
 - angle: float,
 - y_offset: float,
 - quadrant: str,
 - element_type: str,
 - element_replacement: str,
 - backend: str,
 - output_type: str,
 Return the sphere/partition/mesh commands for system testing.
- Returns:
 list of string or string template commands
- turbo_turtle._tests.test_system.test_project_shell_commands(
 - abaqus_command: Path,
 - cubit_command: Path,
 - commands: list[str | Template],
 Run the system tests.
Executes with a temporary directory that is cleaned up after each test execution.
Accepts custom pytest CLI options to specify abaqus and cubit commands
pytest --abaqus-command /my/system/abaqus --cubit-command /my/system/cubit
- Parameters:
 abaqus_command – string absolute path to Abaqus executable
cubit_command – string absolute path to Cubit executable
command – the full list of command string(s) for the system test
- turbo_turtle._tests.test_system.test_require_third_party(
 - abaqus_command: Path,
 - cubit_command: Path,
 - commands: list[str | Template],
 Run system tests that require third-party software.
Executes with a temporary directory that is cleaned up after each test execution.
Accepts custom pytest CLI options to specify abaqus and cubit commands
pytest --abaqus-command /my/system/abaqus --cubit-command /my/system/cubit
- Parameters:
 abaqus_command – string absolute path to Abaqus executable
cubit_command – string absolute path to Cubit executable
command – the full list of command string(s) for the system test
test_wrappers.py#
Test the Python 3 wrappers of third-party interfaces.
- turbo_turtle._tests.test_wrappers.test_abaqus_wrappers(
 - subcommand: str,
 - namespace: dict[str, Any],
 - expected_options: list[str],
 - unexpected_options: list[str],
 Test the
turbo_turtle._abaqus_wrappersmodule.
- turbo_turtle._tests.test_wrappers.test_cubit_wrappers(
 - subcommand: str,
 - namespace: dict[str, Any],
 - positional: tuple[str],
 - keywords: dict[str, Any],
 Test the
turbo_turtle._cubit_wrappersmodule.
- turbo_turtle._tests.test_wrappers.test_gmsh_wrappers(
 - subcommand: str,
 - namespace: dict[str, Any],
 - positional: tuple[str],
 - keywords: dict[str, Any],
 Test the
turbo_turtle._gmsh_wrappersmodule.
- turbo_turtle._tests.test_wrappers.test_trim_namespace() None[source]#
 Test
trim_namespace()function.
test_vertices#
Test Python 3 compatibility of the vertices module.
Warning
These are tests of a mixed Python 2/3 compatible module. When updating, be sure to update the Abaqus Python tests to match.
- turbo_turtle._tests.test_vertices.test_any_parallel(first: tuple[float, ...], options: list[tuple[float, ...]], expected: bool) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.any_parallel().
- turbo_turtle._tests.test_vertices.test_bool_via_or(bool_list_1: list[bool], bool_list_2: list[bool], expected: list[bool]) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._bool_via_or().
- turbo_turtle._tests.test_vertices.test_break_coordinates(coordinates: ndarray, euclidean_distance: float, expected: list[ndarray]) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._break_coordinates().
- turbo_turtle._tests.test_vertices.test_break_coordinates_passthrough() None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._break_coordinates().
- turbo_turtle._tests.test_vertices.test_compare_euclidean_distance(coordinates: ndarray, euclidean_distance: float, expected: list[bool]) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._compare_euclidean_distance().
- turbo_turtle._tests.test_vertices.test_compare_xy_values(
 - coordinates: ndarray,
 - expected: list[bool],
 - rtol: float | None,
 - atol: float | None,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._compare_xy_values().
- turbo_turtle._tests.test_vertices.test_cylinder(
 - inner_radius: float,
 - outer_radius: float,
 - height: float,
 - y_offset: float | None,
 - expected: ndarray,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.cylinder().
- turbo_turtle._tests.test_vertices.test_cylinder_lines(
 - inner_radius: float,
 - outer_radius: float,
 - height: float,
 - y_offset: float,
 - expected: list[tuple[ndarray, ndarray]],
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.cylinder_lines().
- turbo_turtle._tests.test_vertices.test_datum_planes(xvector: ndarray, zvector: ndarray, expected: ndarray) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.datum_planes().
- turbo_turtle._tests.test_vertices.test_fortyfive_vectors(xvector: ndarray, zvector: ndarray, expected: ndarray) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.fortyfive_vectors().
- turbo_turtle._tests.test_vertices.test_is_parallel(first: tuple[float, ...], second: tuple[float, ...], expected: bool) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.is_parallel().
- turbo_turtle._tests.test_vertices.test_line_pairs(all_splines: list[ndarray], expected: list[tuple[ndarray, ndarray]]) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._line_pairs().
- turbo_turtle._tests.test_vertices.test_lines_and_splines(
 - coordinates: ndarray,
 - euclidean_distance: float,
 - expected_lines: list[ndarray],
 - expected_splines: list[ndarray],
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.lines_and_splines().
- turbo_turtle._tests.test_vertices.test_lines_and_splines_passthrough() None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.lines_and_splines().
- turbo_turtle._tests.test_vertices.test_midpoint_vector(first: list[float], second: list[float], expected: ndarray) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.midpoint_vector().
- turbo_turtle._tests.test_vertices.test_normalize_vector(vector: tuple[float, ...], expected: ndarray) None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.normalize_vector().
- turbo_turtle._tests.test_vertices.test_ordered_lines_and_splines(
 - coordinates: ndarray,
 - euclidean_distance: float,
 - expected_lines_and_splines: list[ndarray],
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.ordered_lines_and_splines().
- turbo_turtle._tests.test_vertices.test_rectalinear_coordinates(
 - radius_list: tuple[float, ...],
 - angle_list: tuple[float, ...],
 - expected: tuple[tuple[float, ...]],
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.rectalinear_coordinates().
- turbo_turtle._tests.test_vertices.test_scale_and_offset_coordinates(
 - coordinates: ndarray,
 - unit_conversion: float,
 - y_offset: float,
 - expected: ndarray,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.scale_and_offset_coordinates().
test_mixed_utilities#
Test Python 3 compatibility of the mixed utilities module.
Warning
These are tests of a mixed Python 2/3 compatible module. When updating, be sure to update the Abaqus Python tests to match.
- turbo_turtle._tests.test_mixed_utilities.test_cubit_part_names(part_name: list[str], expected: list[str]) None[source]#
 Test
turbo_turtle._abaqus_python._mixed_utilities.cubit_part_names().
- turbo_turtle._tests.test_mixed_utilities.test_element_type_regex(content: str, element_type: str, expected: str) None[source]#
 Test
turbo_turtle._abaqus_python._mixed_utilities._element_type_regex().
- turbo_turtle._tests.test_mixed_utilities.test_intersection_of_lists(requested: list[str | None], available: list[str], expected: list[str]) None[source]#
 Test
turbo_turtle._abaqus_python._mixed_utilities.intersection_of_lists().
- turbo_turtle._tests.test_mixed_utilities.test_remove_duplicate_items(string_list: list[str], expected: list[str]) None[source]#
 Test
turbo_turtle._abaqus_python._mixed_utilities.remove_duplicate_items().
- turbo_turtle._tests.test_mixed_utilities.test_return_genfromtxt(
 - file_name: str,
 - delimiter: str,
 - header_lines: int | None,
 - expected_dimensions: int | None,
 - expected_columns: int | None,
 - expected: ndarray,
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.return_genfromtxt().Tests both the expection raising version and the system exit version
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.return_genfromtxt_or_exit()- Parameters:
 file_name (str) – dummy data file name
delimiter (str) – String for file name delimiter character
header_lines (int) – Integer number of header lines to ignore
expected_dimensions (int) – The expected dimensionality of the data. When mismatched, should trigger an exception/error.
expected_columns (int) – The expected number of columns of the data. When mismatched, should trigger an exception/error.
expected (numpy.array) – expected return data of the function under test
outcome – either contextlib.nullcontext or pytest.raises() depending on expected success or exception, respectively
- turbo_turtle._tests.test_mixed_utilities.test_substitute_element_type() None[source]#
 Test
turbo_turtle._abaqus_python._mixed_utilities.substitute_element_type().
- turbo_turtle._tests.test_mixed_utilities.test_sys_exit() None[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.sys_exit()sys.exit wrapper.We can’t test the Abaqus Python override print to
sys.__stderr__because the print statement is not valid Python 3 code.
- turbo_turtle._tests.test_mixed_utilities.test_validate_element_type(
 - length_part_name: int,
 - original_element_type: list[str | None],
 - expected: list[str | None],
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_element_type().Tests both the expection raising version and the system exit version
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_element_type_or_exit()- Parameters:
 length_part_name (int) – length of the
part_namelistoriginal_element_type (list) – List of element types passed to function under test
expected (list) – Expected list of element types returned by function under test
outcome – either contextlib.nullcontext or pytest.raises() depending on expected success or exception, respectively
- turbo_turtle._tests.test_mixed_utilities.test_validate_part_name(
 - input_file: list[str],
 - original_part_name: list[str],
 - expected: list[str],
 - outcome: nullcontext | RaisesExc,
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_part_name().Tests both the expection raising version and the system exit version
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_part_name_or_exit()- Parameters:
 input_file (str) – dummy input file name
original_part_name (list) – List of part names passed to function under test
expected (list) – Expected list of part names returned by function under test
outcome – either contextlib.nullcontext or pytest.raises() depending on expected success or exception, respectively
Python 2/3#
These modules are intended for re-use in both Python 3 and Abaqus Python. Care should be taken to maintain backward compatibility with the Python 2.7 site-packages provided by Abaqus. For re-use in the Abaqus Python scripts, they must be co-located in the Abaqus Python module. Modules may not perform internal package imports to minimize the risk of polluting the Abaqus Python namespace with Python 3 modules, and vice versa.
These modules may have duplicate Python 3 tests turbo_turtle/tests/test*.py and Abaqus Python tests
turbo_turtle/_abaqus_python/turbo_turtle_abaqus/test*.py
parsers#
Define Python 2/3 compatible parsers for use in both Abaqus Python scripts and Turbo-Turtle Python 3 modules.
Content must be compatible with Python 2 and 3. Content should be limited to those things necessary to construct the
CLI parser(s). Other content, such as project/package settings type variables, can be included to minimize the required
sys.path modifications required in the Abaqus Python package/scripts. For now, that means this file does double duty
as the Abaqus Python package settings file and the parsers file.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.construct_prog(basename)[source]#
 Construct the Abaqus Python usage string.
- Parameters:
 basename (str) – Abaqus Python script basename
- Returns:
 program usage string
- Return type:
 str
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.cylinder_parser(
 - basename='cylinder.py',
 - add_help=True,
 - description='Accept dimensions of a right circular cylinder and generate an axisymmetric revolved geometry.',
 - cubit=False,
 Return the cylinder subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interfacecubit (bool) – Include the Cubit specific options and help language when True
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.export_parser(basename='export.py', add_help=True, description='Export a part mesh as an orphan mesh', cubit=False)[source]#
 Return the export subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interface
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.geometry_parser(
 - basename='geometry.py',
 - add_help=True,
 - description='Create a 2D planar, 2D axisymmetric, or 3D body of revolution (about the global Y-Axis) by sketching lines and splines in the XY plane. Line and spline definitions are formed by parsing an input file with [N, 2] array of XY coordinates.',
 - cubit=False,
 Return the geometry subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interfacecubit (bool) – Include the Cubit specific options and help language when True
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.image_parser(
 - basename='image.py',
 - add_help=True,
 - description='Save a part or assembly view image for a given Abaqus input file',
 - cubit=False,
 Return the image subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interface
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.merge_parser(
 - basename='merge.py',
 - add_help=True,
 - description='Supply multiple model database files, model names, and part names to merge the parts into a new model. Every model databse file is searched for every model/part name combination. If a part name is found in more than one model, return an error.',
 - cubit=False,
 Return the merge subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interface
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.mesh_parser(
 - basename='mesh_module.py',
 - add_help=True,
 - description='Mesh a part from a global seed and optional edge seeds. The edge seeds must be positive numbers. If the seed is an integer, the edge will be seeded by number. If it is a float, the edge will be seeded by size.',
 - cubit=False,
 Return the mesh subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interface
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.partition_parser(
 - basename='partition.py',
 - add_help=True,
 - description='Partition hollow spheres into a turtle shell given a small number of locating, clocking, and partition plane angle parameters.',
 - cubit=False,
 Return the partition subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interfacecubit (bool) – Include the Cubit specific options and help language when True
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.positive_float(argument)[source]#
 Validate argparse custom type: positive floats including zero.
Abaqus Python 2 and Python 3 compatible argparse type method: https://docs.python.org/3/library/argparse.html#type.
- Parameters:
 argument (str) – string argument from argparse
- Returns:
 argument
- Return type:
 float
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.positive_int(argument)[source]#
 Validate argparse custom type: positive integers including zero.
Abaqus Python 2 and Python 3 compatible argparse type method: https://docs.python.org/3/library/argparse.html#type.
- Parameters:
 argument (str) – string argument from argparse
- Returns:
 argument
- Return type:
 int
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.sets_parser(
 - basename='sets.py',
 - add_help=True,
 - description="Create geometric sets from mask strings. Primarly intended for use in scripted workflows with stable geometry creation order and features because masks are fragile with respect to geometric changes. The recommended workflow is to perform manual set creation on a nominal geometry model, record the set masks/IDs reported by the third-party software, and write the CLI options into a scripted workflow file. Abaqus reports CAE operations in the ``abaqus.rpy`` replay file, e.g. ``grep -A 1 'mask=' abaqus.rpy``. Cubit IDs can be found in the model tree.",
 - cubit=False,
 Return the sets subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interface
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers.sphere_parser(
 - basename='sphere.py',
 - add_help=True,
 - description='Create a hollow, spherical geometry from a sketch in the X-Y plane with upper (+X+Y), lower (+X-Y), or both quadrants.',
 - cubit=False,
 Return the sphere subcommand parser.
- Parameters:
 basename (str) – Explicit script basename for the usage.
add_help (bool) –
add_helpargument value for theargparse.ArgumentParserclass interfacedescription (str) – The
descriptionargument value for theargparse.ArgumentParserclass interfacecubit (bool) – Include the Cubit specific options and help language when True
- Returns:
 argparse parser
- Return type:
 argparse.ArgumentParser
vertices#
Provide Python 2/3 compatible coordinate handling for Abaqus Python scripts and Turbo-Turtle Python 3 modules.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._bool_via_or(bools_list_1, bools_list_2)[source]#
 Compare two lists of bools using an
orstatement.- Parameters:
 bools_list_1 (list) – first set of bools
bools_list_2 (list) – second set of bools
- Returns:
 bools resulting from
orstatment- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._break_coordinates(coordinates, euclidean_distance, rtol=None, atol=None)[source]#
 Accept a [N, 2] numpy array and break into a list of [M, 2] arrays.
This function follows this methodology to turn a [N, 2] numpy array into a list of [M, 2] arrays denoting individual lines or splines.
If neighboring points are farther apart than the euclidean distance, break the original array between them.
If neighboring points have the same X or Y coordinate (horizontally or vertically aligned), break the original array between them. Uses
numpy.isclosewith the default tolerance for float comparison.
- Parameters:
 coordinates (numpy.array) – [N, 2] array of XY coordinates.
euclidean_distance (float) – If the distance between two points is greater than this, draw a straight line.
rtol (float) – relative tolerance used by
numpy.isclose. If None, use the numpy default.atol (float) – absolute tolerance used by
numpy.isclose. If None, use the numpy default.
- Returns:
 Series of line and spline definitions
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._compare_euclidean_distance(coordinates, euclidean_distance)[source]#
 Compare the distance between coordinates in a 2D numpy array of XY data to a provided euclidean distance.
The distance comparison is performed as
numpy_array_distance > euclidean_distance. The distance between coordinates in the numpy array is computed such that the “current point” is compared to the previous point in the list. As such, a singleFalseis always prepended to the beginning of the outputeuclidean_distance_boolslist, because there is no such distance between the first point and one that comes before it.- Parameters:
 coordinates (numpy.array) – [N, 2] array of XY coordinates.
euclidean_distance (float) – distance value to compare against
- Returns:
 bools for the distance comparison
- Return type:
 list of length N
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._compare_xy_values(coordinates, rtol=None, atol=None)[source]#
 Check neighboring XY values in an [N, 2] array of coordinates for vertical or horizontal relationships.
This function loops through lists of coordinates checking to see if a “current point” and the previous point in the numpy array are vertical or hozitonal from one another. As such, a single
Falseis always prepended to the beginning of the outputvertical_horizontal_boolslist, because there is no such vertical/horizontal relationship between the first point and one that comes before it.- Parameters:
 coordinates (numpy.array) – [N, 2] array of XY coordinates.
rtol (float) – relative tolerance used by
numpy.isclose. If None, use the numpy default.atol (float) – absolute tolerance used by
numpy.isclose. If None, use the numpy default.
- Returns:
 bools for vertical/horizontal relationship comparison
- Return type:
 list of length N
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices._line_pairs(all_splines)[source]#
 Accept a list of [N, 2] arrays and return a list of paired coordinates to connect as lines.
Given a list of [N, 2] numpy arrays, create tuple pairs of coordinates between the end and beginning of subsequent arrays. Also return a pair from the last array’s last coordinate to the first array’s first coordinate.
- Parameters:
 all_splines (list) – a list of 2D numpy arrays
- Returns:
 line pairs
- Return type:
 list of [2, 2] numpy arrays
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.any_parallel(first, options, rtol=None, atol=None)[source]#
 If the first vector is parellel to any of the options, return True.
- Parameters:
 first (numpy.array) – First vector
options (list) – List of vectors to compare against the first vector
- Returns:
 boolean answering “is the first vector parallel to any of the option vectors?”
- Return type:
 bool
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.cylinder(inner_radius, outer_radius, height, y_offset=0.0)[source]#
 Return
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.lines_and_splines()compatible vertex array.- Parameters:
 inner_radius (float) – Radius of the hollow center
outer_radius (float) – Outer radius of the cylinder
height (float) – Height of the cylinder
- Returns:
 vertex coordinate array
- Return type:
 numpy.array
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.cylinder_lines(inner_radius, outer_radius, height, y_offset=0.0)[source]#
 Return the line coordinate pairs defining a cylinder.
- Parameters:
 inner_radius (float) – Radius of the hollow center
outer_radius (float) – Outer radius of the cylinder
height (float) – Height of the cylinder
- Returns:
 list of line segment coordinate pairs
- Return type:
 list of (numpy.array, numpy.array) tuples
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.datum_planes(xvector, zvector)[source]#
 Calculate the sphere partitioning datum plane normal vectors on a local coordinate system.
The x- and z-vectors must be orthogonal. They will be normalized prior to calculating the normalized plane normal vectors.
- Parameters:
 xvector (list) – List of three (3) floats defining the local x-axis vector in global coordinate space
zvector (list) – List of three (3) floats defining the local z-axis vector in global coordinate space
- Returns:
 list of normalized local plane normal vectors [9, 3] - (3) xy/yz/zx planes, (6) +/- 45 degrees from xy/yz/zx planes
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.fortyfive_vectors(xvector, zvector)[source]#
 Return the normalized (1, 1, 1) vector variants of a local coordinate system defined by the x- and z-vector.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.is_parallel(first, second, rtol=None, atol=None)[source]#
 Compute cross product. If it is near zero, return True. Else False.
- Parameters:
 first (numpy.array) – First vector
second (numpy.array) – Second vector
- Returns:
 boolean answering “are these vectors parallel?”
- Return type:
 bool
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.lines_and_splines(coordinates, euclidean_distance, rtol=None, atol=None)[source]#
 Accept a [N, 2] numpy array of XY coordinates and return line point pairs and splines.
Array is broken into a list of [M, 2] arrays according to the following rules
If neighboring points are farther apart than the euclidean distance, break the original array between them.
If neighboring points have the same X or Y coordinate (horizontally or vertically aligned), break the original array between them. Uses
numpy.isclosewith the default tolerance for float comparison.
After breaking into a list of arrays, the line pair list and spline list are generated from the following rules
Line point pairs are returned for the end and beginning of adjacent arrays, and for the end of the last array and the beginning of the first array.
Arrays of length 2 are converted to line pair coordinates
Arrays greater than length 2 are kept intact as splines.
- Parameters:
 coordinates (numpy.array) – [N, 2] array of XY coordinates.
euclidean_distance (float) – If the distance between two points is greater than this, draw a straight line.
rtol (float) – relative tolerance used by
numpy.isclose. If None, use the numpy default.atol (float) – absolute tolerance used by
numpy.isclose. If None, use the numpy default.
- Returns:
 list of line pairs and list of spline arrays
- Return type:
 tuple
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.midpoint_vector(first, second, third=None)[source]#
 Calculate the vector between two vectors (summation / 2).
- Parameters:
 first (numpy.array) – First vector
second (numpy.array) – Second vector
- Returns:
 Vector midway between first and second vector
- Return type:
 numpy.array
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.normalize_vector(vector)[source]#
 Normalize a cartesian vector.
- Parameters:
 vector (list) – List of three floats defining a cartesian vector
- Returns:
 normalized
- Return type:
 numpy.array
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.ordered_lines_and_splines(coordinates, euclidean_distance, rtol=None, atol=None)[source]#
 Return a single, closed loop list of [M, 2] arrays with lines (length 2) and splines (length >2).
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.pyramid_surfaces(center, xvector, zvector, big_number)[source]#
 Return the pyramid surfaces defined by the center and vertices of a cube.
Returns arrays of [N, 2] coordinates defining 12 triangular surfaces and 6 square surfaces defining the 4 edge pyramids from the center of a cube to the cube vertices.
- Returns:
 list of numpy arrays, where each numpy array is an [N, 3] list of coordinates defining a surface
- Return type:
 list of numpy.array
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.rectalinear_coordinates(radius_list, angle_list)[source]#
 Calculate 2D rectalinear XY coordinates from 2D polar coordinates.
- Parameters:
 radius (list) – length N list of polar coordinate radius
angle (list) – length N list of polar coordinate angle measured from the positive X-axis in radians
- Returns coords:
 length N tuple of tuple(X, Y) rectalinear coordinates
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.scale_and_offset_coordinates(coordinates, unit_conversion=1.0, y_offset=0.0)[source]#
 Scale and offset XY coordinates in a 2 column numpy array.
First multiply by the unit conversion. Then offset the Y coordinates (2nd column) by adding the y offset
- Parameters:
 coordinates (numpy.array) – [N, 2] array of XY coordinates.
unit_conversion (float) – multiplication factor applies to all coordinates
y_offset (float) – vertical offset along the global Y-axis. Offset should be provided in units after the unit conversion.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.sphere(center, inner_radius, outer_radius, quadrant)[source]#
 Return the inner and outer radii vertices defining a 2D sketh of a sphere for revolution.
- Parameters:
 center (tuple) – tuple of floats (X, Y) location for the center of the sphere
inner_radius (float) – inner radius (size of hollow)
outer_radius (float) – outer radius (size of sphere)
quadrant (str) – quadrant of XY plane for the sketch: upper (I), lower (IV), both
- Returns:
 [4, 2] inner/outer radii in (x, y) coordinates defining inner/outer circular arc segments
- Return type:
 numpy.array
_mixed_utilities#
Python 2/3 compatible utilities for use in both Abaqus Python scripts and Turbo-Turtle Python 3 modules.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities._element_type_regex(content, element_type)[source]#
 Place element type in Abaqus element keywords. RegEx uses MULTILINE and IGNORECASE.
- Parameters:
 content (str) – String of Abaqus keyword text
element_type (str) – New element type to place in the
*element, type=text
- Returns:
 substituted element type keyword text
- Return type:
 str
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.cubit_part_names(part_name)[source]#
 Replace hyphens with underscores in strings for ACIS name compliance.
- Parameters:
 part_name (list) – list of strings for character replacement(s)
- Returns:
 modified list of part names
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.intersection_of_lists(requested, available)[source]#
 Return sorted intersection of available and requested items or all available items if none requested.
- Parameters:
 requested (list) – requested items
available (list) – available items
- Returns:
 intersection of requested and available items. All available items if None requested.
- Ttype:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.print_exception_message(function)[source]#
 Decorate a function to catch bare exception and instead call sys.exit with the message.
- Parameters:
 function – function to decorate
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.remove_duplicate_items(string_list)[source]#
 Remove duplicates from
string_listand print a warning to STDERR of all duplicates removed.- Parameters:
 string_list (list) – list of strings to remove duplicates
- Returns:
 unique strings
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.return_genfromtxt(file_name, delimiter=',', header_lines=0, expected_dimensions=None, expected_columns=None)[source]#
 Parse a text file of XY coordinates into a numpy array.
If the resulting numpy array doesn’t have the specified dimensions or column count, return an error exit code
- Parameters:
 file_name (str) – input text file with coordinates to draw
delimiter (str) – character to use as a delimiter when reading the input file
header_lines (int) – number of lines in the header to skip when reading the input file
- Returns:
 2D array of XY coordinates with shape [N, 2]
- Return type:
 numpy.array
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.substitute_element_type(mesh_file, element_type)[source]#
 Substitute element types in an existing orphan mesh file via the
*Elementkeyword.- Parameters:
 mesh_file (str) – existing orphan mesh file
element_type (str) – element type to substitute into the
*Elementkeyword phrase
- Returns:
 re-writes
mesh_fileif element type changes have been made
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.sys_exit(err)[source]#
 Thin wrapper on
sys.exitto force print to STDERR from Abaqus Python.Python 2/3 compatible system exit that forces Abaqus CAE to print to system STDERR
- Parameters:
 err (Exception) – The exception object to print and pass to
sys.exit
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_element_type(length_part_name, element_type)[source]#
 Validate the structure of the
element_typelist.Validated against the following rules:
If the length of
element_typeis 1, propagate to matchlength_part_nameRaise a RuntimeError if
element_typeis greater than 1, but not equal to the length ofpart_name
- Parameters:
 length_part_name (int) – length of the
part_namelistelement_type (list) – list of element types
- Returns:
 element types
- Return type:
 list
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities.validate_part_name(input_file, part_name)[source]#
 Validate the structure of the
part_namelist.Validated against the following rules:
If
part_nameis[None], assign the base names ofinput_filetopart_nameElse if the length of
part_nameis not equal to the length ofinput_file, raise an exception
- Parameters:
 input_file (list) – input text file(s) with coordinates to draw
part_name (list) – name(s) of part(s) being created
- Returns:
 part name(s)
- Return type:
 list
_mixed_settings#
Python 2/3 compatible settings for use in both Abaqus Python scripts and Turbo-Turtle Python 3 modules.
Abaqus Python#
These modules are intended purely for Abaqus Python use, but may freely use the mixed Python 2/3 compatible modules and other Abaqus Python modules. For the purposes of Sphinx compatible documentation, Abaqus package imports are not located at the module level. Abaqus Python imports must be made in each function where they are used.
Internal package imports must treat the turbo_turtle_abaqus directory as the Abaqus Python compatible package root
to avoid accidentally placing Python 3 packages in PYTHONPATH before Abaqus Python packages. This is managed by common
boilerplate to modify sys.path. The boilerplate is irreducible and must be duplicated in each module because the
modified import path is not available until after the sys.path modification.
_abaqus_utilities#
- class turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.AbaqusNamedTemporaryFile(input_file, *args, **kwargs)[source]#
 Open an Abaqus CAE
input_fileas a temporary file. Close and delete on exit of context manager.Provides Windows compatible temporary file handling. Required until Python 3.12
delete_on_close=Falseoption is available in Abaqus Python.- Parameters:
 input_file (str) – The input file to copy before open
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities._conditionally_create_model(model_name)[source]#
 Create a new model in an Abaqus database if the specified model name is not already existing.
- Parameters:
 model_name (str) – Abaqus model name
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities._view_part(model_name, part_name, **kwargs)[source]#
 Place a part in the current viewport as a GUI post-action.
Depending on if
part_nameis a list or a string, either place the last part in the list or the string part name in the viewport.This function requires the arguments documented below, and any other arguments will be unpacked but ignored. This behavior makes it convenient to use this function generally with the arguments of any of the GUI plug-in actions (so long as those documented below are present).
- Parameters:
 model_name (str) – name of the Abaqus model to query in the post-action
part_name (str/list) – name of the part to place in the viewport. If
listtype, use the last part name in the list. Ifstrtype, use that part name directly.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.edge_seeds(part, name_number)[source]#
 Seed edges by number (if passed integer) or size (if passed float).
- Parameters:
 part (abaqus.models[model].parts[part]) – Abaqus part object
feature (str) – Abaqus part geometric attribute, e.g. ‘faces’, ‘edges’
- Raises:
 ValueError – If any number is negative
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.gui_wrapper(inputs_function, subcommand_function, post_action_function=None)[source]#
 Wrap a function calling
abaqus.getInputs, then call aturbo_turtlesubcommand module.inputs_functioncannot have any function arguments.inputs_functionmust return a dictionary of key-value pairs that match thesubcommand_functionarguments.post_action_functionmust have identical arguments tosubcommand_functionor the ability to ignore provided arguments. Any return values frompost_action_functionwill have no affect.This wrapper expects the dictionary output from
inputs_functionto be empty when the GUI interface is exited early (escape or cancel). Otherwise, the dictionary will be unpacked as**kwargsintosubcommand_functionandpost_action_function.- Parameters:
 inputs_function (func) – function to get user inputs through the Abaqus CAE GUI
subcommand_function (func) – function with arguments matching the return values from
inputs_functionpost_action_function (func) – function to call for script actions after calling
subcommand_function
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.part_dimensionality(part)[source]#
 Return part dimensionality as an int.
- Parameters:
 part (abaqus.models[model].parts[part]) – Abaqus part object
- Returns:
 integer number of part dimensions
- Return type:
 int
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.part_dimensionality_key(part)[source]#
 Get the Abaqus dimensionality key for the current part.
- Parameters:
 part (abaqus.models[model].parts[part]) – Abaqus part object
- Returns:
 part dimensionality
- Return type:
 str
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.return_abaqus_constant(search)[source]#
 If search is found in the abaqusConstants module, return the abaqusConstants object.
Raise a ValueError if the search string is not found.
- Parameters:
 search (str) – string to search in the abaqusConstants module attributes
- Return value:
 abaqusConstants attribute
- Return type:
 abaqusConstants.<search>
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.revolution_direction(revolution_angle)[source]#
 Pick revolution direction constant consistent with +Y revolve direction.
Positive rotation angles should result in +Y revolve direction (abaqusConstants.ON) Negative rotation angles should result in -Y revolve direction (abaqusConstants.OFF)
- Parameters:
 revolution_angle (float) – angle of solid revolution for
3Dgeometries
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.set_from_mask(part, feature, name_mask)[source]#
 Create named set(s) from the geometric feature and mask(s).
- Parameters:
 part (abaqus.models[model].parts[part]) – Abaqus part object
feature (str) – Abaqus part geometric attribute, e.g. ‘faces’, ‘edges’, ‘vertices’
name_mask (list[tuple[str, str]]) – List of set name/mask tuples to create
- Raises:
 RuntimeError – If Abaqus throws an empty sequence abaqus.AbaqusException on one or more masks
- turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities.surface_from_mask(part, feature, name_mask)[source]#
 Create named surface(s) from the geometric feature and mask(s).
- Parameters:
 part (abaqus.models[model].parts[part]) – Abaqus part object
feature (str) – Abaqus part geometric attribute, e.g. ‘faces’, ‘edges’
name_mask (list[tuple[str, str]]) – List of set name/mask tuples to create
- Raises:
 ValueError – If feature is not one of ‘faces’ or ‘edges’
RuntimeError – If Abaqus throws an empty sequence abaqus.AbaqusException on one or more masks
geometry#
Create axisymmetric geometry through Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.geometry._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.geometry._gui_get_inputs()[source]#
 Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._geometry_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Input File(s) - glob statement or comma separated list of files (NO SPACES) with points in x-y coordinates
- Part Name(s) - part names for the parts being created. If 
None, then part name is determined by the input files. This must either
None, a single part name, or a comma separated list of part names (NO SPACES)
- Part Name(s) - part names for the parts being created. If 
 Model Name - parts will be created in a new model with this name
Unit Conversion - unit conversion multiplication factor
Euclidean Distance - connect points with a straight line if the distance between them is larger than this
Planar Geometry Switch - switch to indicate that the 2D model is planar not axisymmetric (
Truefor planar)Revolution Angle - revolution angle for a 3D part in degrees
Delimiter - delimiter character between columns in the input file(s)
Header Lines - number of header lines to skip in the input file(s)
Y-Offset - offset along the global y-axis
rtol - relative tolerance used by
numpy.isclose. IfNone, use numpy defaultsatol - absolute tolerance used by
numpy.isclose. IfNone, use numpy defaults
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsingeometry- return:
 user_inputs- a dictionary of the following key-value pair types:
input_file:listtype, input text files with points in x-y coordinatespart_name:listtype, part names, one for each input file, orNonemodel_name:strtype, new model containing the part generated from the input file(s)unit_conversion:floattype, unit conversion multiplication factoreuclidean_distance:floattype, distance between points for deciding to draw a straight lineplanar:booltype, switch for making 2D geometry planar, instead of axisymmetricrevolution_angle:floattype, revolution angle in degrees for 3D geometrydelimiter:strtype, delimiter character between columns in the input file(s)header_lines:inttype, number of header lines to skip in the input file(s)y_offset:floattype, offset along the y-axisrtol:floattype, relative tolerance used bynumpy.isclose. IfNone, use numpy defaultsatol:floattype, absolute tolerance used bynumpy.isclose. IfNone, use numpy defaults
- raises RuntimeError:
 if at least one input file is not specified
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.geometry.draw_part_from_splines(
 - lines,
 - splines,
 - planar=False,
 - model_name='Model-1',
 - part_name=[None],
 - euclidean_distance=4.0,
 - revolution_angle=360.0,
 - rtol=None,
 - atol=None,
 Create a part from connected lines and splines.
Given a series of line/spline definitions, draw lines/splines in an Abaqus sketch and generate either a 2D part or a 3D body of revolution about the global Y-axis using the sketch. A 2D part can be either axisymmetric or planar depending on the
planarandrevolution_angleparameters.If
planarisFalseandrevolution_angleis equal (numpy.isclose()) to zero, this script will attempt to create a 2D axisymmetric model.If
planarisFalseandrevolution_angleis not zero, this script will attempt to create a 3D body of revolution about the global Y-axis.The default behavior of assuming
planar=Falseimplies that the sketch must lie entirely on the positive-X side of the global Y-axis, which is the constraint for both 2D axisymmetric and 3D revolved bodies.If
planarisTrue, this script will attempt to create a 2D planar model, which can be sketched in any/all four quadrants.Note: This function will always connect the first and last coordinates
- Parameters:
 lines (list) – list of [2, 2] shaped arrays of (x, y) coordinates defining a line segment
splines (list) – list of [N, 2] shaped arrays of (x, y) coordinates defining a spline
planar (bool) – switch to indicate that 2D model dimensionality is planar, not axisymmetric
model_name (str) – name of the Abaqus model in which to create the part
part_name (str) – name of the part being created
euclidean_distance (float) – if the distance between two coordinates is greater than this, draw a straight line.
revolution_angle (float) – angle of solid revolution for
3Dgeometries
- Returns:
 creates
{part_name}within an Abaqus CAE database, not yet saved to local memory
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.geometry.geometry(
 - input_file,
 - planar,
 - model_name,
 - part_name,
 - revolution_angle,
 - delimiter,
 - header_lines,
 - euclidean_distance,
 - unit_conversion,
 - y_offset,
 - rtol,
 - atol,
 Create 2D planar, 2D axisymmetric, or 3D revolved geometry from an array of XY coordinates.
This function drive the geometry creation of 2D planar, 2D axisymetric, or 3D revolved bodies and operates on a new Abaqus moddel database object.
- Parameters:
 input_file (str) – input text file(s) with coordinates to draw
output_file (str) – Abaqus CAE database to save the part(s)
planar (bool) – switch to indicate that 2D model dimensionality is planar, not axisymmetric
model_name (str) – name of the Abaqus model in which to create the part
part_name (list) – name(s) of the part(s) being created
unit_conversion (float) – multiplication factor applies to all coordinates
euclidean_distance (float) – if the distance between two coordinates is greater than this, draw a straight line. Distance should be provided in units after the unit conversion
delimiter (str) – character to use as a delimiter when reading the input file
header_lines (int) – number of lines in the header to skip when reading the input file
revolution_angle (float) – angle of solid revolution for
3Dgeometriesy_offset (float) – vertical offset along the global Y-axis. Offset should be provided in units after the unit conversion.
rtol (float) – relative tolerance for vertical/horizontal line checks
atol (float) – absolute tolerance for vertical/horizontal line checks
- Raises:
 RuntimeError – failure to create a sketch or part from a CSV file.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.geometry.main(
 - input_file,
 - output_file,
 - planar=False,
 - model_name='Model-1',
 - part_name=[None],
 - unit_conversion=1.0,
 - euclidean_distance=4.0,
 - delimiter=',',
 - header_lines=0,
 - revolution_angle=360.0,
 - y_offset=0.0,
 - rtol=None,
 - atol=None,
 Create 2D planar, 2D axisymmetric, or 3D revolved geometry from an array of XY coordinates.
This script takes an array of XY coordinates from a text file and creates a 2D sketch or 3D body of revolution about the global Y-axis. Note that 2D axisymmetric sketches and sketches for 3D bodies of revolution about the global Y-axis must lie entirely on the positive-X side of the global Y-axis. In general, a 2D sketch can lie in all four quadrants; this is referred to as a “planar” sketch and requires that the
planarboolean arugment be set toTrue. This script can accept multiple input files to create multiple parts in the same Abaqus model. Thepart_nameparameter allows explicit naming of part(s) in the model. If omitted from the command line arguments, the default is to use the input file basename(s) as the part name(s).- Parameters:
 input_file (str) – input text file(s) with coordinates to draw
output_file (str) – Abaqus CAE database to save the part(s)
planar (bool) – switch to indicate that 2D model dimensionality is planar, not axisymmetric
model_name (str) – name of the Abaqus model in which to create the part
part_name (list) – name(s) of the part(s) being created
unit_conversion (float) – multiplication factor applies to all coordinates
euclidean_distance (float) – if the distance between two coordinates is greater than this, draw a straight line. Distance should be provided in units after the unit conversion
delimiter (str) – character to use as a delimiter when reading the input file
header_lines (int) – number of lines in the header to skip when reading the input file
revolution_angle (float) – angle of solid revolution for
3Dgeometriesy_offset (float) – vertical offset along the global Y-axis. Offset should be provided in units after the unit conversion.
rtol (float) – relative tolerance for vertical/horizontal line checks
atol (float) – absolute tolerance for vertical/horizontal line checks
- Returns:
 writes
{output_file}.cae
cylinder#
Create a cylinder geometry through Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.cylinder._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.cylinder._gui_get_inputs()[source]#
 Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._cylinder_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Part Name - part name for the cylinder being created.
Model Name - parts will be created in a new model with this name
Inner Radius - inner radius of the cylinder
Outer Radius - outer radius of the cylinder
Height - height of the cylinder
Revolution Angle - revolution angle for a 3D part in degrees
Y-Offset - offset along the global y-axis
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsincylinder- return:
 user_inputs- a dictionary of the following key-value pair types:
part_name:strtype, part name of the cylindermodel_name:strtype, new model containing the part generated from the input file(s)inner_radius:floattype, inner radius of the cylinderouter_radius:floattype, outer radius of the cylinderheight:floattype, height of the cylinderrevolution_angle:floattype, revolution angle in degrees for 3D geometryy_offset:floattype, offset along the y-axis
- raises RuntimeError:
 if inner radius, outer radius, or height are not specified.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.cylinder.cylinder(inner_radius, outer_radius, height, y_offset, model_name, part_name, revolution_angle)[source]#
 Accept dimensions of a right circular cylinder and generate an axisymmetric revolved geometry.
This function drives the geometry creation of a cylinder whose axis of symmetry is located on the global coordinate origin by default, and always on the global Y-axis.
- Parameters:
 inner_radius (float) – Radius of the hollow center
outer_radius (float) – Outer radius of the cylinder
height (float) – Height of the cylinder
y_offset (float) – vertical offset along the global Y-axis
model_name (str) – name of the Abaqus model in which to create the part
part_name (list) – name(s) of the part(s) being created
revolution_angle (float) – angle of solid revolution for
3Dgeometries
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.cylinder.main(
 - inner_radius,
 - outer_radius,
 - height,
 - output_file,
 - model_name='Model-1',
 - part_name='Part-1',
 - revolution_angle=360.0,
 - y_offset=0.0,
 Accept dimensions of a right circular cylinder and generate an axisymmetric revolved geometry.
Centroid of cylinder is located on the global coordinate origin by default.
- Parameters:
 inner_radius (float) – Radius of the hollow center
outer_radius (float) – Outer radius of the cylinder
height (float) – Height of the cylinder
output_file (str) – Abaqus CAE database to save the part(s)
model_name (str) – name of the Abaqus model in which to create the part
part_name (list) – name(s) of the part(s) being created
revolution_angle (float) – angle of solid revolution for
3Dgeometriesy_offset (float) – vertical offset along the global Y-axis
sphere#
Create a sphere geometry through Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sphere._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sphere._gui_get_inputs()[source]#
 Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._sphere_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Part Name - part name for the sphere being created.
Model Name - parts will be created in a new model with this name
Inner Radius - inner radius of the sphere
Outer Radius - outer radius of the sphere
Revolution Angle - revolution angle for a 3D part in degrees
Y-Offset - offset along the global y-axis
Quadrant - XY plane quadrant for drawing the sphere. Choose from ‘both’, ‘upper’, or ‘lower’
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsinsphere- return:
 user_inputs- a dictionary of the following key-value pair types:
part_name:strtype, part name of the spheremodel_name:strtype, new model containing the part generated from the input file(s)inner_radius:floattype, inner radius of the sphereouter_radius:floattype, outer radius of the sphererevolution_angle:floattype, revolution angle in degrees for 3D geometryy_offset:floattype, offset along the y-axisquadrant:strtype, XY plane quadrant for drawing the sphere
- raises RuntimeError:
 if inner radius or outer radius are not specified.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sphere._validate_sphere_quadrant(quadrant, valid_quadrants)[source]#
 Validate the user-provided sphere quadrant against a provided list of valid quadrants.
- Parameters:
 quadrant (str) – user provided sphere quadrant
valid_quadrants (list) – valid quadrant to check against
- Raises:
 RuntimError – if user provided quadrant is invalid
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sphere.main(
 - inner_radius,
 - outer_radius,
 - output_file,
 - input_file=None,
 - quadrant='both',
 - revolution_angle=360.0,
 - y_offset=0.0,
 - model_name='Model-1',
 - part_name='Part-1',
 Wrap sphere function with file open and file write operations.
- Parameters:
 inner_radius (float) – inner radius (size of hollow)
outer_radius (float) – outer radius (size of sphere)
output_file (str) – output file name. Will be stripped of the extension and
.caewill be used.input_file (str) – input file name. Will be stripped of the extension and
.caewill be used.quadrant (str) – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle (float) – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
y_offset (float) – vertical offset along the global Y-axis
model_name (str) – name of the Abaqus model
part_name (str) – name of the part to be created in the Abaqus model
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sphere.sphere(
 - inner_radius,
 - outer_radius,
 - center=(0.0, 0.0),
 - quadrant='both',
 - revolution_angle=360.0,
 - model_name='Model-1',
 - part_name='Part-1',
 Create a hollow, spherical geometry from a sketch in the X-Y plane.
Sketch may be defined in the upper (+X+Y), lower (+X-Y), or both quadrants.
Warning
The lower quadrant creation is currently broken
- Parameters:
 inner_radius (float) – inner radius (size of hollow)
outer_radius (float) – outer radius (size of sphere)
center (tuple) – tuple of floats (X, Y) location for the center of the sphere
quadrant (str) – quadrant of XY plane for the sketch: upper (I), lower (IV), both
revolution_angle (float) – angle of rotation 0.-360.0 degrees. Provide 0 for a 2D axisymmetric model.
model_name (str) – name of the Abaqus model
part_name (str) – name of the part to be created in the Abaqus model
partition#
Partition spheres through the Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition._gui_get_inputs()[source]#
 Partition Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._partition_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Center - center location of the geometry
X-Vector - location on the x-axis local to the geometry
Z-Vector - location on the z-axis local to the geometry
Part Name(s) - part name(s) to partition as a comma separated list (NO SPACES). This can also be a glob statement
Copy and Paste Parameters - copy and paste the parameters printed to the Abaqus Python terminal to make re-use of previous partition parameters easier
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsinpartition- return:
 user_inputs- a dictionary of the following key-value pair types:
center:listtype, center location of the geometryxvector:listtype, location on the x-axis local to the geometryzvector:listtype, location on the z-axis local to the geometrymodel_name:strtype, name of the model in the current viewportpart_name:listtype, name of the part in the current viewport, or a list of all part names in the model
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.datum_axis(center, vector, part)[source]#
 Return an Abaqus DataAxis object by center and normal axis.
- Parameters:
 center (numpy.array) – center location of the axis
vector (numpy.array) – axis vector
part (abaqus.mdb.models[].parts[]) – Abaqus part object
- Returns:
 Abaqus datum axis object
- Return type:
 DatumAxis
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.datum_plane(center, normal, part)[source]#
 Return an Abaqus DataPlane object by center and normal axis.
- Parameters:
 center (numpy.array) – center location of the plane
normal (numpy.array) – plane normal vector
part (abaqus.mdb.models[].parts[]) – Abaqus part object
- Returns:
 Abaqus Datum Plane object
- Return type:
 DatumPlane
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.main(
 - input_file,
 - output_file=None,
 - center=[0.0, 0.0, 0.0],
 - xvector=[1.0, 0.0, 0.0],
 - zvector=[0.0, 0.0, 1.0],
 - model_name='Model-1',
 - part_name=['Part-1'],
 - big_number=1000000.0,
 Wrap partition function with file open and file write operations.
- Parameters:
 input_file (str) – Abaqus CAE model database to open
output_file (str) – Abaqus CAE model database to write. If none is provided, use the input file.
center (list) – center location of the geometry
xvector (list) – Local x-axis vector defined in global coordinates
zvector (list) – Local z-axis vector defined in global coordinates
model_name (str) – model to query in the Abaqus model database (only applies when used with
abaqus cae -nogui)part_name (list) – list of parts to query in the specified Abaqus model (only applies when used with
abaqus cae -nogui)big_number (float) – Number larger than the outer radius of the part to partition.
- Returns:
 Abaqus CAE database named
{output_file}.cae
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.partition(center, xvector, zvector, model_name, part_name, big_number=1000000.0)[source]#
 Partition the model/part with the turtle shell method, also know as the soccer ball method.
If the body is modeled with fractional symmetry (e.g. quater or half symmetry), this code will attempt all partitioning and face removal actions anyways. If certain aspects of the code fail, the code will move on and give no errors.
Note: It is possible to create strange looking partitions if inputs are not defined properly. Always check your partitions visually after using this tool.
- Parameters:
 center (list) – center location of the geometry
xvector (list) – Local x-axis vector defined in global coordinates
zvector (list) – Local z-axis vector defined in global coordinates
model_name (str) – model to query in the Abaqus model database (only applies when used with
abaqus cae -nogui)part_name (list) – list of parts to query in the specified Abaqus model (only applies when used with
abaqus cae -nogui)big_number (float) – Number larger than the outer radius of the part to partition.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.partition_2d(model_name, part_name, center, big_number, sketch_vertex_pairs)[source]#
 Partition a 2D-axisymmetric part by three lines using the same vertex pairs computed for the 3D case.
- Parameters:
 model_name (str) – model to query in the Abaqus model database (only applies when used with
abaqus cae -nogui)part_name (list) – list of parts to query in the specified Abaqus model (only applies when used with
abaqus cae -nogui)center (list) – center location of the geometry
big_number (float) – Number larger than the outer radius of the part to partition.
sketch_vertex_pairs (tuple) – Tuple of vertices that make up the 3D partioning scheme’s sketch (See
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.rectalinear_coordinates())
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.partition.partition_3d(model_name, part_name, center, xvector, yvector, zvector, sketch_vertex_pairs)[source]#
 Partition a 3D-revolved part by using the turtle shell method, also known as the soccer ball method.
- Parameters:
 model_name (str) – model to query in the Abaqus model database (only applies when used with
abaqus cae -nogui)part_name (list) – list of parts to query in the specified Abaqus model (only applies when used with
abaqus cae -nogui)center (list) – center location of the geometry
xvector (list) – Local x-axis vector defined in global coordinates
yvector (list) – Local y-axis vector defined in global coordinates
zvector (list) – Local z-axis vector defined in global coordinates
sketch_vertex_pairs (tuple) – Tuple of vertices that make up the 3D partioning scheme’s sketch (See
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices.rectalinear_coordinates())
sets#
Create geometry and mesh sets through the Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sets.main(
 - input_file,
 - face_sets=None,
 - edge_sets=None,
 - vertex_sets=None,
 - output_file=None,
 - model_name='Model-1',
 - part_name='Part-1',
 Wrap sets function for input file handling.
- Parameters:
 input_file (str) – Abaqus CAE file to open that already contains a model with a part to be meshed
face_sets (list[tuple[str, str]]) – Face set tuples (name, mask)
edge_sets (list[tuple[str, str]]) – Edge set tuples (name, mask)
vertex_sets (list[tuple[str, str]]) – Vertex set tuples (name, mask)
output_file (str) – Abaqus CAE file to save with the newly meshed part
model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.sets.sets(face_sets=None, edge_sets=None, vertex_sets=None, model_name='Model-1', part_name='Part-1')[source]#
 Create sets from masks.
- Parameters:
 face_sets (list[tuple[str, str]]) – Face set tuples (name, mask)
edge_sets (list[tuple[str, str]]) – Edge set tuples (name, mask)
vertex_sets (list[tuple[str, str]]) – Vertex set tuples (name, mask)
model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
- Raises:
 RuntimeError – Collection of all set creation RuntimeError(s)
mesh_module#
Mesh partitioned geometry through the Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.mesh_module._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.mesh_module._gui_get_default_elem_type(model_name, part_name)[source]#
 Set default element types for the _gui_get_inputs_function.
Use a one-time dump of the Abaqus default element types for known part dimensionality
- Parameters:
 model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
- Returns:
 element type from a hard-coded mapping of Abaqus default element types
- Return type:
 str
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.mesh_module._gui_get_inputs()[source]#
 Mesh Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._mesh_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Part Name - part name to mesh
Element Type - a valid Abaqus element type for meshing the part
Global Seed - global seed value in the model’s units
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsinmesh- return:
 user_inputs- a dictionary of the following key-value pair types:
element_type:strtype, valid Abaqus element typemodel_name:strtype, name of the model in the current viewportpart_name:listtype, name of the part to meshglobal_seed:floattype, global element seed
- raises RuntimeError:
 if a element type or global mesh seed are not specified.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.mesh_module.main(
 - input_file,
 - element_type,
 - output_file=None,
 - model_name='Model-1',
 - part_name='Part-1',
 - global_seed=1.0,
 - edge_seeds=None,
 Wrap mesh function for input file handling.
- Parameters:
 input_file (str) – Abaqus CAE file to open that already contains a model with a part to be meshed
element_type (str) – Abaqus element type
output_file (str) – Abaqus CAE file to save with the newly meshed part
model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
global_seed (float) – The global mesh seed size
edge_seeds (list[tuple[str, number]]) – List of edge seed (name, number) pairs
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.mesh_module.mesh(element_type, model_name='Model-1', part_name='Part-1', global_seed=1.0, edge_seeds=None)[source]#
 Apply a global seed, optional edge seed(s), and mesh the specified part.
Always creates sets
ELEMENTS: All elementsNODES: All nodes
- Parameters:
 element_type (str) – Abaqus element type
model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
global_seed (float) – The global mesh seed size
edge_seeds (list[tuple[str, number]]) – List of edge seed (name, number) pairs
image#
Export a model image through Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.image._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.image._gui_get_inputs()[source]#
 Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._image_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Output File - output image file name (with ‘.png’ or ‘.svg’ extension)
Model Name - model to query
Part Name - part to query. If blank, assembly view will be queried
Color Map - valid Abaqus color map. Choose from: ‘Material’, ‘Section’, ‘Composite layup’, ‘Composite ply’, ‘Part’, ‘Part instance’, ‘Element set’, ‘Averaging region’, ‘Element type’, ‘Default’, ‘Assembly’, ‘Part geometry’, ‘Load’, ‘Boundary condition’, ‘Interaction’, ‘Constraint’, ‘Property’, ‘Meshability’, ‘Instance type’, ‘Set’, ‘Surface’, ‘Internal set’, ‘Internal surface’, ‘Display group’, ‘Selection group’, ‘Skin’, ‘Stringer’, ‘Cell’, ‘Face’
Image Size - size in pixels. Width, Height
X-Angle - rotation about x-axis in degrees
Y-Angle - rotation about y-axis in degrees
Z-Angle - rotation about z-axis in degrees
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsinimage- return:
 user_inputs- a dictionary of the following key-value pair types:
output_file:strtype, output file namepart_name:strtype, part to query. IfNonethe assembly view will be queriedmodel_name:strtype, model to querycolor_map:strtype, valid Abaqus color mapimage_size:listtype, image size in pixels [width, height]x_angle:floattype, rotation about x-axis in degreesy_angle:floattype, rotation about y-axis in degreesz_angle:floattype, rotation about z-axis in degrees
- raises RuntimeError:
 if
output_fileis not specified, ifoutput_fileextension is not valid, ifcolor_mapis not valid
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.image._validate_color_map(color_map, valid_color_maps)[source]#
 Validate the user-provided color map against a provided list of valid color maps.
- Parameters:
 color_map (str) – user provided color map
valid_color_maps (list) – valid color maps to check against
- Raises:
 RuntimError – if user provided color map is invalid
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.image.image(
 - output_file,
 - x_angle=0.0,
 - y_angle=0.0,
 - z_angle=0.0,
 - image_size=[1920, 1080],
 - model_name='Model-1',
 - part_name=None,
 - color_map='Material',
 Script for saving a part or assembly view image for a given Abaqus input file.
The color map is set to color by material. Finally, viewport is set to fit the view to the viewport screen.
If
part_nameis specified, an image of that part will be exported. If nopart_nameis specified, the model’s root assembly will be queried and if empty, all parts in the model will be instanced into the root assembly. Then, an image of the root assembly will be exported. Theinput_fileis not modified to include any generated instances.- Parameters:
 output_file (str) – Output image file. Supports
*.pngand*.svg.x_angle (float) – Rotation about X-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methody_angle (float) – Rotation about Y-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methodz_angle (float) – Rotation about Z-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methodmodel_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
color_map (str) – color map key
- Returns:
 writes image to
{output_file}- Raises:
 RuntimeError – if the extension of
output_fileis not recognized by Abaqus
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.image.main(
 - input_file,
 - output_file,
 - x_angle=0.0,
 - y_angle=0.0,
 - z_angle=0.0,
 - image_size=[1920, 1080],
 - model_name='Model-1',
 - part_name=None,
 - color_map='Material',
 Wrap image with file input handling.
- Parameters:
 input_file (str) – Abaqus input file. Suports
*.inpand*.cae.output_file (str) – Output image file. Supports
*.pngand*.svg.x_angle (float) – Rotation about X-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methody_angle (float) – Rotation about Y-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methodz_angle (float) – Rotation about Z-axis in degrees for
abaqus.session.viewports[].view.rotateAbaqus Python methodmodel_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
color_map (str) – color map key
- Returns:
 writes image to
{output_file}
merge#
Merge models into one file through the Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.merge.main(input_file, output_file, merged_model_name='Model-1', model_name=[None], part_name=[None])[source]#
 Merge parts from multiple Abaqus CAE files and models into one Abaqus CAE file and model.
This script loops through all input file(s) specified and merges the intersection of provided model/part name(s) and available model/part combinations. Duplicate part names are removed from the part name list. If a part name exists in more than one model, return an error.
- Parameters:
 input_file (list) – Abaqus CAE file(s) to query for model(s)/part(s)
output_file (str) – Abaqus CAE file for saving the merged model
merged_model_name (str) – Abaqus model to merge into
model_name (list) – model name(s) to query
part_name (list) – part_names(s) to search for
- Returns:
 writes
{output_file}.caewith the merged model
export#
Export a mesh through Abaqus CAE GUI, Abaqus Python API, or through a command-line interface.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export._gui()[source]#
 Drive the Abaqus CAE GUI plugin.
Function with no inputs required for driving the plugin.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export._gui_get_inputs()[source]#
 Interactive Inputs.
Prompt the user for inputs with this interactive data entry function. When called, this function opens an Abaqus CAE GUI window with text boxes to enter the values given below. Note to developers - if you update this ‘GUI-INPUTS’ below, also update
_mixed_settings._export_gui_help_stringthat gets used as the GUIlabel.GUI-INPUTS#
Model Name - model to query
Part Name - list of part names to query. Comma separated, no spaces (part-1 or part-1,part-2).
Element Type - list of element types, one per part, or one global replacement for every part. If blank, element type in the part will not be changed. Comma separated, no spaces (c3d8r or c3d8r,c3d8).
Destination - destination directory for orphan mesh files
Assembly File - file with assembly block keywords. If provided, and no instances are found, all part names are instanced before exporting the file.
IMPORTANT - this function must return key-value pairs that will successfully unpack as
**kwargsinexport- return:
 user_inputs- a dictionary of the following key-value pair types:
model_name:strtype, model to querypart_name:listtype, part names to queryelement_type:listtype, element types one for each part or one global replacementdestination:strtype, destination directory for orphan mesh filesassembly:strtype, assembly keword block file. If provided and no instances are found, all part names are instanced before exporting the file.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export.export(model_name, part_name, element_type, destination, assembly)[source]#
 Driver function for exporting part and assembly files.
- Parameters:
 model_name (str) – model to query in the Abaqus model database
part_name (list) – list of parts to query in the specified Abaqus model
element_type (list) – list of element types, one per part name or one global replacement for every part name
destination (str) – write output orphan mesh files to this output directory
assembly (str) – Assembly file for exporting the assembly keyword block. If provided and no instances are found, instance all part names before export.
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export.export_mesh_file(output_file, model_name='Model-1', part_name='Part-1')[source]#
 Export an orphan mesh from a single part.
- Parameters:
 output_file (str) – Abaqus CAE file to save with the newly meshed part
model_name (str) – model to query in the Abaqus model database
part_name (str) – part to query in the specified Abaqus model
- Returns:
 writes
output_file
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export.export_multiple_parts(model_name, part_name, element_type, destination)[source]#
 Export orphan mesh files for multiple parts, and allow element type changes.
Specify a model name and one or multiple part names for exporting orphan mesh files. This function will write one orphan mesh file per part name specified, and the orphan mesh file name will be the part name.
- Parameters:
 model_name (str) – model to query in the Abaqus model database
part_name (list) – list of parts to query in the specified Abaqus model
element_type (list) – list of element types, one per part name or one global replacement for every part name
destination (str) – write output orphan mesh files to this output directory
- Returns:
 uses
turbo_turtle._export.export()to write an orphan mesh file and optionally modifies element types with :turbo_turtle._export.substitute_element_type`
- turbo_turtle._abaqus_python.turbo_turtle_abaqus.export.main(
 - input_file,
 - model_name='Model-1',
 - part_name=['Part-1'],
 - element_type=[None],
 - destination='/home/runner/work/turbo-turtle/turbo-turtle',
 - assembly=None,
 Wrap orphan mesh export function for input file handling.
- Parameters:
 input_file (str) – Abaqus CAE file to open that already contains a model with a part to be meshed
model_name (str) – model to query in the Abaqus model database
part_name (list) – list of parts to query in the specified Abaqus model
element_type (list) – list of element types, one per part name or one global replacement for every part name
destination (str) – write output orphan mesh files to this output directory
assembly (str) – Assembly file for exporting the assembly keyword block. If provided and no instances are found, instance all part names before export.
Abaqus Python tests#
These modules are intended purely for use in Abaqus Python. They do not need to be Python 3 compatible, but they may have corresponding Python 3 tests. These tests would be signifacantly improved by understanding and adding Abaqus Python mocking. Without mocking behavior, some of the Python 3 test conditions can not be replicated in Abaqus Python.
Abaqus python unit test files may be executed as abaqus python -m unittest discover <directory>, for example from
the project root directory
$ /apps/abaqus/Commands/abq2024 python -m unittest discover turbo_turtle/_abaqus_python/turbo_turtle_abaqus
The test execution is also available as an SCons alias: test_abaqus_python, which is collected under the aliases:
unittest and regression.
test_abaqus_utilities#
Test the Abaqus Python utilities module.
Note
These are tests of the pure Abaqus Python utilities. The test file may make Abaqus Python specific imports.
- class turbo_turtle._abaqus_python.turbo_turtle_abaqus.test_abaqus_utilities.TestAbaqusUtilities(methodName='runTest')[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._abaqus_utilities().
test_mixed_utilities#
Test the Abaqus Python compatibility for the mixed utilities module.
Warning
These tests are duplicates of the Python 3 tests in turbo_turtle.tests.test_mixed_utilities()
- class turbo_turtle._abaqus_python.turbo_turtle_abaqus.test_mixed_utilities.TestMixedUtilities(methodName='runTest')[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus._mixed_utilities()against Abaqus Python.
test_parsers#
Test Abaqus Python compatibility of the command-line parsers.
Warning
These tests are duplicates of the Python 3 tests in turbo_turtle.tests.test_parsers()
- class turbo_turtle._abaqus_python.turbo_turtle_abaqus.test_parsers.TestParsers(methodName='runTest')[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.parsers()against Abaqus Python.
test_vertices#
Test the Abaqus Python compatibility of the vertices module.
Warning
These tests are duplicates of the Python 3 tests in turbo_turtle.tests.test_vertices()
- class turbo_turtle._abaqus_python.turbo_turtle_abaqus.test_vertices.TestVertices(methodName='runTest')[source]#
 Test
turbo_turtle._abaqus_python.turbo_turtle_abaqus.vertices()against Abaqus Python.