Opened 17 years ago

Last modified 15 years ago

#308 closed enhancement

ANUGA high level API — at Initial Version

Reported by: ole Owned by: ole
Priority: normal Milestone:
Component: Architecture and API Version:
Severity: normal Keywords:
Cc: steve

Description

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.shallow_water 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 ) 

# Run baby run
model.run(...)

Change History (0)

Note: See TracTickets for help on using tickets.