Skip to content

Commit

Permalink
fix: faults were not faulting unconformities
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jul 27, 2022
1 parent b98397b commit ec520fa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
27 changes: 9 additions & 18 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def feature_names(self):
return self.feature_name_index.keys()

def fault_names(self):
pass

return [f.name for f in self.faults]

def check_inialisation(self):
if self.data is None:
Expand Down Expand Up @@ -485,7 +486,8 @@ def _add_feature(self, feature):
f"Adding {feature.name} to model at location {len(self.features)}"
)
self._add_domain_fault_above(feature)
self._add_unconformity_above(feature)
if feature.type == FeatureType.INTERPOLATED:
self._add_unconformity_above(feature)
feature.model = self

def data_for_feature(self, feature_name):
Expand Down Expand Up @@ -882,8 +884,6 @@ def create_and_add_dtm(self, series_surface_data, **kwargs):
series_feature = series_builder.feature
series_builder.build_arguments = kwargs
series_feature.type = "dtm"
# see if any unconformities are above this feature if so add region
# self._add_unconformity_above(series_feature)self._add_feature(series_feature)
self._add_feature(series_feature)
return series_feature

Expand Down Expand Up @@ -921,8 +921,7 @@ def create_and_add_fold_frame(self, foldframe_data, tol=None, **kwargs):
kwargs["tol"] = tol
fold_frame_builder.setup(**kwargs)
fold_frame = fold_frame_builder.frame
# for i in range(3):
# self._add_unconformity_above(fold_frame[i])

fold_frame.type = FeatureType.STRUCTURALFRAME
fold_frame.builder = fold_frame_builder
self._add_feature(fold_frame)
Expand Down Expand Up @@ -983,9 +982,7 @@ def create_and_add_folded_foliation(
series_builder.build_arguments = kwargs
series_feature.type = FeatureType.INTERPOLATED
series_feature.fold = fold
# see if any unconformities are above this feature if so add region
# self._add_unconformity_above(series_feature)self._add_feature(series_feature)
# result['support'] = series_feature.get_interpolator().support

self._add_feature(series_feature)
return series_feature

Expand Down Expand Up @@ -1049,9 +1046,6 @@ def create_and_add_folded_fold_frame(
folded_fold_frame.builder = fold_frame_builder

folded_fold_frame.type = "structuralframe"
# see if any unconformities are above this feature if so add region
# for i in range(3):
# self._add_unconformity_above(fold_frame[i])

self._add_feature(folded_fold_frame)

Expand Down Expand Up @@ -1255,6 +1249,7 @@ def _add_unconformity_above(self, feature):
-------
"""

for f in reversed(self.features):
if f.type == FeatureType.UNCONFORMITY and f.name != feature.name:
feature.add_region(lambda pos: f.evaluate(pos))
Expand Down Expand Up @@ -1330,6 +1325,8 @@ def add_unconformity(
logger.debug(f"Reached unconformity {f.name}")
break
logger.debug(f"Adding {uc_feature.name} as unconformity to {f.name}")
if f.type == FeatureType.FAULT:
continue
f.add_region(lambda pos: ~uc_feature.evaluate(pos))
# now add the unconformity to the feature list
self._add_feature(uc_feature)
Expand Down Expand Up @@ -1362,12 +1359,6 @@ def add_onlap_unconformity(
break
if f != feature:
f.add_region(lambda pos: uc_feature.evaluate(pos))
# for f in self.features:
# f.add_region(lambda pos: uc_feature.evaluate(pos))

# see if any unconformities are above this feature if so add region
# self._add_unconformity_above(uc_feature)
# self._add_unconformity_below(uc_feature) # , uc_feature)
self._add_feature(uc_feature)

return uc_feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BaseFeature:
Base class for geological features.
"""

def __init__(self, name, model, faults, regions, builder):
def __init__(self, name, model=None, faults=[], regions=[], builder=None):
self.name = name
self.type = FeatureType.BASE
self.regions = regions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, name, geological_feature_a, geological_feature_b):
geological_feature_a: first feature
geological_feature_b: second feature
"""
super().__init__(name, None, None, None, None)
super().__init__(name)
self.geological_feature_a = geological_feature_a
self.geological_feature_b = geological_feature_b
self.value_feature = None
Expand Down
3 changes: 2 additions & 1 deletion LoopStructural/modelling/features/_structural_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def model(self, model):
f.model = model

def add_region(self, region):
self.regions.append(region)
for i in range(3):
self.features[i].add_region(region)
self.features[i].regions = self.regions

def get_feature(self, i):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def setup(self, w1=1.0, w2=1.0, w3=1.0, **kwargs):

logger.debug("Creating analytical structural frame coordinate 2")
c3 = CrossProductGeologicalFeature(
self.name + "_2", self._frame[0], self._frame[1]
self.name + "__2", self._frame[0], self._frame[1]
)
self._frame[2] = c3

Expand Down

0 comments on commit ec520fa

Please sign in to comment.