Skip to content

Commit e5b8839

Browse files
committed
add swap_yz_dims (useful for pTatin)
1 parent 42ff61d commit e5b8839

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/pTatin_IO.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# We follow the python routines given here https://github.com/hpc4geo/gmsh_to_point_cloud, written by Dave May
44

55
import Base: show, size
6-
export write_pTatin_mesh
6+
export write_pTatin_mesh, swap_yz_dims
77

88

99
"""
@@ -154,3 +154,14 @@ function _write_field_file(fname::String, field, len, dtype_map)
154154

155155
return nothing
156156
end
157+
158+
"""
159+
fe_swap = swap_yz_dims(fe_data::FEData)
160+
161+
This swaps the `y` and `z` dimensions of the FEData object, which is useful for pTatin as it uses `y` for what is `z` in GMG.
162+
"""
163+
function swap_yz_dims(fe_data::FEData)
164+
vertices = copy(fe_data.vertices)
165+
return FEData(vertices[[1,3,2],:], fe_data.connectivity, fe_data.fields, fe_data.cellfields)
166+
end
167+

0 commit comments

Comments
 (0)