msml.exporter

msml.exporter – base functionality for all exporters.

An exporter is like an operator but with great power! It is a cut-off in the execution of an msml file and can read/manipulate the whole and processed memory content.

For more information: msml.exporter.Exporter

Functions

get_exporter(name) Find an Exporter under the given name
get_known_exporters()
register_exporter(name, clazz) Register an exporter class under the given name.

Classes

Exceptions

msml.exporter.register_exporter(name, clazz)[source]

Register an exporter class under the given name.

Args:
name (str): name to select the Exporter from the command line interface clazz (type): the type object or a factory function for the Exporter
msml.exporter.get_exporter(name)[source]

Find an Exporter under the given name

Args:
name (str): common name of the Exporter,
Returns:
type: a factory function

See Also:

class msml.exporter.Exporter(msml_file)[source]

Bases: object

datamodel
evaluate_node(expression)[source]
execute()[source]

should execute the external tool and set the memory

features
gather_inputs()[source]

find all references needed by this exporter from workflow :param msml_file: msml.model.base.MSMLFile :return:

gather_output()[source]

finds all variables that is provided by the exporter :param msmlfile: msml.model.base.MSMLFile :return: list of MSMLVariables

generate_data_model()[source]
get_input_constraint_name(const)[source]

generates the input for a given OAConstraint :param const: :type msml.model.OAConstraint :return:

get_input_material_name(region)[source]
Parameters:region (MaterialRegion) –

:rtype str :return: a name for the indices input slot for the given material region

get_input_mesh_name(mesh)[source]

generates the name for an output request within an object declaration :param mesh: :type msml.model.base.Mesh :return: :rtype str

get_input_objectelement_name(objectelement, parameter)[source]

generates the slot name for an objectelement

Parameters:
  • objectelement (msml.model.base.ObjectElement) – ObjectElement
  • parameter (msml.model.alphabet.Slot) – the slot of the given object element
Returns:

get_input_set_name(setelement)[source]

the input slot name for the given setelement :param setelement: :type setelement: IndexGroup :return: :type str

get_value_from_memory(reference, parameter=None)[source]
Parameters:reference
Returns:
init_exec(executer)[source]

initialization by the executor, sets memory and executor member :param executer: msml.run.Executer :return:

initialize(msml_file, name='base', output_type_of_elements=None, features=frozenset([]), mesh_sort=('VTK', 'Mesh'))[source]

Call this in derived classes for initializing the input, output and arguments structures.

Parameters:
  • msml_file (msml.model.base.MSMLFile) – the given msml in the constructor
  • name (str) – a name for your exporter
  • output_type_of_elements (dict[str, dict[str, msml.sorts.Sort]]) – a dictionary of dictionaries for every element and parameter
  • features (set) – a list of string with supported features
  • mesh_sort (tuple[str, str]) – a tuple of (physical, logical) type name
Returns:

lookup(ref, outarg)[source]
render()[source]

Builds the File (XML e.g) for the external tool

class msml.exporter.AbaqusExporter(msml_file)[source]

Bases: msml.exporter.base.XMLExporter

execute()[source]

should execute the external tool and set the memory

init_exec(executer)[source]

initialization by the executer, sets memory and executor member :param executer: msml.run.Executer :return:

render()[source]

Builds the File (XML e.g) for the external tool

write_inp(inpfile)[source]
class msml.exporter.SofaExporter(msml_file)[source]

Bases: msml.exporter.base.XMLExporter

createConstraintRegions(objectNode, msmlObject)[source]
createContactNode(objectNode, msmlObject)[source]
createMaterialRegions(objectNode, msmlObject)[source]
createMeshTopology(objectNode, msmlObject)[source]
createObject(currentSofaNode, scobj)[source]
createPostProcessingRequests(objectNode, msmlObject)[source]
createScene()[source]
createSceneContactNodes(root)[source]
createSolvers()[source]
execute()[source]

should execute the external tool and set the memory

init_exec(executer)[source]

initialization by the executor, sets memory and executor member

Returns:
render()[source]

Builds the File (XML e.g) for the external tool

sub(tag, root=None, **kwargs)[source]
write_scn()[source]
class msml.exporter.HiFlow3Exporter(msml_file)[source]

Bases: msml.exporter.base.Exporter

Exporter for hiflow3

Todo

What does this exporter support? - See GitHub issue n73.

create_bcdata(obj, step)[source]
Parameters:obj (msml.model.base.SceneObject) –
Returns:a object of BcData
Return type:BcData
create_bcdata_files(obj)[source]

creates all bcdata files for all declared steps in msml/env/simulation

Parameters:obj (msml.model.base.SceneObject) – scene object
Returns:
create_scenes()[source]
Parameters:hf3xmlfile (file) –
Returns:
execute()[source]

Execute runHiFlow3

render()[source]

Builds the File (XML e.g) for the external tool