mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix incorrect setting of num buckets
This commit is contained in:
@@ -165,10 +165,9 @@ void RivPolylineIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray*
|
||||
std::vector<cvf::uint> polygonToCellIndexMap = {};
|
||||
|
||||
// Welder for segment vertices
|
||||
// - Number of buckets is size of columnCellCandidates divided by 8 to avoid too many buckets (Random selected value).
|
||||
// Usage of columnCellCandidates is to get a dynamic number of buckets usable for respective segment.
|
||||
const cvf::uint numWelderBuckets = static_cast<cvf::uint>( columnCellCandidates.size() / size_t( 8 ) );
|
||||
// - Number of buckets is size of columnCellCandidates to get a dynamic number of buckets usable for respective segment.
|
||||
cvf::VertexWelder segmentVertexWelder;
|
||||
const cvf::uint numWelderBuckets = std::max( static_cast<cvf::uint>( columnCellCandidates.size() ), cvf::uint( 1 ) );
|
||||
segmentVertexWelder.initialize( weldingDistance, weldingCellSize, numWelderBuckets );
|
||||
|
||||
// Intersection per grid cell - transform from set of triangles to polygon for cell
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,8 @@ from rips.generated.GridGeometryExtraction_pb2 import *
|
||||
# from ..generated.GridGeometryExtraction_pb2_grpc import *
|
||||
# from ..generated.GridGeometryExtraction_pb2 import *
|
||||
|
||||
from drogon_grid_well_path_polyline_xy_utm import drogon_well_path_polyline_xy_utm
|
||||
|
||||
rips_instance = Instance.find()
|
||||
grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel)
|
||||
|
||||
@@ -17,6 +19,7 @@ grid_file_name = "MOCKED_TEST_GRID"
|
||||
grid_file_name = (
|
||||
"D:/Git/resinsight-tutorials/model-data/norne/NORNE_ATW2013_RFTPLT_V2.EGRID"
|
||||
)
|
||||
grid_file_name = "D:/ResInsight/GRID__DROGON_13M.roff"
|
||||
|
||||
# Test polylines
|
||||
mocked_model_fence_poly_line_utm_xy = [
|
||||
@@ -235,4 +238,7 @@ print(f"Total time elapsed: {total_time_elapsed} ms")
|
||||
for message, time_elapsed in named_events_and_time_elapsed.items():
|
||||
print(f"{message}: {time_elapsed}")
|
||||
|
||||
print(f"Expected number of segments: {len(fence_poly_line_utm_xy) / 2 - 1}")
|
||||
print(f"Number of segments: {len(fence_mesh_sections)}")
|
||||
|
||||
fig.show()
|
||||
|
||||
@@ -13,11 +13,12 @@ from rips.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 = (
|
||||
# "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"
|
||||
grid_file_name = "D:/ResInsight/GRID__DROGON_13M.roff"
|
||||
|
||||
ijk_index_filter = GridGeometryExtraction__pb2.IJKIndexFilter(
|
||||
iMin=15, iMax=30, jMin=30, jMax=90, kMin=1, kMax=12
|
||||
|
||||
@@ -429,7 +429,7 @@ std::vector<cvf::uint> RiaGrpcGridGeometryExtractionService::initAndWeldVertices
|
||||
const cvf::Vec3fArray& vertices ) const
|
||||
{
|
||||
// Initialize welder
|
||||
const cvf::uint numBuckets = static_cast<cvf::uint>( vertices.size() );
|
||||
const cvf::uint numBuckets = std::max( static_cast<cvf::uint>( vertices.size() ), cvf::uint( 1 ) );
|
||||
rWelder.initialize( m_weldingDistance, m_weldingCellSize, numBuckets );
|
||||
|
||||
// Weld vertices
|
||||
|
||||
Reference in New Issue
Block a user