Skip to content

Commit

Permalink
Merge pull request #132 from PTsolvers/pa-patch
Browse files Browse the repository at this point in the history
dimensionalize vtk files
  • Loading branch information
aelligp authored Apr 12, 2024
2 parents 62d7c2b + 9c7e06a commit 04ac372
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,19 +513,21 @@ function main2D(igg; figdir=figdir, nx=nx, ny=ny, do_vtk=false)
if do_vtk
JustRelax.velocity2vertex!(Vx_v, Vy_v, @velocity(stokes)...)
data_v = (;
T=Array(thermal.T[2:(end - 1), :]),
τxy=Array(stokes.τ.xy),
εxy=Array(stokes.ε.xy),
Vx=Array(Vx_v),
Vy=Array(Vy_v),
T=Array(ustrip.(dimensionalize(thermal.T[2:(end - 1), :], C, CharDim))),
τxy= Array(ustrip.(dimensionalize(stokes.τ.xy, s^-1, CharDim))),
εxy= Array(ustrip.(dimensionalize(stokes.ε.xy, s^-1, CharDim))),
Vx = Array(ustrip.(dimensionalize(Vx_v,cm/yr,CharDim))),
Vy = Array(ustrip.(dimensionalize(Vy_v, cm/yr, CharDim))),
)
data_c = (;
P=Array(stokes.P),
τxx=Array(stokes.τ.xx),
τyy=Array(stokes.τ.yy),
εxx=Array(stokes.ε.xx),
εyy=Array(stokes.ε.yy),
η=Array(η),
P = Array(ustrip.(dimensionalize(stokes.P,MPa,CharDim))),
τxx = Array(ustrip.(dimensionalize(stokes.τ.xx, MPa,CharDim))),
τyy = Array(ustrip.(dimensionalize(stokes.τ.yy,MPa,CharDim))),
τII = Array(ustrip.(dimensionalize(stokes.τ.II, MPa, CharDim))),
εxx = Array(ustrip.(dimensionalize(stokes.ε.xx, s^-1,CharDim))),
εyy = Array(ustrip.(dimensionalize(stokes.ε.yy, s^-1,CharDim))),
εII = Array(ustrip.(dimensionalize(stokes.ε.II, s^-1,CharDim))),
η = Array(ustrip.(dimensionalize(η,Pa*s,CharDim))),
)
save_vtk(
joinpath(vtk_dir, "vtk_" * lpad("$it", 6, "0")),
Expand All @@ -552,7 +554,7 @@ function main2D(igg; figdir=figdir, nx=nx, ny=ny, do_vtk=false)
ax0 = Axis(
fig[1, 1:2];
aspect=ar,
title="t = $(t_dim) Kyrs",
title="t = $(round(ustrip.(t_Kyrs); digits=3)) Kyrs",
titlesize=50,
height=0.0,
)
Expand Down Expand Up @@ -746,7 +748,7 @@ function main2D(igg; figdir=figdir, nx=nx, ny=ny, do_vtk=false)

end

figdir = "NONDIM_Thermal_stresses_around_cooling_magma"
figdir = "Thermal_stresses_around_cooling_magma"
do_vtk = true # set to true to generate VTK files for ParaView
ar = 1 # aspect ratio
n = 128
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,24 +489,24 @@ function main3D(igg; figdir = "output", nx = 64, ny = 64, nz = 64, do_vtk = fals
if do_vtk
JustRelax.velocity2vertex!(Vx_v, Vy_v, Vz_v, @velocity(stokes)...)
data_v = (;
T = Array(thermal.T),
τxy= Array(stokes.τ.xy),
εxy= Array(stokes.ε.xy),
Vx = Array(Vx_v),
Vy = Array(Vy_v),
Vz = Array(Vz_v),
T = Array(ustrip.(dimensionalize(thermal.T, C, CharDim))),
τxy= Array(ustrip.(dimensionalize(stokes.τ.xy, s^-1, CharDim))),
εxy= Array(ustrip.(dimensionalize(stokes.ε.xy, s^-1, CharDim))),
Vx = Array(ustrip.(dimensionalize(Vx_v,cm/yr,CharDim))),
Vy = Array(ustrip.(dimensionalize(Vy_v, cm/yr, CharDim))),
Vz = Array(ustrip.(dimensionalize(Vz_v, cm/yr, CharDim))),
)
data_c = (;
P = Array(stokes.P),
τxx = Array(stokes.τ.xx),
τyy = Array(stokes.τ.yy),
τzz = Array(stokes.τ.zz),
τII = Array(stokes.τ.II),
εxx = Array(stokes.ε.xx),
εyy = Array(stokes.ε.yy),
εzz = Array(stokes.ε.zz),
εII = Array(stokes.ε.II),
η = Array(η),
P = Array(ustrip.(dimensionalize(stokes.P,MPa,CharDim))),
τxx = Array(ustrip.(dimensionalize(stokes.τ.xx, MPa,CharDim))),
τyy = Array(ustrip.(dimensionalize(stokes.τ.yy,MPa,CharDim))),
τzz = Array(ustrip.(dimensionalize(stokes.τ.zz,MPa,CharDim))),
τII = Array(ustrip.(dimensionalize(stokes.τ.II, MPa, CharDim))),
εxx = Array(ustrip.(dimensionalize(stokes.ε.xx, s^-1,CharDim))),
εyy = Array(ustrip.(dimensionalize(stokes.ε.yy, s^-1,CharDim))),
εzz = Array(ustrip.(dimensionalize(stokes.ε.zz, s^-1,CharDim))),
εII = Array(ustrip.(dimensionalize(stokes.ε.II, s^-1,CharDim))),
η = Array(ustrip.(dimensionalize(η,Pa*s,CharDim))),
)
save_vtk(
joinpath(vtk_dir, "vtk_" * lpad("$it", 6, "0")),
Expand Down Expand Up @@ -541,7 +541,7 @@ function main3D(igg; figdir = "output", nx = 64, ny = 64, nz = 64, do_vtk = fals
return nothing
end

figdir = "NONDIM_Thermal_stresses_around_cooling_magma_3D"
figdir = "Thermal_stresses_around_cooling_magma_3D"
do_vtk = true # set to true to generate VTK files for ParaView
ar = 1 # aspect ratio
n = 64
Expand Down

0 comments on commit 04ac372

Please sign in to comment.