Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions _data/sidebars/docs_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,6 @@ entries:
url: /dev-docs-naming.html
output: web, pdf

- title: Source documentation
url: /dev-docs-sourcedocs.html
output: web

- title: General coding conventions
url: /dev-docs-dev-conventions.html
output: web, pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ As a minimal example, we consider here two timestamps `t1 = 0.25` and `t2 = 0.5`

Of course, both variants work with preCICE, but the resulting computational cost might be considerable different (with Version 1 being much more efficient).

A more comprehensive description of all involved API function and their arguments is given in the [API documentation](/doxygen/main/classprecice_1_1Participant.html) (see the section on just-in-time mapping). Many other configuration and code examples can be found in related [integration tests](https://github.com/precice/precice/tree/develop/tests/serial/just-in-time-mapping). Just-in-time mapping includes full support for [time interpolation](couple-your-code-waveform.html) and subcycling.
A more comprehensive description of all involved API function and their arguments is given in the [API documentation](https://api.precice.org/cpp/latest/classprecice_1_1Participant.html) (see the section on just-in-time mapping). Many other configuration and code examples can be found in related [integration tests](https://github.com/precice/precice/tree/develop/tests/serial/just-in-time-mapping). Just-in-time mapping includes full support for [time interpolation](couple-your-code-waveform.html) and subcycling.

## Limitations

Expand Down
92 changes: 58 additions & 34 deletions content/docs/couple-your-code/couple-your-code-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,78 @@ title: Application programming interface
permalink: couple-your-code-api.html
keywords: api, adapter, library, bindings, Participant
summary: "This page gives an overview on available preCICE APIs and minimal reference implementations."
redirect_from: dev-docs-sourcedocs.html
---

preCICE is written in C++. Thus, the native API language of preCICE is C++ as well. If you are new to the preCICE API, we recommended that you first follow the [step-by-step guide](couple-your-code-preparing-your-solver.html).
preCICE is written in C++. Thus, the native API language of preCICE is C++ as well. If you are new to the preCICE API, we recommended that you first follow the [step-by-step guide](couple-your-code-preparing-your-solver.html). If you are using an older version, see the [porting guides](couple-your-code-porting-overview) to port an adapter between major version of preCICE.

## Native API
Next to the native C++ API, bindings for further languages are also available. In this page, we provide an overview of all supported languages, including location, installation, and minimal reference implementations.

The definite documentation of the C++ API is available on [the preCICE API doxygen pages for the latest release](https://precice.org/doxygen/main/classprecice_1_1Participant.html), or [see more options](dev-docs-sourcedocs.html).
The reference implementations are the so called _solver dummies_, which can be a great source to copy from. The community also maintains [MPI-parallel versions of some of these solver dummies](https://github.com/ajaust/precice-parallel-solverdummies).

| Language | Location | Installation |
|----------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| C++ | [`precice/precice/tree/main/src/precice/Participant.hpp`](https://github.com/precice/precice/tree/main/src/precice/Participant.hpp) | Automatically included |
## C++

## Bindings
This is the native API of preCICE.

Besides the C++ API, there are also bindings to other languages available:
- Location: [`precice/precice/src/precice/Participant.hpp`](https://github.com/precice/precice/tree/main/src/precice/Participant.hpp)
- Installation: Automatically included
- Usage: `#include "precice/precice.hpp"`
- Reference implementation: [`precice/precice/examples/solverdummies/cpp`](https://github.com/precice/precice/tree/main/examples/solverdummies/cpp)
- C++ API documentation: [latest release](https://api.precice.org/cpp/latest/classprecice_1_1Participant.html), [development version](https://api.precice.org/cpp/develop/classprecice_1_1Participant.html)

| Language | Location | Installation |
|----------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| C | [`precice/precice/tree/main/extras/bindings/c`](https://github.com/precice/precice/tree/main/extras/bindings/c) | [native bindings](installation-source-advanced.html#disabling-native-bindings)|
| Fortran | [`precice/precice/tree/main/extras/bindings/fortran`](https://github.com/precice/precice/tree/main/extras/bindings/fortran) | [native bindings](installation-source-advanced.html#disabling-native-bindings)|
| Fortran Module | [`precice/fortran-module`](https://github.com/precice/fortran-module) | [`make`](installation-bindings-fortran.html) |
| Python | [`precice/python-bindings`](https://github.com/precice/python-bindings) | [`pip3 install pyprecice`](installation-bindings-python.html) |
| Matlab | [`precice/matlab-bindings`](https://github.com/precice/matlab-bindings) | [installation script](installation-bindings-matlab.html) |
| Julia | [`precice/PreCICE.jl`](https://github.com/precice/PreCICE.jl) | [`add PreCICE`](installation-bindings-julia.html) |
| Rust | [`precice/rust-bindings`](https://github.com/precice/rust-bindings) | [`cargo add precice`](installation-bindings-rust.html) |
See also the source code documentation (Doxygen pages) for the [latest release](https://api.precice.org/cpp/latest/), or the [development version](https://api.precice.org/cpp/develop/).

The community is also working on the following bindings:
## C

| Language | Location | Notes |
|----------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| Rust | [`ajaust/rust-precice`](https://github.com/ajaust/rust-precice) | Experimental prototype / work in progress |
C bindings are included in the main repository.

## Minimal reference implementations
- Location: [`precice/precice/extras/bindings/c`](https://github.com/precice/precice/tree/main/extras/bindings/c)
- Installation: [native bindings](installation-source-advanced.html#disabling-native-bindings)
- Usage: `#include "precice/preciceC.h"`
- Reference implementation: [`precice/precice/examples/solverdummies/c`](https://github.com/precice/precice/tree/main/examples/solverdummies/c)
- C API documentation: [latest release](https://api.precice.org/cpp/latest/preciceC_8h.html), [development version](https://api.precice.org/cpp/develop/preciceC_8h.html)

For all languages, we provide minimal reference implementations, so called _solver dummies_. They can be a great source to copy from.
## Fortran

| Language | Location |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------|
| C++ | [`precice/precice/examples/solverdummies/cpp`](https://github.com/precice/precice/tree/main/examples/solverdummies/cpp) |
| C | [`precice/precice/examples/solverdummies/c`](https://github.com/precice/precice/tree/main/examples/solverdummies/c) |
| Fortran | [`precice/precice/examples/solverdummies/fortran`](https://github.com/precice/precice/tree/main/examples/solverdummies/fortran) |
| Fortran Module | [`precice/fortran-module/examples/solverdummy`](https://github.com/precice/fortran-module/tree/master/examples/solverdummy) |
| Python | [`precice/python-bindings/examples/solverdummy`](https://github.com/precice/python-bindings/tree/master/examples/solverdummy) |
| Matlab | [`precice/matlab-bindings/solverdummy`](https://github.com/precice/matlab-bindings/tree/master/solverdummy) |
| Julia | [`precice/PreCICE.jl/solverdummy`](https://github.com/precice/PreCICE.jl/tree/main/solverdummy) |
| Rust | [`precice/rust-bindings/examples/solverdummy`](https://github.com/precice/rust-bindings/tree/main/examples/solverdummy) |
Fortran bindings are included in the main repository.

The community also maintains [MPI-parallel versions of some of these solver dummies](https://github.com/ajaust/precice-parallel-solverdummies).
- Location: [`precice/precice/extras/bindings/fortran`](https://github.com/precice/precice/tree/main/extras/bindings/fortran)
- Installation: [native bindings](installation-source-advanced.html#disabling-native-bindings)
- Reference implementation: [`precice/precice/examples/solverdummies/fortran`](https://github.com/precice/precice/tree/main/examples/solverdummies/fortran)
- Fortran API documentation: [latest release](https://api.precice.org/cpp/latest/preciceFortran_8hpp.html), [development version](https://api.precice.org/cpp/develop/preciceFortran_8hpp.html)

## Fortran module

- Location: [`precice/fortran-module`](https://github.com/precice/fortran-module)
- Installation: [`make`](installation-bindings-fortran.html)
- Usage: `use precice`
- Reference implementation: [`precice/fortran-module/examples/solverdummy`](https://github.com/precice/fortran-module/tree/master/examples/solverdummy)

## Python

- Location:[`precice/python-bindings`](https://github.com/precice/python-bindings)
- Installation: [`pip3 install pyprecice`](installation-bindings-python.html)
- Usage: `import precice`
- Reference implementation: [`precice/python-bindings/examples/solverdummy`](https://github.com/precice/python-bindings/tree/master/examples/solverdummy)

## Matlab

- Location:[`precice/matlab-bindings`](https://github.com/precice/matlab-bindings)
- Installation: [installation script](installation-bindings-matlab.html)
- Reference implementation: [`precice/matlab-bindings/examples/solverdummy`](https://github.com/precice/matlab-bindings/tree/master/examples/solverdummy)

## Julia

- Location: [`precice/PreCICE.jl`](https://github.com/precice/PreCICE.jl)
- Installation: [`add PreCICE`](installation-bindings-julia.html)
- Usage: `using PreCICE`
- Reference implementation: [`precice/PreCICE.jl/solverdummy`](https://github.com/precice/PreCICE.jl/tree/main/solverdummy)

## Rust

- Location: [`precice/rust-bindings`](https://github.com/precice/rust-bindings)
- Installation:[`cargo add precice`](installation-bindings-rust.html)
- Reference implementation: [`precice/rust-bindings/examples/solverdummy`](https://github.com/precice/rust-bindings/tree/main/examples/solverdummy)

## Architectural overview of bindings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There are [guidelines for adapters](community-guidelines-adapters.html) and [gui
{% endtip %}

{% tip %}
Also have a look at the [source documentation](dev-docs-sourcedocs.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
Also have a look at the [API documentation](couple-your-code-api.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
{% endtip %}

## preCICE API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are [guidelines for adapters](community-guidelines-adapters.html) and [gui
{% endtip %}

{% tip %}
Also have a look at the [source documentation](dev-docs-sourcedocs.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
Also have a look at the [API documentation](couple-your-code-api.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
{% endtip %}

## preCICE API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Probably most solvers have such a structures: something in the beginning (readin
In the following steps, we will slowly add more and more calls to the preCICE API in this code snippet. Some part of the preCICE API is briefly described in each step. More precisely (no pun intended :grin:), we use the native `C++` API of preCICE. The API is, however, also available in other scientific programming languages: plain `C`, `Fortran`, `Python`, `Matlab`, `Julia`, and `Rust` (see [Application Programming Interface](couple-your-code-api)).

{% tip %}
Also have a look at the [source documentation](dev-docs-sourcedocs.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
Also have a look at the [API documentation](couple-your-code-api.html) and [minimal reference implementations](couple-your-code-api.html#minimal-reference-implementations).
{% endtip %}

{% tip %}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/dev-docs/dev-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permalink: dev-docs-overview.html

This section contains information for preCICE maintainers and contributors.

To see the source code documentation, please visit our [doxygen](dev-docs-sourcedocs.html).
See also the [API and source documentation](couple-your-code-api.html).

## Getting started

Expand Down
31 changes: 0 additions & 31 deletions content/docs/dev-docs/dev-sourcedocs.md

This file was deleted.

2 changes: 1 addition & 1 deletion content/docs/dev-docs/dev-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Integrations tests:
Inside the test, `PRECICE_TEST()` applies the defined test setup to the current environment.
It handles unnecessary ranks and partitions MPI communicators to represent the correct communicator sizes.

It also defines a [TestContext](https://precice.org/doxygen/develop/classprecice_1_1testing_1_1TestContext.html) named `context`, which provides context of the currently running test.
It also defines a [TestContext](https://api.precice.org/cpp/develop/classprecice_1_1testing_1_1TestContext.html) named `context`, which provides context of the currently running test.
Information is accessible directly and checkable as predicates.
You can safely pass this per reference (`const precice::testing::TestContext&`) to other functions to refactor common test functionality.

Expand Down
Loading