create_cosim_project
Scaffold a coupled-solver co-simulation case by defining solvers, interface-data couplings, and convergence options, ready to run with the Kratos simulation runner.
Instructions
Scaffold a CoSimulation (coupled-solver) case: several solvers exchanging interface data inside every time step, run with run_simulation like any case (the runner drives it through CoSimulationAnalysis). Needs KratosCoSimulationApplication.
'solvers' is a list of {"name", "type", "data", "parameters"?, "input_file"?}. 'type' is a CoSimulation wrapper module ('solver_wrappers.kratos.structural_mechanics_wrapper', ...) or the shorthands 'sdof' / 'sdof_static' (Python-only single-degree-of-freedom solvers: no mesh, ideal for learning/testing couplings). 'data' maps an interface-data name to {"model_part_name", "variable_name", "location"?} ('sdof' data gets "location": "model_part" automatically). Give 'parameters' to have the solver's own parameter file written to .json, or 'input_file' to reference one already in the directory.
'couplings' is a list of {"from_solver", "from_data", "to_solver", "to_data", "operator"='copy', "options"=[]} (options e.g. 'swap_sign'). 'order' is the coupling sequence (default: solver order); a coupling whose producer comes first is exchanged right after the producer solves, otherwise right before the consumer solves (previous iteration's value). 'coupled_solver' is 'gauss_seidel_weak' (one pass per step) or a strong variant ('gauss_seidel_strong', 'jacobi_strong') that iterates until every entry of 'convergence_criteria' (e.g. {"type": "relative_norm_initial_residual", "solver": s, "data_name": d, "abs_tolerance": 1e-10, "rel_tolerance": 1e-8}) holds, optionally accelerated by 'convergence_accelerators' (e.g. {"type": "aitken", "solver": s, "data_name": d}). The result is statically validated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | ||
| solvers | Yes | ||
| end_time | No | ||
| couplings | Yes | ||
| directory | Yes | ||
| start_time | No | ||
| coupled_solver | No | gauss_seidel_weak | |
| convergence_criteria | No | ||
| data_transfer_operators | No | ||
| num_coupling_iterations | No | ||
| convergence_accelerators | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||