Skip to content

Commit 7a7e9ba

Browse files
committed
fix: set min number of elements to 3
1 parent e35003c commit 7a7e9ba

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

LoopStructural/interpolators/_builders.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def get_interpolator(
4848
axis_labels = ["x", "y", "z"]
4949
for i in range(3):
5050
if nsteps[i] < 3:
51+
nsteps[i] = 3
5152
logger.error(
5253
f"Number of steps in direction {axis_labels[i]} is too small, try increasing nelements"
5354
)
@@ -87,13 +88,14 @@ def get_interpolator(
8788
axis_labels = ["x", "y", "z"]
8889
for i in range(3):
8990
if nsteps[i] < 3:
90-
logger.error(
91-
f"Number of steps in direction {axis_labels[i]} is too small, try increasing nelements"
92-
)
93-
raise ValueError("Number of steps too small cannot create interpolator")
91+
nsteps[i] = 3
92+
# logger.error(
93+
# f"Number of steps in direction {axis_labels[i]} is too small, try increasing nelements"
94+
# )
95+
# raise ValueError("Number of steps too small cannot create interpolator")
9496
# create a structured grid using the origin and number of steps
95-
else:
96-
grid = StructuredGrid(origin=origin, nsteps=nsteps, step_vector=step_vector)
97+
98+
grid = StructuredGrid(origin=origin, nsteps=nsteps, step_vector=step_vector)
9799
logger.info(
98100
f"Creating regular grid with {grid.n_elements} elements \n"
99101
"for modelling using FDI"

0 commit comments

Comments
 (0)