Skip to content

Commit a05d277

Browse files
committed
fix: add fault pitch
1 parent 2b81f6e commit a05d277

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ def create_and_add_fault(
12931293
fault_trace_anisotropy=0.0,
12941294
fault_dip=90,
12951295
fault_dip_anisotropy=0.0,
1296+
fault_pitch=None,
12961297
**kwargs,
12971298
):
12981299
"""
@@ -1393,6 +1394,7 @@ def create_and_add_fault(
13931394
fault_trace_anisotropy=fault_trace_anisotropy,
13941395
fault_dip=fault_dip,
13951396
fault_dip_anisotropy=fault_dip_anisotropy,
1397+
fault_pitch=fault_pitch,
13961398
)
13971399
if "force_mesh_geometry" not in kwargs:
13981400
fault_frame_builder.set_mesh_geometry(kwargs.get("fault_buffer", 0.2), 0)

LoopStructural/modelling/features/builders/_fault_builder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def create_data_from_geometry(
9191
fault_trace_anisotropy=1.0,
9292
fault_dip=90,
9393
fault_dip_anisotropy=1.0,
94+
fault_pitch=None,
9495
):
9596
"""Generate the required data for building a fault frame for a fault with the
9697
specified parameters
@@ -204,13 +205,19 @@ def create_data_from_geometry(
204205
fault_frame_data["coord"] == 1, ~np.isnan(fault_frame_data["gz"])
205206
)
206207
fault_slip_data = fault_frame_data.loc[slip_mask, ["gx", "gy", "gz"]]
208+
207209
if len(fault_slip_data) == 0:
208210
logger.warning(
209211
"There is no slip vector data for the fault, using vertical slip vector\n\
210212
projected onto fault surface estimating from fault normal"
211213
)
212214
strike_vector, dip_vector = get_vectors(fault_normal_vector[None, :])
213215
fault_slip_vector = dip_vector[:, 0]
216+
if fault_pitch is not None:
217+
print('using pitch')
218+
rotm = rotation(fault_normal_vector[None,:],[fault_pitch])
219+
print(rotm.shape,fault_slip_vector.shape)
220+
fault_slip_vector = np.einsum("ijk,k->ij", rotm, fault_slip_vector)[0,:]
214221
logger.info(f"Estimated fault slip vector: {fault_slip_vector}")
215222
else:
216223
fault_slip_vector = fault_slip_data.mean(axis=0).to_numpy()

0 commit comments

Comments
 (0)