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:
anuga_domain (anuga.domain) – The pre-constructed computational domain.
vegetation (VegetationSpecies or MultipleVegetationSpecies, optional) – Vegetation object passed down from the base simulation.
Notes
ANUGA runs in many short domain.evolve() loops (see
step()) rather than one long simulation call; theskip_stepmechanism prevents duplicate first timesteps across loops.Parallel execution (if enabled) requires merging local vegetation states after simulation; see
merge_parallel_veg().
Methods
__init__(anuga_domain[, vegetation])check_simulation_inputs(simstate)Perform checks on simulation time inputs.
cleanup()Clean up resources.
Return number of active grid cells in the model.
Return array of bed elevations at cell-centers.
get_rank()Get current parallel processor/rank.
Get model reference date as a datetime object.
Return stem dens., diam., and height arrays from numerical model.
Return velocity magnitude and depth arrays at cell-centers.
Prepare engine to run (allocate memory, read/check inputs, print start, etc.)
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.
- get_refdate()[source]
Get model reference date as a datetime object. Required for now, only really used by DFM.
- 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.