ANUGA high level API
The functionality of ANUGA is increasing and some structures need to appear in different locations of the typical script and in a particular order. Examples are STS boundary data which must appear both in the mesh generation and the boundary setting. Culvert routines are heading in the same direction with openings needing to be refined in the mesh generator. Finally, parallelism still imposes a bit of ordering.
Consequently I propose writing a high level ANUGA interface where data can be specified in any order to setup ANUGA models easily. At the same time, low level functionality should be exposed if required. Here's a beginning for this idea:
from anuga.interface import model
# Define mesh boundary and initial internal regions
model.set_boundary_segment( segment1, tag1 )
model.set_boundary_segment( segment2, tag2 )
model.set_internal_region( polygon1, resolution1 )
model.set_internal_region( polygon2, resolution2 )
# Initial conditions
model.set_quantity('elevation', pts_file) # Register, don't run it yet
# Forcing terms
model.add_forcing( Culvert(...) )
model.add_forcing( Rain(...) )
# Boundary conditions
model.add_boundary_condition( sts_file, tag ) # Affect both the mesh boundary and set_boundary.
model.add_boundary_condition( Dirichlet_boundary(), tag )
# Build internal structures and check
model.build(...)
# Run baby run
model.run(...)
Change History (5)
Description: |
modified (diff)
|
Cc: |
steve added
|
Owner: |
changed from ole to nariman
|
Owner: |
changed from nariman to James Hudson
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
API changes completed - simpler public API through using init files.