diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644
index 0000000..aea7c4c
--- /dev/null
+++ b/.github/codecov.yml
@@ -0,0 +1,15 @@
+coverage:
+ precision: 2
+ range:
+ - 65.0
+ - 100.0
+ round: down
+ status:
+ project:
+ default:
+ target: 70%
+ threshold: 10%
+ patch:
+ default:
+ target: 50%
+ threshold: 10%
diff --git a/.github/workflows/acoustics.yml b/.github/workflows/acoustics.yml
index 29b8cea..4ed2cbb 100644
--- a/.github/workflows/acoustics.yml
+++ b/.github/workflows/acoustics.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'acoustics'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/aerodynamics.yml b/.github/workflows/aerodynamics.yml
index 6be9f3b..36e6936 100644
--- a/.github/workflows/aerodynamics.yml
+++ b/.github/workflows/aerodynamics.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'aerodynamics'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/bilaplacian.yml b/.github/workflows/bilaplacian.yml
index f432863..5228bde 100644
--- a/.github/workflows/bilaplacian.yml
+++ b/.github/workflows/bilaplacian.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'bilaplacian'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
new file mode 100644
index 0000000..d76a46f
--- /dev/null
+++ b/.github/workflows/codecov.yml
@@ -0,0 +1,87 @@
+name: 'Codecov Scan'
+
+on:
+ schedule:
+ - cron: '24 0 * * *'
+ pull_request:
+ branches: [ main ]
+ workflow_dispatch:
+
+env:
+ # CTest
+ CT_OPTS: "--timeout 300 --output-on-failure"
+
+ # MPI
+ OMPI_ALLOW_RUN_AS_ROOT: 1
+ OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
+ OMPI_MCA_rmaps_base_oversubscribe: 1
+
+jobs:
+ tests:
+ name: 'Build and Test'
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_release_latest
+
+ steps:
+ # On place la source à la racine pour éviter
+ # un sous-répertoire en plus dans Codecov.
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
+ - name: Checkout repo
+ uses: actions/checkout@v4
+ with:
+ path: ${{ env.SOURCE_DIR }}
+
+ - name: Configure
+ shell: bash
+ run: |
+ cmake \
+ -S ${{ env.SOURCE_DIR }} \
+ -B ${{ env.BUILD_DIR }} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_CXX_FLAGS_RELEASE="-O2 -g --coverage -fprofile-abs-path -ftest-coverage" \
+ -GNinja
+
+ - name: Build
+ shell: bash
+ run: |
+ cmake --build ${{ env.BUILD_DIR }}
+
+ - name: Test
+ shell: bash
+ run: |
+ mkdir -p ${{ env.CT_RESULT_DIR }}
+ ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }}
+
+ - name: Apply coverage
+ shell: bash
+ continue-on-error: true
+ run: |
+ gcov -p $(find . -name "*.gcno" -o -name "*.gcda")
+
+ - name: Remove gcov files for generated axl .h
+ shell: bash
+ run: |
+ rm -v -f *_axl.h.gcov
+
+ - name: Upload coverage files to Codecov
+ uses: codecov/codecov-action@v4
+ env:
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
+ with:
+ verbose: true
+ fail_ci_if_error: true
+
+ - name: Upload test artifact
+ uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: test-all-modules-artifact
+ path: ${{ env.CT_RESULT_DIR }}
+ retention-days: 7
diff --git a/.github/workflows/elasticity.yml b/.github/workflows/elasticity.yml
index 1a36356..8ee2959 100644
--- a/.github/workflows/elasticity.yml
+++ b/.github/workflows/elasticity.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'elasticity'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/elastodynamics.yml b/.github/workflows/elastodynamics.yml
index fb092c9..c420ca5 100644
--- a/.github/workflows/elastodynamics.yml
+++ b/.github/workflows/elastodynamics.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'elastodynamics'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/electrostatics.yml b/.github/workflows/electrostatics.yml
index d80d7de..b5c43eb 100644
--- a/.github/workflows/electrostatics.yml
+++ b/.github/workflows/electrostatics.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'electrostatics'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/fourier.yml b/.github/workflows/fourier.yml
index 773ae49..b67086a 100644
--- a/.github/workflows/fourier.yml
+++ b/.github/workflows/fourier.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'fourier'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/heat.yml b/.github/workflows/heat.yml
index caf91c2..d32eaad 100644
--- a/.github/workflows/heat.yml
+++ b/.github/workflows/heat.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'heat'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/laplace.yml b/.github/workflows/laplace.yml
index 7fdd764..cd1c8cc 100644
--- a/.github/workflows/laplace.yml
+++ b/.github/workflows/laplace.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'laplace'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -46,17 +49,20 @@ jobs:
-S ${{ env.SOURCE_DIR }} \
-B ${{ env.BUILD_DIR }} \
-GNinja
+
- name: Build
shell: bash
run: |
cmake --build ${{ env.BUILD_DIR }}
+
- name: Test
shell: bash
run: |
mkdir -p ${{ env.CT_RESULT_DIR }}
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
+
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/passmo.yml b/.github/workflows/passmo.yml
index 916fc11..24d0fef 100644
--- a/.github/workflows/passmo.yml
+++ b/.github/workflows/passmo.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'passmo'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/poisson.yml b/.github/workflows/poisson.yml
index 5ec7455..2123772 100644
--- a/.github/workflows/poisson.yml
+++ b/.github/workflows/poisson.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'poisson'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -59,7 +62,7 @@ jobs:
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/soildynamics.yml b/.github/workflows/soildynamics.yml
index f8b0fc6..b9b7d9a 100644
--- a/.github/workflows/soildynamics.yml
+++ b/.github/workflows/soildynamics.yml
@@ -12,13 +12,9 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
MODULE_DIR: 'soildynamics'
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -31,11 +27,18 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
@@ -46,17 +49,20 @@ jobs:
-S ${{ env.SOURCE_DIR }} \
-B ${{ env.BUILD_DIR }} \
-GNinja
+
- name: Build
shell: bash
run: |
cmake --build ${{ env.BUILD_DIR }}
+
- name: Test
shell: bash
run: |
mkdir -p ${{ env.CT_RESULT_DIR }}
ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -R '\[${{ env.MODULE_DIR }}\]'
+
- name: Upload test artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
if: failure()
with:
name: tests-${{ env.MODULE_DIR }}-artifact
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 1a432e9..611d6b7 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -8,12 +8,7 @@ on:
workflow_dispatch:
env:
-
- SOURCE_DIR: '/__w/arcanefem/arcanefem/src'
- BUILD_DIR: '/__w/arcanefem/arcanefem/build'
-
# CTest
- CT_RESULT_DIR: '/__w/arcanefem/arcanefem/test'
CT_OPTS: "--timeout 300 --output-on-failure"
# MPI
@@ -26,9 +21,16 @@ jobs:
name: 'Build and Test'
runs-on: ubuntu-latest
container:
- image: ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_full_check_latest
+ image: ghcr.io/arcaneframework/arcane_ubuntu-2404:gcc-14_full_check_latest
steps:
+ - name: Define environment paths
+ shell: bash
+ run: |
+ echo "SOURCE_DIR=${GITHUB_WORKSPACE}/src" >> $GITHUB_ENV
+ echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
+ echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
+
- name: Checkout repo
uses: actions/checkout@v4
with:
@@ -59,4 +61,4 @@ jobs:
with:
name: test-all-modules-artifact
path: ${{ env.CT_RESULT_DIR }}
- retention-days: 7
\ No newline at end of file
+ retention-days: 7
diff --git a/femutils/CooFormatMatrix.h b/femutils/CooFormatMatrix.h
index 1a837d9..749422d 100644
--- a/femutils/CooFormatMatrix.h
+++ b/femutils/CooFormatMatrix.h
@@ -40,7 +40,7 @@ class CooFormat : TraceAccessor
CooFormat(ISubDomain* sd)
: TraceAccessor(sd->traceMng())
{
- info() << "Creating CSR Matrix";
+ info() << "Creating COO Matrix";
}
void initialize(IItemFamily* dof_family, Int32 nnz)
diff --git a/poisson/CMakeLists.txt b/poisson/CMakeLists.txt
index 4848b77..be81fbb 100644
--- a/poisson/CMakeLists.txt
+++ b/poisson/CMakeLists.txt
@@ -27,8 +27,12 @@ target_include_directories(Poisson PUBLIC . ${CMAKE_CURRENT_BINARY_DIR})
configure_file(Poisson.config ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.L-shape.2D.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.L-shape.2D.nwcsr.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
-configure_file(Test.L-shape.3D.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.L-shape.3D.nwcsr.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+configure_file(Test.L-shape.2D.coo.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+configure_file(Test.L-shape.2D.coo-sort.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+configure_file(Test.L-shape.3D.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+configure_file(Test.L-shape.3D.coo.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+configure_file(Test.L-shape.3D.coo-sort.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.sphere.3D.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.sphere.3D.csr.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.sphere.3D.csr.no-edge.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
@@ -89,9 +93,13 @@ endif()
if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [poisson]L-shape_2D COMMAND Poisson Test.L-shape.2D.arc)
+ add_test(NAME [poisson]L-shape_2D_petsc_coo COMMAND Poisson Test.L-shape.2D.coo.arc)
+ add_test(NAME [poisson]L-shape_2D_petsc_coo-sort COMMAND Poisson Test.L-shape.2D.coo-sort.arc)
add_test(NAME [poisson]petsc COMMAND Poisson Test.petsc.arc)
add_test(NAME [poisson]neumann COMMAND Poisson Test.neumann.arc)
add_test(NAME [poisson]porous COMMAND Poisson Test.porous.arc)
+ add_test(NAME [poisson]3D_Dirichlet_petsc_coo COMMAND Poisson Test.L-shape.3D.coo.arc)
+ add_test(NAME [poisson]3D_Dirichlet_petsc_coo-sort COMMAND Poisson Test.L-shape.3D.coo-sort.arc)
endif()
diff --git a/poisson/CooBiliAssembly.cc b/poisson/CooBiliAssembly.cc
index 00b0c22..d31b8ea 100644
--- a/poisson/CooBiliAssembly.cc
+++ b/poisson/CooBiliAssembly.cc
@@ -13,61 +13,69 @@
#include "FemModule.h"
+/*---------------------------------------------------------------------------*/
/**
- * @brief Initialization of the coo matrix. It only works for p=1 since there is
- * one node per Edge.
+ * @brief Builds the coordinate (COO) matrix for the finite element method (FEM) module.
*
+ * This function initializes and populates the COO matrix based on the mesh's nodes and their connectivity.
+ * It assumes a polynomial degree (p) of 1. The matrix is constructed by iterating over all nodes in the mesh
+ * and setting the coordinates for the degrees of freedom (DOFs) associated with each node and its connected
+ * edges or faces, depending on the mesh dimension.
*
+ * @note This implementation is specific to 2D and 3D meshes.
*/
-void FemModule::
-_buildMatrix()
-{
- //Initialization of the coo matrix;
- //This formula only works in p=1
-
- /*
- //Create a connection between nodes through the faces
- //Useless here because we only need this information once
- IItemFamily* node_family = mesh()->nodeFamily();
- NodeGroup nodes = node_family->allItems();
- auto idx_cn = mesh()->indexedConnectivityMng()->findOrCreateConnectivity(node_family, node_family, "NodeToNeighbourFaceNodes");
- auto* cn = idx_cn->connectivity();
- ENUMERATE_NODE (node, allNodes()) {
- }
- */
+/*---------------------------------------------------------------------------*/
- Int32 nnz = nbFace() * 2 + nbNode();
+void FemModule::_buildMatrixCoo()
+{
+ Int8 mesh_dim = mesh()->dimension();
+ Int64 nbEdge = mesh_dim == 3 ? m_nb_edge : nbFace();
+ Int32 nnz = nbEdge * 2 + nbNode();
m_coo_matrix.initialize(m_dof_family, nnz);
auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
- //We iterate through the node, and we do not sort anymore : we assume the nodes ID are sorted, and we will iterate throught the column to avoid making < and > comparison
ENUMERATE_NODE (inode, allNodes()) {
Node node = *inode;
m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(node, 0));
- for (Face face : node.faces()) {
- if (face.nodeId(0) == node.localId())
- m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(face.nodeId(1), 0));
- else
- m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(face.nodeId(0), 0));
+ if (mesh_dim == 2) {
+ for (Face face : node.faces()) {
+ Node other_node = (face.nodeId(0) == node.localId()) ? face.node(1) : face.node(0);
+ m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(other_node, 0));
+ }
+ }
+ else {
+ for (Edge edge : node.edges()) {
+ Node other_node = (edge.nodeId(0) == node.localId()) ? edge.node(1) : edge.node(0);
+ m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(other_node, 0));
+ }
}
}
}
/*---------------------------------------------------------------------------*/
+/**
+ * @brief Assembles the bilinear operator matrix for the FEM linear system with
+ * the COO sparse matrix format for TRIA3 elements.
+ *
+ * The method performs the following steps:
+ * 1. Builds the COO matrix using _buildMatrixCoo.
+ * 2. For each cell, computes element matrix using _computeElementMatrixTRIA3.
+ * 3. Assembles global matrix by adding contributions from each cell's element
+ * matrix to the corresponding entries in the global matrix.
+ */
/*---------------------------------------------------------------------------*/
-void FemModule::
-_assembleCooBilinearOperatorTRIA3()
+void FemModule::_assembleCooBilinearOperatorTRIA3()
{
+ info() << "Assembling COO Bilinear Operator TRIA3";
Timer::Action timer_coo_bili(m_time_stats, "AssembleCooBilinearOperatorTria3");
{
- Timer::Action timer_coo_build(m_time_stats, "CooBuildMatrix");
- // Build the coo matrix
- _buildMatrix();
+ Timer::Action timer_coo_build(m_time_stats, "BuildMatrixCoo");
+ _buildMatrixCoo();
}
auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
@@ -77,30 +85,20 @@ _assembleCooBilinearOperatorTRIA3()
FixedMatrix<3, 3> K_e;
{
- //Timer::Action timer_coo_compute(m_time_stats, "CooComputeElementMatrix");
- K_e = _computeElementMatrixTRIA3(cell); // element stifness matrix
+ Timer::Action timer_coo_compute(m_time_stats, "CooComputeElementMatrixTria3");
+ K_e = _computeElementMatrixTRIA3(cell);
}
- // # assemble elementary matrix into the global one
- // # elementary terms are positionned into K according
- // # to the rank of associated node in the mesh.nodes list
- // for node1 in elem.nodes:
- // inode1=elem.nodes.index(node1) # get position of node1 in nodes list
- // for node2 in elem.nodes:
- // inode2=elem.nodes.index(node2)
- // K[node1.rank,node2.rank]=K[node1.rank,node2.rank]+K_e[inode1,inode2]
-
- //Timer::Action timer_coo_add(m_time_stats, "CooAddToGlobalMatrix");
+ Timer::Action timer_coo_add(m_time_stats, "CooAddToGlobalMatrix");
Int32 n1_index = 0;
for (Node node1 : cell.nodes()) {
Int32 n2_index = 0;
for (Node node2 : cell.nodes()) {
- // K[node1.rank,node2.rank]=K[node1.rank,node2.rank]+K_e[inode1,inode2]
Real v = K_e(n1_index, n2_index);
- // m_k_matrix(node1.localId(), node2.localId()) += v;
- if (node1.isOwn()) {
+
+ if (node1.isOwn())
m_coo_matrix.matrixAddValue(node_dof.dofId(node1, 0), node_dof.dofId(node2, 0), v);
- }
+
++n2_index;
}
++n1_index;
@@ -109,4 +107,56 @@ _assembleCooBilinearOperatorTRIA3()
}
/*---------------------------------------------------------------------------*/
+/**
+ * @brief Assembles the bilinear operator matrix for the FEM linear system with
+ * the COO sparse matrix format.
+ *
+ * The method performs the following steps:
+ * 1. Builds the COO matrix using _buildMatrixCoo.
+ * 2. For each cell, computes element matrix using _computeElementMatrixTETRA4.
+ * 3. Assembles global matrix by adding contributions from each cell's element
+ * matrix to the corresponding entries in the global matrix.
+ */
+/*---------------------------------------------------------------------------*/
+
+void FemModule::_assembleCooBilinearOperatorTETRA4()
+{
+ info() << "Assembling COO Bilinear Operator TETRA4";
+
+ Timer::Action timer_coo_bili(m_time_stats, "AssembleCooBilinearOperatorTetra4");
+
+ {
+ Timer::Action timer_coo_build(m_time_stats, "BuildMatrixCoo");
+ _buildMatrixCoo();
+ }
+
+ auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
+
+ ENUMERATE_ (Cell, icell, allCells()) {
+ Cell cell = *icell;
+
+ FixedMatrix<4, 4> K_e;
+ {
+ Timer::Action timer_coo_compute(m_time_stats, "CooComputeElementMatrixTetra4");
+ K_e = _computeElementMatrixTETRA4(cell);
+ }
+
+ Timer::Action timer_coo_add(m_time_stats, "CooAddToGlobalMatrix");
+ Int32 n1_index = 0;
+ for (Node node1 : cell.nodes()) {
+ Int32 n2_index = 0;
+ for (Node node2 : cell.nodes()) {
+ Real v = K_e(n1_index, n2_index);
+
+ if (node1.isOwn())
+ m_coo_matrix.matrixAddValue(node_dof.dofId(node1, 0), node_dof.dofId(node2, 0), v);
+
+ ++n2_index;
+ }
+ ++n1_index;
+ }
+ }
+}
+
/*---------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
\ No newline at end of file
diff --git a/poisson/CooSortBiliAssembly.cc b/poisson/CooSortBiliAssembly.cc
index 64f61fe..a286072 100644
--- a/poisson/CooSortBiliAssembly.cc
+++ b/poisson/CooSortBiliAssembly.cc
@@ -14,71 +14,86 @@
#include "FemModule.h"
+/*---------------------------------------------------------------------------*/
/**
- * @brief Initialization of the coo matrix. It only works for p=1 since there is
- * one node per Edge.
+ * @brief Builds the COO Sort matrix by first filling the diagonal and then the off-diagonal entries.
*
+ * This method initializes the diagonal elements of the matrix and then proceeds to fill the remaining
+ * entries based on the connectivity of the mesh entities (nodes, edges, faces). After filling the matrix,
+ * a sorting step is performed to optimize further operations.
+ *
+ * @note This implementation is specific to 2D and 3D meshes.
*
*/
+/*---------------------------------------------------------------------------*/
+
void FemModule::
-_buildMatrixSort()
+_buildMatrixCooSort()
{
- //Initialization of the coo matrix;
- //This formula only works in p=1
-
- /*
- //Create a connection between nodes through the faces
- //Useless here because we only need this information once
- IItemFamily* node_family = mesh()->nodeFamily();
- NodeGroup nodes = node_family->allItems();
- auto idx_cn = mesh()->indexedConnectivityMng()->findOrCreateConnectivity(node_family, node_family, "NodeToNeighbourFaceNodes");
- auto* cn = idx_cn->connectivity();
- ENUMERATE_NODE (node, allNodes()) {
- }
- */
- Int32 nnz = nbFace() * 2 + nbNode();
+ Int8 mesh_dim = mesh()->dimension();
+ Int64 nbEdge = mesh_dim == 3 ? m_nb_edge : nbFace();
+ Int32 nnz = nbEdge * 2 + nbNode();
m_coo_matrix.initialize(m_dof_family, nnz);
auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
- //In this commented code, we begin by filling the diagonal before filling what's left by iterating through the nodes. It corresponds to the COO-sort method in the diagrams
-
- //In this one, we begin by filling the diagonal before filling what's left by iterating through the nodes
-
- //Fill the diagonal
+ // Fill the diagonal
ENUMERATE_NODE (inode, allNodes()) {
Node node = *inode;
m_coo_matrix.setCoordinates(node_dof.dofId(node, 0), node_dof.dofId(node, 0));
}
- //Fill what is left
- ENUMERATE_FACE (iface, allFaces()) {
- Face face = *iface;
- auto nodes = face.nodes();
+ // Fill what is left
+ auto fillMatrix = [&](auto entity) {
+ auto nodes = entity.nodes();
for (Int32 i = 0; i < nodes.size() - i - 1; i++) {
m_coo_matrix.setCoordinates(node_dof.dofId(nodes[i], 0), node_dof.dofId(nodes[nodes.size() - i - 1], 0));
m_coo_matrix.setCoordinates(node_dof.dofId(nodes[nodes.size() - i - 1], 0), node_dof.dofId(nodes[i], 0));
}
+ };
+
+ if (mesh_dim == 2) {
+ ENUMERATE_FACE (iface, allFaces()) {
+ fillMatrix(*iface);
+ }
+ } else {
+ ENUMERATE_EDGE (iedge, allEdges()) {
+ fillMatrix(*iedge);
+ }
}
- //Sort the matrix
+ // Sort the matrix
Timer::Action timer_action(m_time_stats, "SortingCooMatrix");
m_coo_matrix.sort();
}
/*---------------------------------------------------------------------------*/
+/**
+ * @brief Assembles the bilinear operator matrix for the FEM linear system with
+ * the COO Sorted sparse matrix format for TRIA3 elements.
+ *
+ * The method performs the following steps:
+ * 1. Builds the COO Sorted matrix using _buildMatrixCooSort.
+ * 2. For each cell, computes element matrix using _computeElementMatrixTRIA3.
+ * 3. Assembles global matrix by adding contributions from each cell's element
+ * matrix to the corresponding entries in the global matrix.
+ *
+ * @note This implementation is the same as the one in CooBiliAssembly.cc, but
+ * uses the sorted COO matrix.
+ *
+ */
/*---------------------------------------------------------------------------*/
void FemModule::
_assembleCooSortBilinearOperatorTRIA3()
{
+ info() << "Assembling COO Sort Bilinear Operator TRIA3";
Timer::Action timer_coosort_bili(m_time_stats, "AssembleCooSortBilinearOperatorTria3");
{
Timer::Action timer_build_coosort(m_time_stats, "BuildMatrixCooSort");
- // Build the coo matrix
- _buildMatrixSort();
+ _buildMatrixCooSort();
}
auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
@@ -88,30 +103,20 @@ _assembleCooSortBilinearOperatorTRIA3()
FixedMatrix<3, 3> K_e;
{
- //Timer::Action timer_element_coosort(m_time_stats,"CooSortComputeElementMatrixTria3");
-
- K_e = _computeElementMatrixTRIA3(cell); // element stifness matrix
+ Timer::Action timer_element_coosort(m_time_stats,"CooSortComputeElementMatrixTria3");
+ K_e = _computeElementMatrixTRIA3(cell);
}
- // # assemble elementary matrix into the global one
- // # elementary terms are positionned into K according
- // # to the rank of associated node in the mesh.nodes list
- // for node1 in elem.nodes:
- // inode1=elem.nodes.index(node1) # get position of node1 in nodes list
- // for node2 in elem.nodes:
- // inode2=elem.nodes.index(node2)
- // K[node1.rank,node2.rank]=K[node1.rank,node2.rank]+K_e[inode1,inode2]
-
- //Timer::Action timer_coosort_add_compute(m_time_stats, "CooSortAddToGlobalMatrix");
+
+ Timer::Action timer_coosort_add_compute(m_time_stats, "CooSortAddToGlobalMatrix");
Int32 n1_index = 0;
for (Node node1 : cell.nodes()) {
Int32 n2_index = 0;
for (Node node2 : cell.nodes()) {
- // K[node1.rank,node2.rank]=K[node1.rank,node2.rank]+K_e[inode1,inode2]
Real v = K_e(n1_index, n2_index);
- // m_k_matrix(node1.localId(), node2.localId()) += v;
- if (node1.isOwn()) {
+
+ if (node1.isOwn())
m_coo_matrix.matrixAddValue(node_dof.dofId(node1, 0), node_dof.dofId(node2, 0), v);
- }
+
++n2_index;
}
++n1_index;
@@ -120,4 +125,59 @@ _assembleCooSortBilinearOperatorTRIA3()
}
/*---------------------------------------------------------------------------*/
+/**
+ * @brief Assembles the bilinear operator matrix for the FEM linear system with
+ * the COO Sorted sparse matrix format for TETRA4 elements.
+ *
+ * The method performs the following steps:
+ * 1. Builds the COO Sorted matrix using _buildMatrixCooSort.
+ * 2. For each cell, computes element matrix using _computeElementMatrixTETRA4.
+ * 3. Assembles global matrix by adding contributions from each cell's element
+ * matrix to the corresponding entries in the global matrix.
+ *
+ * @note This implementation is the same as the one in CooBiliAssembly.cc, but
+ * uses the sorted COO matrix.
+ *
+ */
+/*---------------------------------------------------------------------------*/
+
+void FemModule::_assembleCooSortBilinearOperatorTETRA4() {
+ info() << "Assembling COO Sort Bilinear Operator TETRA4";
+
+ Timer::Action timer_coosort_bili(m_time_stats, "AssembleCooSortBilinearOperatorTetra4");
+
+ {
+ Timer::Action timer_build_coosort(m_time_stats, "BuildMatrixCooSort");
+ _buildMatrixCooSort();
+ }
+
+ auto node_dof(m_dofs_on_nodes.nodeDoFConnectivityView());
+
+ ENUMERATE_ (Cell, icell, allCells()) {
+ Cell cell = *icell;
+
+ FixedMatrix<4, 4> K_e;
+ {
+ Timer::Action timer_element_coosort(m_time_stats,"CooSortComputeElementMatrixTetra4");
+ K_e = _computeElementMatrixTETRA4(cell);
+ }
+
+ Timer::Action timer_coosort_add_compute(m_time_stats, "CooSortAddToGlobalMatrix");
+ Int32 n1_index = 0;
+ for (Node node1 : cell.nodes()) {
+ Int32 n2_index = 0;
+ for (Node node2 : cell.nodes()) {
+ Real v = K_e(n1_index, n2_index);
+
+ if (node1.isOwn())
+ m_coo_matrix.matrixAddValue(node_dof.dofId(node1, 0), node_dof.dofId(node2, 0), v);
+
+ ++n2_index;
+ }
+ ++n1_index;
+ }
+ }
+}
+
/*---------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
\ No newline at end of file
diff --git a/poisson/FemModule.cc b/poisson/FemModule.cc
index b28c21d..42ac09e 100644
--- a/poisson/FemModule.cc
+++ b/poisson/FemModule.cc
@@ -423,28 +423,44 @@ _doStationarySolve()
if (m_use_coo) {
m_linear_system.clearValues();
- _assembleCooBilinearOperatorTRIA3();
+ if (options()->meshType == "TRIA3")
+ _assembleCooBilinearOperatorTRIA3();
+ if (options()->meshType == "TETRA4")
+ _assembleCooBilinearOperatorTETRA4();
if (m_cache_warming != 1) {
m_time_stats->resetStats("AssembleCooBilinearOperatorTria3");
+ m_time_stats->resetStats("AssembleCooBilinearOperatorTetra4");
for (cache_index = 1; cache_index < m_cache_warming; cache_index++) {
m_linear_system.clearValues();
- _assembleCooBilinearOperatorTRIA3();
+ if (options()->meshType == "TRIA3")
+ _assembleCooBilinearOperatorTRIA3();
+ if (options()->meshType == "TETRA4")
+ _assembleCooBilinearOperatorTETRA4();
}
}
m_coo_matrix.translateToLinearSystem(m_linear_system);
}
+
if (m_use_coo_sort) {
m_linear_system.clearValues();
- _assembleCooSortBilinearOperatorTRIA3();
+ if (options()->meshType == "TRIA3")
+ _assembleCooSortBilinearOperatorTRIA3();
+ if (options()->meshType == "TETRA4")
+ _assembleCooSortBilinearOperatorTETRA4();
if (m_cache_warming != 1) {
m_time_stats->resetStats("AssembleCooSortBilinearOperatorTria3");
+ m_time_stats->resetStats("AssembleCooSortBilinearOperatorTetra4");
for (cache_index = 1; cache_index < m_cache_warming; cache_index++) {
m_linear_system.clearValues();
- _assembleCooSortBilinearOperatorTRIA3();
+ if (options()->meshType == "TRIA3")
+ _assembleCooSortBilinearOperatorTRIA3();
+ if (options()->meshType == "TETRA4")
+ _assembleCooSortBilinearOperatorTETRA4();
}
}
m_coo_matrix.translateToLinearSystem(m_linear_system);
}
+
#ifdef USE_COO_GPU
for (i = 0; i < 3; i++) {
m_linear_system.clearValues();
diff --git a/poisson/FemModule.h b/poisson/FemModule.h
index 99ecc3f..4ecb4bc 100644
--- a/poisson/FemModule.h
+++ b/poisson/FemModule.h
@@ -243,11 +243,13 @@ class FemModule
private:
- void _buildMatrix();
+ void _buildMatrixCoo();
void _assembleCooBilinearOperatorTRIA3();
+ void _assembleCooBilinearOperatorTETRA4();
- void _buildMatrixSort();
+ void _buildMatrixCooSort();
void _assembleCooSortBilinearOperatorTRIA3();
+ void _assembleCooSortBilinearOperatorTETRA4();
public:
diff --git a/poisson/Test.L-shape.2D.coo-sort.arc b/poisson/Test.L-shape.2D.coo-sort.arc
new file mode 100644
index 0000000..5090497
--- /dev/null
+++ b/poisson/Test.L-shape.2D.coo-sort.arc
@@ -0,0 +1,31 @@
+
+
+
+ L-Shape 2D with COO-Sort sparse matrix format. The result of this test is compared with test_poisson_results.txt.
+ PoissonLoop
+
+
+
+ 1
+
+
+
+
+
+
+ L-shape.msh
+
+
+
+
+ true
+ test_poisson_results.txt
+ -1.0
+
+ boundary
+ 0.0
+
+
+
diff --git a/poisson/Test.L-shape.2D.coo.arc b/poisson/Test.L-shape.2D.coo.arc
new file mode 100644
index 0000000..9b94699
--- /dev/null
+++ b/poisson/Test.L-shape.2D.coo.arc
@@ -0,0 +1,31 @@
+
+
+
+ L-Shape 2D with COO sparse matrix format. The result of this test is compared with test_poisson_results.txt.
+ PoissonLoop
+
+
+
+ 1
+
+
+
+
+
+
+ L-shape.msh
+
+
+
+
+ true
+ test_poisson_results.txt
+ -1.0
+
+ boundary
+ 0.0
+
+
+
diff --git a/poisson/Test.L-shape.3D.coo-sort.arc b/poisson/Test.L-shape.3D.coo-sort.arc
new file mode 100644
index 0000000..d49c224
--- /dev/null
+++ b/poisson/Test.L-shape.3D.coo-sort.arc
@@ -0,0 +1,39 @@
+
+
+
+ L-Shape 3D with COO-Sort sparse matrix format. The result of this test is compared with test_3D_L-shape_poisson.txt.
+ PoissonLoop
+
+
+
+ 1
+
+
+
+
+
+
+ L-shape-3D.msh
+
+
+
+
+ true
+ 1.0
+ test_3D_L-shape_poisson.txt
+ TETRA4
+
+ bot
+ 50.0
+
+
+ bc
+ 10.0
+
+
+ petsc
+
+
+
diff --git a/poisson/Test.L-shape.3D.coo.arc b/poisson/Test.L-shape.3D.coo.arc
new file mode 100644
index 0000000..1c82c5a
--- /dev/null
+++ b/poisson/Test.L-shape.3D.coo.arc
@@ -0,0 +1,39 @@
+
+
+
+ L-Shape 3D with COO sparse matrix format. The result of this test is compared with test_3D_L-shape_poisson.txt.
+ PoissonLoop
+
+
+
+ 1
+
+
+
+
+
+
+ L-shape-3D.msh
+
+
+
+
+ true
+ 1.0
+ test_3D_L-shape_poisson.txt
+ TETRA4
+
+ bot
+ 50.0
+
+
+ bc
+ 10.0
+
+
+ petsc
+
+
+