-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split generation of surface vertices and fault vertices for getGirdSu…
…rface
- Loading branch information
1 parent
4df9eab
commit 985e2e2
Showing
12 changed files
with
291 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...thon/rips/WebvizPythonExamples/grid_geometry_extraction_get_grid_surface POLYGON_COUNT.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import numpy as np | ||
|
||
import plotly.graph_objects as go | ||
|
||
from rips.instance import * | ||
from rips.generated.GridGeometryExtraction_pb2_grpc import * | ||
from rips.generated.GridGeometryExtraction_pb2 import * | ||
|
||
# from ..instance import * | ||
# from ..generated.GridGeometryExtraction_pb2_grpc import * | ||
# from ..generated.GridGeometryExtraction_pb2 import * | ||
|
||
rips_instance = Instance.find() | ||
grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel) | ||
|
||
grid_file_name = ( | ||
"D:/Git/resinsight-tutorials/model-data/norne/NORNE_ATW2013_RFTPLT_V2.EGRID" | ||
) | ||
# grid_file_name = "MOCKED_TEST_GRID" | ||
# grid_file_name = "D:/ResInsight/GRID__SNORRE_BASECASEGRID.roff" | ||
|
||
ijk_index_filter = GridGeometryExtraction__pb2.IJKIndexFilter( | ||
iMin=-1, iMax=-1, jMin=-1, jMax=-1, kMin=1, kMax=12 | ||
) | ||
ijk_index_filter = None | ||
|
||
get_grid_surface_request = GridGeometryExtraction__pb2.GetGridSurfaceRequest( | ||
gridFilename=grid_file_name, | ||
ijkIndexFilter=ijk_index_filter, | ||
cellIndexFilter=None, | ||
propertyFilter=None, | ||
) | ||
get_grid_surface_response: GridGeometryExtraction__pb2.GetGridSurfaceResponse = ( | ||
grid_geometry_extraction_stub.GetGridSurface(get_grid_surface_request) | ||
) | ||
|
||
total_time_elapsed = get_grid_surface_response.timeElapsedInfo.totalTimeElapsedMs | ||
named_events_and_time_elapsed = ( | ||
get_grid_surface_response.timeElapsedInfo.namedEventsAndTimeElapsedMs | ||
) | ||
|
||
vertex_array = get_grid_surface_response.vertexArray | ||
quad_indices_array = get_grid_surface_response.quadIndicesArr | ||
origin_utm_xy = get_grid_surface_response.originUtmXy | ||
source_cell_indices_arr = get_grid_surface_response.sourceCellIndicesArr | ||
grid_dimensions = get_grid_surface_response.gridDimensions | ||
|
||
num_vertex_coords = 3 # [x, y, z] | ||
num_vertices_per_quad = 4 # [v1, v2, v3, v4] | ||
num_quads = len(vertex_array) / (num_vertex_coords * num_vertices_per_quad) | ||
|
||
|
||
print(f"Number of quads: {num_quads}") | ||
print(f"Source cell indices array length: {len(source_cell_indices_arr)}") | ||
print(f"Origin UTM coordinates [x, y]: [{origin_utm_xy.x}, {origin_utm_xy.y}]") | ||
print( | ||
f"Grid dimensions [I, J, K]: [{grid_dimensions.i}, {grid_dimensions.j}, {grid_dimensions.k}]" | ||
) | ||
print(f"Total time elapsed: {total_time_elapsed} ms") | ||
# print(f"Time elapsed per event [ms]: {named_events_and_time_elapsed}") | ||
for message, time_elapsed in named_events_and_time_elapsed.items(): | ||
print(f"{message}: {time_elapsed}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.