Opened 16 years ago

Closed 14 years ago

#308 closed enhancement (fixed)

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)

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)

comment:1 Changed 16 years ago by ole

  • Description modified (diff)

comment:2 Changed 15 years ago by ole

  • Cc steve added
  • Owner changed from ole to nariman

comment:3 Changed 15 years ago by hudson

  • Owner changed from nariman to hudson

comment:4 Changed 15 years ago by hudson

  • Status changed from new to assigned

comment:5 Changed 14 years ago by hudson

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Note: See TracTickets for help on using tickets.