resqpy 4.5.0__py3-none-any.whl → 4.6.3__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- resqpy/__init__.py +1 -1
- resqpy/grid/_defined_geometry.py +15 -9
- resqpy/grid_surface/__init__.py +61 -40
- resqpy/grid_surface/_find_faces.py +351 -243
- resqpy/grid_surface/grid_surface_cuda.py +172 -125
- resqpy/lines/_common.py +10 -7
- resqpy/lines/_polyline.py +20 -0
- resqpy/lines/_polyline_set.py +64 -34
- resqpy/model/_hdf5.py +17 -7
- resqpy/model/_model.py +2 -1
- resqpy/model/_xml.py +4 -4
- resqpy/multi_processing/_multiprocessing.py +1 -0
- resqpy/multi_processing/wrappers/grid_surface_mp.py +12 -3
- resqpy/olio/intersection.py +2 -3
- resqpy/olio/read_nexus_fault.py +71 -67
- resqpy/olio/triangulation.py +66 -22
- resqpy/olio/vector_utilities.py +175 -71
- resqpy/olio/wellspec_keywords.py +5 -4
- resqpy/olio/write_hdf5.py +16 -8
- resqpy/olio/xml_et.py +3 -3
- resqpy/property/_collection_get_attributes.py +11 -5
- resqpy/property/_property.py +16 -5
- resqpy/property/property_collection.py +36 -11
- resqpy/surface/__init__.py +2 -2
- resqpy/surface/_surface.py +69 -6
- resqpy/time_series/__init__.py +3 -2
- resqpy/time_series/_time_series.py +10 -0
- {resqpy-4.5.0.dist-info → resqpy-4.6.3.dist-info}/METADATA +3 -3
- {resqpy-4.5.0.dist-info → resqpy-4.6.3.dist-info}/RECORD +31 -31
- {resqpy-4.5.0.dist-info → resqpy-4.6.3.dist-info}/WHEEL +1 -1
- {resqpy-4.5.0.dist-info → resqpy-4.6.3.dist-info}/LICENSE +0 -0
resqpy/__init__.py
CHANGED
resqpy/grid/_defined_geometry.py
CHANGED
@@ -60,12 +60,14 @@ def cell_geometry_is_defined(grid, cell_kji0 = None, cell_geometry_is_defined_ro
|
|
60
60
|
object = grid,
|
61
61
|
array_attribute = 'array_cell_geometry_is_defined',
|
62
62
|
dtype = 'bool')
|
63
|
-
if grid.geometry_defined_for_all_cells_cached is None and cache_array and
|
64
|
-
grid, 'array_cell_geometry_is_defined'):
|
65
|
-
grid.geometry_defined_for_all_cells_cached =
|
66
|
-
grid.array_cell_geometry_is_defined) == grid.array_cell_geometry_is_defined.size)
|
63
|
+
if (grid.geometry_defined_for_all_cells_cached is None and (cache_array or cell_kji0 is None) and
|
64
|
+
hasattr(grid, 'array_cell_geometry_is_defined')):
|
65
|
+
grid.geometry_defined_for_all_cells_cached = \
|
66
|
+
(np.count_nonzero(grid.array_cell_geometry_is_defined) == grid.array_cell_geometry_is_defined.size)
|
67
67
|
if grid.geometry_defined_for_all_cells_cached:
|
68
68
|
delattr(grid, 'array_cell_geometry_is_defined')
|
69
|
+
if cell_kji0 is None:
|
70
|
+
return grid.geometry_defined_for_all_cells_cached
|
69
71
|
return result
|
70
72
|
|
71
73
|
|
@@ -291,7 +293,7 @@ def set_geometry_is_defined(grid,
|
|
291
293
|
|
292
294
|
assert not np.all(nan_mask), 'grid does not have any geometry defined'
|
293
295
|
|
294
|
-
points[
|
296
|
+
points[np.where(np.repeat(np.expand_dims(nan_mask, axis = nan_mask.ndim), 3, axis = -1))] = np.NaN
|
295
297
|
|
296
298
|
surround_z = grid.xyz_box(lazy = False)[1 if grid.z_inc_down() else 0, 2]
|
297
299
|
|
@@ -307,11 +309,12 @@ def set_geometry_is_defined(grid,
|
|
307
309
|
|
308
310
|
grid.geometry_defined_for_all_cells_cached = False
|
309
311
|
|
310
|
-
primary_nan_mask =
|
311
|
-
|
312
|
-
|
312
|
+
primary_nan_mask = nan_mask.reshape((grid.nk_plus_k_gaps + 1, -1))[:, :primary_count].reshape(
|
313
|
+
(grid.nk_plus_k_gaps + 1, grid.nj + 1, grid.ni + 1))
|
314
|
+
|
313
315
|
column_nan_mask = np.logical_or(np.logical_or(primary_nan_mask[:, :-1, :-1], primary_nan_mask[:, :-1, 1:]),
|
314
316
|
np.logical_or(primary_nan_mask[:, 1:, :-1], primary_nan_mask[:, 1:, 1:]))
|
317
|
+
|
315
318
|
if grid.k_gaps:
|
316
319
|
grid.array_cell_geometry_is_defined = np.logical_not(
|
317
320
|
np.logical_or(column_nan_mask[grid.k_raw_index_array], column_nan_mask[grid.k_raw_index_array + 1]))
|
@@ -333,6 +336,7 @@ def set_geometry_is_defined(grid,
|
|
333
336
|
partial_pillar_mask = np.logical_and(pillar_defined_mask, np.any(nan_mask, axis = 0).flatten())
|
334
337
|
if np.any(partial_pillar_mask):
|
335
338
|
points.reshape((grid.nk_plus_k_gaps + 1, -1, 3))[:, partial_pillar_mask, :] = np.NaN
|
339
|
+
grid.geometry_defined_for_all_pillars_cached = False
|
336
340
|
cells_update_needed = True
|
337
341
|
elif complete_partial_pillars:
|
338
342
|
partial_pillar_mask = np.logical_and(pillar_defined_mask, np.any(nan_mask, axis = 0).flatten())
|
@@ -356,7 +360,9 @@ def set_geometry_is_defined(grid,
|
|
356
360
|
(grid.nj + 1, grid.ni + 1)))
|
357
361
|
column_nan_mask = np.logical_or(np.logical_or(top_nan_mask[:-1, :-1], top_nan_mask[:-1, 1:]),
|
358
362
|
np.logical_or(top_nan_mask[1:, :-1], top_nan_mask[1:, 1:]))
|
359
|
-
grid.array_cell_geometry_is_defined = np.repeat(np.expand_dims(column_nan_mask, 0),
|
363
|
+
grid.array_cell_geometry_is_defined = np.repeat(np.logical_not(np.expand_dims(column_nan_mask, 0)),
|
364
|
+
grid.nk,
|
365
|
+
axis = 0)
|
360
366
|
grid.geometry_defined_for_all_cells_cached = np.all(grid.array_cell_geometry_is_defined)
|
361
367
|
if grid.geometry_defined_for_all_cells_cached:
|
362
368
|
del grid.array_cell_geometry_is_defined
|
resqpy/grid_surface/__init__.py
CHANGED
@@ -1,49 +1,70 @@
|
|
1
1
|
"""Classes for RESQML objects related to surfaces."""
|
2
2
|
|
3
3
|
__all__ = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
"GridSkin",
|
5
|
+
"generate_untorn_surface_for_layer_interface",
|
6
|
+
"generate_torn_surface_for_layer_interface",
|
7
|
+
"generate_torn_surface_for_x_section",
|
8
|
+
"generate_untorn_surface_for_x_section",
|
9
|
+
"point_is_within_cell",
|
10
|
+
"create_column_face_mesh_and_surface",
|
11
|
+
"find_intersections_of_trajectory_with_surface",
|
12
|
+
"find_intersections_of_trajectory_with_layer_interface",
|
13
|
+
"find_first_intersection_of_trajectory_with_surface",
|
14
|
+
"find_first_intersection_of_trajectory_with_layer_interface",
|
15
|
+
"find_first_intersection_of_trajectory_with_cell_surface",
|
16
|
+
"find_intersection_of_trajectory_interval_with_column_face",
|
17
|
+
"trajectory_grid_overlap",
|
18
|
+
"populate_blocked_well_from_trajectory",
|
19
|
+
"generate_surface_for_blocked_well_cells",
|
20
|
+
"find_faces_to_represent_surface_staffa",
|
21
|
+
"find_faces_to_represent_surface_regular",
|
22
|
+
"find_faces_to_represent_surface_regular_optimised",
|
23
|
+
"find_faces_to_represent_surface",
|
24
|
+
"bisector_from_faces",
|
25
|
+
"column_bisector_from_faces",
|
26
|
+
"shadow_from_faces",
|
27
|
+
"get_boundary",
|
28
|
+
"_where_true",
|
29
|
+
"_first_true",
|
30
|
+
"intersect_numba",
|
15
31
|
]
|
16
32
|
|
17
33
|
from ._grid_skin import GridSkin
|
18
|
-
from ._grid_surface import
|
19
|
-
generate_untorn_surface_for_layer_interface,
|
20
|
-
generate_torn_surface_for_layer_interface,
|
21
|
-
generate_torn_surface_for_x_section,
|
22
|
-
generate_untorn_surface_for_x_section,
|
23
|
-
point_is_within_cell,
|
24
|
-
create_column_face_mesh_and_surface
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
from ._grid_surface import (
|
35
|
+
generate_untorn_surface_for_layer_interface,
|
36
|
+
generate_torn_surface_for_layer_interface,
|
37
|
+
generate_torn_surface_for_x_section,
|
38
|
+
generate_untorn_surface_for_x_section,
|
39
|
+
point_is_within_cell,
|
40
|
+
create_column_face_mesh_and_surface,
|
41
|
+
)
|
42
|
+
from ._trajectory_intersects import (
|
43
|
+
find_intersections_of_trajectory_with_surface,
|
44
|
+
find_intersections_of_trajectory_with_layer_interface,
|
45
|
+
find_first_intersection_of_trajectory_with_surface,
|
46
|
+
find_first_intersection_of_trajectory_with_layer_interface,
|
47
|
+
find_first_intersection_of_trajectory_with_cell_surface,
|
48
|
+
find_intersection_of_trajectory_interval_with_column_face,
|
49
|
+
trajectory_grid_overlap,
|
50
|
+
)
|
51
|
+
from ._blocked_well_populate import (
|
52
|
+
populate_blocked_well_from_trajectory,
|
53
|
+
generate_surface_for_blocked_well_cells,
|
54
|
+
)
|
55
|
+
from ._find_faces import (
|
56
|
+
find_faces_to_represent_surface_staffa,
|
57
|
+
find_faces_to_represent_surface_regular,
|
58
|
+
find_faces_to_represent_surface_regular_optimised,
|
59
|
+
find_faces_to_represent_surface,
|
60
|
+
bisector_from_faces,
|
61
|
+
column_bisector_from_faces,
|
62
|
+
shadow_from_faces,
|
63
|
+
get_boundary,
|
64
|
+
_where_true,
|
65
|
+
_first_true,
|
66
|
+
intersect_numba,
|
67
|
+
)
|
47
68
|
|
48
69
|
# Set "module" attribute of all public objects to this path.
|
49
70
|
for _name in __all__:
|