Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
2c04012
change long to int64_t
stoiver Feb 25, 2025
37cbde8
Merge branch 'main' of github.com:anuga-community/anuga_core
stoiver Mar 1, 2025
68d4923
Create python-publish.yml
stoiver Mar 11, 2025
dd931dc
Create python-package-conda.yml
stoiver Mar 11, 2025
3b5024c
For the time being remove github action in main branch
stoiver Mar 12, 2025
67b8850
Create python-package.yml
stoiver Mar 18, 2025
7f6e925
Added reference to validation tests in installation instructions
uniomni May 10, 2025
0e59383
Forgot to add blank line before code block
uniomni May 10, 2025
cfa119c
disable openmp on apple
stoiver May 12, 2025
54cab3f
Merge branch 'main' of github.com:anuga-community/anuga_core
stoiver May 12, 2025
d8dae28
link to validation tests in docs
stoiver May 12, 2025
c858cf2
turn off openmp on win32
stoiver May 12, 2025
e991e41
set multiprocessor_mode to openmp
stoiver May 12, 2025
2afe67f
merge develop branch
stoiver May 12, 2025
a61d753
update to using meson builds
stoiver May 12, 2025
24df3a2
openacc not implemented on windows
stoiver May 12, 2025
5afe270
return to compiling openacc code
stoiver May 12, 2025
28db140
remove pkg-config from docs requirements.txt
stoiver May 12, 2025
249e47e
changed license in pyproject.toml
stoiver May 12, 2025
325ad7d
another change to license in pyproject.toml
stoiver May 12, 2025
d253f1a
another change to license in pyproject.toml
stoiver May 12, 2025
55c5da7
try to produce pdf documentation
stoiver May 13, 2025
d2afb1e
2nd try to produce pdf documentation
stoiver May 13, 2025
ce390d2
3rd try to produce pdf documentation
stoiver May 13, 2025
eeea03e
4th try to produce pdf documentation
stoiver May 13, 2025
0a7944e
doi link to anuga user manual
stoiver May 18, 2025
c11406f
typo in doi link
stoiver May 18, 2025
446bd34
typo in doi
stoiver May 18, 2025
b5661b7
skip unittest using gdal if not installed
stoiver May 18, 2025
0b97404
import pytest to allow skip of gdal
stoiver May 18, 2025
2a89490
import sys to test_quantity
stoiver May 18, 2025
001e885
remove pkg-conf from requirements
stoiver May 19, 2025
b377944
adding requirements for nci
stoiver May 19, 2025
2c7caf7
typo in developers installation doc
stoiver May 19, 2025
3172420
Merge branch 'main' of github.com:anuga-community/anuga_core
stoiver May 19, 2025
f386b18
update some tests to non deprecated function of unitttest
May 21, 2025
cb1f4ec
Finish replacing deprecated operator for unit testing
May 22, 2025
4a15ec3
remove the commented out line for the unittest deprecated routine
May 22, 2025
d8c4506
Merge branch 'main' into devlop_gpu_sandbox
stoiver May 22, 2025
4b7c443
Only run github action on PRs
stoiver May 22, 2025
e091db7
run python-package.yml on release
stoiver May 22, 2025
53e8771
Merge branch 'main' into develop_gpu
stoiver May 22, 2025
b9bca2a
Merge pull request #59 from JorgeG94/fix/testloader
stoiver May 22, 2025
05cf8e2
change kernal to kernel
stoiver May 25, 2025
5f9c5b4
picked up memory problem with pyx files and riverwalls
stoiver May 29, 2025
207360a
small typo
stoiver May 29, 2025
6034522
setup towradgi to short run
stoiver May 29, 2025
7a66161
typo fix kernal to kernel
stoiver May 29, 2025
1322228
comments addded to run_towradgi.py
stoiver May 30, 2025
0d87f83
fix memory problem in pyx files
stoiver May 30, 2025
f6d6107
fix memory problem in pyx files
stoiver May 30, 2025
0d515b0
updates
JorgeG94 May 30, 2025
3149cb2
added comment to run_towradgi.py
stoiver May 30, 2025
ae589e9
skip unittests if gdal not available
stoiver May 30, 2025
2128d8c
skip unittests if gdal not available
stoiver May 30, 2025
be9d05b
cleanup of omp and some ideas
JorgeG94 Jun 3, 2025
ede3b9f
fixed adjust_edgeflux_with_weir edgeflux argument
stoiver Jun 3, 2025
ee9e055
setting up openmp update_conserved_quantities
stoiver Jun 3, 2025
28fc47c
update variable scoping
JorgeG94 Jun 4, 2025
b98d830
some refactoring for better readability and then performance
JorgeG94 Jun 4, 2025
364ffaf
refactor of function done, now let's start making things const
JorgeG94 Jun 4, 2025
b2adaf4
updates to openmp code
JorgeG94 Jun 4, 2025
23a0a73
remove some warnings from the intel compiler
Jun 5, 2025
98d1d99
some tests
Jun 5, 2025
670221b
rstrict
Jun 5, 2025
52d07e4
more updates, I think things are looking nice
Jun 5, 2025
c83f619
added some benchmarking scripts for towradgi
stoiver Jun 5, 2025
fb236c3
refactor more things, I want to profile
Jun 6, 2025
18e5113
Merge remote-tracking branch 'origin/jorge/omp_playground' into devel…
stoiver Jun 6, 2025
23c581a
determine conda environment
stoiver Jun 6, 2025
2280488
added cli to create_benchmark_csvfile.py
stoiver Jun 9, 2025
e433cf7
Merge branch 'develop_gpu' into develop_gpu_steve
stoiver Jun 9, 2025
150842a
update manning friction code
stoiver Jun 9, 2025
0577e56
remove static from omp pragma
stoiver Jun 9, 2025
40849d4
change pragma
stoiver Jun 9, 2025
9a50b02
some updates
Jun 10, 2025
32d938c
static not dynamic
Jun 10, 2025
e62cfa1
added openmp versions of saxpy and backup_conserved_values
stoiver Jun 10, 2025
891ba61
ignore pstat files
stoiver Jun 10, 2025
1a08c11
updates to build system to quite warnings
Jun 11, 2025
d7589af
Merge remote-tracking branch 'origin' into jorge/merge/omp
Jun 11, 2025
edcbadf
test tmp files in backup_centroid_values
stoiver Jun 11, 2025
72183d2
fix polygon
Jun 12, 2025
f53660e
remove all warnings from normal compilation
Jun 12, 2025
c3f0353
Merge pull request #81 from anuga-community/jorge/merge/omp
stoiver Jun 12, 2025
274bd15
merge with Jorge branch
stoiver Jun 12, 2025
02722ce
Merge branch 'main' into develop_gpu_steve
stoiver Jun 12, 2025
473033b
one model to rule them all, one model to bind them all darkness
Jun 12, 2025
ba43062
update error in sw_domain_openmp.c
stoiver Jun 12, 2025
9a0222e
Update conda-setup.yml
stoiver Jun 12, 2025
2b7237e
merge pr-82 with main
stoiver Jun 12, 2025
8fc1b5d
remove eferences to orig
stoiver Jun 12, 2025
6255d05
Resolve merge conflicts for PR #82
stoiver Jun 12, 2025
a3e6caa
comment on multiprocessor_mode
stoiver Jun 15, 2025
7df1715
clean up variable declaration in cg.c
stoiver Jun 15, 2025
fae5113
fix segmentation fault caused by tmp arrays in update_centroid_values
stoiver Jun 15, 2025
e444bcb
comment on the multiprocessor_mode
stoiver Jun 15, 2025
72f7a1b
Merge branch 'pr-82' of github.com:stoiver/anuga_core into pr-82
stoiver Jun 15, 2025
e81ff44
remove compiler warnings
stoiver Jun 15, 2025
c3abcdf
Merge branch 'pr-82' into main_steve
stoiver Jun 15, 2025
4691b12
Merge branch 'main' of github.com:stoiver/anuga_core into main_steve
stoiver Jun 15, 2025
4896d9c
ensure number of OMP threads = 1
stoiver Jun 15, 2025
a69ac7b
try microsoft compiler
stoiver Jun 15, 2025
ce8f62f
fix my dumb tmp array things and a missing variable in omp shared
Jun 15, 2025
243c2fd
int64_t for everything to be inline with the previous implementation
Jun 16, 2025
af907aa
add daxpy and dscal functions
Jun 16, 2025
43dfa3c
typedef anuga_int and anuga_uint for one general interface
Jun 16, 2025
134ed42
constants
Jun 16, 2025
b0d97e6
missed one
Jun 16, 2025
405fb4e
Merge pull request #66 from anuga-community/jorge/experiment/anuga_int
JorgeG94 Jun 16, 2025
f5e96fd
GitHub Actions: Upgrade to actions/setup-python@v5
cclauss Jun 16, 2025
acf3a9f
install_anuga.rst: Fix typo discovered by codespell
cclauss Jun 16, 2025
d903962
change constants to typedefs, add anuga_constants and anuga_runtime f…
Jun 16, 2025
df21ab5
use constants
Jun 16, 2025
5641c4c
delete pi from here
Jun 16, 2025
273ae28
move constant
Jun 16, 2025
620bc9e
Merge branch 'jorge/experiment/anuga_int' into jorge/fix/tmp_arrays
Jun 16, 2025
dc87b10
bring back culvert flows
Jun 16, 2025
a086c45
try another gcc?
Jun 17, 2025
ea044dd
openmp?
Jun 17, 2025
bcca437
also install gxx
Jun 17, 2025
7c3e7c2
verbose compilation to make sure of things
Jun 17, 2025
f5b026e
do I fall back on msvc?
Jun 17, 2025
7f0b084
let's fail quickly
Jun 17, 2025
6034ecf
confusion
Jun 17, 2025
acea66e
anmother test
Jun 17, 2025
a1e2260
revert
Jun 17, 2025
82a5d37
actually install things
Jun 17, 2025
81e2209
CI works
Jun 17, 2025
44d9d07
pray
Jun 17, 2025
a58aeb7
Update appveyor.yml
stoiver Jun 17, 2025
8998482
Update appveyor.yml
stoiver Jun 17, 2025
4f21d9b
Update conda-setup.yml
stoiver Jun 17, 2025
696e731
Update appveyor.yml
stoiver Jun 17, 2025
5b840db
Update appveyor.yml
stoiver Jun 17, 2025
8ad28d9
Merge pull request #83 from anuga-community/jorge/fix/tmp_arrays
stoiver Jun 17, 2025
98ca08c
Merge pull request #69 from cclauss/patch-2
JorgeG94 Jun 17, 2025
402b30f
Merge pull request #68 from cclauss/patch-1
JorgeG94 Jun 17, 2025
89e7f02
resolve appveyor.yml
stoiver Jun 17, 2025
aadd95e
resolve appveyor.yml
stoiver Jun 17, 2025
8450fc2
trying to remove long long int warnings on windows
stoiver Jun 17, 2025
7172b5d
added <inttypes.h> PRId64 to deal with printf ints
stoiver Jun 17, 2025
a53ad1f
fix problem with <inttypes.h>
stoiver Jun 17, 2025
d658933
Keep GitHub Actions up to date with GitHub's Dependabot
cclauss Jun 17, 2025
9553e61
Stop using removed alias numpy.float
cclauss Jun 17, 2025
e578af5
Merge branch 'stoiver:main' into main
JorgeG94 Jun 17, 2025
c069572
Merge pull request #70 from cclauss/patch-1
JorgeG94 Jun 17, 2025
ae84aea
Merge pull request #71 from cclauss/fix-ruff-rule-NPY001
JorgeG94 Jun 17, 2025
af70173
print is a function in Python 3
cclauss Jun 17, 2025
bd024ea
Merge pull request #72 from cclauss/print-is-a-fuction-in-Python-3
stoiver Jun 17, 2025
266bbc8
Merge pull request #84 from anuga-community/main
stoiver Jun 18, 2025
d99f6ba
add missing import
stoiver Jun 18, 2025
2bad145
Merge branch 'main' of github.com:stoiver/anuga_core
stoiver Jun 18, 2025
bbfc116
github action: test on macos for py3.13
stoiver Jun 18, 2025
6a2069f
add github action on push
stoiver Jun 18, 2025
5e5c80c
move openmp dependency definition to parent meson.build file
stoiver Jun 18, 2025
49f67c6
trying to debug macos run
stoiver Jun 18, 2025
50bdc4b
more info from mac
stoiver Jun 18, 2025
03d1758
mac info after conda activate
stoiver Jun 18, 2025
e4c309d
on mac explicitly define CC C++ variables
stoiver Jun 18, 2025
cb3fcaa
on mac list /Users/runner/miniconda3/envs/anuga_env/bin directory
stoiver Jun 18, 2025
13fab62
on mac install cxx-compiler
stoiver Jun 18, 2025
506f160
Test github actions with macos test
stoiver Jun 18, 2025
9ba9fc4
Weird negative cells warning on macos
stoiver Jun 18, 2025
f7b5f20
picked up error in passing num_negative_cells
stoiver Jun 19, 2025
5493559
add comment to action conda-setup.yml
stoiver Jun 19, 2025
93933ac
extend the CI tests on github/actions
stoiver Jun 19, 2025
e4609de
Problems with meson.build configuring numpy when testing py 3.8
stoiver Jun 19, 2025
7d3e30b
Picked up some bugs in the CUDA code
stoiver Jun 20, 2025
41403e3
small typos
stoiver Jun 21, 2025
435c078
bug with saxpy function
stoiver Jun 22, 2025
7263994
updated saxpy openmp code
stoiver Jun 23, 2025
56b9867
benchmark based on pbs queue
stoiver Jun 23, 2025
6077372
Rename dependabot.yml to .github/dependabot.yml
cclauss Jun 23, 2025
f51b199
test if c = 1 in saxpy calculation
stoiver Jun 24, 2025
9623180
generalise benchmark file
stoiver Jun 24, 2025
9ae1d46
remove filename past hyphen
stoiver Jun 24, 2025
4e4f180
Merge pull request #76 from cclauss/patch-1
JorgeG94 Jun 24, 2025
a5d3419
port eval segment to C
Jun 25, 2025
5b5299a
add __restrict to C code
stoiver Jun 25, 2025
d7eb01d
Merge branch 'main' of github.com:anuga-community/anuga_core
stoiver Jun 25, 2025
def0c0b
uninstall mpi4py on windows, seems to be causing a segmentation fault!
stoiver Jun 26, 2025
e451e8f
Merge branch 'main' into jorge/feat/port_eval_segment
JorgeG94 Jun 26, 2025
b978bb8
changed profile file names to include script name
stoiver Jun 26, 2025
56d82de
revert sw_domain_openmp.c to version from f51b199fac1e9352dd2327b28e6…
stoiver Jun 26, 2025
7fe50a9
try old version of mpi4py
stoiver Jun 26, 2025
99a4b0e
move back from mpi4py=1.0 to mpi4py
stoiver Jun 26, 2025
8d0beca
github action on push
stoiver Jun 26, 2025
c6eae30
update compilers on windows
stoiver Jun 26, 2025
c6b5d68
back to restrict code in sw_domain_openmp
stoiver Jun 26, 2025
b8e9e28
Merge pull request #78 from anuga-community/jorge/feat/port_eval_segment
stoiver Jun 26, 2025
4c35346
cleanup of old files
stoiver Jun 27, 2025
77b6ebc
remove old files from meson.build
stoiver Jun 27, 2025
f9b0dd1
uninstall mpi4py on windows github actions
stoiver Jun 27, 2025
407d7da
Merge remote-tracking branch 'origin/main' into develop_gpu
Jun 27, 2025
3669293
Merge pull request #79 from anuga-community/jorge/develop_gpu_on_par_…
stoiver Jun 27, 2025
9e753a2
stop using travis CI as we are now covered by github actions
stoiver Jun 27, 2025
edbf978
set appveyor badge to main branch
stoiver Jun 27, 2025
86230a6
update badge to main branch
stoiver Jun 27, 2025
82c1433
github action badge
stoiver Jun 27, 2025
a248550
remove double badge3
stoiver Jun 27, 2025
9c14a11
Update conda-setup.yml
stoiver Jun 28, 2025
077694a
merge with main
stoiver Jun 29, 2025
3308daf
Merge branch 'main' into develop_gpu
stoiver Jun 29, 2025
008e44f
remove meson warning
stoiver Jun 29, 2025
fe2fb76
Merge branch 'develop_gpu' into develop
stoiver Jun 29, 2025
e2337a5
look at restricting vertex calculations in extrapolation
stoiver Jun 29, 2025
6db2a81
use edge values for sloped manning fricton
stoiver Jun 30, 2025
8d52185
add set_omp_num_threads to domain
stoiver Jun 30, 2025
9833e3c
Merge branch 'main' into develop
stoiver Jun 30, 2025
40af98a
add *.pstat file to .gitignore
stoiver Jun 30, 2025
347bf0f
Update appveyor.yml
stoiver Jun 30, 2025
49b94ec
Merge branch 'main' of github.com:anuga-community/anuga_core
stoiver Jul 1, 2025
15cb1c1
appveyor is getting very slow. Disable and use Github actions
stoiver Jul 1, 2025
a6aa510
Merge branch 'main' into develop
stoiver Jul 1, 2025
4bdd735
need to change script to take anuga script arguments
stoiver Jul 29, 2025
83ba090
bug in install_miniforge.sh
stoiver Jul 29, 2025
9d7d5e8
Merge branch 'main' into develop
stoiver Jul 29, 2025
39d3b74
git ignore *.csv
stoiver Aug 15, 2025
b1746b3
remove all setup.py files
stoiver Aug 15, 2025
b49683c
remove setup.py from meson.build files
stoiver Aug 15, 2025
d49f4cd
ensure multiprocessor_mode in [1,2]
stoiver Aug 19, 2025
7fd437a
update error message when setting multiprocessor_mode
stoiver Aug 20, 2025
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
36 changes: 26 additions & 10 deletions .github/workflows/conda-setup.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Conda setup
name: github CI

on: [push, pull_request]
on: [pull_request, push]

jobs:
test_conda:
Expand All @@ -9,9 +9,14 @@ jobs:
strategy:
fail-fast: false
matrix:
#os: ["ubuntu-latest", "macos-latest", "windows-latest"]
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.11", "3.13"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

# Our meson.build expects that numpy-config is installed but this
# is not available for python < 3.9

# 2025/06/19: 3.14 causes an error with conda_incubator/setup-miniconda@v3
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
Expand All @@ -25,21 +30,32 @@ jobs:
run: |
conda env create --name anuga_env --file environments/environment_${{matrix.python-version}}.yml

- name: Install mingw compilers on Windows
- name: Install gcc compilers on Windows
if: runner.os == 'Windows'
shell: bash -el {0}
run: |
conda install -c conda-forge -n anuga_env libpython m2w64-toolchain
conda install -c conda-forge -n anuga_env gcc_win-64 gxx_win-64
# As of 2025/06/19, strange combination of mpi4py, the new compilers and pytest is
# causing a segmentation fault on Windows so we uninstall mpi4py
# This is a temporary workaround until the issue is resolved.
conda uninstall -n anuga_env mpi4py

- name: Install package
- name: Install clang with openmp compiler on macOS
if: runner.os == 'macOS'
shell: bash -el {0}
run: |
conda install -c conda-forge -n anuga_env cxx-compiler llvm-openmp

- name: Install anuga package
shell: bash -el {0}
run: |
conda activate anuga_env
pip install --no-build-isolation .
pip install --no-build-isolation -v .

- name: Test package
shell: bash -el {0}
run: |
conda activate anuga_env
cd ..
pytest -p no:faulthandler -q --pyargs anuga
export OMP_NUM_THREADS=1
pytest -p no:faulthandler -rs --pyargs anuga
40 changes: 40 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "develop-meson" ]
release:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[#]*#
*~
*$
*.csv
*.pstat
*.bak
.idea/*
*.kdev4
Expand All @@ -15,6 +17,7 @@
.settings/
.*.sw[nop]
.sw[nop]
*.pstat
*.c
*.cpp
*.tmp
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ build:
sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
# - epub

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
Expand Down
18 changes: 12 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@

.. image:: https://badges.gitter.im/gitterHQ/gitter.png
.. |badge0| image:: https://badges.gitter.im/gitterHQ/gitter.png
:target: https://app.gitter.im/#/room/#anuga-community:gitter.im
:alt: Community Chat

.. image:: https://app.travis-ci.com/anuga-community/anuga_core.svg?branch=develop_hackathon
..
|badge1| image:: https://img.shields.io/travis/com/anuga-community/anuga_core/develop_hackathon.svg
:target: https://app.travis-ci.com/anuga-community/anuga_core
:alt: travis ci status
:alt: Travis CI Status

.. |badge1| image:: https://github.com/anuga-community/anuga_core/actions/workflows/conda-setup.yml/badge.svg
:target: https://github.com/anuga-community/anuga_core/actions/workflows/conda-setup.yml
:alt: GitHub Actions Status

.. image:: https://ci.appveyor.com/api/projects/status/x5airjv7eq2u805w/branch/develop_hackathon?svg=true
..
|badge2| image:: https://ci.appveyor.com/api/projects/status/x5airjv7eq2u805w/branch/main?svg=true
:target: https://ci.appveyor.com/project/stoiver/anuga-core-nwgr0
:alt: appveyor status

Expand All @@ -31,7 +37,7 @@
:target: https://anuga.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

|badge0| |badge1| |badge2| |badge3| |badge3| |badge4| |badge5| |badge6| |badge7|
|badge0| |badge1| |badge3| |badge4| |badge5| |badge6| |badge7|



Expand Down Expand Up @@ -103,7 +109,7 @@ ANUGA documentation is available via "read the docs" at
https://anuga.readthedocs.io

Also you can obtain help via the old
`user_manual <https://github.com/anuga-community/anuga_core/raw/main/doc/anuga_user_manual.pdf>`_
`user_manual <https://dx.doi.org/10.13140/RG.2.2.17267.81446>`_

Also helpful information is available online at

Expand Down
74 changes: 20 additions & 54 deletions anuga/abstract_2d_finite_volumes/generic_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,10 @@ def __init__(self,

#-------------------------------
# Set multiprocessor mode
# 0. orig (original with edge optim)
# 1. simd (used for multiprocessor)
# 2. openmp (in development)
# 3. openacc (in development)
# 4. cuda (in development)
# 1. openmp (in development)
# 2. cuda (in development)
#-------------------------------
self.set_multiprocessor_mode(0)
self.set_multiprocessor_mode(1)

self.processor = processor
self.numproc = numproc
Expand Down Expand Up @@ -749,18 +746,23 @@ def set_multiprocessor_mode(self, multiprocessor_mode= 0):
"""
Set multiprocessor mode

0. original
1. simd (used for multiprocessor)
2. openmp (in development)
3. openacc (in development)
4. cuda (in development)
1. openmp (in development)
2. cuda (in development)
"""

if multiprocessor_mode in [0,1,2,3,4]:
if multiprocessor_mode in [1,2]:
self.multiprocessor_mode = multiprocessor_mode
else:
raise Exception('multiprocessor mode {multiprocessor_mode} not supported')

def get_multiprocessor_mode(self):
"""
Get multiprocessor mode

1. openmp (in development)
2. cuda (in development)
"""
return self.multiprocessor_mode

def set_using_centroid_averaging(self, flag=True):
"""Set flag to use centroid averaging in output
Expand Down Expand Up @@ -2164,10 +2166,7 @@ def evolve_one_rk3_step(self, yieldstep, finaltime):
# self.saxpy_conserved_quantities(2.0/3.0, 1.0/3.0)

# So do this instead!
self.saxpy_conserved_quantities(2.0, 1.0)
for name in self.conserved_quantities:
Q = self.quantities[name]
Q.centroid_values[:] = Q.centroid_values / 3.0
self.saxpy_conserved_quantities(2.0, 1.0, 3.0)

# Update special conditions
# self.update_special_conditions()
Expand All @@ -2191,12 +2190,15 @@ def backup_conserved_quantities(self):
Q = self.quantities[name]
Q.backup_centroid_values()

def saxpy_conserved_quantities(self, a, b):
def saxpy_conserved_quantities(self, a, b, c=None):

# Backup conserved_quantities centroid values
# saxpy conserved_quantities centroid values with backup values
for name in self.conserved_quantities:
Q = self.quantities[name]
Q.saxpy_centroid_values(a, b)
if c is not None:
Q.centroid_values[:] = Q.centroid_values / c


def conserved_values_to_evolved_values(self, q_cons, q_evol):
"""Needs to be overridden by Domain subclass
Expand Down Expand Up @@ -2517,42 +2519,6 @@ def centroid_norm(self, quantity, normfunc):

return normfunc(self.quantities[quantity].centroid_values)

def apply_protection_against_isolated_degenerate_timesteps(self):

# FIXME (Steve): This should be in shallow_water as it assumes x and y
# momentum
if self.protect_against_isolated_degenerate_timesteps is False:
return

# FIXME (Ole): Make this configurable
if num.max(self.max_speed) < 10.0:
return

# Setup 10 bins for speed histogram
from anuga.utilities.numerical_tools import histogram, create_bins

bins = create_bins(self.max_speed, 10)
hist = histogram(self.max_speed, bins)

# Look for characteristic signature
if len(hist) > 1 and hist[-1] > 0 and \
hist[4] == hist[5] == hist[6] == hist[7] == hist[8] == 0:
# Danger of isolated degenerate triangles

# Find triangles in last bin
# FIXME - speed up using numeric package
d = 0
for i in range(self.number_of_triangles):
if self.max_speed[i] > bins[-1]:
msg = 'Time=%f: Ignoring isolated high ' % self.get_time()
msg += 'speed triangle '
msg += '#%d of %d with max speed = %f' \
% (i, self.number_of_triangles, self.max_speed[i])

self.get_quantity('xmomentum').set_values(0.0, indices=[i])
self.get_quantity('ymomentum').set_values(0.0, indices=[i])
self.max_speed[i] = 0.0
d += 1


if __name__ == "__main__":
Expand Down
35 changes: 3 additions & 32 deletions anuga/abstract_2d_finite_volumes/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
inc_dir = include_directories('../utilities', incdir_numpy)


openmp = dependency('openmp', required: false)
if openmp.found()
if host_machine.system() == 'windows'
# On Windows, the mingw compiler does not support OpenMP ATOMIC operations
openmp_deps = dependencies
else
openmp_deps = dependencies + [openmp]
endif

else
openmp_deps = dependencies
endif

# FIXME SR: Need to setup dependencies for openacc code
openacc_deps = dependencies

# Compile the Cython-generated C code and additional C code
py3.extension_module('mesh_factory_ext',
sources: ['mesh_factory_ext.pyx'],
Expand Down Expand Up @@ -52,35 +36,22 @@ py3.extension_module('pmesh2domain_ext',
install: true,
)

py3.extension_module('quantity_ext',
sources: ['quantity_ext.pyx'],
include_directories: inc_dir,
dependencies: dependencies,
subdir: 'anuga/abstract_2d_finite_volumes',
install: true,
)


py3.extension_module('quantity_openmp_ext',
sources: ['quantity_openmp_ext.pyx'],
c_args : openmp_c_args,
include_directories: inc_dir,
dependencies: openmp_deps,
subdir: 'anuga/abstract_2d_finite_volumes',
install: true,
)

py3.extension_module('quantity_openacc_ext',
sources: ['quantity_openacc_ext.pyx'],
include_directories: inc_dir,
dependencies: openacc_deps,
subdir: 'anuga/abstract_2d_finite_volumes',
install: true,
)

py3.extension_module('quantity_cuda_ext',
sources: ['quantity_cuda_ext.pyx'],
c_args : openmp_c_args,
include_directories: inc_dir,
dependencies: dependencies,
dependencies: openmp_deps,
subdir: 'anuga/abstract_2d_finite_volumes',
install: true,
)
Expand Down
1 change: 1 addition & 0 deletions anuga/abstract_2d_finite_volumes/neighbour_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ def statistics(self, nbins=10):
hist = histogram(areas, bins)

str = '------------------------------------------------\n'
str += ' Jorge openmp version \n'
str += 'Mesh statistics:\n'
str += ' Number of triangles = %d\n' %len(self)
str += ' Extent [m]:\n'
Expand Down
Loading
Loading