Skip to content

Commit

Permalink
Add normal vector for left/right handedness
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Jan 29, 2024
1 parent 3b218e5 commit badf23c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CornerPointGrid/processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ function cpgrid_primitives(coord, zcorn, cartdims; actnum = missing, pinch = mis
end
end
end
# Get a normal vector to estimate the direction of the coordiante system
x1_l, = get_line(coord, 2, 1, nlinex, nliney)
x1_r, = get_line(coord, 1, 2, nlinex, nliney)
coord_normal = cross(x1_l - x1, x1_r - x1)
coord_normal = coord_normal./norm(coord_normal, 2)

return (
lines = lines,
Expand All @@ -249,7 +254,8 @@ function cpgrid_primitives(coord, zcorn, cartdims; actnum = missing, pinch = mis
columns = columns,
active = active_cell_indices,
nodes = nodes,
cartdims = cartdims
cartdims = cartdims,
coord_normal = coord_normal
)
end

Expand Down

0 comments on commit badf23c

Please sign in to comment.