Giter Club home page Giter Club logo

anuga_core's Introduction

travis ci status appveyor status Latest PyPi Version Latest PyPi Version PyPi download statistics Latest Conda Version Conda Forge download statistics Documentation Status

ANUGA (pronounced "AHnooGAH") is open-source software for the simulation of the shallow water equation, in particular it can be used to model tsunamis and floods.

ANUGA is a python 3 package with some C and Cython extensions (and an optional fortran extension).

ANUGA was created in a collaboration by Geoscience Australia and Mathematical Sciences Institute at the Australian National University, though now it is further developed and maintained by a community of volunteers.

Copyright Commonwealth of Australia (Geoscience Australia) and Australian National University 2004-Now

ANUGA is available from either https://github.com/anuga-community/anuga_core or https://github.com/GeoscienceAustralia/anuga_core.

The Python 3.x version is the default and available in the main branches of both repositories.

If you rely on the old Python 2.7 version, it is available in branches named anuga_py2.

The python 3 version of ANUGA will continue to be developed and the most up-to-date versions will be available from the anuga-community repository.

If you use conda to provide your python environment, then you can install anuga from the conda-forge channel as follows. First setup the conda-forge channel:

conda config --add channels conda-forge
conda config --set channel_priority strict

Once the conda-forge channel has been enabled, anuga can be installed with conda:

conda install anuga

For more installation instructions, see https://anuga.readthedocs.io/en/latest/installation.html

ANUGA documentation is available via "read the docs" at

https://anuga.readthedocs.io

Also you can obtain help via the old user_manual

Also helpful information is available online at

http://anuga.anu.edu.au

A collection of online jupyter notebooks which can run under google's colab environment can be found at:

https://github.com/anuga-community/anuga-clinic

You can subscribe to our mailing via:

https://lists.sourceforge.net/lists/listinfo/anuga-user

and send questions using the address

[email protected]

You can also submit issues to:

https://github.com/anuga-community/anuga_core/issues

The latest development version of ANUGA's sources are is available at:

https://github.com/anuga-community/anuga_core

They can be downloaded as a zip file or using the Git client as follows

git clone https://github.com/anuga-community/anuga_core #(for read only)
git clone [email protected]:anuga-community/anuga_core.git #(to contribute)

For the latter option see e.g. https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/ for instructions on how to authenticate using ssh keys.

To search for bugs or report them, please use the ANUGA's Bug Tracker at:

https://github.com/anuga-community/anuga_core/issues

If you would like to take part in ANUGA development, take a look at CONTRIBUTING.rst.

See the file LICENSE.txt for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

At the Australian National University: Stephen Roberts Lead Developer <[email protected]>

At Geoscience Australia: Gareth Davies Developer <[email protected]>

ANUGA Community: Ole Nielsen Architect and Developer <[email protected]>

anuga_core's People

Contributors

stoiver avatar uniomni avatar stoiveroberts avatar dunkgray avatar gareth-d-ga avatar rkwi avatar sextonjane avatar nhabili avatar yazgoo avatar jjakeman avatar ninnghazad avatar petarmilevski avatar acer8 avatar chen-huang-326 avatar padarn avatar griffij avatar davekennewell avatar rachelwu21 avatar samcom12 avatar vnewey avatar lixinhou avatar mingdazheng avatar pabryan avatar zijunzhang-zoe avatar panxnan avatar

Stargazers

 avatar KungCh'i avatar shoudaoz avatar Carlos Rodrigues  avatar  avatar  avatar JianFei Zhao avatar BinWang990510 avatar  avatar Marcelo Zenaide avatar Andrew C. avatar Fernando Aristizabal avatar  avatar  avatar  avatar Andrew Moodie avatar  avatar Michael Ransby avatar  avatar  avatar  avatar Erdong avatar Giovanni De Feudis avatar Ed Barry avatar febrifahmi avatar  avatar  avatar Daniel Knott avatar sechelé delaruse avatar André Kruger avatar  avatar  avatar

Watchers

James Cloos avatar Guo Rui avatar  avatar  avatar  avatar  avatar  avatar André Kruger avatar  avatar  avatar

anuga_core's Issues

Parallel Distribute copies vertex values

We now exclusively use the DE algorithms which really only work with centroid values. But the parallel distribute procedures send/recv quantity vertex values. Probably should change to communicating only centroid values.

At present this means that if you change just centroid values (not via set_quantity) of a sequential domain quantity and then distribute, the centroid value will not propagated.

run_open_slot_wide_bridge.py not working

in anuga_core/examples/structures/run_open_slot_wide_bridge.py

on line 46:

domain = rectangular_cross_domain(int(length/dx), int(width/dy),
len1=length, len2=width)

should be

points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
len1=length, len2=width)
domain = Domain(points, vertices, boundary)

for model to run

Is reading from array of Q available for Inlet_operator()?

Docs describe possible inflow setting with constant value or with lambda function. As far as I see in the code these are the only ways to provide the inflow to equations.
lambda can be used as an iterator from lists as lambda t: value[time.index(t)] if value=[Q1...Qn] and time=[t1...tn]. Lengths should be same. So, can we use this approach to provide inflow time arrays? time array can be easily calculated from initial settings.

Create conda-forge distribution

Conda Forge would be a good environment for installing anuga. This would allow anuga to be installed via:

conda install anuga

pybind11 not installed error

Hi Steve, how are you going?

I cloned the latest anuga on my ubuntu 20.04lts box and did sudo bash anuga_core/tools/install_ubuntu_20_04.sh to install and this error occurred. Tried this python -m pip install pybind11, it says its installed but i keep getting the error.

Any ideas??

  Building wheel for meshpy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/petar/anuga_env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wm9zkzsj/meshpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wm9zkzsj/meshpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gqp4dbqn
       cwd: /tmp/pip-install-wm9zkzsj/meshpy/
  Complete output (20 lines):
  ---------------------------------------------------------------------------
  Pybind11 is not installed.
  ---------------------------------------------------------------------------
  Very likely, the build process after this message will fail.
  
  Simply press Ctrl+C and type
  python -m pip install pybind11
  to fix this. If you don't, the build will continue
  in a few seconds.
  
  [1] https://pybind11.readthedocs.io/en/stable/
  ---------------------------------------------------------------------------
  Continuing in 1 seconds...    
  WARNING: The wheel package is not available.
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
  
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for meshpy
  Running setup.py clean for meshpy
^CERROR: Operation cancelled by user
petar@petar:~$ python -m pip install pybind11
Requirement already satisfied: pybind11 in ./.local/lib/python3.8/site-packages (2.10.0)

Impact of changing internal parameters like CFL.

Hi @stoiver,

We have tried changing CFL value from 1.0 to 2.0 (default is 1.0) with the DE1 algorithm.
We wanted to know the impact of the CFL value change on accuracy and quality of output.

Do you suggest changing the CFL value or any other parameter for getting good performance without compromising output accuracy?

Cheers,
Samir Shaikh

Use of ASYNC progress in ANUGA

Hi @stephen,

Greetings of the day!!
In ANUGA manual we see a description about ASYNC MPI communication.
But, when we benchmark it we are not seeing any performance gain.

Maybe as MPI4PY doesn't allow it to be used with ANUA.
Any comments from your end?

Cheers,
Samir Shaikh

Add Support for Mean with SWW2DEM

Currently it seems only max and min, and time step can be used to extract Grid of SWW results. Some times other functions over the domain could be useful. One for example being the mean....
There is likely others ?

Get parallel_rectangle working again

We have an old procedure anuga.parallel.parallel_meshes.parallel_rectangle which is supposed to create a distributed parallel rectangular domain. Unfortunately it doesn't work at the moment.

We should update it to work with the python 3 version of anuga.

It would avoid the problem of first creating a sequential domain and then distributing it using metis.

anuga has a read grid coding error while running on linux

Hello, I am a newbie to using anuga.
I'm running it fine in windows, but running it in Ubuntu gives me read grid file encoding error and can't open grid file on behalf of the grid file.
This is my problem:
OSError: File mesh_1716207772.msh could not be opened

Add support for conversion CSV -> GPKG

Dear all,

thanks for this project.
I see a need to convert from CSV -> GPKG file format starting out from validation_tests\case_studies\merewether\houses\. I have written a first script to compile from the buildings in CSV format to a GPKG-package. It serves my purposes and I would like to contribute as per my capacities.

Best regards

Sebastian

"""
Sources:
https://stackoverflow.com/questions/9234560/find-all-csv-files-in-a-directory-using-python#12280052
https://gis.stackexchange.com/questions/301251/geopandas-import-csv-make-polygons-from-x-y-coordinates-based-on-id
https://gis.stackexchange.com/questions/294206/%d0%a1reating-polygon-from-coordinates-in-geopandas
https://gis.stackexchange.com/questions/266098/how-to-convert-a-geoseries-to-a-geodataframe-with-geopandas
"""

import os
from glob import glob
import pandas as pd
from shapely.geometry import Polygon
import geopandas as gpd

def get_csv_files(dir_path, ext):
    os.chdir(dir_path)
    return list(map(lambda x: os.path.join(dir_path, x), glob(f'*.{ext}')))

def get_mpolygons(file_list, crs):
    polygons = []
    for file in file_list:
        df = pd.read_csv(file, header=None)
        polygons.append(Polygon(zip(df[0], df[1])))
    gs = gpd.GeoSeries(polygons)
    print(gs)
    return gpd.GeoDataFrame(geometry=gpd.GeoSeries(gs, crs=crs))

if __name__ == "__main__":
    file_list = get_csv_files(".", "csv")
    mp = get_mpolygons(file_list, crs='epsg:32756')
    print(mp)
    mp.to_file(filename='buildings.gpkg', driver="GPKG")

Error in "import anuga"

I installed anuga by conda create -n anuga_env python=3.9 anuga mpi4py, successfully installed but fail in using.
Here is the error message:

Traceback (most recent call last):
  File "/home/shoudaoz/Documents/anuga_core-main/test_zsd.py", line 1, in <module>
    import anuga
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/__init__.py", line 48, in <module>
    from anuga.shallow_water.shallow_water_domain import Domain
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/shallow_water/shallow_water_domain.py", line 102, in <module>
    from anuga.abstract_2d_finite_volumes.generic_domain \
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/abstract_2d_finite_volumes/generic_domain.py", line 27, in <module>
    from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/abstract_2d_finite_volumes/neighbour_mesh.py", line 10, in <module>
    from .general_mesh import General_mesh
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/abstract_2d_finite_volumes/general_mesh.py", line 7, in <module>
    from anuga.coordinate_transforms.geo_reference import Geo_reference
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/coordinate_transforms/__init__.py", line 3, in <module>
    from .redfearn import *
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/coordinate_transforms/redfearn.py", line 9, in <module>
    from anuga.coordinate_transforms.geo_reference import Geo_reference, DEFAULT_ZONE
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/coordinate_transforms/geo_reference.py", line 14, in <module>
    from anuga.utilities.numerical_tools import ensure_numeric
  File "/home/shoudaoz/Documents/anuga_core-main/anuga/utilities/numerical_tools.py", line 389, in <module>
    from .util_ext import gradient, gradient2
ModuleNotFoundError: No module named 'anuga.utilities.util_ext'

How can I solve the problem?

Runtime issue: for finer-grained mesh resolution

Hi,
We can run Anuga with coarser-grained mesh resolution well.
But, while using finer-grained mesh, we get a below error.

ValueError: send_recv_via_dicts: Number of recv communication buffers > 10

Which is getting triggered from utilities/parallel_abstraction.py

It could create and distribute domains and fails in EVOLVE phase.

Issue in running Anuga on higher number of processes

Hi,
I have tried installing Anuga with the combination of compilers and MPI implementations like GCC and OpenMPI, GCC and MPICH, Intel compilers and Intel MPI, Intel-Oneapi-compilers and Intel-Oneapi-MPI.

The simulation works well till 16 nodes and 48 MPI processes per node i.e 768 processes.
However, for scaling on more nodes like 32 nodes with 48 MPI processes per node it fails with some messages like below in each above combination.


 File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 786, in exec_module
  File "<frozen importlib._bootstrap_external>", line 922, in get_code
  File "<frozen importlib._bootstrap_external>", line 979, in get_data
OSError: [Errno 24] Too many open files: '/home/apps/spack/opt/spack/linux-centos7-cascadelake/gcc-10.3.0/py-scipy-1.7.1-hmjpuclzfylrfolqqwodbnjnl76y6nbw/lib/python3.9/site-packages/scipy/interpolate/_fitpack_impl.py'
Abort(135378319) on node 5906 (rank 5906 in comm 0): Fatal error in PMPI_Mprobe: Other MPI error, error stack:
PMPI_Mprobe(117)..............:  MPI_Mprobe(source=0, tag=1, comm=MPI_COMM_WORLD, message=0x7fff4600cf10, status=0x7fff4600cf20)
PMPI_Mprobe(100)..............:
MPID_Mprobe(188)..............:
progress_test(100)............:
MPIDI_OFI_handle_cq_error(951): OFI poll failed (ofi_events.c:951:MPIDI_OFI_handle_cq_error:Input/output error)
Abort(673297807) on node 5909 (rank 5909 in comm 0): Fatal error in PMPI_Mprobe: Other MPI error, error stack:
PMPI_Mprobe(117)..............:  MPI_Mprobe(source=0, tag=1, comm=MPI_COMM_WORLD, message=0x7fff8405e110, status=0x7fff8405e120)
PMPI_Mprobe(100)..............:
MPID_Mprobe(185)..............:
MPIDI_improbe_safe(135).......:
MPIDI_improbe_unsafe(79)......:
MPIDI_OFI_do_iprobe(69).......:
MPIDI_OFI_handle_cq_error(951): OFI poll failed (ofi_events.c:951:MPIDI_OFI_handle_cq_error:Input/output error)
Abort(269596047) on node 5917 (rank 5917 in comm 0): Fatal error in PMPI_Mprobe: Other MPI error, error stack:
PMPI_Mprobe(117)..............:  MPI_Mprobe(source=0, tag=1, comm=MPI_COMM_WORLD, message=0x7ffd5a330030, status=0x7ffd5a330040)
PMPI_Mprobe(100)..............:
MPID_Mprobe(188)..............:
progress_test(100)............:
MPIDI_OFI_handle_cq_error(951): OFI poll failed (ofi_events.c:951:MPIDI_OFI_handle_cq_error:Input/output error)
Abort(940684687) on node 5921 (rank 5921 in comm 0): Fatal error in PMPI_Mprobe: Other MPI error, error stack:
PMPI_Mprobe(117)..............:  MPI_Mprobe(source=0, tag=1, comm=MPI_COMM_WORLD, message=0x7ffcd06d0610, status=0x7ffcd06d0620)
PMPI_Mprobe(100)..............:
MPID_Mprobe(188)..............:
progress_test(100)............:
MPIDI_OFI_handle_cq_error(951): OFI poll failed (ofi_events.c:951:MPIDI_OFI_handle_cq_error:Input/output error)
Abort(806466959) on node 5925 (rank 5925 in comm 0): Fatal error in PMPI_Mprobe: Other MPI error, error stack:
PMPI_Mprobe(117)..............:  MPI_Mprobe(source=0, tag=1, comm=MPI_COMM_WORLD, message=0x7ffc0c9d5610, status=0x7ffc0c9d5620)

I have run examples for MPI4PY with all combinations and it runs well on a large number of nodes like 32.

No module named 'numpy.lib.arraysetops'

(anuga_env) [wwh@wwh simple_examples]$ python runup.py
Traceback (most recent call last):
  File "/home/wwh/Documents/anuga_core/examples/simple_examples/runup.py", line 10, in <module>
    import anuga
  File "/home/wwh/miniforge3/envs/anuga_env/lib/python3.9/site-packages/anuga/__init__.py", line 110, in <module>
    from anuga.parallel.parallel_api import distribute
  File "/home/wwh/miniforge3/envs/anuga_env/lib/python3.9/site-packages/anuga/parallel/__init__.py", line 15, in <module>
    from .parallel_api import distribute
  File "/home/wwh/miniforge3/envs/anuga_env/lib/python3.9/site-packages/anuga/parallel/parallel_api.py", line 16, in <module>
    from anuga.parallel.sequential_distribute import sequential_distribute_dump
  File "/home/wwh/miniforge3/envs/anuga_env/lib/python3.9/site-packages/anuga/parallel/sequential_distribute.py", line 10, in <module>
    from anuga.parallel.distribute_mesh  import send_submesh
  File "/home/wwh/miniforge3/envs/anuga_env/lib/python3.9/site-packages/anuga/parallel/distribute_mesh.py", line 30, in <module>
    import numpy.lib.arraysetops as numset
ModuleNotFoundError: No module named 'numpy.lib.arraysetops'
(anuga_env) [wwh@wwh simple_examples]$ pip list | grep numpy
numpy               2.0.0

ANUGA GPU support

Hi All,

With recent developments like OpenMP offload support or openacc pragma, Can we port ANUGA to use GPU and accelerate simulations?

Cheers,
Samir

Couple with pipedream

pipedream is another open source urban storm water model. It is python code so should couple easily with anuga.

A lot of the coupling code should overlap with the swmm coupling project.

Consider using meshpy wrapper of triangle

Triangle has a license which restricts use in commercial projects. This can lead to problems with Triangle wrapper projects.

The wrapper https://github.com/drufat/triangle uses a LGPL licence which has lead to problems with it being accepted as a conda-forge package. This package is available via pip install meshpy.

On the other hand https://github.com/inducer/meshpy uses an MIT type licence for the wrapper which is acceptable as a conda-forge package. It is installable via either pip install meshpy or conda install -c conda-forge meshpy

If we move over to meshpy then it should be easy to create a conda forge anuga package.

Make Riverwalls transmissive

At present riverwalls are impervious to flow until they are over topped.

There would be useful situations (such as wire fences) to have riverwalls transmissive.

error in run_set_stage.py

Hi Steve, in anuga_core/examples/operators/run_set_stage.py

line 13 - ImportError: cannot import name 'float' from 'numpy'

line 37 - domain.set_flow_algorithm(2.0) - Unknown flow_algorithm. Possible choices are: DE0, DE1, DE2, DE0_7, DE1_7.

Reduce Memory usage

@uniomni , @PetarMilevski, @rudyvandrie

ANUGA is quite a memory hog. For instance when running run_parallel_rectanguar.py (from the examples/parallel directory) with varying --sqrtN values, using a command like::

mpiexec -np 2 time -f "User = %U s System = %S s Maximum RSS = %M kB" python -u run_parallel_rectangular.py --sqrtN 750

we obtained the following results

sqrtN no of triangles process 0 RSS memory User Time
250 250_000 710 MB 6 s
500 1_000_000 2.5 GB 34 s
750 2_250_000 5.1 GB 118 s

We can see very large memory usage for not so large number of triangles. So for a 100_000_000 triangle simulation we would be looking at processor 0 needing 250 GB.

An obvious place to save on memory usage would be to rationalise the memory usage of the Quantity objects. At present we store centroid, edge, vertex and 2 work arrays of size no of triangles. This means 9 x no of triangles. We should be able to get away easily with just centroid, edge and a work array for 5 x no of triangles. A saving of 5/9

Also we store numerous quantities, such as stage, height, elevation, xmom, ymon, xvel, yvel, friction. Probably only need stage, elevation (or height), xmom and ymom. Ie as saving of 4/8.

So total savings could be 5/9 x 4/8 = 20/72 ~ 3/10

To go forward with trying to reduce memory usage, I think it would be necessary to just work with the DE algorithms. An idea would be with say version 4 of anuga we could remove all the old algorithms, and just concentrate on a stream lined version of anuga just using the DE algorithm.

Thoughts?

Add support for conversion GPKG -> CSV

Dear all,

thanks for this project.
I see a need to convert from GPKG->CSV file format starting out from #39. I have written a first script to compile from attached sample file buildings from a GPKG-package into CSV format. Thus one should be able to edit a GPKG-file through GIS and later serve as model input.

Best regards

Sebastian

"""
Sources:
Polyline geometry with attribute measuredHeight to be converted into CSV format as per documentation
csv2building_polygons(file name, floor height=3)
Module: shallow_water.data_manager
Convert CSV files of the form:
easting,northing,id,floors
422664.22,870785.46,2,0
422672.48,870780.14,2,0
422668.17,870772.62,2,0
422660.35,870777.17,2,0
422664.22,870785.46,2,0
422661.30,871215.06,3,1
422667.50,871215.70,3,1
422668.30,871204.86,3,1
422662.21,871204.33,3,1
422661.30,871215.06,3,1

https://stackoverflow.com/questions/69859170/how-acess-get-extract-the-values-of-polygon-in-a-geometry-column-of-geopandas-da
https://stackoverflow.com/questions/56709561/how-to-smartly-loop-over-all-points-in-a-geodataframe-and-look-at-nearest-neig
https://stackoverflow.com/questions/44513738/pandas-create-empty-dataframe-with-only-column-names
https://stackoverflow.com/questions/16923281/writing-a-pandas-dataframe-to-csv-file#16923367
"""

import pandas as pd
import geopandas as gpd

def coord_lister(geom):
    coords = list(geom.exterior.coords)
    return (coords)

def write_csv_files(row):
    dir_path = './'
    file_name = dir_path + '_building_' + str(row.id) + '.csv'
    coords = coord_lister(row.geometry)
    df = pd.DataFrame(columns=['easting','northing','id','floors'])
    for xy in coords:
        df.loc[len(df)] = [xy[0], xy[1], int(row.id), int(row.floors)]
    df['id'] = df['id'].astype(int)
    df['floors'] = df['floors'].astype(int)
    df.to_csv(file_name, sep=',', header=True, index=None)
    return(file_name)

if __name__ == "__main__":
    gdf = gpd.read_file("buildings_mod.gpkg")
    for index,row in gdf.iterrows():
        file_name = write_csv_files(row)
        print("Writing file " + str(file_name))
    print("Files have been written\n")

buildings_mod.zip

Errors in relative_time when using a realistic starttime

There is a problem with catastrophic cancellation when using realistic starttime.

For instance the following code:

import anuga
import numpy as np
import matplotlib.pyplot as plt

from datetime import datetime

%matplotlib inline

print('# Setup domain with realistic starttime')
domain = anuga.rectangular_cross_domain(10,10)
Br = anuga.Reflective_boundary(domain)
domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
domain.set_timezone('Australia/Sydney')
domain.set_starttime(datetime(2022,9,29,12,30))
domain.set_quantity('elevation', lambda x,y : x)
domain.set_quantity('stage', lambda x,y : x+0.5)

print('# Evolve')
for t in domain.evolve(yieldstep=0.1, duration=1.0):
    domain.print_timestepping_statistics()
    print('    Relative time :',domain.relative_time)

produces the following:

# Setup domain with realistic starttime
# Evolve
Time = 1664418600.0000 (sec), steps=0 (0s)
    Relative time : 0.0
Time = 1664418600.1000 (sec), delta t in [0.00465004, 0.00677631] (s), steps=19 (0s)
    Relative time : 0.09999990463256836
Time = 1664418600.2000 (sec), delta t in [0.00362748, 0.00464594] (s), steps=25 (0s)
    Relative time : 0.19999980926513672
Time = 1664418600.3000 (sec), delta t in [0.00351577, 0.00390400] (s), steps=28 (0s)
    Relative time : 0.2999997138977051
Time = 1664418600.4000 (sec), delta t in [0.00390404, 0.00439568] (s), steps=25 (0s)
    Relative time : 0.39999961853027344
Time = 1664418600.5000 (sec), delta t in [0.00433682, 0.00457341] (s), steps=23 (0s)
    Relative time : 0.4999995231628418
Time = 1664418600.6000 (sec), delta t in [0.00439858, 0.00479898] (s), steps=22 (0s)
    Relative time : 0.5999994277954102
Time = 1664418600.7000 (sec), delta t in [0.00452521, 0.00499509] (s), steps=21 (0s)
    Relative time : 0.6999993324279785
Time = 1664418600.8000 (sec), delta t in [0.00499236, 0.00505003] (s), steps=20 (0s)
    Relative time : 0.7999992370605469
Time = 1664418600.9000 (sec), delta t in [0.00505604, 0.00508120] (s), steps=20 (0s)
    Relative time : 0.8999991416931152
Time = 1664418601.0000 (sec), delta t in [0.00504063, 0.00506525] (s), steps=20 (0s)
    Relative time : 0.9999990463256836
Time = 1664418601.0000 (sec), delta t = 0.00503902 (s), steps=1 (0s)
    Relative time : 1.0

Observe that Relative_time has inherited a large numerical error (cause by catastrophic cancellation). This example shows that this can lead to a strange extra step just before the finaltime.

To deal with this we will need to carefully reimplement the evolve procedures to work exclusively with relative_time .

Move from pytz to zoneinfo

Just recently I have added in the facility for a domain (simulation) to have a timezone and for the time to be converted to a datetime.

To do this I used the pytz module. But now I see that people are moving away from 'pytz to zoneinfo. For instance see
https://groups.google.com/g/django-developers/c/PtIyadoC-fI

Zoneinfo has been introduced into the system module with python 3.9.
There is a backport https://github.com/pganssle/zoneinfo for earlier version of python.

So I think I had better move over to zoneinfo quick smart!

Add region argument to get_water_volume

A Quantity has a member function get_integral which has an optional argument region.

We should also add a similar optional argument to the get_water_volume member function for anuga.Domain.

Inlet operator bug

Just as with the rate operator, we need to change the xmom and ymom if the discharge Q is negative, to avoid unrealistically large velocities developing.

AttributeError: 'GPU_interface' object has no attribute 'extrapolate_kernel1'

Hi all,

We've recently initiated the development of Anuga on GPU using the hackthon_development branch. However, during testing, we encountered the following error in the GPU_interface class when attempting to call the extrapolate_kernel1 attribute:

AttributeError: 'GPU_interface' object has no attribute 'extrapolate_kernel1'
Steps to Reproduce:

Load nvhpc and cuda.

Install Miniconda.

Create a Conda environment and activate it.

Install necessary packages using Conda and Pip:

conda install -c conda-forge cython dill future gitpython matplotlib netcdf4 numpy pytest pytz scipy setuptools wheel pip GDAL -y
pip install --no-cache cupy-cuda114 pmw utm meshpy pymetis pytriangle tzdata nvtx

Testing Steps:

Download the benchmark from here.
Run the benchmark using the following command:

python run_anuga_rectangular.py -mm 4
Environment:

Operating System: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.17
Python Version: 3.10.13
GPU Model: Tesla V100-SXM2-16GB

We appreciate any insights or suggestions for resolving this issue. If you need further information or details, please let us know.

Rate operator bug

When calculating the rate update __call__ in the Rate_operator I think we need to adjust the velocities, especially if rate < 0.

At present the xmom and ymom stay the same but it is possible for height -> 0 so xvel, yvel -> infty

culvert operator new unit test

THe current unit test for the culverts (eg test_boyd_box_operator.py) only test exchange lines. Need to add tests when using end points.

Bug in logging

As of 20/12/2022 there seems to be an error introduced into the logging module when using the extra argument. I have now commented out the use of extra argument on line 162 of utilities/log.py.

Will need to return to this to see when the logging module is corrected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.