
Add protections to an existing model
add_protection.RdThis function adds two types of protections to an existing model (cofferdams and pumps). The model should be correctly loaded, with an existing data_table slot.
Details
Only pump that are located in existing rooms, given by
model[["data_table"]][["room"]][["name"]] are added. If a pump is
located in a non existing room, a warning is sent.
Only cofferdam that are located at existing opnings, given by
model[["data_table"]][["opening"]][["name"]] are added. If a cofferdam is
located at a non existing opning, a warning is sent.
If added, pump and cofferdam are found in model[["data_table"]].
Examples
# no warnings
add_protection(adu_t, cofferdam = c(door1 = 0.3))
add_protection(adu_t, pump = c(room_1 = 10))
add_protection(adu_t, pump = c(room_1 = 10), cofferdam = c(door1 = 0.3))
# warnings, nothing is added
add_protection(adu_t, cofferdam = c(no_door = 0.3), pump = c(no_room = 10))
#> Warning: Some cofferdam (no_door) are not located at existing openings They are removed. Some pumps (no_room) are not located in existing rooms. They are removed.