Ticket #308 (closed enhancement: fixed)

Opened 8 years ago

Last modified 7 years ago

ANUGA high level API

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

Description (last modified by ole) (diff)

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

Changed 8 years ago by ole

  • description modified (diff)

Changed 8 years ago by ole

  • cc steve added
  • owner changed from ole to nariman

Changed 7 years ago by hudson

  • owner changed from nariman to hudson

Changed 7 years ago by hudson

  • status changed from new to assigned

Changed 7 years ago by hudson

  • status changed from assigned to closed
  • resolution set to fixed

API changes completed - simpler public API through using init files.

Note: See TracTickets for help on using tickets.