Skip to content

Commit

Permalink
Merge pull request #182 from precice/develop
Browse files Browse the repository at this point in the history
Release v3 compatible ASTE version
  • Loading branch information
davidscn authored Mar 22, 2024
2 parents 9e7b31c + 3168b0e commit 765f405
Show file tree
Hide file tree
Showing 44 changed files with 5,478 additions and 2,705 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
9 changes: 0 additions & 9 deletions .github/dependency_bot.yml

This file was deleted.

24 changes: 14 additions & 10 deletions .github/workflows/aste_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
container: precice/precice:develop
timeout-minutes: 30
env:
CXX_FLAGS: "-Werror -Wall -Wextra -Wno-unused-parameter"
CTEST_OUTPUT_ON_FAILURE: "Yes"
steps:
- uses: actions/checkout@v2
- name: install preCICE
- uses: actions/checkout@v4
- name: setup system
run: |
wget https://github.com/precice/precice/releases/download/v2.5.0/libprecice2_2.5.0_focal.deb && \
sudo apt-get -y update && \
sudo apt-get -y install ./libprecice2_2.5.0_focal.deb
apt-get -y update && apt-get -y upgrade
apt-get install -y python3-pip pkg-config time
pip3 install --upgrade pip
- name: install VTK
run: |
sudo apt-get -y install libvtk7-dev
apt-get -y install libvtk9-dev libvtk9-qt-dev
- name: install example dependencies
run: |
python3 -m pip install sympy scipy jinja2
Expand All @@ -41,13 +42,15 @@ jobs:
run: |
cmake ..
cmake --build .
- name: Adjust user rights
run: chown -R $PRECICE_USER .
- name: run test gcc
working-directory: build_gcc
run: |
ctest
su -c "ctest" $PRECICE_USER
- name: install clang
run: |
sudo apt-get -y install clang
apt-get -y install clang
- name: build aste clang
working-directory: build_clang
env:
Expand All @@ -56,8 +59,9 @@ jobs:
run: |
cmake ..
cmake --build .
sudo cmake --install .
- name: Adjust user rights
run: chown -R $PRECICE_USER .
- name: run test clang
working-directory: build_clang
run: |
ctest
su -c "ctest" $PRECICE_USER
7 changes: 5 additions & 2 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout preCICE
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true
- name: Install pre-commit
run: pip install pre-commit
- name: Run checks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Check links in markdown files (markdown-link-check)
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/lint_markdown.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"MD013": false,
"MD033": false
"MD033": false,
"MD041": false
}
18 changes: 14 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ repos:
types_or: [c++, c]
# isort for python imports
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
# black repo for python formatting
- repo: https://github.com/ambv/black
rev: 22.6.0
rev: 22.12.0
hooks:
- id: black
# Official repo for default hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.3.0"
rev: "v4.4.0"
hooks:
- id: check-xml
exclude: "tools"
Expand All @@ -30,7 +30,17 @@ repos:
- id: requirements-txt-fixer
# Custom repo for the preCICE configuration formatter
- repo: https://github.com/precice/precice-pre-commit-hooks
rev: "v2.1"
rev: "v3.2"
hooks:
- id: format-precice-config
exclude: "tools"
- id: check-image-prefix
files: "^docs/images/.*"
args: [ --prefix=docs-tooling-aste- ]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
exclude: changelog-entries
- id: markdownlint-fix
exclude: changelog-entries
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
cmake_minimum_required (VERSION 3.1)
cmake_minimum_required (VERSION 3.16.3)

project(ASTE)

list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES)
set (CMAKE_CXX_EXTENSIONS NO)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
Expand All @@ -20,9 +21,9 @@ option(ASTE_SET_MESH_BLOCK "Use block versions to set mesh primitives." ON)

find_package (Threads REQUIRED)

find_package(precice REQUIRED CONFIG)
find_package(precice 3.0 REQUIRED)

find_package(Boost 1.65.1 REQUIRED COMPONENTS log log_setup system program_options filesystem unit_test_framework)
find_package(Boost 1.71.0 REQUIRED COMPONENTS log log_setup system program_options unit_test_framework)

option(ASTE_USE_VTK_COMPONENTS "Find VTK with components" OFF)
if(ASTE_USE_VTK_COMPONENTS)
Expand Down Expand Up @@ -63,9 +64,9 @@ if(METIS_FOUND)
endif()


add_executable(testing tests/testing.cpp tests/read_test.cpp tests/write_test.cpp src/mesh.cpp src/logger.cpp)
target_include_directories(testing PRIVATE src thirdparty)
target_link_libraries(testing
add_executable(test-precice-aste tests/testing.cpp tests/read_test.cpp tests/write_test.cpp src/mesh.cpp src/logger.cpp)
target_include_directories(test-precice-aste PRIVATE src thirdparty)
target_link_libraries(test-precice-aste
${Boost_LIBRARIES}
MPI::MPI_CXX
${VTK_LIBRARIES}
Expand All @@ -77,7 +78,7 @@ if (VTK_VERSION VERSION_LESS "8.90.0")
else ()
# vtk_module_autoinit is needed
vtk_module_autoinit(
TARGETS precice-aste-run testing
TARGETS precice-aste-run test-precice-aste
MODULES ${VTK_LIBRARIES}
)
endif()
Expand All @@ -95,7 +96,7 @@ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-partition ${CMAKE_

enable_testing()

add_test(NAME read_write_test COMMAND testing WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests")
add_test(NAME read_write_test COMMAND test-precice-aste WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests")

# Detect and register examples as tests

Expand Down
9 changes: 5 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ pip3 install -r requirements.txt

### Building and installation

In order to build ASTE, clone the project repository and use the usual `CMake` steps to steer the installation procedure:
In order to build ASTE, download the [latest release](https://github.com/precice/aste/releases/latest) (or clone the `master` branch of the project repository) and use the usual `CMake` steps to steer the installation procedure:

```bash
git clone https://github.com/precice/aste.git
mkdir build && cd build
git clone --branch master https://github.com/precice/aste.git
cd aste && mkdir build && cd build
cmake .. && make
```

Expand Down Expand Up @@ -95,6 +95,7 @@ The following subsections explain each part of ASTE in more detail. All ASTE mod
| --------------- | ---------------------------------------------------------------------- |
| `--aste-config` | ASTE configuration file (only used for replay mode) |
| `-v` | Enables verbose logging output from preCICE |
| `-a` | Enables additional logging from all secondary ranks |
| `-c` | To specify preCICE configuration file (default=`"precice-config.xml"`) |
| `-p` | Participant name, which can take the arguments `A` or `B` |
| `--vector` | A bool switch to specify vector data (default=`False`) |
Expand All @@ -110,7 +111,7 @@ precice-aste-run -p A --mesh fine_mesh --data "dummyData"
precice-aste-run -p B --mesh coarse_mesh --data "mappedData" --output mappedMesh
```

While the example above exexutes the mapping in serial, `precice-aste-run` can be executed in parallel (using MPI). However, this requires a partitioned mesh (one per parallel rank). In order to decompose a single mesh appropriately, the tools `precice-aste-partition` and `precice-aste-join` can be used.
While the example above executes the mapping in serial, `precice-aste-run` can be executed in parallel (using MPI). However, this requires a partitioned mesh (one per parallel rank). In order to decompose a single mesh appropriately, the tools `precice-aste-partition` and `precice-aste-join` can be used.

{% tip %}
If you want to reproduce a specific setup of your solvers, you can use the [export functionality](https://precice.org/configuration-export.html#enabling-exporters) of preCICE and use the generated meshes directly in `precice-aste-run`. If you run your solver in parallel, preCICE exports the decomposed meshes directly, so that no further partitioning is required.
Expand Down
81 changes: 38 additions & 43 deletions examples/lci_2d/precice-config.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<precice-configuration>
<log>
<sink
filter="%Severity% > debug and %Rank% = 0"
format="---[precice] %ColorizedSeverity% %Message%"
enabled="true" />
</log>

<solver-interface dimensions="2">
<data:scalar name="Data" />

<mesh name="A-Mesh">
<use-data name="Data" />
</mesh>

<mesh name="B-Mesh">
<use-data name="Data" />
</mesh>

<m2n:sockets from="A" to="B" exchange-directory="." />

<participant name="A">
<use-mesh name="A-Mesh" provide="yes" />
<write-data name="Data" mesh="A-Mesh" />
</participant>

<participant name="B">
<use-mesh name="A-Mesh" provide="no" from="A" />
<use-mesh name="B-Mesh" provide="yes" />
<read-data name="Data" mesh="B-Mesh" />
<mapping:linear-cell-interpolation
constraint="consistent"
direction="read"
from="A-Mesh"
to="B-Mesh" />
</participant>

<coupling-scheme:parallel-explicit>
<participants first="A" second="B" />
<max-time value="1.0" />
<time-window-size value="1" />
<exchange data="Data" mesh="A-Mesh" from="A" to="B" />
</coupling-scheme:parallel-explicit>
</solver-interface>
<log enabled="0" />

<profiling mode="all" />

<data:scalar name="Data" />

<mesh name="A-Mesh" dimensions="2">
<use-data name="Data" />
</mesh>

<mesh name="B-Mesh" dimensions="2">
<use-data name="Data" />
</mesh>

<m2n:sockets acceptor="A" connector="B" exchange-directory="." />

<participant name="A">
<provide-mesh name="A-Mesh" />
<write-data name="Data" mesh="A-Mesh" />
</participant>

<participant name="B">
<receive-mesh name="A-Mesh" from="A" />
<provide-mesh name="B-Mesh" />
<read-data name="Data" mesh="B-Mesh" />
<mapping:linear-cell-interpolation
constraint="consistent"
direction="read"
from="A-Mesh"
to="B-Mesh" />
</participant>

<coupling-scheme:parallel-explicit>
<participants first="A" second="B" />
<max-time value="1.0" />
<time-window-size value="1" />
<exchange data="Data" mesh="A-Mesh" from="A" to="B" />
</coupling-scheme:parallel-explicit>
</precice-configuration>
Loading

0 comments on commit 765f405

Please sign in to comment.