Skip to content

Commit

Permalink
fix: number of constraints warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jan 19, 2022
1 parent f77f915 commit 9abcc04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def add_vaue_constraints(self, w=1.0):
w=w * points[inside, 4],
name="value",
)
if np.sum(inside)>0:
if np.sum(inside)<=0:
logger.warning(f"{self.propertyname}: {np.sum(~inside)} value constraints not added: outside of model bounding box")
def add_interface_constraints(
self, w=1.0
Expand Down Expand Up @@ -295,7 +295,7 @@ def add_gradient_constraints(self, w=1.0):
self.add_constraints_to_least_squares(
A, B, idc[inside, :], w=w * self.vol, name="gradient"
)
if np.sum(inside)>0:
if np.sum(inside)<=0:
logger.warning(f"{self.propertyname}: {np.sum(~inside)} norm constraints not added: outside of model bounding box")
def add_norm_constraints(self, w=1.0):
"""
Expand Down Expand Up @@ -356,7 +356,7 @@ def add_norm_constraints(self, w=1.0):
w=w * self.vol,
name="norm",
)
if np.sum(inside)>0:
if np.sum(inside)<=0:
logger.warning(f"{self.propertyname}: {np.sum(~inside)} norm constraints not added: outside of model bounding box")

def add_gradient_orthogonal_constraints(self, points, vector, w=1.0, B=0):
Expand Down Expand Up @@ -408,7 +408,7 @@ def add_gradient_orthogonal_constraints(self, points, vector, w=1.0, B=0):
self.add_constraints_to_least_squares(
A, B, idc[inside, :], w=w * self.vol, name="gradient orthogonal"
)
if np.sum(inside)>0:
if np.sum(inside)<=0:
logger.warning(f"{self.propertyname}: {np.sum(~inside)} gradient constraints not added: outside of model bounding box")

def add_regularisation(self, operator, w=0.1):
Expand Down
1 change: 0 additions & 1 deletion LoopStructural/modelling/fault/fault_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def set_mesh_geometry(self, buffer, rotation):
length = np.max(self.maximum - self.origin)
# for builder in self.builders:
# all three coordinates share the same support
print(self.maximum,self.origin)
self.builders[0].set_interpolation_geometry(
self.origin - length * buffer, self.maximum + length * buffer, rotation
)
Expand Down

0 comments on commit 9abcc04

Please sign in to comment.