generated from ucgmsim/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, we use this algorithm to determine the segment delays in a multi-segment/multi-fault rupture:
- Identify the nearest points between two faults,
- Calculate the distance
$x$ in km between these two points, - Calculate the delay as
$x/3.5$ , - Add this delay to all of the points in fault b.
Conceptually:
Trouble is, this is not very configurable. If, for example, you wished to randomise the delay on segments you cannot. If you wanted to adjust the jump velocity you cannot. We should update the workflow so that delays can be tweaked per segment and the jump velocity can be modified. For now just implement the per-segment rupture delays.
Steps to complete this task
- Update the
schemas.pyfile and therealisations.pysomething like so:
# realisations.py
@dataclasses.dataclass
class RupturePropagationConfig(RealisationConfiguration):
"""Configuration for rupture propagation."""
_config_key: ClassVar[str] = "rupture_propagation"
_schema: ClassVar[Schema] = schemas.RUPTURE_PROPAGATION_SCHEMA
# TODO: add `delays` dictionary here
# delays: dict[str, float]
# A dict where the keys are fault names and the values are segment delay offsets.
rupture_causality_tree: dict[str, str | None]
"""A dict where the keys are faults and the values the parent fault (i.e. if fault a triggers fault b then rupture_causality_tree[fault b] = fault a)."""
jump_points: dict[str, JumpPair]
"""A map from faults to pairs of fault-local coordinates representing jump points. If the rupture jumps from fault a at point a to point b on fault b then jump_points[fault a] = JumpPoint(point b, point a)."""
hypocentre: npt.NDArray[np.float64]
"""The hypocentre of the fault."""# schemas.py
RUPTURE_PROPAGATION_SCHEMA = Schema(
{
Literal(
"hypocentre",
description="The hypocentre coordinates (or initial rupture point if not the initial fault)",
): FAULT_LOCAL_COORDINATES_SCHEMA,
# TODO: add delays dictionary here
# Literal("delays", description="The fault propagation tree"): {
# str: NUMBER
# },
Literal("jump_points", description="The jump points for the rupture"): Or(
{
str: And(
{
"from_point": FAULT_LOCAL_COORDINATES_SCHEMA,
"to_point": FAULT_LOCAL_COORDINATES_SCHEMA,
},
Use(lambda pts: rupture_propagation.JumpPair(**pts)),
)
},
{},
),
Literal("rupture_causality_tree", description="The fault propagation tree"): {
str: Or(str, None)
},
}
)- Update
realisation_to_srf.pyto use this new dictionary.
# In realisation_to_srf.py
time_delay = compute_rupture_delay(
tinit, parent_coordinates, child_coordinates
) # + rupture_propagation.delays.get(fault_name, 0.0)- Re-run the tests and make the necessary updates to get them to pass again.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels