Generate files and folder structure for a coupled simulation with preCICE.
Project description
preCICE Case Generate
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.
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
- Automated preCICE configuration generation
- YAML-based input parsing
- Flexible topology description support
- Comprehensive error logging and handling
- Simple command-line interface
Getting Started
Prerequisites
Required dependencies are:
- Python ≥ 3.10
- pip
- git for cloning the repository :)
- preCICE Config Graph (will be installed during the setup)
- pyyaml
- jsonschema
Optional dependencies are:
- pytest
- preCICE Config Check
Manual Installation
- Clone the repository
git clone https://github.com/precice/case-generate.git
cd case-generate
- Create a virtual environment
# On Unix/macOS
python -m venv venv
source venv/bin/activate
# On Windows
python -m venv venv
.\venv\Scripts\activate
- Install the project
# Upgrade pip and install build tools
python -m pip install --upgrade pip
pip install build
# Install the project in editable mode
pip install -e .
Optional dependencies for testing can be installed via
pip install -e ".[dev]"
Using Setup Scripts
Unix/macOS
./setup_scripts/install_dependencies.sh
Windows
.\setup_scripts\install_dependencies.ps1
Verifying Installation
- Test the CLI tool
precice-case-generate --help
Usage
Command-Line Interface
Generate a preCICE configuration file from a YAML topology called topology.yaml:
precice-case-generate path/to/topology.yaml
The only required argument is the path/to/topology.yaml.
The precice-case-generate tool supports the following optional parameters:
-
-o, --output-path: Destination path for the generated folder.- Default:
./_generated/ - Description: Choose a specific output location for the
_generated/directory.
- Default:
-
-v, --verbose: Enable verbose console logging.- Default: Disabled
- Description: Provides detailed logging information during execution.
[!NOTE] While it is not expected, the topology generation might fail or produce faulty configuration files. This might happen in situations where the
topology.yamlcontains multiple edge cases, such as many data exchanges with the samedata-tag. The 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
- Prepare a YAML topology file describing your multi-physics simulation setup.
- Use the command-line interface to generate the preCICE configuration.
- preCICE Case Generate will create the necessary configuration files in the
_generated/directory.
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:
-
Open the MetaConfigurator with the preloaded schema: MetaConfigurator link
-
Use the interactive interface to define your topology:
- The preloaded schema provides a structured way to describe your simulation components
-
Once complete, export your topology as a YAML file
- Save the generated YAML file
- Use
precice-case-generateto create your preCICE application case and configuration files - Validate the generated preCICE config with config-checker
Documentation
The template for our topology.yaml file can be found in the schemas folder.
Alongside it, you will find README.md, which explains the topology's parameters.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
Troubleshooting
- Ensure all dependencies are correctly installed
- Verify the format of your input YAML file
- Check the generated logs (
./.logs) for detailed process information
If all else fails, open a pull request describing the issue you are encountering.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file precice_case_generate-1.0.0.tar.gz.
File metadata
- Download URL: precice_case_generate-1.0.0.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253911d162c2a4240497225a5300220754fe4892e6df841316a265e07bbcd05b
|
|
| MD5 |
e616533ea12b1978788bb78b43e7284a
|
|
| BLAKE2b-256 |
2721b41d14a0c0d82c8a013565032ab4321655b66292d3a058c0685e431a191f
|
Provenance
The following attestation bundles were made for precice_case_generate-1.0.0.tar.gz:
Publisher:
release.yml on precice/case-generate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
precice_case_generate-1.0.0.tar.gz -
Subject digest:
253911d162c2a4240497225a5300220754fe4892e6df841316a265e07bbcd05b - Sigstore transparency entry: 1802639715
- Sigstore integration time:
-
Permalink:
precice/case-generate@03496d4c70a3cfb783f29c60cc39788b90501d3b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/precice
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@03496d4c70a3cfb783f29c60cc39788b90501d3b -
Trigger Event:
push
-
Statement type:
File details
Details for the file precice_case_generate-1.0.0-py3-none-any.whl.
File metadata
- Download URL: precice_case_generate-1.0.0-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5811bffa259a5599d30783cbb7a37660f514e931743c969f13d193c589275853
|
|
| MD5 |
1907902a50319813060585319572ef11
|
|
| BLAKE2b-256 |
517504b1b967e5007747f65ac5bfc344794cedad9eb2572c1d734cabd1385032
|
Provenance
The following attestation bundles were made for precice_case_generate-1.0.0-py3-none-any.whl:
Publisher:
release.yml on precice/case-generate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
precice_case_generate-1.0.0-py3-none-any.whl -
Subject digest:
5811bffa259a5599d30783cbb7a37660f514e931743c969f13d193c589275853 - Sigstore transparency entry: 1802640007
- Sigstore integration time:
-
Permalink:
precice/case-generate@03496d4c70a3cfb783f29c60cc39788b90501d3b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/precice
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@03496d4c70a3cfb783f29c60cc39788b90501d3b -
Trigger Event:
push
-
Statement type: