General Nodes¶
General nodes provide basic file operations, code execution, and template processing capabilities. These nodes are not specific to any simulation domain and can be used in any workflow.
Available Nodes¶
| Node | Type | Description |
|---|---|---|
| CopyDirectory | general.CopyDirectory |
Copy an entire directory to a new location |
| CopyFile | general.CopyFile |
Copy a single file |
| RunOsCommand | general.RunOsCommand |
Execute a system/shell command |
| RunPythonCode | general.RunPythonCode |
Execute a Python method from a module |
| JinjaTransform | general.JinjaTransform |
Apply Jinja2 template transformations |
| FilesWriter | general.FilesWriter |
Write files using content from node outputs |
| Parameters | general.Parameters |
Define general simulation parameters |
Common Patterns¶
Chaining File Operations¶
{
"nodeList": ["CopyDirectory", "RunOsCommand"],
"nodes": {
"CopyDirectory": {
"Execution": {
"input_parameters": {
"Source": "template_case",
"Target": "my_case"
}
},
"type": "general.CopyDirectory"
},
"RunOsCommand": {
"Execution": {
"input_parameters": {
"Command": "ls -la {CopyDirectory.output.Target}"
}
},
"type": "general.RunOsCommand"
}
}
}
Template-Based File Generation¶
{
"nodeList": ["Parameters", "JinjaTransform", "FilesWriter"],
"nodes": {
"Parameters": {
"Execution": {
"input_parameters": {
"velocity": 10.0,
"viscosity": 1e-6
}
},
"type": "general.Parameters"
},
"JinjaTransform": {
"Execution": {
"input_parameters": {
"TemplatePath": "templates/config.j2",
"Parameters": "{Parameters.output}"
}
},
"type": "general.JinjaTransform"
},
"FilesWriter": {
"Execution": {
"input_parameters": {
"Files": [
{
"Path": "output/config.txt",
"Content": "{JinjaTransform.output.Result}"
}
]
}
},
"type": "general.FilesWriter"
}
}
}