Skip to content

Commit

Permalink
fix: don't add fault above an unconformity!
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed May 12, 2024
1 parent 1692d67 commit a5fc543
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 7 additions & 5 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,7 @@ def _add_faults(self, feature_builder, features=None):
f = self.__getitem__(f)
if f.type == FeatureType.FAULT:
feature_builder.add_fault(f)
# if f.type == 'unconformity':
# break


def _add_domain_fault_above(self, feature):
"""
Expand Down Expand Up @@ -1153,7 +1152,9 @@ def _add_unconformity_above(self, feature):
if f.type == FeatureType.UNCONFORMITY and f.name != feature.name:
logger.info(f"Adding {f.name} as unconformity to {feature.name}")
feature.add_region(f)
# break
if f.type == FeatureType.ONLAPUNCONFORMITY:
feature.add_region(f)
break

def add_unconformity(self, feature: GeologicalFeature, value: float) -> UnconformityFeature:
"""
Expand Down Expand Up @@ -1213,10 +1214,11 @@ def add_onlap_unconformity(self, feature: GeologicalFeature, value: float) -> Ge
"""
feature.regions = []
uc_feature = UnconformityFeature(feature, value, False)
uc_feature = UnconformityFeature(feature, value, False, onlap=True)
feature.add_region(uc_feature.inverse())
for f in reversed(self.features):
if f.type == FeatureType.UNCONFORMITY:
f.add_region(uc_feature)
continue
if f.type == FeatureType.FAULT:
continue
Expand Down Expand Up @@ -1773,5 +1775,5 @@ def get_stratigraphic_surfaces(self, units: List[str] = [], bottoms: bool = True

def get_block_model(self):
grid = self.bounding_box.vtk
grid['id'] = self.evaluate_model(grid.points, scale=False)
grid['id'] = self.evaluate_model(grid.points, scale=True)
return grid, self.stratigraphic_ids()
1 change: 1 addition & 0 deletions LoopStructural/modelling/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class FeatureType(IntEnum):
FAULT = 9
DOMAINFAULT = 10
INACTIVEFAULT = 11
ONLAPUNCONFORMITY = 12


# from .builders._geological_feature_builder import GeologicalFeatureBuilder
Expand Down
11 changes: 8 additions & 3 deletions LoopStructural/modelling/features/_unconformity_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class UnconformityFeature(GeologicalFeature):
""" """

def __init__(self, feature: GeologicalFeature, value: float, sign=True):
def __init__(self, feature: GeologicalFeature, value: float, sign=True, onlap=False):
"""
Parameters
Expand All @@ -27,7 +27,7 @@ def __init__(self, feature: GeologicalFeature, value: float, sign=True):
interpolator=feature.interpolator,
)
self.value = value
self.type = FeatureType.UNCONFORMITY
self.type = FeatureType.UNCONFORMITY if onlap is False else FeatureType.ONLAPUNCONFORMITY
self.sign = sign
self.parent = feature

Expand All @@ -52,7 +52,12 @@ def inverse(self):
UnconformityFeature
_description_
"""
uc = UnconformityFeature(self.parent, self.value, sign=not self.sign)
uc = UnconformityFeature(
self.parent,
self.value,
sign=not self.sign,
onlap=self.type == FeatureType.ONLAPUNCONFORMITY,
)
uc.name = self.name + "_inverse"
return uc

Expand Down

0 comments on commit a5fc543

Please sign in to comment.