diff --git a/notebooks/sz_geometry.ipynb b/notebooks/sz_geometry.ipynb index 665fa23..e92f586 100644 --- a/notebooks/sz_geometry.ipynb +++ b/notebooks/sz_geometry.ipynb @@ -459,6 +459,8 @@ "source": [ "if __name__ == \"__main__\":\n", " plotter_mesh = utils.plot_mesh(mesh, tags=cell_tags, gather=True, show_edges=True, line_width=1)\n", + " utils.plot_geometry(geom, plotter=plotter_mesh, color='green', width=2)\n", + " utils.plot_couplingdepth(slab, plotter=plotter_mesh, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_mesh)\n", " utils.plot_save(plotter_mesh, output_folder / \"sz_geometry_benchmark_mesh.png\")" ] @@ -591,6 +593,8 @@ "source": [ "if __name__ == \"__main__\":\n", " plotter_mesh_ak = utils.plot_mesh(mesh_ak, tags=cell_tags_ak, gather=True, show_edges=True, line_width=1)\n", + " utils.plot_geometry(geom_ak, plotter=plotter_mesh_ak, color='green', width=2)\n", + " utils.plot_couplingdepth(slab_ak, plotter=plotter_mesh_ak, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_mesh_ak)\n", " utils.plot_save(plotter_mesh_ak, output_folder / \"sz_geometry_ak_mesh.png\")" ] @@ -716,6 +720,8 @@ "source": [ "if __name__ == \"__main__\":\n", " plotter_mesh_ant = utils.plot_mesh(mesh_ant, tags=cell_tags_ant, gather=True, show_edges=True, line_width=1)\n", + " utils.plot_geometry(geom_ant, plotter=plotter_mesh_ant, color='green', width=2)\n", + " utils.plot_couplingdepth(slab_ant, plotter=plotter_mesh_ant, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_mesh_ant)\n", " utils.plot_save(plotter_mesh_ant, output_folder / \"sz_geometry_ant_mesh.png\")" ] diff --git a/notebooks/sz_geometry.py b/notebooks/sz_geometry.py index a46406d..5fa4368 100644 --- a/notebooks/sz_geometry.py +++ b/notebooks/sz_geometry.py @@ -306,6 +306,8 @@ def create_sz_geometry(slab, resscale, sztype, io_depth, extra_width, if __name__ == "__main__": plotter_mesh = utils.plot_mesh(mesh, tags=cell_tags, gather=True, show_edges=True, line_width=1) + utils.plot_geometry(geom, plotter=plotter_mesh, color='green', width=2) + utils.plot_couplingdepth(slab, plotter=plotter_mesh, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_mesh) utils.plot_save(plotter_mesh, output_folder / "sz_geometry_benchmark_mesh.png") @@ -376,6 +378,8 @@ def create_sz_geometry(slab, resscale, sztype, io_depth, extra_width, if __name__ == "__main__": plotter_mesh_ak = utils.plot_mesh(mesh_ak, tags=cell_tags_ak, gather=True, show_edges=True, line_width=1) + utils.plot_geometry(geom_ak, plotter=plotter_mesh_ak, color='green', width=2) + utils.plot_couplingdepth(slab_ak, plotter=plotter_mesh_ak, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_mesh_ak) utils.plot_save(plotter_mesh_ak, output_folder / "sz_geometry_ak_mesh.png") @@ -443,6 +447,8 @@ def create_sz_geometry(slab, resscale, sztype, io_depth, extra_width, if __name__ == "__main__": plotter_mesh_ant = utils.plot_mesh(mesh_ant, tags=cell_tags_ant, gather=True, show_edges=True, line_width=1) + utils.plot_geometry(geom_ant, plotter=plotter_mesh_ant, color='green', width=2) + utils.plot_couplingdepth(slab_ant, plotter=plotter_mesh_ant, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_mesh_ant) utils.plot_save(plotter_mesh_ant, output_folder / "sz_geometry_ant_mesh.png") diff --git a/notebooks/sz_problem.ipynb b/notebooks/sz_problem.ipynb index 2672027..ae686ec 100644 --- a/notebooks/sz_problem.ipynb +++ b/notebooks/sz_problem.ipynb @@ -836,6 +836,8 @@ " self.update_T_functions()\n", "\n", " # just set the boundary conditions on the boundaries for the velocities\n", + " self.wedge_vpw_i.x.array[:] = 0.0\n", + " self.slab_vps_i.x.array[:] = 0.0\n", " df.fem.set_bc(self.wedge_vpw_i.x.array, self.bcs_vpw)\n", " df.fem.set_bc(self.slab_vps_i.x.array, self.bcs_vps)\n", " # and update the interpolated v functions for consistency\n", @@ -1128,8 +1130,10 @@ "outputs": [], "source": [ "if __name__ == \"__main__\":\n", - " plotter_ic = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'})\n", + " plotter_ic = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", " utils.plot_vector_glyphs(sz_case1.vw_i, plotter=plotter_ic, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0))\n", + " utils.plot_geometry(sz_case1.geom, plotter=plotter_ic, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case1.geom.slab_spline, plotter=plotter_ic, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_ic)\n", " utils.plot_save(plotter_ic, output_folder / \"sz_problem_case1_ics.png\")" ] @@ -1614,9 +1618,11 @@ "outputs": [], "source": [ "if __name__ == \"__main__\":\n", - " plotter_iso = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'})\n", + " plotter_iso = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", " utils.plot_vector_glyphs(sz_case1.vw_i, plotter=plotter_iso, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0))\n", " utils.plot_vector_glyphs(sz_case1.vs_i, plotter=plotter_iso, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0))\n", + " utils.plot_geometry(sz_case1.geom, plotter=plotter_iso, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case1.geom.slab_spline, plotter=plotter_iso, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_iso)\n", " utils.plot_save(plotter_iso, output_folder / \"sz_problem_case1_solution.png\")" ] @@ -2071,9 +2077,11 @@ "outputs": [], "source": [ "if __name__ == \"__main__\":\n", - " plotter_dis = utils.plot_scalar(sz_case2.T_i, scale=sz_case2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'})\n", + " plotter_dis = utils.plot_scalar(sz_case2.T_i, scale=sz_case2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", " utils.plot_vector_glyphs(sz_case2.vw_i, plotter=plotter_dis, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2.v0))\n", " utils.plot_vector_glyphs(sz_case2.vs_i, plotter=plotter_dis, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2.v0))\n", + " utils.plot_geometry(sz_case2.geom, plotter=plotter_dis, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case2.geom.slab_spline, plotter=plotter_dis, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_dis)\n", " utils.plot_save(plotter_dis, output_folder / \"sz_problem_case2_solution.png\")" ] @@ -2122,7 +2130,9 @@ "source": [ "if __name__ == \"__main__\":\n", " eta_i = sz_case2.project_dislocationcreep_viscosity()\n", - " plotter_eta = utils.plot_scalar(eta_i, scale=sz_case2.eta0, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa) [log scale]'})\n", + " plotter_eta = utils.plot_scalar(eta_i, scale=sz_case2.eta0, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa) [log scale]', 'bold':True})\n", + " utils.plot_geometry(sz_case2.geom, plotter=plotter_eta, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case2.geom.slab_spline, plotter=plotter_eta, render_points_as_spheres=True, point_size=10.0, color='green')\n", " utils.plot_show(plotter_eta)\n", " utils.plot_save(plotter_eta, output_folder / \"sz_problem_case2_eta.png\")" ] @@ -2243,7 +2253,7 @@ "outputs": [], "source": [ "class SubductionProblem(SubductionProblem):\n", - " def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_options=None):\n", + " def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_options=None, plotter=None):\n", " \"\"\"\n", " Solve the coupled temperature-velocity-pressure problem assuming an isoviscous rheology with time dependency\n", "\n", @@ -2268,6 +2278,9 @@ " self.dt = df.fem.Constant(self.mesh, df.default_scalar_type(dt/self.t0_Myr))\n", " self.theta = df.fem.Constant(self.mesh, df.default_scalar_type(theta))\n", "\n", + " # reset the initial conditions\n", + " self.setup_boundaryconditions()\n", + " \n", " # first solve both Stokes systems\n", " self.solve_stokes_isoviscous(petsc_options=petsc_options)\n", "\n", @@ -2285,6 +2298,11 @@ " while t < tf_nd - 1e-9:\n", " if self.comm.rank == 0 and verbosity>1:\n", " print(\"Step: {:>6d}, Times: {:>9g} -> {:>9g} Myr\".format(ti, t*self.t0_Myr, (t+self.dt.value)*self.t0_Myr))\n", + " if plotter is not None:\n", + " for mesh in plotter.meshes:\n", + " if self.T_i.name in mesh.point_data:\n", + " mesh.point_data[self.T_i.name][:] = self.T_i.x.array\n", + " plotter.write_frame()\n", " self.T_n.x.array[:] = self.T_i.x.array\n", " self.T_i = problem_T.solve()\n", " ti+=1\n", @@ -2317,7 +2335,17 @@ " geom_case1td = create_sz_geometry(slab, resscale, sztype, io_depth_1, extra_width, \n", " coast_distance, lc_depth, uc_depth)\n", " sz_case1td = SubductionProblem(geom_case1td, A=A, Vs=Vs, sztype=sztype, qs=qs)\n", - " sz_case1td.solve_timedependent_isoviscous(25, 0.05, theta=0.5)" + "\n", + " fps = 5\n", + " plotter_gif = pv.Plotter(notebook=False, off_screen=True)\n", + " utils.plot_scalar(sz_case1td.T_i, plotter=plotter_gif, scale=sz_case1td.T0, gather=True, cmap='coolwarm', clim=[0.0, sz_case1td.Tm*sz_case1td.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + " utils.plot_geometry(sz_case1td.geom, plotter=plotter_gif, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_gif, render_points_as_spheres=True, point_size=10.0, color='green')\n", + " plotter_gif.open_gif( str(output_folder / \"sz_problem_case1td_solution.gif\"), fps=fps)\n", + " \n", + " sz_case1td.solve_timedependent_isoviscous(25, 0.05, theta=0.5, plotter=plotter_gif)\n", + " \n", + " plotter_gif.close()" ] }, { @@ -2328,10 +2356,13 @@ "outputs": [], "source": [ "if __name__ == \"__main__\":\n", - " plotter_isotd = utils.plot_scalar(sz_case1td.T_i, scale=sz_case1td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'})\n", + " plotter_isotd = utils.plot_scalar(sz_case1td.T_i, scale=sz_case1td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", " utils.plot_vector_glyphs(sz_case1td.vw_i, plotter=plotter_isotd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1td.v0))\n", " utils.plot_vector_glyphs(sz_case1td.vs_i, plotter=plotter_isotd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1td.v0))\n", - " utils.plot_show(plotter_isotd)" + " utils.plot_geometry(sz_case1td.geom, plotter=plotter_isotd, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_isotd, render_points_as_spheres=True, point_size=10.0, color='green')\n", + " utils.plot_show(plotter_isotd)\n", + " utils.plot_save(plotter_isotd, output_folder / \"sz_problem_case1td_solution.png\")" ] }, { @@ -2351,7 +2382,7 @@ "source": [ "class SubductionProblem(SubductionProblem):\n", " def solve_timedependent_dislocationcreep(self, tf, dt, theta=0.5, rtol=5.e-6, atol=5.e-9, maxits=50, verbosity=2, \n", - " petsc_options=None):\n", + " petsc_options=None, plotter=None):\n", " \"\"\"\n", " Solve the coupled temperature-velocity-pressure problem assuming a dislocation creep rheology with time dependency\n", "\n", @@ -2380,6 +2411,9 @@ " self.dt = df.fem.Constant(self.mesh, df.default_scalar_type(dt/self.t0_Myr))\n", " self.theta = df.fem.Constant(self.mesh, df.default_scalar_type(theta))\n", " \n", + " # reset the initial conditions\n", + " self.setup_boundaryconditions()\n", + " \n", " # first solve the isoviscous problem\n", " self.solve_stokes_isoviscous(petsc_options=petsc_options)\n", "\n", @@ -2432,6 +2466,11 @@ " while t < tf_nd - 1e-9:\n", " if self.comm.rank == 0 and verbosity>1:\n", " print(\"Step: {:>6d}, Times: {:>9g} -> {:>9g} Myr\".format(ti, t*self.t0_Myr, (t+self.dt.value)*self.t0_Myr,))\n", + " if plotter is not None:\n", + " for mesh in plotter.meshes:\n", + " if self.T_i.name in mesh.point_data:\n", + " mesh.point_data[self.T_i.name][:] = self.T_i.x.array\n", + " plotter.write_frame()\n", " self.T_n.x.array[:] = self.T_i.x.array\n", " # calculate the initial residual\n", " r = calculate_residual()\n", @@ -2497,7 +2536,17 @@ " geom_case2td = create_sz_geometry(slab, resscale, sztype, io_depth_2, extra_width, \n", " coast_distance, lc_depth, uc_depth)\n", " sz_case2td = SubductionProblem(geom_case2td, A=A, Vs=Vs, sztype=sztype, qs=qs)\n", - " sz_case2td.solve_timedependent_dislocationcreep(10, 0.05, theta=0.5, rtol=1.e-3)" + " \n", + " fps = 5\n", + " plotter_gif2 = pv.Plotter(notebook=False, off_screen=True)\n", + " utils.plot_scalar(sz_case2td.T_i, plotter=plotter_gif2, scale=sz_case2td.T0, gather=True, cmap='coolwarm', clim=[0.0, sz_case2td.Tm*sz_case2td.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + " utils.plot_geometry(sz_case2td.geom, plotter=plotter_gif2, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case2td.geom.slab_spline, plotter=plotter_gif2, render_points_as_spheres=True, point_size=10.0, color='green')\n", + " plotter_gif2.open_gif( str(output_folder / \"sz_problem_case2td_solution.gif\"), fps=fps)\n", + " \n", + " sz_case2td.solve_timedependent_dislocationcreep(10, 0.05, theta=0.5, rtol=1.e-3, plotter=plotter_gif2)\n", + "\n", + " plotter_gif2.close()" ] }, { @@ -2508,10 +2557,13 @@ "outputs": [], "source": [ "if __name__ == \"__main__\":\n", - " plotter_distd = utils.plot_scalar(sz_case2td.T_i, scale=sz_case2td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'})\n", + " plotter_distd = utils.plot_scalar(sz_case2td.T_i, scale=sz_case2td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", " utils.plot_vector_glyphs(sz_case2td.vw_i, plotter=plotter_distd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2td.v0))\n", " utils.plot_vector_glyphs(sz_case2td.vs_i, plotter=plotter_distd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2td.v0))\n", - " utils.plot_show(plotter_distd)" + " utils.plot_geometry(sz_case1td.geom, plotter=plotter_distd, color='green', width=2)\n", + " utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_distd, render_points_as_spheres=True, point_size=10.0, color='green')\n", + " utils.plot_show(plotter_distd)\n", + " utils.plot_save(plotter_distd, output_folder / \"sz_problem_case2td_solution.png\")" ] }, { diff --git a/notebooks/sz_problem.py b/notebooks/sz_problem.py index 182d0c2..5222efd 100644 --- a/notebooks/sz_problem.py +++ b/notebooks/sz_problem.py @@ -677,6 +677,8 @@ def setup_boundaryconditions(self): self.update_T_functions() # just set the boundary conditions on the boundaries for the velocities + self.wedge_vpw_i.x.array[:] = 0.0 + self.slab_vps_i.x.array[:] = 0.0 df.fem.set_bc(self.wedge_vpw_i.x.array, self.bcs_vpw) df.fem.set_bc(self.slab_vps_i.x.array, self.bcs_vps) # and update the interpolated v functions for consistency @@ -895,8 +897,10 @@ def __init__(self, geom, **kwargs): if __name__ == "__main__": - plotter_ic = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'}) + plotter_ic = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case1.vw_i, plotter=plotter_ic, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0)) + utils.plot_geometry(sz_case1.geom, plotter=plotter_ic, color='green', width=2) + utils.plot_couplingdepth(sz_case1.geom.slab_spline, plotter=plotter_ic, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_ic) utils.plot_save(plotter_ic, output_folder / "sz_problem_case1_ics.png") @@ -1263,9 +1267,11 @@ def get_diagnostics(self): if __name__ == "__main__": - plotter_iso = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'}) + plotter_iso = utils.plot_scalar(sz_case1.T_i, scale=sz_case1.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case1.vw_i, plotter=plotter_iso, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0)) utils.plot_vector_glyphs(sz_case1.vs_i, plotter=plotter_iso, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1.v0)) + utils.plot_geometry(sz_case1.geom, plotter=plotter_iso, color='green', width=2) + utils.plot_couplingdepth(sz_case1.geom.slab_spline, plotter=plotter_iso, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_iso) utils.plot_save(plotter_iso, output_folder / "sz_problem_case1_solution.png") @@ -1616,9 +1622,11 @@ def calculate_residual(): if __name__ == "__main__": - plotter_dis = utils.plot_scalar(sz_case2.T_i, scale=sz_case2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'}) + plotter_dis = utils.plot_scalar(sz_case2.T_i, scale=sz_case2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case2.vw_i, plotter=plotter_dis, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2.v0)) utils.plot_vector_glyphs(sz_case2.vs_i, plotter=plotter_dis, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2.v0)) + utils.plot_geometry(sz_case2.geom, plotter=plotter_dis, color='green', width=2) + utils.plot_couplingdepth(sz_case2.geom.slab_spline, plotter=plotter_dis, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_dis) utils.plot_save(plotter_dis, output_folder / "sz_problem_case2_solution.png") @@ -1647,7 +1655,9 @@ def calculate_residual(): if __name__ == "__main__": eta_i = sz_case2.project_dislocationcreep_viscosity() - plotter_eta = utils.plot_scalar(eta_i, scale=sz_case2.eta0, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa) [log scale]'}) + plotter_eta = utils.plot_scalar(eta_i, scale=sz_case2.eta0, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa) [log scale]', 'bold':True}) + utils.plot_geometry(sz_case2.geom, plotter=plotter_eta, color='green', width=2) + utils.plot_couplingdepth(sz_case2.geom.slab_spline, plotter=plotter_eta, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_eta) utils.plot_save(plotter_eta, output_folder / "sz_problem_case2_eta.png") @@ -1732,7 +1742,7 @@ def temperature_forms_timedependent(self): class SubductionProblem(SubductionProblem): - def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_options=None): + def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_options=None, plotter=None): """ Solve the coupled temperature-velocity-pressure problem assuming an isoviscous rheology with time dependency @@ -1757,6 +1767,9 @@ def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_o self.dt = df.fem.Constant(self.mesh, df.default_scalar_type(dt/self.t0_Myr)) self.theta = df.fem.Constant(self.mesh, df.default_scalar_type(theta)) + # reset the initial conditions + self.setup_boundaryconditions() + # first solve both Stokes systems self.solve_stokes_isoviscous(petsc_options=petsc_options) @@ -1774,6 +1787,11 @@ def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_o while t < tf_nd - 1e-9: if self.comm.rank == 0 and verbosity>1: print("Step: {:>6d}, Times: {:>9g} -> {:>9g} Myr".format(ti, t*self.t0_Myr, (t+self.dt.value)*self.t0_Myr)) + if plotter is not None: + for mesh in plotter.meshes: + if self.T_i.name in mesh.point_data: + mesh.point_data[self.T_i.name][:] = self.T_i.x.array + plotter.write_frame() self.T_n.x.array[:] = self.T_i.x.array self.T_i = problem_T.solve() ti+=1 @@ -1794,17 +1812,30 @@ def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_o geom_case1td = create_sz_geometry(slab, resscale, sztype, io_depth_1, extra_width, coast_distance, lc_depth, uc_depth) sz_case1td = SubductionProblem(geom_case1td, A=A, Vs=Vs, sztype=sztype, qs=qs) - sz_case1td.solve_timedependent_isoviscous(25, 0.05, theta=0.5) + + fps = 5 + plotter_gif = pv.Plotter(notebook=False, off_screen=True) + utils.plot_scalar(sz_case1td.T_i, plotter=plotter_gif, scale=sz_case1td.T0, gather=True, cmap='coolwarm', clim=[0.0, sz_case1td.Tm*sz_case1td.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) + utils.plot_geometry(sz_case1td.geom, plotter=plotter_gif, color='green', width=2) + utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_gif, render_points_as_spheres=True, point_size=10.0, color='green') + plotter_gif.open_gif( str(output_folder / "sz_problem_case1td_solution.gif"), fps=fps) + + sz_case1td.solve_timedependent_isoviscous(25, 0.05, theta=0.5, plotter=plotter_gif) + + plotter_gif.close() # In[ ]: if __name__ == "__main__": - plotter_isotd = utils.plot_scalar(sz_case1td.T_i, scale=sz_case1td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'}) + plotter_isotd = utils.plot_scalar(sz_case1td.T_i, scale=sz_case1td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case1td.vw_i, plotter=plotter_isotd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1td.v0)) utils.plot_vector_glyphs(sz_case1td.vs_i, plotter=plotter_isotd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case1td.v0)) + utils.plot_geometry(sz_case1td.geom, plotter=plotter_isotd, color='green', width=2) + utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_isotd, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_isotd) + utils.plot_save(plotter_isotd, output_folder / "sz_problem_case1td_solution.png") # ### 7. Solution - dislocation creep, time-dependent @@ -1814,7 +1845,7 @@ def solve_timedependent_isoviscous(self, tf, dt, theta=0.5, verbosity=2, petsc_o class SubductionProblem(SubductionProblem): def solve_timedependent_dislocationcreep(self, tf, dt, theta=0.5, rtol=5.e-6, atol=5.e-9, maxits=50, verbosity=2, - petsc_options=None): + petsc_options=None, plotter=None): """ Solve the coupled temperature-velocity-pressure problem assuming a dislocation creep rheology with time dependency @@ -1843,6 +1874,9 @@ def solve_timedependent_dislocationcreep(self, tf, dt, theta=0.5, rtol=5.e-6, at self.dt = df.fem.Constant(self.mesh, df.default_scalar_type(dt/self.t0_Myr)) self.theta = df.fem.Constant(self.mesh, df.default_scalar_type(theta)) + # reset the initial conditions + self.setup_boundaryconditions() + # first solve the isoviscous problem self.solve_stokes_isoviscous(petsc_options=petsc_options) @@ -1895,6 +1929,11 @@ def calculate_residual(): while t < tf_nd - 1e-9: if self.comm.rank == 0 and verbosity>1: print("Step: {:>6d}, Times: {:>9g} -> {:>9g} Myr".format(ti, t*self.t0_Myr, (t+self.dt.value)*self.t0_Myr,)) + if plotter is not None: + for mesh in plotter.meshes: + if self.T_i.name in mesh.point_data: + mesh.point_data[self.T_i.name][:] = self.T_i.x.array + plotter.write_frame() self.T_n.x.array[:] = self.T_i.x.array # calculate the initial residual r = calculate_residual() @@ -1948,17 +1987,30 @@ def calculate_residual(): geom_case2td = create_sz_geometry(slab, resscale, sztype, io_depth_2, extra_width, coast_distance, lc_depth, uc_depth) sz_case2td = SubductionProblem(geom_case2td, A=A, Vs=Vs, sztype=sztype, qs=qs) - sz_case2td.solve_timedependent_dislocationcreep(10, 0.05, theta=0.5, rtol=1.e-3) + + fps = 5 + plotter_gif2 = pv.Plotter(notebook=False, off_screen=True) + utils.plot_scalar(sz_case2td.T_i, plotter=plotter_gif2, scale=sz_case2td.T0, gather=True, cmap='coolwarm', clim=[0.0, sz_case2td.Tm*sz_case2td.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) + utils.plot_geometry(sz_case2td.geom, plotter=plotter_gif2, color='green', width=2) + utils.plot_couplingdepth(sz_case2td.geom.slab_spline, plotter=plotter_gif2, render_points_as_spheres=True, point_size=10.0, color='green') + plotter_gif2.open_gif( str(output_folder / "sz_problem_case2td_solution.gif"), fps=fps) + + sz_case2td.solve_timedependent_dislocationcreep(10, 0.05, theta=0.5, rtol=1.e-3, plotter=plotter_gif2) + + plotter_gif2.close() # In[ ]: if __name__ == "__main__": - plotter_distd = utils.plot_scalar(sz_case2td.T_i, scale=sz_case2td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)'}) + plotter_distd = utils.plot_scalar(sz_case2td.T_i, scale=sz_case2td.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case2td.vw_i, plotter=plotter_distd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2td.v0)) utils.plot_vector_glyphs(sz_case2td.vs_i, plotter=plotter_distd, factor=0.1, gather=True, color='k', scale=utils.mps_to_mmpyr(sz_case2td.v0)) + utils.plot_geometry(sz_case1td.geom, plotter=plotter_distd, color='green', width=2) + utils.plot_couplingdepth(sz_case1td.geom.slab_spline, plotter=plotter_distd, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_distd) + utils.plot_save(plotter_distd, output_folder / "sz_problem_case2td_solution.png") # ## Themes and variations diff --git a/notebooks/sz_suite_ss/01_Alaska_Peninsula.ipynb b/notebooks/sz_suite_ss/01_Alaska_Peninsula.ipynb index 13e59fe..45ffe90 100644 --- a/notebooks/sz_suite_ss/01_Alaska_Peninsula.ipynb +++ b/notebooks/sz_suite_ss/01_Alaska_Peninsula.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/01_Alaska_Peninsula.py b/notebooks/sz_suite_ss/01_Alaska_Peninsula.py index 7b529b2..2bd2eda 100644 --- a/notebooks/sz_suite_ss/01_Alaska_Peninsula.py +++ b/notebooks/sz_suite_ss/01_Alaska_Peninsula.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/02_Alaska.ipynb b/notebooks/sz_suite_ss/02_Alaska.ipynb index f20c0ce..3d6d812 100644 --- a/notebooks/sz_suite_ss/02_Alaska.ipynb +++ b/notebooks/sz_suite_ss/02_Alaska.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/02_Alaska.py b/notebooks/sz_suite_ss/02_Alaska.py index 0e8198b..4d35e01 100644 --- a/notebooks/sz_suite_ss/02_Alaska.py +++ b/notebooks/sz_suite_ss/02_Alaska.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/03_British_Columbia.ipynb b/notebooks/sz_suite_ss/03_British_Columbia.ipynb index 5b77f44..950903e 100644 --- a/notebooks/sz_suite_ss/03_British_Columbia.ipynb +++ b/notebooks/sz_suite_ss/03_British_Columbia.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/03_British_Columbia.py b/notebooks/sz_suite_ss/03_British_Columbia.py index e1c9197..9706f74 100644 --- a/notebooks/sz_suite_ss/03_British_Columbia.py +++ b/notebooks/sz_suite_ss/03_British_Columbia.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/04_Cascadia.ipynb b/notebooks/sz_suite_ss/04_Cascadia.ipynb index 6b5c25f..555354d 100644 --- a/notebooks/sz_suite_ss/04_Cascadia.ipynb +++ b/notebooks/sz_suite_ss/04_Cascadia.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/04_Cascadia.py b/notebooks/sz_suite_ss/04_Cascadia.py index d59c77d..68e633b 100644 --- a/notebooks/sz_suite_ss/04_Cascadia.py +++ b/notebooks/sz_suite_ss/04_Cascadia.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/05_Mexico.ipynb b/notebooks/sz_suite_ss/05_Mexico.ipynb index 81b55f2..41174da 100644 --- a/notebooks/sz_suite_ss/05_Mexico.ipynb +++ b/notebooks/sz_suite_ss/05_Mexico.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/05_Mexico.py b/notebooks/sz_suite_ss/05_Mexico.py index deb8688..ea21ec3 100644 --- a/notebooks/sz_suite_ss/05_Mexico.py +++ b/notebooks/sz_suite_ss/05_Mexico.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/06_GuatElSal.ipynb b/notebooks/sz_suite_ss/06_GuatElSal.ipynb index c395e9a..f70589e 100644 --- a/notebooks/sz_suite_ss/06_GuatElSal.ipynb +++ b/notebooks/sz_suite_ss/06_GuatElSal.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/06_GuatElSal.py b/notebooks/sz_suite_ss/06_GuatElSal.py index 540394b..99e67e0 100644 --- a/notebooks/sz_suite_ss/06_GuatElSal.py +++ b/notebooks/sz_suite_ss/06_GuatElSal.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/07_Nicaragua.ipynb b/notebooks/sz_suite_ss/07_Nicaragua.ipynb index 17762ad..f18bea8 100644 --- a/notebooks/sz_suite_ss/07_Nicaragua.ipynb +++ b/notebooks/sz_suite_ss/07_Nicaragua.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/07_Nicaragua.py b/notebooks/sz_suite_ss/07_Nicaragua.py index 1e999fc..ae7bdff 100644 --- a/notebooks/sz_suite_ss/07_Nicaragua.py +++ b/notebooks/sz_suite_ss/07_Nicaragua.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/08_Costa_Rica.ipynb b/notebooks/sz_suite_ss/08_Costa_Rica.ipynb index 1d8ca63..31903b4 100644 --- a/notebooks/sz_suite_ss/08_Costa_Rica.ipynb +++ b/notebooks/sz_suite_ss/08_Costa_Rica.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/08_Costa_Rica.py b/notebooks/sz_suite_ss/08_Costa_Rica.py index 8b89841..c574df4 100644 --- a/notebooks/sz_suite_ss/08_Costa_Rica.py +++ b/notebooks/sz_suite_ss/08_Costa_Rica.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/09_Colombia_Ecuador.ipynb b/notebooks/sz_suite_ss/09_Colombia_Ecuador.ipynb index e116963..689a9b9 100644 --- a/notebooks/sz_suite_ss/09_Colombia_Ecuador.ipynb +++ b/notebooks/sz_suite_ss/09_Colombia_Ecuador.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/09_Colombia_Ecuador.py b/notebooks/sz_suite_ss/09_Colombia_Ecuador.py index e15477b..5455a87 100644 --- a/notebooks/sz_suite_ss/09_Colombia_Ecuador.py +++ b/notebooks/sz_suite_ss/09_Colombia_Ecuador.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/10_N_Peru_Gap.ipynb b/notebooks/sz_suite_ss/10_N_Peru_Gap.ipynb index fd99b36..b05b310 100644 --- a/notebooks/sz_suite_ss/10_N_Peru_Gap.ipynb +++ b/notebooks/sz_suite_ss/10_N_Peru_Gap.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/10_N_Peru_Gap.py b/notebooks/sz_suite_ss/10_N_Peru_Gap.py index 5756848..beb24c2 100644 --- a/notebooks/sz_suite_ss/10_N_Peru_Gap.py +++ b/notebooks/sz_suite_ss/10_N_Peru_Gap.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/11_C_Peru_Gap.ipynb b/notebooks/sz_suite_ss/11_C_Peru_Gap.ipynb index 4970949..2de8dd7 100644 --- a/notebooks/sz_suite_ss/11_C_Peru_Gap.ipynb +++ b/notebooks/sz_suite_ss/11_C_Peru_Gap.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/11_C_Peru_Gap.py b/notebooks/sz_suite_ss/11_C_Peru_Gap.py index d451d52..aafb600 100644 --- a/notebooks/sz_suite_ss/11_C_Peru_Gap.py +++ b/notebooks/sz_suite_ss/11_C_Peru_Gap.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/12_Peru.ipynb b/notebooks/sz_suite_ss/12_Peru.ipynb index a7d641b..3108c09 100644 --- a/notebooks/sz_suite_ss/12_Peru.ipynb +++ b/notebooks/sz_suite_ss/12_Peru.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/12_Peru.py b/notebooks/sz_suite_ss/12_Peru.py index d286597..42ad010 100644 --- a/notebooks/sz_suite_ss/12_Peru.py +++ b/notebooks/sz_suite_ss/12_Peru.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/13_N_Chile.ipynb b/notebooks/sz_suite_ss/13_N_Chile.ipynb index 563e7a7..d567933 100644 --- a/notebooks/sz_suite_ss/13_N_Chile.ipynb +++ b/notebooks/sz_suite_ss/13_N_Chile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/13_N_Chile.py b/notebooks/sz_suite_ss/13_N_Chile.py index 802fc0c..b2b1318 100644 --- a/notebooks/sz_suite_ss/13_N_Chile.py +++ b/notebooks/sz_suite_ss/13_N_Chile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/14_NC_Chile.ipynb b/notebooks/sz_suite_ss/14_NC_Chile.ipynb index 690133c..c7c092b 100644 --- a/notebooks/sz_suite_ss/14_NC_Chile.ipynb +++ b/notebooks/sz_suite_ss/14_NC_Chile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/14_NC_Chile.py b/notebooks/sz_suite_ss/14_NC_Chile.py index 560b2e7..74e8eb1 100644 --- a/notebooks/sz_suite_ss/14_NC_Chile.py +++ b/notebooks/sz_suite_ss/14_NC_Chile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/15_C_Chile_Gap.ipynb b/notebooks/sz_suite_ss/15_C_Chile_Gap.ipynb index 0595db9..f79cd4f 100644 --- a/notebooks/sz_suite_ss/15_C_Chile_Gap.ipynb +++ b/notebooks/sz_suite_ss/15_C_Chile_Gap.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/15_C_Chile_Gap.py b/notebooks/sz_suite_ss/15_C_Chile_Gap.py index 7848261..3723817 100644 --- a/notebooks/sz_suite_ss/15_C_Chile_Gap.py +++ b/notebooks/sz_suite_ss/15_C_Chile_Gap.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/16_C_Chile.ipynb b/notebooks/sz_suite_ss/16_C_Chile.ipynb index c371738..269b8da 100644 --- a/notebooks/sz_suite_ss/16_C_Chile.ipynb +++ b/notebooks/sz_suite_ss/16_C_Chile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/16_C_Chile.py b/notebooks/sz_suite_ss/16_C_Chile.py index 54d49f0..4034ea4 100644 --- a/notebooks/sz_suite_ss/16_C_Chile.py +++ b/notebooks/sz_suite_ss/16_C_Chile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/17_SC_Chile.ipynb b/notebooks/sz_suite_ss/17_SC_Chile.ipynb index 5391c83..eb0fedc 100644 --- a/notebooks/sz_suite_ss/17_SC_Chile.ipynb +++ b/notebooks/sz_suite_ss/17_SC_Chile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/17_SC_Chile.py b/notebooks/sz_suite_ss/17_SC_Chile.py index 5413b19..748dc9b 100644 --- a/notebooks/sz_suite_ss/17_SC_Chile.py +++ b/notebooks/sz_suite_ss/17_SC_Chile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/18_S_Chile.ipynb b/notebooks/sz_suite_ss/18_S_Chile.ipynb index 166dd39..22c311e 100644 --- a/notebooks/sz_suite_ss/18_S_Chile.ipynb +++ b/notebooks/sz_suite_ss/18_S_Chile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/18_S_Chile.py b/notebooks/sz_suite_ss/18_S_Chile.py index 8b1d9a2..5459d6c 100644 --- a/notebooks/sz_suite_ss/18_S_Chile.py +++ b/notebooks/sz_suite_ss/18_S_Chile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/19_N_Antilles.ipynb b/notebooks/sz_suite_ss/19_N_Antilles.ipynb index 02f502e..597aa44 100644 --- a/notebooks/sz_suite_ss/19_N_Antilles.ipynb +++ b/notebooks/sz_suite_ss/19_N_Antilles.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/19_N_Antilles.py b/notebooks/sz_suite_ss/19_N_Antilles.py index 33b7e6c..1a0492d 100644 --- a/notebooks/sz_suite_ss/19_N_Antilles.py +++ b/notebooks/sz_suite_ss/19_N_Antilles.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/20_S_Antilles.ipynb b/notebooks/sz_suite_ss/20_S_Antilles.ipynb index 39da660..759084e 100644 --- a/notebooks/sz_suite_ss/20_S_Antilles.ipynb +++ b/notebooks/sz_suite_ss/20_S_Antilles.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/20_S_Antilles.py b/notebooks/sz_suite_ss/20_S_Antilles.py index 5f13a8f..c30a846 100644 --- a/notebooks/sz_suite_ss/20_S_Antilles.py +++ b/notebooks/sz_suite_ss/20_S_Antilles.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/21_Scotia.ipynb b/notebooks/sz_suite_ss/21_Scotia.ipynb index 09cec0a..49a28dc 100644 --- a/notebooks/sz_suite_ss/21_Scotia.ipynb +++ b/notebooks/sz_suite_ss/21_Scotia.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/21_Scotia.py b/notebooks/sz_suite_ss/21_Scotia.py index 4526f41..b879547 100644 --- a/notebooks/sz_suite_ss/21_Scotia.py +++ b/notebooks/sz_suite_ss/21_Scotia.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/22_Aegean.ipynb b/notebooks/sz_suite_ss/22_Aegean.ipynb index fd12e04..83499d2 100644 --- a/notebooks/sz_suite_ss/22_Aegean.ipynb +++ b/notebooks/sz_suite_ss/22_Aegean.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/22_Aegean.py b/notebooks/sz_suite_ss/22_Aegean.py index fcfce61..e2c4233 100644 --- a/notebooks/sz_suite_ss/22_Aegean.py +++ b/notebooks/sz_suite_ss/22_Aegean.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/23_N_Sumatra.ipynb b/notebooks/sz_suite_ss/23_N_Sumatra.ipynb index f7c3d72..6dcb94d 100644 --- a/notebooks/sz_suite_ss/23_N_Sumatra.ipynb +++ b/notebooks/sz_suite_ss/23_N_Sumatra.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/23_N_Sumatra.py b/notebooks/sz_suite_ss/23_N_Sumatra.py index 388d4fe..3e64c3c 100644 --- a/notebooks/sz_suite_ss/23_N_Sumatra.py +++ b/notebooks/sz_suite_ss/23_N_Sumatra.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/24_C_Sumatra.ipynb b/notebooks/sz_suite_ss/24_C_Sumatra.ipynb index c701fc3..a5f9d7f 100644 --- a/notebooks/sz_suite_ss/24_C_Sumatra.ipynb +++ b/notebooks/sz_suite_ss/24_C_Sumatra.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/24_C_Sumatra.py b/notebooks/sz_suite_ss/24_C_Sumatra.py index 753bd88..ce4b73f 100644 --- a/notebooks/sz_suite_ss/24_C_Sumatra.py +++ b/notebooks/sz_suite_ss/24_C_Sumatra.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/25_S_Sumatra.ipynb b/notebooks/sz_suite_ss/25_S_Sumatra.ipynb index faf358a..ce91930 100644 --- a/notebooks/sz_suite_ss/25_S_Sumatra.ipynb +++ b/notebooks/sz_suite_ss/25_S_Sumatra.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/25_S_Sumatra.py b/notebooks/sz_suite_ss/25_S_Sumatra.py index 9c73022..934a501 100644 --- a/notebooks/sz_suite_ss/25_S_Sumatra.py +++ b/notebooks/sz_suite_ss/25_S_Sumatra.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/26_Sunda_Strait.ipynb b/notebooks/sz_suite_ss/26_Sunda_Strait.ipynb index 810c066..b26945e 100644 --- a/notebooks/sz_suite_ss/26_Sunda_Strait.ipynb +++ b/notebooks/sz_suite_ss/26_Sunda_Strait.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/26_Sunda_Strait.py b/notebooks/sz_suite_ss/26_Sunda_Strait.py index 1175526..b0a0887 100644 --- a/notebooks/sz_suite_ss/26_Sunda_Strait.py +++ b/notebooks/sz_suite_ss/26_Sunda_Strait.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/27_Java.ipynb b/notebooks/sz_suite_ss/27_Java.ipynb index a35247a..b5144e6 100644 --- a/notebooks/sz_suite_ss/27_Java.ipynb +++ b/notebooks/sz_suite_ss/27_Java.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/27_Java.py b/notebooks/sz_suite_ss/27_Java.py index d3ce8b6..3e01abd 100644 --- a/notebooks/sz_suite_ss/27_Java.py +++ b/notebooks/sz_suite_ss/27_Java.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/28_Bali_Lombok.ipynb b/notebooks/sz_suite_ss/28_Bali_Lombok.ipynb index add375b..8c8b853 100644 --- a/notebooks/sz_suite_ss/28_Bali_Lombok.ipynb +++ b/notebooks/sz_suite_ss/28_Bali_Lombok.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/28_Bali_Lombok.py b/notebooks/sz_suite_ss/28_Bali_Lombok.py index 1878c5e..f444ae7 100644 --- a/notebooks/sz_suite_ss/28_Bali_Lombok.py +++ b/notebooks/sz_suite_ss/28_Bali_Lombok.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/29_W_Banda_Sea.ipynb b/notebooks/sz_suite_ss/29_W_Banda_Sea.ipynb index 4fcec03..e52dab4 100644 --- a/notebooks/sz_suite_ss/29_W_Banda_Sea.ipynb +++ b/notebooks/sz_suite_ss/29_W_Banda_Sea.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/29_W_Banda_Sea.py b/notebooks/sz_suite_ss/29_W_Banda_Sea.py index 980b9f3..4b70bbf 100644 --- a/notebooks/sz_suite_ss/29_W_Banda_Sea.py +++ b/notebooks/sz_suite_ss/29_W_Banda_Sea.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/30_E_Banda_Sea.ipynb b/notebooks/sz_suite_ss/30_E_Banda_Sea.ipynb index cc868ec..9730312 100644 --- a/notebooks/sz_suite_ss/30_E_Banda_Sea.ipynb +++ b/notebooks/sz_suite_ss/30_E_Banda_Sea.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/30_E_Banda_Sea.py b/notebooks/sz_suite_ss/30_E_Banda_Sea.py index 9ba613f..14cf49f 100644 --- a/notebooks/sz_suite_ss/30_E_Banda_Sea.py +++ b/notebooks/sz_suite_ss/30_E_Banda_Sea.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/31_New_Britain.ipynb b/notebooks/sz_suite_ss/31_New_Britain.ipynb index 6a06d35..c92daff 100644 --- a/notebooks/sz_suite_ss/31_New_Britain.ipynb +++ b/notebooks/sz_suite_ss/31_New_Britain.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/31_New_Britain.py b/notebooks/sz_suite_ss/31_New_Britain.py index 3d23f16..8f4c780 100644 --- a/notebooks/sz_suite_ss/31_New_Britain.py +++ b/notebooks/sz_suite_ss/31_New_Britain.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/32_Solomon.ipynb b/notebooks/sz_suite_ss/32_Solomon.ipynb index 230e3f3..f2d4003 100644 --- a/notebooks/sz_suite_ss/32_Solomon.ipynb +++ b/notebooks/sz_suite_ss/32_Solomon.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/32_Solomon.py b/notebooks/sz_suite_ss/32_Solomon.py index c19d491..94e3e60 100644 --- a/notebooks/sz_suite_ss/32_Solomon.py +++ b/notebooks/sz_suite_ss/32_Solomon.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/33_N_Vanuatu.ipynb b/notebooks/sz_suite_ss/33_N_Vanuatu.ipynb index b98395d..1e7d314 100644 --- a/notebooks/sz_suite_ss/33_N_Vanuatu.ipynb +++ b/notebooks/sz_suite_ss/33_N_Vanuatu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/33_N_Vanuatu.py b/notebooks/sz_suite_ss/33_N_Vanuatu.py index b5f12fd..c1e4d11 100644 --- a/notebooks/sz_suite_ss/33_N_Vanuatu.py +++ b/notebooks/sz_suite_ss/33_N_Vanuatu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/34_S_Vanuatu.ipynb b/notebooks/sz_suite_ss/34_S_Vanuatu.ipynb index 545349d..8f274a4 100644 --- a/notebooks/sz_suite_ss/34_S_Vanuatu.ipynb +++ b/notebooks/sz_suite_ss/34_S_Vanuatu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/34_S_Vanuatu.py b/notebooks/sz_suite_ss/34_S_Vanuatu.py index 7ab8a5f..4f91330 100644 --- a/notebooks/sz_suite_ss/34_S_Vanuatu.py +++ b/notebooks/sz_suite_ss/34_S_Vanuatu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/35_Tonga.ipynb b/notebooks/sz_suite_ss/35_Tonga.ipynb index e13fcfd..9d6d329 100644 --- a/notebooks/sz_suite_ss/35_Tonga.ipynb +++ b/notebooks/sz_suite_ss/35_Tonga.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/35_Tonga.py b/notebooks/sz_suite_ss/35_Tonga.py index 77f1cc9..fdda9aa 100644 --- a/notebooks/sz_suite_ss/35_Tonga.py +++ b/notebooks/sz_suite_ss/35_Tonga.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/36_Kermadec.ipynb b/notebooks/sz_suite_ss/36_Kermadec.ipynb index b9d6a4a..b7b9bf8 100644 --- a/notebooks/sz_suite_ss/36_Kermadec.ipynb +++ b/notebooks/sz_suite_ss/36_Kermadec.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/36_Kermadec.py b/notebooks/sz_suite_ss/36_Kermadec.py index 54cc78e..c8d87ea 100644 --- a/notebooks/sz_suite_ss/36_Kermadec.py +++ b/notebooks/sz_suite_ss/36_Kermadec.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/37_New_Zealand.ipynb b/notebooks/sz_suite_ss/37_New_Zealand.ipynb index 3632c16..b06ad92 100644 --- a/notebooks/sz_suite_ss/37_New_Zealand.ipynb +++ b/notebooks/sz_suite_ss/37_New_Zealand.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/37_New_Zealand.py b/notebooks/sz_suite_ss/37_New_Zealand.py index 1a7eb2d..8be8cf0 100644 --- a/notebooks/sz_suite_ss/37_New_Zealand.py +++ b/notebooks/sz_suite_ss/37_New_Zealand.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/38_S_Philippines.ipynb b/notebooks/sz_suite_ss/38_S_Philippines.ipynb index ffd13a3..de60b35 100644 --- a/notebooks/sz_suite_ss/38_S_Philippines.ipynb +++ b/notebooks/sz_suite_ss/38_S_Philippines.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/38_S_Philippines.py b/notebooks/sz_suite_ss/38_S_Philippines.py index 8f4b4aa..d3fa26e 100644 --- a/notebooks/sz_suite_ss/38_S_Philippines.py +++ b/notebooks/sz_suite_ss/38_S_Philippines.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/39_N_Philippines.ipynb b/notebooks/sz_suite_ss/39_N_Philippines.ipynb index 88f5af4..a9f742c 100644 --- a/notebooks/sz_suite_ss/39_N_Philippines.ipynb +++ b/notebooks/sz_suite_ss/39_N_Philippines.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/39_N_Philippines.py b/notebooks/sz_suite_ss/39_N_Philippines.py index 5f6b03e..7e6a8a7 100644 --- a/notebooks/sz_suite_ss/39_N_Philippines.py +++ b/notebooks/sz_suite_ss/39_N_Philippines.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/40_S_Marianas.ipynb b/notebooks/sz_suite_ss/40_S_Marianas.ipynb index a8fdbf8..0dde1b7 100644 --- a/notebooks/sz_suite_ss/40_S_Marianas.ipynb +++ b/notebooks/sz_suite_ss/40_S_Marianas.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/40_S_Marianas.py b/notebooks/sz_suite_ss/40_S_Marianas.py index 1eaf54c..f8caab9 100644 --- a/notebooks/sz_suite_ss/40_S_Marianas.py +++ b/notebooks/sz_suite_ss/40_S_Marianas.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/41_N_Marianas.ipynb b/notebooks/sz_suite_ss/41_N_Marianas.ipynb index d58b34c..e69da2f 100644 --- a/notebooks/sz_suite_ss/41_N_Marianas.ipynb +++ b/notebooks/sz_suite_ss/41_N_Marianas.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/41_N_Marianas.py b/notebooks/sz_suite_ss/41_N_Marianas.py index fa72241..9dc96fc 100644 --- a/notebooks/sz_suite_ss/41_N_Marianas.py +++ b/notebooks/sz_suite_ss/41_N_Marianas.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/42_Bonin.ipynb b/notebooks/sz_suite_ss/42_Bonin.ipynb index 95dcee3..2024066 100644 --- a/notebooks/sz_suite_ss/42_Bonin.ipynb +++ b/notebooks/sz_suite_ss/42_Bonin.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/42_Bonin.py b/notebooks/sz_suite_ss/42_Bonin.py index 86d2ba0..22bf755 100644 --- a/notebooks/sz_suite_ss/42_Bonin.py +++ b/notebooks/sz_suite_ss/42_Bonin.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/43_Izu.ipynb b/notebooks/sz_suite_ss/43_Izu.ipynb index d0e7e91..b13bdfe 100644 --- a/notebooks/sz_suite_ss/43_Izu.ipynb +++ b/notebooks/sz_suite_ss/43_Izu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/43_Izu.py b/notebooks/sz_suite_ss/43_Izu.py index 9028745..f8b7127 100644 --- a/notebooks/sz_suite_ss/43_Izu.py +++ b/notebooks/sz_suite_ss/43_Izu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/44_Kyushu.ipynb b/notebooks/sz_suite_ss/44_Kyushu.ipynb index 15842d6..82f6fdc 100644 --- a/notebooks/sz_suite_ss/44_Kyushu.ipynb +++ b/notebooks/sz_suite_ss/44_Kyushu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/44_Kyushu.py b/notebooks/sz_suite_ss/44_Kyushu.py index ae91eb7..cdaf353 100644 --- a/notebooks/sz_suite_ss/44_Kyushu.py +++ b/notebooks/sz_suite_ss/44_Kyushu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/45_Ryukyu.ipynb b/notebooks/sz_suite_ss/45_Ryukyu.ipynb index b59fd70..ea77c9a 100644 --- a/notebooks/sz_suite_ss/45_Ryukyu.ipynb +++ b/notebooks/sz_suite_ss/45_Ryukyu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/45_Ryukyu.py b/notebooks/sz_suite_ss/45_Ryukyu.py index 43d026a..231b166 100644 --- a/notebooks/sz_suite_ss/45_Ryukyu.py +++ b/notebooks/sz_suite_ss/45_Ryukyu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/46_Nankai.ipynb b/notebooks/sz_suite_ss/46_Nankai.ipynb index 6fad2f2..707e68c 100644 --- a/notebooks/sz_suite_ss/46_Nankai.ipynb +++ b/notebooks/sz_suite_ss/46_Nankai.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/46_Nankai.py b/notebooks/sz_suite_ss/46_Nankai.py index b5a9f03..45a9304 100644 --- a/notebooks/sz_suite_ss/46_Nankai.py +++ b/notebooks/sz_suite_ss/46_Nankai.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/47_C_Honshu.ipynb b/notebooks/sz_suite_ss/47_C_Honshu.ipynb index 9aeba42..66306a1 100644 --- a/notebooks/sz_suite_ss/47_C_Honshu.ipynb +++ b/notebooks/sz_suite_ss/47_C_Honshu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/47_C_Honshu.py b/notebooks/sz_suite_ss/47_C_Honshu.py index f9a0c13..4a6eb41 100644 --- a/notebooks/sz_suite_ss/47_C_Honshu.py +++ b/notebooks/sz_suite_ss/47_C_Honshu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/48_N_Honshu.ipynb b/notebooks/sz_suite_ss/48_N_Honshu.ipynb index 178c1ad..4d45f52 100644 --- a/notebooks/sz_suite_ss/48_N_Honshu.ipynb +++ b/notebooks/sz_suite_ss/48_N_Honshu.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/48_N_Honshu.py b/notebooks/sz_suite_ss/48_N_Honshu.py index 3e3b0e2..33196e5 100644 --- a/notebooks/sz_suite_ss/48_N_Honshu.py +++ b/notebooks/sz_suite_ss/48_N_Honshu.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/49_Hokkaido.ipynb b/notebooks/sz_suite_ss/49_Hokkaido.ipynb index b926063..1e4bd5c 100644 --- a/notebooks/sz_suite_ss/49_Hokkaido.ipynb +++ b/notebooks/sz_suite_ss/49_Hokkaido.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/49_Hokkaido.py b/notebooks/sz_suite_ss/49_Hokkaido.py index c99c0e3..117977c 100644 --- a/notebooks/sz_suite_ss/49_Hokkaido.py +++ b/notebooks/sz_suite_ss/49_Hokkaido.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/50_S_Kurile.ipynb b/notebooks/sz_suite_ss/50_S_Kurile.ipynb index e1ad280..df01fca 100644 --- a/notebooks/sz_suite_ss/50_S_Kurile.ipynb +++ b/notebooks/sz_suite_ss/50_S_Kurile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/50_S_Kurile.py b/notebooks/sz_suite_ss/50_S_Kurile.py index 17df8ff..ff64739 100644 --- a/notebooks/sz_suite_ss/50_S_Kurile.py +++ b/notebooks/sz_suite_ss/50_S_Kurile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/51_N_Kurile.ipynb b/notebooks/sz_suite_ss/51_N_Kurile.ipynb index eb6c99e..942a874 100644 --- a/notebooks/sz_suite_ss/51_N_Kurile.ipynb +++ b/notebooks/sz_suite_ss/51_N_Kurile.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/51_N_Kurile.py b/notebooks/sz_suite_ss/51_N_Kurile.py index af422fe..4834ff5 100644 --- a/notebooks/sz_suite_ss/51_N_Kurile.py +++ b/notebooks/sz_suite_ss/51_N_Kurile.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/52_Kamchatka.ipynb b/notebooks/sz_suite_ss/52_Kamchatka.ipynb index a275516..dadd764 100644 --- a/notebooks/sz_suite_ss/52_Kamchatka.ipynb +++ b/notebooks/sz_suite_ss/52_Kamchatka.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/52_Kamchatka.py b/notebooks/sz_suite_ss/52_Kamchatka.py index 0f72504..b497376 100644 --- a/notebooks/sz_suite_ss/52_Kamchatka.py +++ b/notebooks/sz_suite_ss/52_Kamchatka.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/53_W_Aleutians.ipynb b/notebooks/sz_suite_ss/53_W_Aleutians.ipynb index 26ac93e..4ccbfa3 100644 --- a/notebooks/sz_suite_ss/53_W_Aleutians.ipynb +++ b/notebooks/sz_suite_ss/53_W_Aleutians.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/53_W_Aleutians.py b/notebooks/sz_suite_ss/53_W_Aleutians.py index 55bf654..5cbcb5b 100644 --- a/notebooks/sz_suite_ss/53_W_Aleutians.py +++ b/notebooks/sz_suite_ss/53_W_Aleutians.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/54_C_Aleutians.ipynb b/notebooks/sz_suite_ss/54_C_Aleutians.ipynb index f2ce313..3cdf5d0 100644 --- a/notebooks/sz_suite_ss/54_C_Aleutians.ipynb +++ b/notebooks/sz_suite_ss/54_C_Aleutians.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/54_C_Aleutians.py b/notebooks/sz_suite_ss/54_C_Aleutians.py index 71cd503..b3407d1 100644 --- a/notebooks/sz_suite_ss/54_C_Aleutians.py +++ b/notebooks/sz_suite_ss/54_C_Aleutians.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/55_E_Aleutians.ipynb b/notebooks/sz_suite_ss/55_E_Aleutians.ipynb index 9b4b3ae..5a4bda3 100644 --- a/notebooks/sz_suite_ss/55_E_Aleutians.ipynb +++ b/notebooks/sz_suite_ss/55_E_Aleutians.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/55_E_Aleutians.py b/notebooks/sz_suite_ss/55_E_Aleutians.py index 074a6d4..6475b65 100644 --- a/notebooks/sz_suite_ss/55_E_Aleutians.py +++ b/notebooks/sz_suite_ss/55_E_Aleutians.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/56_Calabria.ipynb b/notebooks/sz_suite_ss/56_Calabria.ipynb index 2de3e76..bd23cfc 100644 --- a/notebooks/sz_suite_ss/56_Calabria.ipynb +++ b/notebooks/sz_suite_ss/56_Calabria.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_ss/56_Calabria.py b/notebooks/sz_suite_ss/56_Calabria.py index 9afdbba..62e705c 100644 --- a/notebooks/sz_suite_ss/56_Calabria.py +++ b/notebooks/sz_suite_ss/56_Calabria.py @@ -132,9 +132,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_ss_solution_resscale_{:.2f}.png".format(name, resscale)) @@ -195,7 +198,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_ss/template.ipynb b/notebooks/sz_suite_ss/template.ipynb index 2279ed2..d9e82d2 100644 --- a/notebooks/sz_suite_ss/template.ipynb +++ b/notebooks/sz_suite_ss/template.ipynb @@ -278,9 +278,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_ss_solution_resscale_{:.2f}.png\".format(name, resscale))" ] @@ -379,7 +382,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/01_Alaska_Peninsula.ipynb b/notebooks/sz_suite_td/01_Alaska_Peninsula.ipynb index 319fbbd..190a323 100644 --- a/notebooks/sz_suite_td/01_Alaska_Peninsula.ipynb +++ b/notebooks/sz_suite_td/01_Alaska_Peninsula.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/01_Alaska_Peninsula.py b/notebooks/sz_suite_td/01_Alaska_Peninsula.py index be6fc12..b98d0c2 100644 --- a/notebooks/sz_suite_td/01_Alaska_Peninsula.py +++ b/notebooks/sz_suite_td/01_Alaska_Peninsula.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/02_Alaska.ipynb b/notebooks/sz_suite_td/02_Alaska.ipynb index 0e16f8d..9f5b4e6 100644 --- a/notebooks/sz_suite_td/02_Alaska.ipynb +++ b/notebooks/sz_suite_td/02_Alaska.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/02_Alaska.py b/notebooks/sz_suite_td/02_Alaska.py index bf4dfd7..ead696e 100644 --- a/notebooks/sz_suite_td/02_Alaska.py +++ b/notebooks/sz_suite_td/02_Alaska.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/03_British_Columbia.ipynb b/notebooks/sz_suite_td/03_British_Columbia.ipynb index 9cad49b..f99d2ef 100644 --- a/notebooks/sz_suite_td/03_British_Columbia.ipynb +++ b/notebooks/sz_suite_td/03_British_Columbia.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/03_British_Columbia.py b/notebooks/sz_suite_td/03_British_Columbia.py index 935f3a7..284d1dd 100644 --- a/notebooks/sz_suite_td/03_British_Columbia.py +++ b/notebooks/sz_suite_td/03_British_Columbia.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/04_Cascadia.ipynb b/notebooks/sz_suite_td/04_Cascadia.ipynb index d671566..c0b8d8d 100644 --- a/notebooks/sz_suite_td/04_Cascadia.ipynb +++ b/notebooks/sz_suite_td/04_Cascadia.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/04_Cascadia.py b/notebooks/sz_suite_td/04_Cascadia.py index 0f999a3..4fba3c2 100644 --- a/notebooks/sz_suite_td/04_Cascadia.py +++ b/notebooks/sz_suite_td/04_Cascadia.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/05_Mexico.ipynb b/notebooks/sz_suite_td/05_Mexico.ipynb index 0cfd285..f8fea8d 100644 --- a/notebooks/sz_suite_td/05_Mexico.ipynb +++ b/notebooks/sz_suite_td/05_Mexico.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/05_Mexico.py b/notebooks/sz_suite_td/05_Mexico.py index 7b0c053..c504c96 100644 --- a/notebooks/sz_suite_td/05_Mexico.py +++ b/notebooks/sz_suite_td/05_Mexico.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/06_GuatElSal.ipynb b/notebooks/sz_suite_td/06_GuatElSal.ipynb index e43cca2..10d6a94 100644 --- a/notebooks/sz_suite_td/06_GuatElSal.ipynb +++ b/notebooks/sz_suite_td/06_GuatElSal.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/06_GuatElSal.py b/notebooks/sz_suite_td/06_GuatElSal.py index 9fabe9c..ebbae13 100644 --- a/notebooks/sz_suite_td/06_GuatElSal.py +++ b/notebooks/sz_suite_td/06_GuatElSal.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/07_Nicaragua.ipynb b/notebooks/sz_suite_td/07_Nicaragua.ipynb index 512108f..4bb045d 100644 --- a/notebooks/sz_suite_td/07_Nicaragua.ipynb +++ b/notebooks/sz_suite_td/07_Nicaragua.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/07_Nicaragua.py b/notebooks/sz_suite_td/07_Nicaragua.py index 8907de0..cf6e13b 100644 --- a/notebooks/sz_suite_td/07_Nicaragua.py +++ b/notebooks/sz_suite_td/07_Nicaragua.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/08_Costa_Rica.ipynb b/notebooks/sz_suite_td/08_Costa_Rica.ipynb index 84a2e87..0ce5d32 100644 --- a/notebooks/sz_suite_td/08_Costa_Rica.ipynb +++ b/notebooks/sz_suite_td/08_Costa_Rica.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/08_Costa_Rica.py b/notebooks/sz_suite_td/08_Costa_Rica.py index 79512d3..c7e61c9 100644 --- a/notebooks/sz_suite_td/08_Costa_Rica.py +++ b/notebooks/sz_suite_td/08_Costa_Rica.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/09_Colombia_Ecuador.ipynb b/notebooks/sz_suite_td/09_Colombia_Ecuador.ipynb index cb079ba..14bc743 100644 --- a/notebooks/sz_suite_td/09_Colombia_Ecuador.ipynb +++ b/notebooks/sz_suite_td/09_Colombia_Ecuador.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/09_Colombia_Ecuador.py b/notebooks/sz_suite_td/09_Colombia_Ecuador.py index f0889de..95ad255 100644 --- a/notebooks/sz_suite_td/09_Colombia_Ecuador.py +++ b/notebooks/sz_suite_td/09_Colombia_Ecuador.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/10_N_Peru_Gap.ipynb b/notebooks/sz_suite_td/10_N_Peru_Gap.ipynb index dc24a6a..9c0ec57 100644 --- a/notebooks/sz_suite_td/10_N_Peru_Gap.ipynb +++ b/notebooks/sz_suite_td/10_N_Peru_Gap.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/10_N_Peru_Gap.py b/notebooks/sz_suite_td/10_N_Peru_Gap.py index 975d7fe..d231f4d 100644 --- a/notebooks/sz_suite_td/10_N_Peru_Gap.py +++ b/notebooks/sz_suite_td/10_N_Peru_Gap.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/11_C_Peru_Gap.ipynb b/notebooks/sz_suite_td/11_C_Peru_Gap.ipynb index 7919fae..9468976 100644 --- a/notebooks/sz_suite_td/11_C_Peru_Gap.ipynb +++ b/notebooks/sz_suite_td/11_C_Peru_Gap.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/11_C_Peru_Gap.py b/notebooks/sz_suite_td/11_C_Peru_Gap.py index 53f6b1e..8fe6aae 100644 --- a/notebooks/sz_suite_td/11_C_Peru_Gap.py +++ b/notebooks/sz_suite_td/11_C_Peru_Gap.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/12_Peru.ipynb b/notebooks/sz_suite_td/12_Peru.ipynb index 089d546..39a4339 100644 --- a/notebooks/sz_suite_td/12_Peru.ipynb +++ b/notebooks/sz_suite_td/12_Peru.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/12_Peru.py b/notebooks/sz_suite_td/12_Peru.py index 87888fd..cd35f6d 100644 --- a/notebooks/sz_suite_td/12_Peru.py +++ b/notebooks/sz_suite_td/12_Peru.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/13_N_Chile.ipynb b/notebooks/sz_suite_td/13_N_Chile.ipynb index 7842c98..eb796a7 100644 --- a/notebooks/sz_suite_td/13_N_Chile.ipynb +++ b/notebooks/sz_suite_td/13_N_Chile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/13_N_Chile.py b/notebooks/sz_suite_td/13_N_Chile.py index 76d964d..0c4dc95 100644 --- a/notebooks/sz_suite_td/13_N_Chile.py +++ b/notebooks/sz_suite_td/13_N_Chile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/14_NC_Chile.ipynb b/notebooks/sz_suite_td/14_NC_Chile.ipynb index 073f75e..5582a49 100644 --- a/notebooks/sz_suite_td/14_NC_Chile.ipynb +++ b/notebooks/sz_suite_td/14_NC_Chile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/14_NC_Chile.py b/notebooks/sz_suite_td/14_NC_Chile.py index 7bb8fd0..be2876f 100644 --- a/notebooks/sz_suite_td/14_NC_Chile.py +++ b/notebooks/sz_suite_td/14_NC_Chile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/15_C_Chile_Gap.ipynb b/notebooks/sz_suite_td/15_C_Chile_Gap.ipynb index c583602..0de39f0 100644 --- a/notebooks/sz_suite_td/15_C_Chile_Gap.ipynb +++ b/notebooks/sz_suite_td/15_C_Chile_Gap.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/15_C_Chile_Gap.py b/notebooks/sz_suite_td/15_C_Chile_Gap.py index 981b41d..127ce6d 100644 --- a/notebooks/sz_suite_td/15_C_Chile_Gap.py +++ b/notebooks/sz_suite_td/15_C_Chile_Gap.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/16_C_Chile.ipynb b/notebooks/sz_suite_td/16_C_Chile.ipynb index 5c334e7..ec84dd9 100644 --- a/notebooks/sz_suite_td/16_C_Chile.ipynb +++ b/notebooks/sz_suite_td/16_C_Chile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/16_C_Chile.py b/notebooks/sz_suite_td/16_C_Chile.py index 954dcc9..25b8f1d 100644 --- a/notebooks/sz_suite_td/16_C_Chile.py +++ b/notebooks/sz_suite_td/16_C_Chile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/17_SC_Chile.ipynb b/notebooks/sz_suite_td/17_SC_Chile.ipynb index fa51b29..4e5daf9 100644 --- a/notebooks/sz_suite_td/17_SC_Chile.ipynb +++ b/notebooks/sz_suite_td/17_SC_Chile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/17_SC_Chile.py b/notebooks/sz_suite_td/17_SC_Chile.py index 9e9d068..c0e1c90 100644 --- a/notebooks/sz_suite_td/17_SC_Chile.py +++ b/notebooks/sz_suite_td/17_SC_Chile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/18_S_Chile.ipynb b/notebooks/sz_suite_td/18_S_Chile.ipynb index fe5486c..f45ef02 100644 --- a/notebooks/sz_suite_td/18_S_Chile.ipynb +++ b/notebooks/sz_suite_td/18_S_Chile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/18_S_Chile.py b/notebooks/sz_suite_td/18_S_Chile.py index 664b6ef..f7a1e11 100644 --- a/notebooks/sz_suite_td/18_S_Chile.py +++ b/notebooks/sz_suite_td/18_S_Chile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/19_N_Antilles.ipynb b/notebooks/sz_suite_td/19_N_Antilles.ipynb index 599efd7..5e02d30 100644 --- a/notebooks/sz_suite_td/19_N_Antilles.ipynb +++ b/notebooks/sz_suite_td/19_N_Antilles.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/19_N_Antilles.py b/notebooks/sz_suite_td/19_N_Antilles.py index 6eb5bc4..5dceb89 100644 --- a/notebooks/sz_suite_td/19_N_Antilles.py +++ b/notebooks/sz_suite_td/19_N_Antilles.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/20_S_Antilles.ipynb b/notebooks/sz_suite_td/20_S_Antilles.ipynb index 13c95e3..6c06611 100644 --- a/notebooks/sz_suite_td/20_S_Antilles.ipynb +++ b/notebooks/sz_suite_td/20_S_Antilles.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/20_S_Antilles.py b/notebooks/sz_suite_td/20_S_Antilles.py index 6400463..b20acf4 100644 --- a/notebooks/sz_suite_td/20_S_Antilles.py +++ b/notebooks/sz_suite_td/20_S_Antilles.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/21_Scotia.ipynb b/notebooks/sz_suite_td/21_Scotia.ipynb index 1de2a7e..f496afa 100644 --- a/notebooks/sz_suite_td/21_Scotia.ipynb +++ b/notebooks/sz_suite_td/21_Scotia.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/21_Scotia.py b/notebooks/sz_suite_td/21_Scotia.py index c011ad7..09f0c57 100644 --- a/notebooks/sz_suite_td/21_Scotia.py +++ b/notebooks/sz_suite_td/21_Scotia.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/22_Aegean.ipynb b/notebooks/sz_suite_td/22_Aegean.ipynb index 9aa768a..9a78c67 100644 --- a/notebooks/sz_suite_td/22_Aegean.ipynb +++ b/notebooks/sz_suite_td/22_Aegean.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/22_Aegean.py b/notebooks/sz_suite_td/22_Aegean.py index 27ffb27..3553f65 100644 --- a/notebooks/sz_suite_td/22_Aegean.py +++ b/notebooks/sz_suite_td/22_Aegean.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/23_N_Sumatra.ipynb b/notebooks/sz_suite_td/23_N_Sumatra.ipynb index e058f4f..c0fb1ee 100644 --- a/notebooks/sz_suite_td/23_N_Sumatra.ipynb +++ b/notebooks/sz_suite_td/23_N_Sumatra.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/23_N_Sumatra.py b/notebooks/sz_suite_td/23_N_Sumatra.py index 0443f38..bd7775d 100644 --- a/notebooks/sz_suite_td/23_N_Sumatra.py +++ b/notebooks/sz_suite_td/23_N_Sumatra.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/24_C_Sumatra.ipynb b/notebooks/sz_suite_td/24_C_Sumatra.ipynb index c725f2c..a30d00b 100644 --- a/notebooks/sz_suite_td/24_C_Sumatra.ipynb +++ b/notebooks/sz_suite_td/24_C_Sumatra.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/24_C_Sumatra.py b/notebooks/sz_suite_td/24_C_Sumatra.py index 7e0e1b2..e4ce4a4 100644 --- a/notebooks/sz_suite_td/24_C_Sumatra.py +++ b/notebooks/sz_suite_td/24_C_Sumatra.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/25_S_Sumatra.ipynb b/notebooks/sz_suite_td/25_S_Sumatra.ipynb index 3e6470f..e859973 100644 --- a/notebooks/sz_suite_td/25_S_Sumatra.ipynb +++ b/notebooks/sz_suite_td/25_S_Sumatra.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/25_S_Sumatra.py b/notebooks/sz_suite_td/25_S_Sumatra.py index 47ee811..ee964b8 100644 --- a/notebooks/sz_suite_td/25_S_Sumatra.py +++ b/notebooks/sz_suite_td/25_S_Sumatra.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/26_Sunda_Strait.ipynb b/notebooks/sz_suite_td/26_Sunda_Strait.ipynb index 92f28ef..f3b69ce 100644 --- a/notebooks/sz_suite_td/26_Sunda_Strait.ipynb +++ b/notebooks/sz_suite_td/26_Sunda_Strait.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/26_Sunda_Strait.py b/notebooks/sz_suite_td/26_Sunda_Strait.py index 51223b9..f3a315e 100644 --- a/notebooks/sz_suite_td/26_Sunda_Strait.py +++ b/notebooks/sz_suite_td/26_Sunda_Strait.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/27_Java.ipynb b/notebooks/sz_suite_td/27_Java.ipynb index 5ebc8df..0f1251a 100644 --- a/notebooks/sz_suite_td/27_Java.ipynb +++ b/notebooks/sz_suite_td/27_Java.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/27_Java.py b/notebooks/sz_suite_td/27_Java.py index 84b28a2..64c5c7c 100644 --- a/notebooks/sz_suite_td/27_Java.py +++ b/notebooks/sz_suite_td/27_Java.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/28_Bali_Lombok.ipynb b/notebooks/sz_suite_td/28_Bali_Lombok.ipynb index 144a4ed..ad9d01f 100644 --- a/notebooks/sz_suite_td/28_Bali_Lombok.ipynb +++ b/notebooks/sz_suite_td/28_Bali_Lombok.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/28_Bali_Lombok.py b/notebooks/sz_suite_td/28_Bali_Lombok.py index 1f1b75a..809ceb1 100644 --- a/notebooks/sz_suite_td/28_Bali_Lombok.py +++ b/notebooks/sz_suite_td/28_Bali_Lombok.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/29_W_Banda_Sea.ipynb b/notebooks/sz_suite_td/29_W_Banda_Sea.ipynb index 30873e1..f6095d3 100644 --- a/notebooks/sz_suite_td/29_W_Banda_Sea.ipynb +++ b/notebooks/sz_suite_td/29_W_Banda_Sea.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/29_W_Banda_Sea.py b/notebooks/sz_suite_td/29_W_Banda_Sea.py index a13ff84..d6be70c 100644 --- a/notebooks/sz_suite_td/29_W_Banda_Sea.py +++ b/notebooks/sz_suite_td/29_W_Banda_Sea.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/30_E_Banda_Sea.ipynb b/notebooks/sz_suite_td/30_E_Banda_Sea.ipynb index 7c9e8b9..516e8d6 100644 --- a/notebooks/sz_suite_td/30_E_Banda_Sea.ipynb +++ b/notebooks/sz_suite_td/30_E_Banda_Sea.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/30_E_Banda_Sea.py b/notebooks/sz_suite_td/30_E_Banda_Sea.py index 054e46b..558c3a1 100644 --- a/notebooks/sz_suite_td/30_E_Banda_Sea.py +++ b/notebooks/sz_suite_td/30_E_Banda_Sea.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/31_New_Britain.ipynb b/notebooks/sz_suite_td/31_New_Britain.ipynb index 0a00c0d..14cdbc6 100644 --- a/notebooks/sz_suite_td/31_New_Britain.ipynb +++ b/notebooks/sz_suite_td/31_New_Britain.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/31_New_Britain.py b/notebooks/sz_suite_td/31_New_Britain.py index 158e985..2294172 100644 --- a/notebooks/sz_suite_td/31_New_Britain.py +++ b/notebooks/sz_suite_td/31_New_Britain.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/32_Solomon.ipynb b/notebooks/sz_suite_td/32_Solomon.ipynb index 1f50437..508fccf 100644 --- a/notebooks/sz_suite_td/32_Solomon.ipynb +++ b/notebooks/sz_suite_td/32_Solomon.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/32_Solomon.py b/notebooks/sz_suite_td/32_Solomon.py index 6501469..813503d 100644 --- a/notebooks/sz_suite_td/32_Solomon.py +++ b/notebooks/sz_suite_td/32_Solomon.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/33_N_Vanuatu.ipynb b/notebooks/sz_suite_td/33_N_Vanuatu.ipynb index fdbbd92..f87fca4 100644 --- a/notebooks/sz_suite_td/33_N_Vanuatu.ipynb +++ b/notebooks/sz_suite_td/33_N_Vanuatu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/33_N_Vanuatu.py b/notebooks/sz_suite_td/33_N_Vanuatu.py index 3da8830..c4a17ca 100644 --- a/notebooks/sz_suite_td/33_N_Vanuatu.py +++ b/notebooks/sz_suite_td/33_N_Vanuatu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/34_S_Vanuatu.ipynb b/notebooks/sz_suite_td/34_S_Vanuatu.ipynb index 89efc40..59bfeee 100644 --- a/notebooks/sz_suite_td/34_S_Vanuatu.ipynb +++ b/notebooks/sz_suite_td/34_S_Vanuatu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/34_S_Vanuatu.py b/notebooks/sz_suite_td/34_S_Vanuatu.py index c02102d..459d779 100644 --- a/notebooks/sz_suite_td/34_S_Vanuatu.py +++ b/notebooks/sz_suite_td/34_S_Vanuatu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/35_Tonga.ipynb b/notebooks/sz_suite_td/35_Tonga.ipynb index b7b7a54..9636134 100644 --- a/notebooks/sz_suite_td/35_Tonga.ipynb +++ b/notebooks/sz_suite_td/35_Tonga.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/35_Tonga.py b/notebooks/sz_suite_td/35_Tonga.py index 3eac7b7..410c125 100644 --- a/notebooks/sz_suite_td/35_Tonga.py +++ b/notebooks/sz_suite_td/35_Tonga.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/36_Kermadec.ipynb b/notebooks/sz_suite_td/36_Kermadec.ipynb index 27207dd..aadbd1b 100644 --- a/notebooks/sz_suite_td/36_Kermadec.ipynb +++ b/notebooks/sz_suite_td/36_Kermadec.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/36_Kermadec.py b/notebooks/sz_suite_td/36_Kermadec.py index 7acce13..6348441 100644 --- a/notebooks/sz_suite_td/36_Kermadec.py +++ b/notebooks/sz_suite_td/36_Kermadec.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/37_New_Zealand.ipynb b/notebooks/sz_suite_td/37_New_Zealand.ipynb index feb3ca6..a401834 100644 --- a/notebooks/sz_suite_td/37_New_Zealand.ipynb +++ b/notebooks/sz_suite_td/37_New_Zealand.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/37_New_Zealand.py b/notebooks/sz_suite_td/37_New_Zealand.py index 1148e0c..96af1b9 100644 --- a/notebooks/sz_suite_td/37_New_Zealand.py +++ b/notebooks/sz_suite_td/37_New_Zealand.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/38_S_Philippines.ipynb b/notebooks/sz_suite_td/38_S_Philippines.ipynb index d8f9df4..6ca4f54 100644 --- a/notebooks/sz_suite_td/38_S_Philippines.ipynb +++ b/notebooks/sz_suite_td/38_S_Philippines.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/38_S_Philippines.py b/notebooks/sz_suite_td/38_S_Philippines.py index 69ae91d..d2e2144 100644 --- a/notebooks/sz_suite_td/38_S_Philippines.py +++ b/notebooks/sz_suite_td/38_S_Philippines.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/39_N_Philippines.ipynb b/notebooks/sz_suite_td/39_N_Philippines.ipynb index 5acdf35..9c138eb 100644 --- a/notebooks/sz_suite_td/39_N_Philippines.ipynb +++ b/notebooks/sz_suite_td/39_N_Philippines.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/39_N_Philippines.py b/notebooks/sz_suite_td/39_N_Philippines.py index 9ca195c..068e848 100644 --- a/notebooks/sz_suite_td/39_N_Philippines.py +++ b/notebooks/sz_suite_td/39_N_Philippines.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/40_S_Marianas.ipynb b/notebooks/sz_suite_td/40_S_Marianas.ipynb index e5a933f..014340b 100644 --- a/notebooks/sz_suite_td/40_S_Marianas.ipynb +++ b/notebooks/sz_suite_td/40_S_Marianas.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/40_S_Marianas.py b/notebooks/sz_suite_td/40_S_Marianas.py index dffb554..18d9aca 100644 --- a/notebooks/sz_suite_td/40_S_Marianas.py +++ b/notebooks/sz_suite_td/40_S_Marianas.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/41_N_Marianas.ipynb b/notebooks/sz_suite_td/41_N_Marianas.ipynb index 8899f7e..26e28fd 100644 --- a/notebooks/sz_suite_td/41_N_Marianas.ipynb +++ b/notebooks/sz_suite_td/41_N_Marianas.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/41_N_Marianas.py b/notebooks/sz_suite_td/41_N_Marianas.py index 7bfe0e2..2ebe966 100644 --- a/notebooks/sz_suite_td/41_N_Marianas.py +++ b/notebooks/sz_suite_td/41_N_Marianas.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/42_Bonin.ipynb b/notebooks/sz_suite_td/42_Bonin.ipynb index a9e1dfd..729c69d 100644 --- a/notebooks/sz_suite_td/42_Bonin.ipynb +++ b/notebooks/sz_suite_td/42_Bonin.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/42_Bonin.py b/notebooks/sz_suite_td/42_Bonin.py index 55aea32..0bc665a 100644 --- a/notebooks/sz_suite_td/42_Bonin.py +++ b/notebooks/sz_suite_td/42_Bonin.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/43_Izu.ipynb b/notebooks/sz_suite_td/43_Izu.ipynb index 72464d1..84feec6 100644 --- a/notebooks/sz_suite_td/43_Izu.ipynb +++ b/notebooks/sz_suite_td/43_Izu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/43_Izu.py b/notebooks/sz_suite_td/43_Izu.py index 1b8dd58..e96a932 100644 --- a/notebooks/sz_suite_td/43_Izu.py +++ b/notebooks/sz_suite_td/43_Izu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/44_Kyushu.ipynb b/notebooks/sz_suite_td/44_Kyushu.ipynb index 751b509..cdcef43 100644 --- a/notebooks/sz_suite_td/44_Kyushu.ipynb +++ b/notebooks/sz_suite_td/44_Kyushu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/44_Kyushu.py b/notebooks/sz_suite_td/44_Kyushu.py index ecf1fdc..58c670a 100644 --- a/notebooks/sz_suite_td/44_Kyushu.py +++ b/notebooks/sz_suite_td/44_Kyushu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/45_Ryukyu.ipynb b/notebooks/sz_suite_td/45_Ryukyu.ipynb index c0d9a60..4bfe6a3 100644 --- a/notebooks/sz_suite_td/45_Ryukyu.ipynb +++ b/notebooks/sz_suite_td/45_Ryukyu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/45_Ryukyu.py b/notebooks/sz_suite_td/45_Ryukyu.py index 1671b20..9bd1459 100644 --- a/notebooks/sz_suite_td/45_Ryukyu.py +++ b/notebooks/sz_suite_td/45_Ryukyu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/46_Nankai.ipynb b/notebooks/sz_suite_td/46_Nankai.ipynb index aa0d398..2c8d107 100644 --- a/notebooks/sz_suite_td/46_Nankai.ipynb +++ b/notebooks/sz_suite_td/46_Nankai.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/46_Nankai.py b/notebooks/sz_suite_td/46_Nankai.py index 5e6dc46..119e253 100644 --- a/notebooks/sz_suite_td/46_Nankai.py +++ b/notebooks/sz_suite_td/46_Nankai.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/47_C_Honshu.ipynb b/notebooks/sz_suite_td/47_C_Honshu.ipynb index 6d6f7da..08199a7 100644 --- a/notebooks/sz_suite_td/47_C_Honshu.ipynb +++ b/notebooks/sz_suite_td/47_C_Honshu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/47_C_Honshu.py b/notebooks/sz_suite_td/47_C_Honshu.py index e14a605..d600671 100644 --- a/notebooks/sz_suite_td/47_C_Honshu.py +++ b/notebooks/sz_suite_td/47_C_Honshu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/48_N_Honshu.ipynb b/notebooks/sz_suite_td/48_N_Honshu.ipynb index 341e00d..d21ad76 100644 --- a/notebooks/sz_suite_td/48_N_Honshu.ipynb +++ b/notebooks/sz_suite_td/48_N_Honshu.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/48_N_Honshu.py b/notebooks/sz_suite_td/48_N_Honshu.py index 363bc29..847e356 100644 --- a/notebooks/sz_suite_td/48_N_Honshu.py +++ b/notebooks/sz_suite_td/48_N_Honshu.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/49_Hokkaido.ipynb b/notebooks/sz_suite_td/49_Hokkaido.ipynb index c6901e1..a6ef18c 100644 --- a/notebooks/sz_suite_td/49_Hokkaido.ipynb +++ b/notebooks/sz_suite_td/49_Hokkaido.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/49_Hokkaido.py b/notebooks/sz_suite_td/49_Hokkaido.py index 2a64aae..f0435cd 100644 --- a/notebooks/sz_suite_td/49_Hokkaido.py +++ b/notebooks/sz_suite_td/49_Hokkaido.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/50_S_Kurile.ipynb b/notebooks/sz_suite_td/50_S_Kurile.ipynb index 09d89dc..64280cb 100644 --- a/notebooks/sz_suite_td/50_S_Kurile.ipynb +++ b/notebooks/sz_suite_td/50_S_Kurile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/50_S_Kurile.py b/notebooks/sz_suite_td/50_S_Kurile.py index c56b549..8789557 100644 --- a/notebooks/sz_suite_td/50_S_Kurile.py +++ b/notebooks/sz_suite_td/50_S_Kurile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/51_N_Kurile.ipynb b/notebooks/sz_suite_td/51_N_Kurile.ipynb index 2ab580c..31a1dbf 100644 --- a/notebooks/sz_suite_td/51_N_Kurile.ipynb +++ b/notebooks/sz_suite_td/51_N_Kurile.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/51_N_Kurile.py b/notebooks/sz_suite_td/51_N_Kurile.py index bf609d7..4cc7279 100644 --- a/notebooks/sz_suite_td/51_N_Kurile.py +++ b/notebooks/sz_suite_td/51_N_Kurile.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/52_Kamchatka.ipynb b/notebooks/sz_suite_td/52_Kamchatka.ipynb index b816c0e..b25789f 100644 --- a/notebooks/sz_suite_td/52_Kamchatka.ipynb +++ b/notebooks/sz_suite_td/52_Kamchatka.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/52_Kamchatka.py b/notebooks/sz_suite_td/52_Kamchatka.py index e21031f..3fe0db3 100644 --- a/notebooks/sz_suite_td/52_Kamchatka.py +++ b/notebooks/sz_suite_td/52_Kamchatka.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/53_W_Aleutians.ipynb b/notebooks/sz_suite_td/53_W_Aleutians.ipynb index 30e751b..b3f70da 100644 --- a/notebooks/sz_suite_td/53_W_Aleutians.ipynb +++ b/notebooks/sz_suite_td/53_W_Aleutians.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/53_W_Aleutians.py b/notebooks/sz_suite_td/53_W_Aleutians.py index e472c87..55a6887 100644 --- a/notebooks/sz_suite_td/53_W_Aleutians.py +++ b/notebooks/sz_suite_td/53_W_Aleutians.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/54_C_Aleutians.ipynb b/notebooks/sz_suite_td/54_C_Aleutians.ipynb index 7f69a56..57baae2 100644 --- a/notebooks/sz_suite_td/54_C_Aleutians.ipynb +++ b/notebooks/sz_suite_td/54_C_Aleutians.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/54_C_Aleutians.py b/notebooks/sz_suite_td/54_C_Aleutians.py index 29e0efb..7c95d19 100644 --- a/notebooks/sz_suite_td/54_C_Aleutians.py +++ b/notebooks/sz_suite_td/54_C_Aleutians.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/55_E_Aleutians.ipynb b/notebooks/sz_suite_td/55_E_Aleutians.ipynb index b231fb2..56783f1 100644 --- a/notebooks/sz_suite_td/55_E_Aleutians.ipynb +++ b/notebooks/sz_suite_td/55_E_Aleutians.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/55_E_Aleutians.py b/notebooks/sz_suite_td/55_E_Aleutians.py index bcf4083..7959ae9 100644 --- a/notebooks/sz_suite_td/55_E_Aleutians.py +++ b/notebooks/sz_suite_td/55_E_Aleutians.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/56_Calabria.ipynb b/notebooks/sz_suite_td/56_Calabria.ipynb index 9962524..6af766f 100644 --- a/notebooks/sz_suite_td/56_Calabria.ipynb +++ b/notebooks/sz_suite_td/56_Calabria.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_suite_td/56_Calabria.py b/notebooks/sz_suite_td/56_Calabria.py index f6b844d..50b094d 100644 --- a/notebooks/sz_suite_td/56_Calabria.py +++ b/notebooks/sz_suite_td/56_Calabria.py @@ -118,6 +118,19 @@ # ### Solve +# Let's first set up a gif of the temperature. + +# In[ ]: + + +fps = 5 +plotter = pv.Plotter(notebook=False, off_screen=True) +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') +plotter.open_gif( str(output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif".format(name, resscale, cfl,)), fps=fps) + + # Solve using a dislocation creep rheology. # In[ ]: @@ -127,7 +140,8 @@ dt = cfl*resscale/szdict['Vs'] # Reduce the timestep to get an integer number of timesteps dt = szdict['As']/np.ceil(szdict['As']/dt) -sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1) +sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter) +plotter.close() # ### Plot @@ -137,9 +151,12 @@ # In[ ]: -plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm') +plotter = pv.Plotter() +utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0)) +utils.plot_geometry(geom, plotter=plotter, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter) utils.plot_save(plotter, output_folder / "{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png".format(name, resscale, cfl,)) @@ -200,7 +217,9 @@ diffgrid.set_active_scalars('T') plotter_diff = pv.Plotter() clim = None -plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim) +plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True}) +utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2) +utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green') plotter_diff.enable_parallel_projection() plotter_diff.view_xy() plotter_diff.show() diff --git a/notebooks/sz_suite_td/template.ipynb b/notebooks/sz_suite_td/template.ipynb index 9f59c39..23b7ac5 100644 --- a/notebooks/sz_suite_td/template.ipynb +++ b/notebooks/sz_suite_td/template.ipynb @@ -240,7 +240,30 @@ }, { "cell_type": "markdown", - "id": "60efe92f-4595-4029-a1b7-c9deabf1ed0f", + "id": "9ee393dc-eae4-411b-8e64-545f841c93ff", + "metadata": {}, + "source": [ + "Let's first set up a gif of the temperature." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa578681-6493-479a-8abb-0e2399a3ae76", + "metadata": {}, + "outputs": [], + "source": [ + "fps = 5\n", + "plotter = pv.Plotter(notebook=False, off_screen=True)\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', clim=[0.0, sz.Tm*sz.T0], scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", + "plotter.open_gif( str(output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.gif\".format(name, resscale, cfl,)), fps=fps)" + ] + }, + { + "cell_type": "markdown", + "id": "6bb953c1-a38d-4374-b0d1-da14591d5eff", "metadata": {}, "source": [ "Solve using a dislocation creep rheology." @@ -257,7 +280,8 @@ "dt = cfl*resscale/szdict['Vs']\n", "# Reduce the timestep to get an integer number of timesteps\n", "dt = szdict['As']/np.ceil(szdict['As']/dt)\n", - "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1)" + "sz.solve_timedependent_dislocationcreep(szdict['As'], dt, theta=0.5, rtol=1.e-1, verbosity=1, plotter=plotter)\n", + "plotter.close()" ] }, { @@ -283,9 +307,12 @@ "metadata": {}, "outputs": [], "source": [ - "plotter = utils.plot_scalar(sz.T_i, scale=sz.T0, gather=True, cmap='coolwarm')\n", + "plotter = pv.Plotter()\n", + "utils.plot_scalar(sz.T_i, plotter=plotter, scale=sz.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz.vw_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", "utils.plot_vector_glyphs(sz.vs_i, plotter=plotter, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz.v0))\n", + "utils.plot_geometry(geom, plotter=plotter, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter)\n", "utils.plot_save(plotter, output_folder / \"{}_td_solution_resscale_{:.2f}_cfl_{:.2f}.png\".format(name, resscale, cfl,))" ] @@ -384,7 +411,9 @@ "diffgrid.set_active_scalars('T')\n", "plotter_diff = pv.Plotter()\n", "clim = None\n", - "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim)\n", + "plotter_diff.add_mesh(diffgrid, cmap='coolwarm', clim=clim, scalar_bar_args={'title': 'Temperature Difference (deg C)', 'bold':True})\n", + "utils.plot_geometry(geom, plotter=plotter_diff, color='green', width=2)\n", + "utils.plot_couplingdepth(slab, plotter=plotter_diff, render_points_as_spheres=True, point_size=5.0, color='green')\n", "plotter_diff.enable_parallel_projection()\n", "plotter_diff.view_xy()\n", "plotter_diff.show()" diff --git a/notebooks/sz_tests.ipynb b/notebooks/sz_tests.ipynb index 943f1d5..3f7f2f6 100644 --- a/notebooks/sz_tests.ipynb +++ b/notebooks/sz_tests.ipynb @@ -184,9 +184,11 @@ "metadata": {}, "outputs": [], "source": [ - "plotter_case1_resscale2 = utils.plot_scalar(sz_case1_resscale2.T_i, scale=sz_case1_resscale2.T0, gather=True, cmap='coolwarm')\n", + "plotter_case1_resscale2 = utils.plot_scalar(sz_case1_resscale2.T_i, scale=sz_case1_resscale2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz_case1_resscale2.vw_i, plotter=plotter_case1_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case1_resscale2.v0))\n", "utils.plot_vector_glyphs(sz_case1_resscale2.vs_i, plotter=plotter_case1_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case1_resscale2.v0))\n", + "utils.plot_geometry(sz_case1_resscale2.geom, plotter=plotter_case1_resscale2, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_case1_resscale2.geom.slab_spline, plotter=plotter_case1_resscale2, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_case1_resscale2)\n", "utils.plot_save(plotter_case1_resscale2, output_folder / \"sz_tests_case1_resscale2_solution.png\")" ] @@ -260,9 +262,11 @@ "metadata": {}, "outputs": [], "source": [ - "plotter_case2_resscale2 = utils.plot_scalar(sz_case2_resscale2.T_i, scale=sz_case2_resscale2.T0, gather=True, cmap='coolwarm')\n", + "plotter_case2_resscale2 = utils.plot_scalar(sz_case2_resscale2.T_i, scale=sz_case2_resscale2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz_case2_resscale2.vw_i, plotter=plotter_case2_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case2_resscale2.v0))\n", "utils.plot_vector_glyphs(sz_case2_resscale2.vs_i, plotter=plotter_case2_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case2_resscale2.v0))\n", + "utils.plot_geometry(sz_case2_resscale2.geom, plotter=plotter_case2_resscale2, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_case2_resscale2.geom.slab_spline, plotter=plotter_case2_resscale2, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_case2_resscale2)\n", "utils.plot_save(plotter_case2_resscale2, output_folder / \"sz_tests_case2_resscale2_solution.png\")" ] @@ -318,9 +322,11 @@ "metadata": {}, "outputs": [], "source": [ - "plotter_ak = utils.plot_scalar(sz_ak.T_i, scale=sz_ak.T0, gather=True, cmap='coolwarm')\n", + "plotter_ak = utils.plot_scalar(sz_ak.T_i, scale=sz_ak.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz_ak.vw_i, plotter=plotter_ak, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_ak.v0))\n", "utils.plot_vector_glyphs(sz_ak.vs_i, plotter=plotter_ak, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_ak.v0))\n", + "utils.plot_geometry(sz_ak.geom, plotter=plotter_ak, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_ak.geom.slab_spline, plotter=plotter_ak, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_ak)\n", "utils.plot_save(plotter_ak, output_folder / \"sz_tests_ak_solution.png\")" ] @@ -333,7 +339,9 @@ "outputs": [], "source": [ "eta_ak = sz_ak.project_dislocationcreep_viscosity()\n", - "plotter_eta_ak = utils.plot_scalar(eta_ak, scale=sz_ak.eta0, gather=True, log_scale=True, show_edges=True)\n", + "plotter_eta_ak = utils.plot_scalar(eta_ak, scale=sz_ak.eta0, gather=True, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa s)', 'bold':True})\n", + "utils.plot_geometry(sz_ak.geom, plotter=plotter_eta_ak, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_ak.geom.slab_spline, plotter=plotter_eta_ak, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_eta_ak)\n", "utils.plot_save(plotter_eta_ak, output_folder / \"sz_tests_ak_eta.png\")" ] @@ -381,9 +389,11 @@ "metadata": {}, "outputs": [], "source": [ - "plotter_ant = utils.plot_scalar(sz_ant.T_i, scale=sz_ant.T0, gather=True, cmap='coolwarm')\n", + "plotter_ant = utils.plot_scalar(sz_ant.T_i, scale=sz_ant.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True})\n", "utils.plot_vector_glyphs(sz_ant.vw_i, plotter=plotter_ant, gather=True, factor=0.25, color='k', scale=utils.mps_to_mmpyr(sz_ant.v0))\n", "utils.plot_vector_glyphs(sz_ant.vs_i, plotter=plotter_ant, gather=True, factor=0.25, color='k', scale=utils.mps_to_mmpyr(sz_ant.v0))\n", + "utils.plot_geometry(sz_ant.geom, plotter=plotter_ant, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_ant.geom.slab_spline, plotter=plotter_ant, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_ant)\n", "utils.plot_save(plotter_ant, output_folder / \"sz_tests_ant_solution.png\")" ] @@ -396,7 +406,9 @@ "outputs": [], "source": [ "eta_ant = sz_ant.project_dislocationcreep_viscosity()\n", - "plotter_eta_ant = utils.plot_scalar(eta_ant, scale=sz_ant.eta0, gather=True, log_scale=True, show_edges=True)\n", + "plotter_eta_ant = utils.plot_scalar(eta_ant, scale=sz_ant.eta0, gather=True, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa s)', 'bold':True})\n", + "utils.plot_geometry(sz_ant.geom, plotter=plotter_eta_ant, color='green', width=2)\n", + "utils.plot_couplingdepth(sz_ant.geom.slab_spline, plotter=plotter_eta_ant, render_points_as_spheres=True, point_size=10.0, color='green')\n", "utils.plot_show(plotter_eta_ant)\n", "utils.plot_save(plotter_eta_ant, output_folder / \"sz_tests_ant_eta.png\")" ] diff --git a/notebooks/sz_tests.py b/notebooks/sz_tests.py index 2ebf3e3..13853da 100644 --- a/notebooks/sz_tests.py +++ b/notebooks/sz_tests.py @@ -101,9 +101,11 @@ # In[ ]: -plotter_case1_resscale2 = utils.plot_scalar(sz_case1_resscale2.T_i, scale=sz_case1_resscale2.T0, gather=True, cmap='coolwarm') +plotter_case1_resscale2 = utils.plot_scalar(sz_case1_resscale2.T_i, scale=sz_case1_resscale2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case1_resscale2.vw_i, plotter=plotter_case1_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case1_resscale2.v0)) utils.plot_vector_glyphs(sz_case1_resscale2.vs_i, plotter=plotter_case1_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case1_resscale2.v0)) +utils.plot_geometry(sz_case1_resscale2.geom, plotter=plotter_case1_resscale2, color='green', width=2) +utils.plot_couplingdepth(sz_case1_resscale2.geom.slab_spline, plotter=plotter_case1_resscale2, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_case1_resscale2) utils.plot_save(plotter_case1_resscale2, output_folder / "sz_tests_case1_resscale2_solution.png") @@ -147,9 +149,11 @@ # In[ ]: -plotter_case2_resscale2 = utils.plot_scalar(sz_case2_resscale2.T_i, scale=sz_case2_resscale2.T0, gather=True, cmap='coolwarm') +plotter_case2_resscale2 = utils.plot_scalar(sz_case2_resscale2.T_i, scale=sz_case2_resscale2.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_case2_resscale2.vw_i, plotter=plotter_case2_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case2_resscale2.v0)) utils.plot_vector_glyphs(sz_case2_resscale2.vs_i, plotter=plotter_case2_resscale2, gather=True, factor=0.05, color='k', scale=utils.mps_to_mmpyr(sz_case2_resscale2.v0)) +utils.plot_geometry(sz_case2_resscale2.geom, plotter=plotter_case2_resscale2, color='green', width=2) +utils.plot_couplingdepth(sz_case2_resscale2.geom.slab_spline, plotter=plotter_case2_resscale2, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_case2_resscale2) utils.plot_save(plotter_case2_resscale2, output_folder / "sz_tests_case2_resscale2_solution.png") @@ -179,9 +183,11 @@ # In[ ]: -plotter_ak = utils.plot_scalar(sz_ak.T_i, scale=sz_ak.T0, gather=True, cmap='coolwarm') +plotter_ak = utils.plot_scalar(sz_ak.T_i, scale=sz_ak.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_ak.vw_i, plotter=plotter_ak, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_ak.v0)) utils.plot_vector_glyphs(sz_ak.vs_i, plotter=plotter_ak, gather=True, factor=0.1, color='k', scale=utils.mps_to_mmpyr(sz_ak.v0)) +utils.plot_geometry(sz_ak.geom, plotter=plotter_ak, color='green', width=2) +utils.plot_couplingdepth(sz_ak.geom.slab_spline, plotter=plotter_ak, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_ak) utils.plot_save(plotter_ak, output_folder / "sz_tests_ak_solution.png") @@ -190,7 +196,9 @@ eta_ak = sz_ak.project_dislocationcreep_viscosity() -plotter_eta_ak = utils.plot_scalar(eta_ak, scale=sz_ak.eta0, gather=True, log_scale=True, show_edges=True) +plotter_eta_ak = utils.plot_scalar(eta_ak, scale=sz_ak.eta0, gather=True, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa s)', 'bold':True}) +utils.plot_geometry(sz_ak.geom, plotter=plotter_eta_ak, color='green', width=2) +utils.plot_couplingdepth(sz_ak.geom.slab_spline, plotter=plotter_eta_ak, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_eta_ak) utils.plot_save(plotter_eta_ak, output_folder / "sz_tests_ak_eta.png") @@ -218,9 +226,11 @@ # In[ ]: -plotter_ant = utils.plot_scalar(sz_ant.T_i, scale=sz_ant.T0, gather=True, cmap='coolwarm') +plotter_ant = utils.plot_scalar(sz_ant.T_i, scale=sz_ant.T0, gather=True, cmap='coolwarm', scalar_bar_args={'title': 'Temperature (deg C)', 'bold':True}) utils.plot_vector_glyphs(sz_ant.vw_i, plotter=plotter_ant, gather=True, factor=0.25, color='k', scale=utils.mps_to_mmpyr(sz_ant.v0)) utils.plot_vector_glyphs(sz_ant.vs_i, plotter=plotter_ant, gather=True, factor=0.25, color='k', scale=utils.mps_to_mmpyr(sz_ant.v0)) +utils.plot_geometry(sz_ant.geom, plotter=plotter_ant, color='green', width=2) +utils.plot_couplingdepth(sz_ant.geom.slab_spline, plotter=plotter_ant, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_ant) utils.plot_save(plotter_ant, output_folder / "sz_tests_ant_solution.png") @@ -229,7 +239,9 @@ eta_ant = sz_ant.project_dislocationcreep_viscosity() -plotter_eta_ant = utils.plot_scalar(eta_ant, scale=sz_ant.eta0, gather=True, log_scale=True, show_edges=True) +plotter_eta_ant = utils.plot_scalar(eta_ant, scale=sz_ant.eta0, gather=True, log_scale=True, show_edges=True, scalar_bar_args={'title': 'Viscosity (Pa s)', 'bold':True}) +utils.plot_geometry(sz_ant.geom, plotter=plotter_eta_ant, color='green', width=2) +utils.plot_couplingdepth(sz_ant.geom.slab_spline, plotter=plotter_eta_ant, render_points_as_spheres=True, point_size=10.0, color='green') utils.plot_show(plotter_eta_ant) utils.plot_save(plotter_eta_ant, output_folder / "sz_tests_ant_eta.png") diff --git a/python/utils.py b/python/utils.py index ebcc220..9766a3e 100644 --- a/python/utils.py +++ b/python/utils.py @@ -437,6 +437,70 @@ def plot_vector_glyphs(vector, factor=1.0, scale=1.0, plotter=None, gather=False return plotter +def plot_slab(slab, plotter=None, **pv_kwargs): + """ + Plot a slab spline using pyvista. + + Arguments: + * slab - the slab spline object to plot + + Keyword Arguments: + * plotter - a pyvista plotter, one will be created if none supplied (default=None) + * **pv_kwargs - kwargs for adding the mesh to the plotter + """ + slabpoints = np.empty((2*len(slab.interpcurves), 3)) + for i, curve in enumerate(slab.interpcurves): + slabpoints[2*i] = [curve.points[0].x, curve.points[0].y, 0.0] + slabpoints[2*i+1] = [curve.points[-1].x, curve.points[-1].y, 0.0] + if plotter is None: plotter = pv.Plotter() + if plotter is not None: + plotter.add_lines(slabpoints, **pv_kwargs) + return plotter + +def plot_geometry(geom, plotter=None, **pv_kwargs): + """ + Plot the subduction zone geometry using pyvista. + + Arguments: + * geom - the geometry object to plot + + Keyword Arguments: + * plotter - a pyvista plotter, one will be created if none supplied (default=None) + * **pv_kwargs - kwargs for adding the mesh to the plotter + """ + lines = [line for lineset in geom.crustal_lines for line in lineset] + \ + geom.slab_base_lines + \ + geom.wedge_base_lines + \ + geom.slab_side_lines + \ + geom.wedge_side_lines + \ + geom.wedge_top_lines + \ + geom.slab_spline.interpcurves + points = np.empty((len(lines)*2, 3)) + for i, line in enumerate(lines): + points[2*i] = [line.points[0].x, line.points[0].y, 0.0] + points[2*i+1] = [line.points[-1].x, line.points[-1].y, 0.0] + if plotter is None: plotter = pv.Plotter() + if plotter is not None: + plotter.add_lines(points,**pv_kwargs) + return plotter + +def plot_couplingdepth(slab, plotter=None, **pv_kwargs): + """ + Plot a point representing the coupling depth using pyvista. + + Arguments: + * slab - the slab spline object containing the 'Slab::FullCouplingDepth' point + + Keyword Arguments: + * plotter - a pyvista plotter, one will be created if none supplied (default=None) + * **pv_kwargs - kwargs for adding the mesh to the plotter + """ + point = slab.findpoint('Slab::FullCouplingDepth') + if plotter is None: plotter = pv.Plotter() + if plotter is not None: + plotter.add_points(np.asarray([point.x, point.y, 0.0]), **pv_kwargs) + return plotter + def plot_show(plotter): """ Display a pyvista plotter.