dycove.sim.engines.ANUGA_hydro.AnugaEngine

class dycove.sim.engines.ANUGA_hydro.AnugaEngine(anuga_domain, vegetation=None)[source]

Engine interface for ANUGA hydrodynamic model.

This engine:

  • Holds the ANUGA domain object.

  • Reads/writes flow and vegetation state directly through Python objects (unlike BMI-based engine used for Delft3D FM).

  • Contains all methods that are specific to the ANUGA model.

Parameters:

Notes

  • ANUGA runs in many short domain.evolve() loops (see step()) rather than one long simulation call; the skip_step mechanism prevents duplicate first timesteps across loops.

  • Parallel execution (if enabled) requires merging local vegetation states after simulation; see merge_parallel_veg().

__init__(anuga_domain, vegetation=None)[source]

Methods

__init__(anuga_domain[, vegetation])

check_simulation_inputs(simstate)

Perform checks on simulation time inputs.

cleanup()

Clean up resources.

get_cell_count()

Return number of active grid cells in the model.

get_elevation()

Return array of bed elevations at cell-centers.

get_rank()

Get current parallel processor/rank.

get_refdate()

Get model reference date as a datetime object.

get_vegetation()

Return stem dens., diam., and height arrays from numerical model.

get_velocity_and_depth()

Return velocity magnitude and depth arrays at cell-centers.

initialize()

Prepare engine to run (allocate memory, read/check inputs, print start, etc.)

is_parallel()

Return True if model is running in parallel based on number of active processors.

merge_local_to_global(local_data, f_gids, ...)

Merge per-processor local arrays into global arrays using local-to-global index mappings.

merge_parallel_veg(OutputManager)

Merge vegetation output files across MPI subdomains into single files.

set_vegetation(stemdensity, stemdiameter, ...)

Push vegetation arrays back into the numerical model.

step(seconds)

Advance the hydrodynamic model forward by a given number of seconds.

check_simulation_inputs(simstate)[source]

Perform checks on simulation time inputs.

cleanup()[source]

Clean up resources.

get_cell_count()[source]

Return number of active grid cells in the model.

get_elevation()[source]

Return array of bed elevations at cell-centers.

get_rank()[source]

Get current parallel processor/rank.

get_refdate()[source]

Get model reference date as a datetime object. Required for now, only really used by DFM.

get_vegetation()[source]

Return stem dens., diam., and height arrays from numerical model.

get_velocity_and_depth()[source]

Return velocity magnitude and depth arrays at cell-centers.

initialize()[source]

Prepare engine to run (allocate memory, read/check inputs, print start, etc.)

is_parallel()[source]

Return True if model is running in parallel based on number of active processors.

static merge_local_to_global(local_data: list[dict[str, ndarray]], f_gids: list[ndarray], f_ids: list[ndarray], n_global: int) dict[str, ndarray][source]

Merge per-processor local arrays into global arrays using local-to-global index mappings.

merge_parallel_veg(OutputManager)[source]

Merge vegetation output files across MPI subdomains into single files.

set_vegetation(stemdensity, stemdiameter, stemheight)[source]

Push vegetation arrays back into the numerical model.

step(seconds)[source]

Advance the hydrodynamic model forward by a given number of seconds.

ANUGA implements this by looping with domain.evolve(), while DFM calls dimr.update().