Automation tools for Autodesk Moldflow¶
-
class
pymoldflow.
MoldflowAutomation
(moldflow_path, use_metric_units=True, verbose=True, stdout=None)¶ Base class for Autodesk Moldflow automation
Parameters: moldflow_path (str) – Path to Autodesk Moldflow Insight -
check_moldflow_path
()¶ Check if the official Moldflow automation utility programs
studymod
,runstudy
andstudyrlt
exist
-
-
class
pymoldflow.
MoldflowStudyRunner
(moldflow_path, use_metric_units=True, verbose=True, stdout=None)¶ Run Autodesk Moldflow study files
Parameters: - moldflow_path (str) – Path to Autodesk Moldflow Insight
- use_metric_units (bool) – Use Metric units (mm for length for instance)
- verbose (bool) – Print out progress information
- stdout (obj) – Redirect progress information
-
run
(sdyfile, check_mode=False)¶ Run a Moldflow simulation using
runstudy
-
class
pymoldflow.
MoldflowResultsExporter
(moldflow_path, sdyfile=None, outdir=None, outfile=None, use_metric_units=True, verbose=True, stdout=None)¶ Export Autodesk Moldflow simulation results
Parameters: - moldflow_path (str) – Path to Autodesk Moldflow Insight
- sdyfile (str) – Autodesk Moldflow
.sdy
file containing simulation results - outdir (str) – Output directory
- outfile (str) – Output file with a format compatible with meshio
- use_metric_units (bool) – Use Metric units (mm for length for instance)
- verbose (bool) – Print out progress information
- stdout (obj) – Redirect progress information
-
check
()¶ Check if the provided
studyrlt.exe
program works
-
export_log
()¶ Export analysis log to
log.txt
Returns: Success indicator Return type: bool
-
export_mesh
(output_formats=[], only_export_rawdata=False, return_mesh=False)¶ Export and optionally process mesh information
Parameters: - output_formats (list) –
List of meshio-compatible mesh formats (MED, XDMF, …) to be exported
- only_export_rawdata (bool) – Whether only export the raw
.pat
Patran mesh without processing - return_mesh (bool) – Whether also return the
meshio
mesh object
Returns: Success indicator
Return type: bool
- output_formats (list) –
-
export_result
(resultID, name, only_last_step=True, export_npy=False, only_export_rawdata=False, return_array=False)¶ Export and optionally process simulation results
Parameters: - resultID (int) – Identifier of the simulation result (refer to
results.dat
) - name (str) – Name of the provided simulation result
- only_last_step (bool) – Only process the last time-step
- export_npy (bool) – Whether also export raw numerical values
- only_export_rawdata (bool) – Whether only export the raw
.xml
file without processing - return_array (bool) – Whether also return the
numpy
array for fields defined at a single time-step
Returns: Success indicator, (1) success; (-1) run_studyrlt error; (-2) read_moldflow_xml error
Return type: int
- resultID (int) – Identifier of the simulation result (refer to
-
finalize
()¶ Post-process the output file
Currently it will generate a time-series XDMF file
-
class
pymoldflow.
MoldflowStudyModifier
(moldflow_path, sdyfile=None, outfile=None, use_metric_units=True, verbose=True, stdout=None)¶ Modify Autodesk Moldflow study files
Parameters: - moldflow_path (str) – Path to Autodesk Moldflow Insight
- sdyfile (str) – Autodesk Moldflow
.sdy
file - outfile (str) – Modified
.sdy
file for output - use_metric_units (bool) – Use Metric units (mm for length for instance)
- verbose (bool) – Print out progress information
- stdout (obj) – Redirect progress information
-
add_parameter
(name, value)¶ Modify the simulation file by adding a new parameter
Parameters: - name (str) – Name of the parameter
- value (int, float, list, ndarray) – New value(s) of the parameter
-
define_material
(name)¶ Define the injection material
-
write
(export_modifier=False, mpifile=None, check_mode=False)¶ Write the modified output file
Parameters: - export_modifier (bool) – Whether also export the XML modifier file
- mpifile (str) – Create or modify the project file
- check_mode (bool) – Only to check if
studymod
works
\ Sort by:\ best rated\ newest\ oldest\
\\
Add a comment\ (markup):
\``code``
, \ code blocks:::
and an indented block after blank line