Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
dbfe219
Update pyproject.toml
orlandoisepic Jan 4, 2026
47d1ab7
Update .gitignore
orlandoisepic Jan 4, 2026
03062de
Removed old files
orlandoisepic Jan 4, 2026
2ecc560
Update topology-schema.json
orlandoisepic Jan 4, 2026
befcc12
Create logging_setup.py
orlandoisepic Jan 4, 2026
c5d0e96
Create topology_reader.py
orlandoisepic Jan 4, 2026
f374f55
Create config_creator.py
orlandoisepic Jan 4, 2026
117b303
Create node_creator.py
orlandoisepic Jan 4, 2026
e531045
Create helper.py
orlandoisepic Jan 4, 2026
2800eef
Update cli.py
orlandoisepic Jan 4, 2026
1a0351f
Update helper.py
orlandoisepic Jan 4, 2026
63b6286
Created new examples
orlandoisepic Jan 4, 2026
7a74c24
Update node_creator.py
orlandoisepic Jan 4, 2026
b609aba
Update .gitignore
orlandoisepic Jan 4, 2026
2d82799
Update logging_setup.py
orlandoisepic Jan 5, 2026
09dd45d
Update config_creator.py
orlandoisepic Jan 5, 2026
e7569c4
Update helper.py
orlandoisepic Jan 5, 2026
a337ff6
Update node_creator.py
orlandoisepic Jan 5, 2026
23c31ea
Create adapter_config_creator.py
orlandoisepic Jan 5, 2026
f432feb
Update cli.py
orlandoisepic Jan 5, 2026
f0047d7
Update node_creator.py
orlandoisepic Jan 5, 2026
f538272
Create adapter-config-schema.json
orlandoisepic Jan 5, 2026
34d73c9
Update adapter_config_creator.py
orlandoisepic Jan 5, 2026
1bc4849
Update topology_reader.py
orlandoisepic Jan 5, 2026
c380efa
Moved files to reflect logic
orlandoisepic Jan 5, 2026
63e9650
Update cli.py
orlandoisepic Jan 5, 2026
cdd4f92
Update helper.py
orlandoisepic Jan 5, 2026
badcaea
Update adapter_config_creator.py
orlandoisepic Jan 5, 2026
1ec350f
Utility file templates
orlandoisepic Jan 5, 2026
d8e7663
Create utility_file_creator.py
orlandoisepic Jan 5, 2026
e3e8ebb
Update cli.py
orlandoisepic Jan 5, 2026
d74f45a
Update helper.py
orlandoisepic Jan 5, 2026
637814d
Update utility_file_creator.py
orlandoisepic Jan 5, 2026
6a073c8
Updated the new examples
orlandoisepic Jan 5, 2026
bd7c1ae
Added option for verbose output
orlandoisepic Jan 5, 2026
5c98df4
Update helper.py
orlandoisepic Jan 5, 2026
e0b5d20
Automatic validation with precice-config-check
orlandoisepic Jan 5, 2026
a8b2263
Update node_creator.py
orlandoisepic Jan 11, 2026
cf76ccc
updated example configs
orlandoisepic Jan 11, 2026
bf5a216
Update helper.py
orlandoisepic Jan 11, 2026
9bdef4d
Update node_creator.py
orlandoisepic Jan 11, 2026
d5227ac
Update helper.py
orlandoisepic Jan 19, 2026
6e186cc
Update config_creator.py
orlandoisepic Jan 19, 2026
499ae1c
Update node_creator.py
orlandoisepic Jan 19, 2026
854ac81
Update topology-schema.json
orlandoisepic Jan 19, 2026
025ac96
Updated examples
orlandoisepic Jan 19, 2026
5f787d4
Test cases for data types
orlandoisepic Jan 19, 2026
a2f5c4c
Update cli.py
orlandoisepic Jan 25, 2026
b4b2eac
Use json.dump() to create file
orlandoisepic Jan 25, 2026
5dcd996
Update config_creator.py
orlandoisepic Jan 25, 2026
0a0378b
Update utility_file_creator.py
orlandoisepic Jan 25, 2026
e5e8135
Update helper.py
orlandoisepic Jan 25, 2026
c7ed65b
Update topology_reader.py
orlandoisepic Jan 25, 2026
a8e7d40
Update node_creator.py
orlandoisepic Jan 25, 2026
e168d14
Update topology-schema.json
orlandoisepic Jan 25, 2026
961cc9e
Moved main logic to separate method
orlandoisepic Jan 25, 2026
b0777ce
Tests for data-type in topology
orlandoisepic Jan 25, 2026
97e108c
Update logging_setup.py
orlandoisepic Jan 25, 2026
4a065aa
Formatting
orlandoisepic Jan 25, 2026
82550f4
Test for node generation
orlandoisepic Jan 25, 2026
9cffa58
Test for coupling schemes
orlandoisepic Jan 25, 2026
3592d1a
Moved tests
orlandoisepic Jan 25, 2026
8d4ab7d
Switched to integer return type
orlandoisepic Jan 25, 2026
2422165
Test preprocessing
orlandoisepic Jan 25, 2026
e9f9c56
Miscellaneous test cases
orlandoisepic Jan 25, 2026
66567d5
Update topology_reader.py
orlandoisepic Jan 25, 2026
313be12
Removed unused imports
orlandoisepic Jan 25, 2026
6bddb1f
Update pyproject.toml
orlandoisepic Jan 25, 2026
729d638
Update topology_reader.py
orlandoisepic Jan 25, 2026
6d02dc9
Changed folder names
orlandoisepic Jan 26, 2026
49f6f13
Updated CI
orlandoisepic Jan 26, 2026
4b1849d
Removed old examples
orlandoisepic Jan 26, 2026
d9abe01
Removed old examples
orlandoisepic Jan 26, 2026
31ed42a
Update .gitignore
orlandoisepic Jan 26, 2026
59b20dd
Fixed default data bug
orlandoisepic Jan 26, 2026
7193004
Update node_creator.py
orlandoisepic Jan 26, 2026
5ddad2a
Update test_examples.py
orlandoisepic Jan 26, 2026
38d8afd
Update test_node_generation.py
orlandoisepic Jan 26, 2026
856d53e
New example topologies
orlandoisepic Jan 26, 2026
cb0fce8
...rest of the example files
orlandoisepic Jan 26, 2026
3c21a43
Bug fix
orlandoisepic Jan 26, 2026
7511e92
Fixed test
orlandoisepic Jan 26, 2026
204b55b
Fixed mesh dimensions bug
orlandoisepic Jan 26, 2026
47954ab
Adjusted tests
orlandoisepic Jan 26, 2026
81044a6
Update .gitignore
orlandoisepic Feb 10, 2026
f336a77
Remove participants if unused
orlandoisepic Feb 10, 2026
9bf5f4b
indentation
orlandoisepic Feb 10, 2026
95999a7
Improved descriptions
orlandoisepic Feb 10, 2026
298c1a6
Check if exchange is a loop
orlandoisepic Feb 10, 2026
3dd1b0e
Add test for loop-exchange
orlandoisepic Feb 10, 2026
ab51ffa
Update README.md
orlandoisepic Feb 10, 2026
8d84f6f
Create README.md
orlandoisepic Feb 10, 2026
df79e55
Update README.md
orlandoisepic Feb 11, 2026
0789718
Change quotation marks
orlandoisepic Feb 11, 2026
025c996
python 3.10 quotation marks
orlandoisepic Feb 11, 2026
0a12f1d
Update adapter-config-schema.json
orlandoisepic Feb 11, 2026
c8e1e96
Update helper.py
orlandoisepic Feb 20, 2026
a002c59
Include "precice_config_file_path" in all files
orlandoisepic Feb 23, 2026
a15bdd9
Update to precice_config_file_path
orlandoisepic Feb 23, 2026
6ba9677
Update examples
orlandoisepic Feb 23, 2026
0f45d2f
Rename test case
orlandoisepic Feb 23, 2026
858bae6
Update node_creator.py
orlandoisepic Feb 23, 2026
41a1313
Test for patches causing renaming
orlandoisepic Feb 23, 2026
5f30487
update indent
orlandoisepic Apr 10, 2026
6e3ae84
Move data label comp to helper
orlandoisepic Apr 28, 2026
375af36
Update helper.py
orlandoisepic Apr 29, 2026
8e7c538
Update logging_setup.py
orlandoisepic Apr 29, 2026
5d7d6f1
Update pyproject.toml
orlandoisepic Apr 29, 2026
e8b5045
Update config_creator.py
orlandoisepic Apr 29, 2026
ade3e58
default for file_path cli argument
orlandoisepic Apr 29, 2026
5ea9305
use preciceadapterschema
orlandoisepic May 1, 2026
db887af
Allow specified output path
orlandoisepic May 1, 2026
773b00c
Revert to old main() method
orlandoisepic May 1, 2026
c65eaae
Update pyproject.toml
orlandoisepic May 1, 2026
5c63671
Update coupling_scheme_test.py
orlandoisepic May 1, 2026
4a13b42
Update import
orlandoisepic May 1, 2026
a956806
Update examples
orlandoisepic May 1, 2026
ddf41e4
Update pyproject.toml
orlandoisepic May 1, 2026
fa3d1c8
Update pyproject.toml
orlandoisepic May 1, 2026
9aea61d
Switch to ruamel.yaml
orlandoisepic May 1, 2026
6b83c6b
Create test_topology_parsing.py
orlandoisepic May 1, 2026
f207d4c
rename misc test folder
orlandoisepic May 1, 2026
a62c714
Rename expected results of examples to "_reference"
orlandoisepic May 1, 2026
7f1fd6e
Delete adapter-config-schema.json
orlandoisepic May 1, 2026
7a4adce
Update README.md
orlandoisepic May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
**/__pycache__/
venv/
_generated/
dist/
build/
*.egg-info/
.tox/
*.spec

# macOS
.DS_Store

.idea/*
# IntelliJ
.idea/*

# Created directories during runs
*_generated/
*logs/
137 changes: 47 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# precice-generator
# preCICE Case Generate

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/precice/case-generate/check.yml?label=Examples%20generation%20and%20validation%20using%20config-checker)
preCICE case-generate is a python based utility designed to simplify the generation of preCICE application cases.
Such cases consist of the central `precice-config.xml` file which defines all sorts of connections and relations between
involved solvers, as well as `adapter-config.json` files for each solver.

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/precice/case-generate/installation.yml?label=Installation%20Checker)

![GitHub License](https://img.shields.io/github/license/precice/case-generate)

## Project Overview

The preCICE case-generate package is a Python-based utility designed to automate the generation of preCICE configuration files from
simple YAML topology descriptions. This tool simplifies the process of setting up multi-physics simulations by transforming
user-defined YAML configurations into preCICE-compatible XML configuration files.
These files involve a lot of complex elements and modifiers, which are often times not needed.
This tool introduces a simpler, easier to read and write `topology.yaml` file,
which covers a wide range of features of the `precice-config.xml` file, yet with only a fraction of the complexity.
An overview over the `topology.yaml` file can be found in `precicecasegenerate/schemas/README.md`.

## Key Features

Expand All @@ -20,24 +17,31 @@ user-defined YAML configurations into preCICE-compatible XML configuration files
- Comprehensive error logging and handling
- Simple command-line interface

## Installation
## Getting Started

### Prerequisites

- Python 3.9 or
higher ([workflow validated](https://github.com/precice/case-generate/actions/workflows/installation.yml)
with 3.9, 3.10, 3.11 and 3.12)
Required dependencies are:

- Python ≥ 3.10
- pip
- venv
- (preCICE library)
- git for cloning the repository :)
- [preCICE Config Graph](https://github.com/precice/config-graph) (will be installed during the setup)
- pyyaml
- jsonschema

Optional dependencies are:

- pytest
- [preCICE Config Check](https://github.com/precice/config-check)

### Manual Installation

1. Clone the repository

```bash
git clone https://github.com/precice/case-generate.git
cd precice-generator
cd case-generate
```

2. Create a virtual environment
Expand All @@ -63,6 +67,11 @@ pip install build
pip install -e .
```

Optional dependencies for testing can be installed via
```bash
pip install -e ".[dev]"
```

### Using Setup Scripts

#### Unix/macOS
Expand Down Expand Up @@ -92,102 +101,54 @@ precice-case-generate --help
Generate a preCICE configuration file from a YAML topology called `topology.yaml`:

```bash
precice-case-generate
precice-case-generate path/to/topology.yaml
```

or pass a topology file via argument;

```bash
precice-case-generate -f path/to/your/topology.yaml
```
The only required argument is the `path/to/topology.yaml`.

The `precice-case-generate` tool supports the following optional parameters:

- `-f, --input-file`: Path to the input topology.yaml file.
- **Default**: `./topology.yaml`
- **Description**: Specify a custom topology file for configuration generation.

- `-o, --output-path`: Destination path for the generated folder.
- **Default**: `./_generated/`
- **Description**: Choose a specific output location for generated files.
- **Description**: Choose a specific output location for the `_generated/` directory.

- `-v, --verbose`: Enable verbose logging.
- `-v, --verbose`: Enable verbose console logging.
- **Default**: Disabled
- **Description**: Provides detailed logging information during execution.

- `--validate-topology`: Validate the input topology.yaml against the preCICE topology schema.
- **Default**: Enabled
- **Description**: Ensures the topology file meets the required schema specifications.

Example usage:
```bash
precice-case-generate -f custom_topology.yaml -o /path/to/output -v
```

> [!NOTE]
> You should validate your files by running them through precice-tools and the
> preCICE [config-checker](https://github.com/precice/case-generate) to avoid errors.
> While it is not expected, the topology generation might fail or produce faulty configuration files.
> This might happen in situations where the `topology.yaml` contains multiple edge cases,
> such as many data exchanges with the same `data`-tag.
> The preCICE [Config Check](https://github.com/precice/config-check) is designed to identify and alert to such errors.

### Examples

Valid `topology.yaml` <-> application case pairs can be found in the `examples/` directory.
They include the preCICE tutorials 1-4 as well as some more complex simulations.

### Configuration

1. Prepare a YAML topology file describing your multi-physics simulation setup.
2. Use the command-line interface to generate the preCICE configuration.
3. The tool will create the necessary configuration files in the `_generated/` directory.
3. preCICE Case Generate will create the necessary configuration files in the `_generated/` directory.

## Creating Topology with MetaConfigurator
## Creating Topologies with MetaConfigurator

You can create a topology for your preCICE simulation using the online MetaConfigurator.
We provide a preloaded schema to help you get started:

1. Open the MetaConfigurator with the preloaded
schema: [MetaConfigurator Link](https://metaconfigurator.github.io/meta-configurator/?schema=https://github.com/precice/case-generate/blob/main/precicecasegenerate/schemas/topology-schema.json&settings=https://github.com/precice/case-generate/blob/main/precicecasegenerate/templates/metaConfiguratorSettings.json)
schema: [MetaConfigurator link](https://metaconfigurator.github.io/meta-configurator/?schema=https://github.com/precice/case-generate/blob/main/precicecasegenerate/schemas/topology-schema.json&settings=https://github.com/precice/case-generate/blob/main/precicecasegenerate/templates/metaConfiguratorSettings.json)

2. Use the interactive interface to define your topology:
- The preloaded schema provides a structured way to describe your simulation components
- Add configuration details on the right side of the screen

3. Once complete, export your topology as a YAML file
- Save the generated YAML file
- Use this file with the `precice-generator` tool to create your preCICE configuration
- Validate the generated preCICE config
with [config-checker](https://github.com/precice/config-check)
- Use `precice-config-checker` and/or `precice-tools check` to validate the generated preCICE config

### Benefits of Using MetaConfigurator

- Visual, user-friendly interface
- Real-time validation against our predefined schema
- Reduces manual configuration errors
- Simplifies topology creation process

## Example Configurations

### Normal Examples (0-5)

Our project provides a set of progressively complex example configurations to help you get started with preCICE
simulations:

- Located in `examples/0` through `examples/5`
- Designed for beginners and intermediate users
- Each example includes:
- A `topology.yaml` file defining the simulation setup
- A `precice-config.xml` file
- Subdirectories for different simulation components
- Showcase simple, linear multi-physics scenarios
- Ideal for learning basic preCICE configuration concepts

### Expert Examples

For advanced users, we offer more sophisticated configuration examples:

- Located in `examples/expert`
- Contain more advanced usage of topology options but extend the according example with the same number
- Demonstrate advanced coupling strategies and intricate topology configurations
- Targeted at users with a better understanding of preCICE

> [!TIP]
> Start with normal examples (0-5) and progress to expert examples as you become more comfortable with preCICE
> configurations.
- Use `precice-case-generate` to create your preCICE application case and configuration files
- Validate the generated preCICE config with [config-checker](https://github.com/precice/config-check)

## Documentation

Expand All @@ -207,10 +168,6 @@ Alongside it, you will find `README.md`, which explains the topology's parameter

- Ensure all dependencies are correctly installed
- Verify the format of your input YAML file
- Check the generated logs for detailed error information

## Acknowledgements
- Check the generated logs (`./.logs`) for detailed process information

This project was started with code from the [preCICE controller](https://github.com/precice/controller) repository.
The file `format_precice_config.py` was taken
from [preCICE pre-commit hook file](https://github.com/precice/precice-pre-commit-hooks/blob/main/format_precice_config/format_precice_config.py)
If all else fails, open a pull request describing the issue you are encountering.
8 changes: 0 additions & 8 deletions examples/0/README.md

This file was deleted.

Binary file removed examples/0/config_graph.png
Binary file not shown.
13 changes: 0 additions & 13 deletions examples/0/fluid-su2/adapter-config.json

This file was deleted.

47 changes: 0 additions & 47 deletions examples/0/precice-config.xml

This file was deleted.

15 changes: 0 additions & 15 deletions examples/0/solid-calculix/adapter-config.json

This file was deleted.

14 changes: 0 additions & 14 deletions examples/0/topology.yaml

This file was deleted.

Binary file removed examples/0/vis.png
Binary file not shown.
8 changes: 0 additions & 8 deletions examples/1/README.md

This file was deleted.

Binary file removed examples/1/config_graph.png
Binary file not shown.
18 changes: 0 additions & 18 deletions examples/1/fluid-su2/precice-adapter-config.json

This file was deleted.

Binary file removed examples/1/image.png
Binary file not shown.
Loading
Loading