Skip to content

Rupture propagation delay as parameters #97

@lispandfound

Description

@lispandfound

Currently, we use this algorithm to determine the segment delays in a multi-segment/multi-fault rupture:

  1. Identify the nearest points between two faults,
  2. Calculate the distance $x$ in km between these two points,
  3. Calculate the delay as $x/3.5$,
  4. Add this delay to all of the points in fault b.

Conceptually:

Image

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

  1. Update the schemas.py file and the realisations.py something 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)
        },
    }
)
  1. Update realisation_to_srf.py to 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)
  1. Re-run the tests and make the necessary updates to get them to pass again.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions