matcal.sierra.input_file_writer

class matcal.sierra.input_file_writer.SierraGlobalDefinitions[source]

Standard global definitions for MatCal-generated SIERRA input decks.

add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.AnalyticSierraFunction(name)[source]

Analytical SIERRA function.

add_expression_variable(name, *vals)[source]

Add an expression variable derived from existing variables.

add_evaluation_expression(expression)[source]

Add an expression used to evaluate the function.

add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

scale_function(x=None, y=None)

Apply a scale factor to the function’s independent or dependent variables.

Parameters:
  • x (float) – independent variable scale factor.

  • y (float) – dependent variable scale factor.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.PiecewiseLinearFunction(name, x_values, y_values)[source]

Piecewise-linear SIERRA function.

add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

scale_function(x=None, y=None)

Apply a scale factor to the function’s independent or dependent variables.

Parameters:
  • x (float) – independent variable scale factor.

  • y (float) – dependent variable scale factor.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SolidMechanicsUserOutput(output_name, mesh_entity_name=None, mesh_entity=None, compute_interval='every step')[source]
add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SolidMechanicsUserVariable(name, var_storage_location, var_type, *initial_values)[source]
add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SierraFileBase(material, death_blocks, **kwargs)[source]

Base SIERRA input file builder for MatCal-generated solid mechanics decks.

add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SierraFileWithCoupling(material, death_blocks, **kwargs)[source]

Extends SierraFileBase to support Arpeggio staggered/iterative coupling with Aria.

add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SierraFileThreeDimensional(material, death_blocks, **kwargs)[source]
add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.

class matcal.sierra.input_file_writer.SierraFileThreeDimensionalContact(*args, **kwargs)[source]
add_line(line, replace=False)

Add a line to the input file block.

Parameters:
  • line (InputFileLine) – the line to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines(*lines, replace=False)

Add a set or list of lines to the input file block.

Parameters:
  • lines (list(InputFileLine)) – the lines to be added.

  • replace (bool) – replace existing value if the line is in the block lines when sen to True

add_lines_from_dictionary(dictionary, replace=False)

Use a dictionary to add several keyword, value pairs to the block as lines. The keywords will end up being the lines’ leading statements and the values will be the values.

Parameters:
  • dictionary (dict(str or float or tuple(float, str) or list(float, str))) – the dictionary containing the line information to be added to the block.

  • replace (bool) – replace lines if already existing in the subblock

add_subblock(subblock, replace=False, set_begin_end_to_parent=False)

Add a subblock to the input file block or input file.

Parameters:
add_table(table)

Add an InputFileTable to the subblock.

get_input_string()

Returns a string of the entire input file/block.

get_line(line_name)

Returns a line with the passed line name.

Parameters:

line_name (str) – the name of the line desired.

Return type:

InputFileLine

get_line_value(key, index=1)

Return the value from the line values at a specified index. By default it returns the second value, which is the value after the line keyword.

Parameters:
  • key (str) – the name of the line. Usually the keyword.

  • index (int) – an optional parameter to set a different index for the returned value from the line

get_string()

Verifies all required lines and input are added and then generates and returns the input block/file string.

get_subblock(key)

Get a subblock by name from the block.

Parameters:

key (str) – the name of the desired subblock.

get_subblock_by_type(block_type)

This will return the subblock of a given type. It will return the first one found if there are multiple subblocks of the same type. If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

InputFileBlock

get_subblocks_by_type(block_type)
This will return all subblocks of a given type.

If the block_type is not found as a subblock, the function returns None.

Parameters:

block_type (str) – the type of the subblock to be returned. This is the input file type, not a Python type.

Return type:

list(InputFileBlock)

get_table(name)

Returns a table for a given table name if it is in the input file/block.

Parameters:

name (str) – name of the desired table.

property lines

Returns a list of all block lines.

Return type:

list(InputFileLine)

property name

Returns the subblock name.

Return type:

str

print_title()

This method returns if the block will print the title.

remove_subblock(subblock)

Remove and return the passed subblock or subblock name.

Parameters:

subblock (str or matcal.core.input_file_writer.InputFileBlock) – the subblock to be removed from the input file block.

remove_subblocks_by_type(block_type)

This will remove all subblocks of a given type. If the block_type is not found as a subblock, none are removed.

Parameters:

block_type (str) – the type of the subblocks to be removed. This is the input file type, not a Python type.

reset_lines()

Clears out the lines in the input block.

set_name(name)

Set the block name.

Parameters:

name (str) – the new block name.

set_print_name(print_name=True, print_title=False)

Controls whether to print the name of the subblock. By default, it prints the name and not the title.

Parameters:

print_name (bool) – print the name if True or do not if False.

set_print_title(print_title=True)

Controls how to print the title of the subblock. By default, it prints the name and not the title. If the title is printed, it is printed before the name.

Parameters:

print_title (bool) – print the title with the name or as the name

set_symbol_for_lines(symbol)

Set the symbol for all lines in the block. Does not apply to subblocks.

Parameters:

symbol (None or str) – symbol to be used for all block lines. If none, the symbol will be suppressed.

property subblocks

Returns a list of all block subblocks.

Return type:

list(InputFileBlock)

suppress_symbols_for_lines()

Suppress the symbol for all lines in the block. Does not apply to subblocks.

property tables

Returns a list of all block tables.

Return type:

list(InputFileTable)

property title

Returns the subblock title.

Return type:

str

write(f)

Write the subblock to a file handle object.

Parameters:

f (TextIOWrapper) – the file object that line will be written to.

write_input_to_file(filename)

Writes the input file/block to the given filename.

Parameters:

filename (str) – the filename to write the input file to.