Skip to content

Commit

Permalink
fix: 🐛 fault geometry weren't being set if they were calculated from …
Browse files Browse the repository at this point in the history
…the fault trace
  • Loading branch information
Lachlan Grose committed Apr 12, 2022
1 parent ebd12ff commit ddec5cb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions LoopStructural/modelling/fault/fault_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ def create_data_from_geometry(
"""
self.fault_normal_vector = normal_vector
self.fault_slip_vector = slip_vector
self.fault_minor_axis = minor_axis
self.fault_major_axis = major_axis
self.fault_intermediate_axis = intermediate_axis

self.fault_centre = fault_center
if major_axis is None:
fault_trace = data.loc[
Expand All @@ -134,6 +132,9 @@ def create_data_from_geometry(
minor_axis = major_axis / 2.0
if intermediate_axis is None:
intermediate_axis = major_axis
self.fault_minor_axis = minor_axis
self.fault_major_axis = major_axis
self.fault_intermediate_axis = intermediate_axis
normal_vector /= np.linalg.norm(normal_vector)
slip_vector /= np.linalg.norm(slip_vector)
# check if slip vector is inside fault plane, if not project onto fault plane
Expand Down Expand Up @@ -183,7 +184,10 @@ def create_data_from_geometry(
data.loc[mask, ["gx", "gy", "gz"]] = data.loc[
mask, ["nx", "ny", "nz"]
]

data.loc[mask, ["nx", "ny", "nz"]] = np.nan
mask = np.logical_and(data["coord"] == 0, ~np.isnan(data["gx"]))
data.loc[mask, ["gx", "gy", "gz"]] /= minor_axis * 0.5
if points == False:
logger.warning(
"Rescaling fault norm constraint length for fault frame"
Expand Down Expand Up @@ -330,7 +334,8 @@ def splayregion(xyz):
)
return mask

self.builders[0].add_equality_constraints(splay, splayregion)
scalefactor = splay.fault_major_axis / self.fault_major_axis
self.builders[0].add_equality_constraints(splay, splayregion, scalefactor)
return splayregion

def update(self):
Expand Down

0 comments on commit ddec5cb

Please sign in to comment.