Skip to content

Commit 1e2bb70

Browse files
committed
Pa to MPa conversion fix, fix outline plot, fix BEMEngine.process call
1 parent e671cb0 commit 1e2bb70

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

beat/bem/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def clear_target_cache(self):
139139
self._obs_points = None
140140
self._ncoords_targets = None
141141

142-
def process(self, sources: list, targets: list, debug=False) -> num.ndarray:
142+
def process(self, sources: list, targets: list, debug=False, nthreads=1) -> num.ndarray:
143143
mesh_size = self.config.mesh_size * km
144144

145145
if self.config.check_mesh_intersection:

beat/bem/sources.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -426,21 +426,19 @@ def __init__(self, **kwargs):
426426
EllipseBEMSource.__init__(self, **kwargs)
427427

428428
def outline(self, cs="xy", npoints=50):
429-
return num.flipud(
430-
get_ellipse_points(
431-
self.lon,
432-
self.lat,
433-
self.east_shift,
434-
self.north_shift,
435-
self.a_half_axis,
436-
self.b_half_axis,
437-
self.dip,
438-
self.plunge,
439-
self.strike,
440-
cs=cs,
441-
npoints=npoints,
429+
return get_ellipse_points(
430+
self.lon,
431+
self.lat,
432+
self.east_shift,
433+
self.north_shift,
434+
self.a_half_axis,
435+
self.b_half_axis,
436+
self.dip,
437+
self.plunge,
438+
self.strike,
439+
cs=cs,
440+
npoints=npoints,
442441
)
443-
)
444442

445443
def get_source_surface(self, geom, mesh_size):
446444
self._init_points_geometry(
@@ -948,10 +946,10 @@ def get_ellipse_points(
948946

949947
ring = num.linspace(0, 2 * num.pi, npoints)
950948
ellipse = num.array(
951-
[b_half_axis_rot * num.cos(ring), a_half_axis_rot * num.sin(ring)]
952-
)
949+
[a_half_axis_rot * num.sin(ring), b_half_axis_rot * num.cos(ring)]
950+
) # y, x | lat, lon
953951

954-
strike_rad = -strike * DEG2RAD
952+
strike_rad = -(strike + 90) * DEG2RAD
955953
rot_strike = num.array(
956954
[
957955
[num.cos(strike_rad), -num.sin(strike_rad)],
@@ -961,9 +959,10 @@ def get_ellipse_points(
961959
ellipse_rot = rot_strike.dot(ellipse)
962960

963961
points = num.atleast_2d(num.zeros([npoints, 2]))
964-
points[:, 0] += ellipse_rot[1, :] + north_shift
965-
points[:, 1] += ellipse_rot[0, :] + east_shift
962+
points[:, 0] += ellipse_rot[0, :] + north_shift
963+
points[:, 1] += ellipse_rot[1, :] + east_shift
966964

965+
# breakpoint()
967966
if cs == "xy":
968967
return points
969968
elif cs in ("latlon", "lonlat"):

beat/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
nucleationtypes = {"nucleation_x", "nucleation_y"}
5252
patch_anchor_points = {"center", "bottom_depth", "bottom_left"}
5353

54-
patypes = {"traction", "strike_traction", "dip_traction", "tensile_traction"}
54+
patypes = {"traction", "strike_traction", "dip_traction", "normal_traction"}
5555
kmtypes = set.union(locationtypes, dimensiontypes, patch_anchor_points)
5656
grouped_vars = set.union(kmtypes, mttypes, degtypes, nucleationtypes)
5757

0 commit comments

Comments
 (0)