Skip to content

Commit 1ac2be7

Browse files
Use the correct precision for points from input mesh when creating points (#204)
1 parent 54a4046 commit 1ac2be7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

mesh-doctor/src/geos/mesh_doctor/actions/generateFractures.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def __performSplit( oldMesh: vtkUnstructuredGrid, cellToNodeMapping: Mapping[ in
418418
# Creating the new points for the new mesh.
419419
oldPoints: vtkPoints = oldMesh.GetPoints()
420420
newPoints = vtkPoints()
421+
newPoints.SetDataType( oldPoints.GetDataType() ) # Preserve precision from input mesh
421422
newPoints.SetNumberOfPoints( numNewPoints )
422423
collocatedNodes = ones( numNewPoints, dtype=int ) * -1
423424
# Copying old points into the new container.
@@ -528,6 +529,7 @@ def __generateFractureMesh( oldMesh: vtkUnstructuredGrid, fractureInfo: Fracture
528529
fractureNodes: Collection[ int ] = tuple( filter( lambda n: n > -1, fractureNodesTmp ) )
529530
numPoints: int = len( fractureNodes )
530531
points = vtkPoints()
532+
points.SetDataType( meshPoints.GetDataType() ) # Preserve precision from input mesh
531533
points.SetNumberOfPoints( numPoints )
532534
node3dToNode2d: dict[ int, int ] = {} # Building the node mapping, from 3d mesh nodes to 2d fracture nodes.
533535
for i, n in enumerate( fractureNodes ):

0 commit comments

Comments
 (0)