Skip to content

Commit 7c20b88

Browse files
committed
fix: default regularisation should be 0.1 for both FDI and PLI.
1 parent de19475 commit 7c20b88

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

LoopStructural/interpolators/_finite_difference_interpolator.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,22 +454,28 @@ def add_gradient_orthogonal_constraints(
454454
)
455455
self.up_to_date = False
456456

457-
def add_regularisation(self, operator, w=0.1):
457+
458+
459+
def assemble_borders(self, operator, w, name='regularisation'):
458460
"""
461+
Adds a constraint to the border of the model to force the value to be equal to the value at the border
459462
460463
Parameters
461464
----------
462-
operator
463-
w
465+
operator : Operator
466+
operator to use for the regularisation
467+
w : double
468+
weight of the regularisation
464469
465470
Returns
466471
-------
467472
468473
"""
469-
self.assemble_inner(operator, w)
470-
# self.assemble_borders()
474+
# First get the global indicies of the pairs of neighbours this should be an
475+
# Nx27 array for 3d and an Nx9 array for 2d
471476

472-
# def assemble_borders(self, operator, w):
477+
global_indexes = self.support.neighbour_global_indexes()
478+
473479

474480
def assemble_inner(self, operator, w, name='regularisation'):
475481
"""

LoopStructural/interpolators/_p1interpolator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def setup_interpolator(self, **kwargs):
146146
self.reset()
147147
for key in kwargs:
148148
if "regularisation" in kwargs:
149-
self.interpolation_weights["cgw"] = 0.1 * kwargs["regularisation"]
149+
self.interpolation_weights["cgw"] = kwargs["regularisation"]
150150
self.up_to_date = False
151151
self.interpolation_weights[key] = kwargs[key]
152152
if self.interpolation_weights["cgw"] > 0.0:

LoopStructural/modelling/features/builders/_geological_feature_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(
8686
self._orthogonal_features = {}
8787
self._equality_constraints = {}
8888
# add default parameters
89-
self.update_build_arguments({'cpw':1.0,'npw':1.0,'regularisation':1.0,'nelements':self.interpolator.n_elements})
89+
self.update_build_arguments({'cpw':1.0,'npw':1.0,'regularisation':.10,'nelements':self.interpolator.n_elements})
9090
def set_not_up_to_date(self, caller):
9191
logger.info(
9292
f"Setting {self.name} to not up to date from an instance of {caller.__class__.__name__}"

0 commit comments

Comments
 (0)