Skip to content

Commit 57cc7be

Browse files
committed
(FEATURE) adding fault bounding box constraint,
speed up interpolation by reducing uncessarary degrees of freedom
1 parent 88824d5 commit 57cc7be

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ def create_and_add_fault(self,
11391139
interpolator = self.get_interpolator(**kwargs)
11401140
fault_frame_builder = FaultBuilder(interpolator,
11411141
name=fault_surface_data,
1142+
model=self,
11421143
**kwargs)
11431144
# add data
11441145
fault_frame_data = self.data[ self.data['feature_name'] == fault_surface_data].copy()

LoopStructural/modelling/core/geological_model_graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def __init__(self, origin, maximum, rescale=True, nsteps=(40, 40, 40),
148148
self.scale_factor = 1.
149149
self.bounding_box = np.zeros((2, 3))
150150
self.bounding_box[1, :] = self.maximum - self.origin
151-
self.bounding_box[1, :] = self.maximum - self.origin
152151
if rescale:
153152
self.scale_factor = np.max(lengths)
154153
logger.info('Rescaling model using scale factor {}'.format(self.scale_factor))

LoopStructural/modelling/fault/fault_builder.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
class FaultBuilder(StructuralFrameBuilder):
5-
def __init__(self,interpolator=None,interpolators=None,**kwargs):
5+
def __init__(self,interpolator=None,interpolators=None,model=None,fault_bounding_box_buffer=0.2,**kwargs):
66
"""A specialised structural frame builder for building a fault
77
88
Parameters
@@ -11,16 +11,29 @@ def __init__(self,interpolator=None,interpolators=None,**kwargs):
1111
the interpolator to use for building the fault frame, by default None
1212
interpolators : [GeologicalInterpolator, GeologicalInterpolator, GeologicalInterpolator], optional
1313
a list of interpolators to use for building the fault frame, by default None
14+
model : GeologicalModel
15+
reference to the model containing the fault
16+
fault_bounding_box_buffer: float, default 0.2
17+
the maximum area around the model domain that a fault is modelled. For high displacement faults this
18+
may need to be large, smaller values will be result in fewer degrees of freedom = quicker interpolation
1419
"""
1520

1621
StructuralFrameBuilder.__init__(self,interpolator,interpolators,**kwargs)
1722
self.origin = np.array([np.nan,np.nan,np.nan])
1823
self.maximum = np.array([np.nan,np.nan,np.nan])
24+
self.model = model
25+
# define a maximum area to mesh adding buffer to model
26+
buffer = .2
27+
self.minimum_origin = self.model.bounding_box[0,:] - buffer*(self.model.bounding_box[1,:]-self.model.bounding_box[0,:])
28+
self.maximum_maximum = self.model.bounding_box[1,:] + buffer*(self.model.bounding_box[1,:]-self.model.bounding_box[0,:])
1929

2030
def update_geometry(self,points):
31+
2132
self.origin = np.nanmin(np.array([np.min(points,axis=0),self.origin]),axis=0)
2233
self.maximum = np.nanmax(np.array([np.max(points,axis=0),self.maximum]),axis=0)
23-
34+
self.origin[self.origin<self.minimum_origin] = self.minimum_origin[self.origin<self.minimum_origin]
35+
self.maximum[self.maximum>self.maximum_maximum] = self.maximum_maximum[self.maximum>self.maximum_maximum]
36+
2437
def create_data_from_geometry(self,
2538
data,
2639
fault_center,

LoopStructural/visualisation/model_visualisation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,9 @@ def save(self, fname, **kwargs):
883883
"""
884884
self.lv.image(fname, **kwargs)
885885

886+
def export_to_webgl(self,fname, **kwargs ):
887+
888+
self.lv.webgl(fname,**kwargs)
886889
def display(self, fname=None, **kwargs):
887890
"""
888891
Calls the lv object display function. Shows a static image of the viewer inline.

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build:
1515

1616
requirements:
1717
build:
18-
- cython
18+
- Cython
1919
host:
2020
- pip
2121
- python

0 commit comments

Comments
 (0)