Project scaffolding
Create and edit the Kratos input files: ProjectParameters.json (solver + processes), Materials.json (constitutive laws + properties) and complete case directories.
list_templates
List available case templates with descriptions, required applications and every placeholder with its default.
Templates: structural_static, structural_dynamic, structural_modal, thermal_transient, thermal_stationary, fluid_transient.
create_project
Scaffold a complete case directory from a template.
| Parameter | Type | Description |
|---|---|---|
directory | string | case directory (created if missing) |
template | string | template name from list_templates |
name | string | problem name (default case) |
overrides | object? | placeholder overrides, e.g. {"end_time": 2.0, "young_modulus": 7e10} |
create_demo_mesh | bool | also write a small rectangle mesh wired to the defaults, so the case runs out of the box (default false) |
Returns: created file list, required_applications, and next_steps (create mesh → validate → run).
// create_project("/tmp/my-case", "structural_static", "cantilever",
// {"fix_model_part": "Structure.left"})
{
"case_dir": "/tmp/my-case",
"created": ["/tmp/my-case/ProjectParameters.json", "/tmp/my-case/Materials.json"],
"next_steps": ["Create the mesh at /tmp/my-case/mesh.mdpa ...", "..."]
}create_project_parameters
Render only a ProjectParameters.json (returned, and optionally written to output_file). Same template/overrides semantics as create_project.
create_materials
Write a Materials.json from a list of material specs.
| Parameter | Type | Description |
|---|---|---|
output_file | string | where to write |
materials | array | one entry per model part (below) |
Each entry: model_part_name (e.g. Structure.domain), optional constitutive_law (thermal problems have none), variables (e.g. {"YOUNG_MODULUS": 2.1e11, "POISSON_RATIO": 0.3}), optional properties_id.
add_boundary_condition
Insert a boundary condition or load process block into an existing ProjectParameters.json.
| Parameter | Type | Description |
|---|---|---|
parameters_file | string | the file to edit |
kind | string | see table below |
model_part | string | dotted target, e.g. Structure.right |
value | number | number[3]? | for fix/prescribe kinds |
modulus, direction | number, number[3] | for directional loads |
interval | [start, end]? | default [0.0, "End"] |
process_list | string? | override the target list |
| kind | variable | typical use |
|---|---|---|
fix_displacement / prescribed_displacement | DISPLACEMENT | supports / imposed motion |
fix_velocity / inlet_velocity | VELOCITY | fluid walls / inlets |
outlet_pressure | PRESSURE | fluid outlets |
fix_temperature | TEMPERATURE | thermal Dirichlet |
point_load / line_load / surface_load | POINT_LOAD / LINE_LOAD / SURFACE_LOAD | directional loads on conditions (need modulus + direction) |
pressure_load | POSITIVE_FACE_PRESSURE | pressure on faces |
surface_heat_flux | FACE_HEAT_FLUX | thermal Neumann on conditions |
volume_heat_source | HEAT_FLUX | volumetric heating |
self_weight | VOLUME_ACCELERATION | gravity (modulus defaults to 9.81) |
// add_boundary_condition(file, "line_load", "Structure.right",
// modulus=1e6, direction=[0, -1, 0])
{ "process_list": "loads_process_list", "added": { "python_module": "assign_vector_by_direction_to_condition_process", "...": "..." } }WARNING
Condition-based loads (point/line/surface_load, pressure_load, surface_heat_flux) need actual load-bearing conditions in the target region — see the MDPA guide.
add_output_process
Add an output process to a ProjectParameters.json.
| Parameter | Type | Description |
|---|---|---|
parameters_file | string | file to edit |
format | string | vtk (ParaView), json (variable time series), point (probe a coordinate) |
variables | string[]? | variables to write |
model_part | string? | defaults to the solver root |
output_path | string | for vtk (default vtk_output) |
output_file | string? | for json/point |
position | number[3]? | for point |
validate_project_parameters
deep mode needs Kratos
Validate a ProjectParameters.json without running anything:
- JSON syntax and required top-level keys,
- referenced mesh/materials files exist and parse,
- every
model_part_namein processes/materials matches a mesh submodelpart, - (
deep: true, default)solver_settingsvalidated against the solver'sGetDefaultParameters()inside a Kratos worker.
Returns: {valid, issues: [...], warnings: [...]}.