Skip to content

Commit

Permalink
build based on 6312c21
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Mar 15, 2024
1 parent e6c0306 commit 6443072
Show file tree
Hide file tree
Showing 35 changed files with 1,967 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable
1 change: 1 addition & 0 deletions v0.3
1 change: 1 addition & 0 deletions v0.3.01/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-03-15T06:42:46","documenter_version":"1.3.0"}}
74 changes: 74 additions & 0 deletions v0.3.01/LaMEM_ModelFunctions/index.html

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions v0.3.01/Subduction3D/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Example 4: 3D Subduction · LaMEM.jl</title><meta name="title" content="Example 4: 3D Subduction · LaMEM.jl"/><meta property="og:title" content="Example 4: 3D Subduction · LaMEM.jl"/><meta property="twitter:title" content="Example 4: 3D Subduction · LaMEM.jl"/><meta name="description" content="Documentation for LaMEM.jl."/><meta property="og:description" content="Documentation for LaMEM.jl."/><meta property="twitter:description" content="Documentation for LaMEM.jl."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">LaMEM.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><span class="tocitem">Installation</span><ul><li><a class="tocitem" href="../installation/">General instructions</a></li><li><a class="tocitem" href="../installation_HPC/">Installation on HPC systems</a></li></ul></li><li><span class="tocitem">Create &amp; run LaMEM models from julia</span><ul><li><a class="tocitem" href="../juliasetups/">Overview</a></li><li><a class="tocitem" href="../juliasetup_example_sphere/">Example 1: Sphere</a></li><li><a class="tocitem" href="../juliasetup_LaPalma/">Example 2: Volcano</a></li><li><a class="tocitem" href="../juliasetup_TMSubduction/">Example 3: 2D Subduction</a></li><li class="is-active"><a class="tocitem" href>Example 4: 3D Subduction</a><ul class="internal"><li><a class="tocitem" href="#1.-Generate-main-model-setup"><span>1. Generate main model setup</span></a></li><li><a class="tocitem" href="#2.-Define-geometry"><span>2. Define geometry</span></a></li><li><a class="tocitem" href="#3.-Add-material-properties:"><span>3. Add material properties:</span></a></li><li><a class="tocitem" href="#4.-Run-the-model"><span>4. Run the model</span></a></li></ul></li><li><a class="tocitem" href="../juliasetup_pluto/">Notebooks</a></li><li><a class="tocitem" href="../LaMEM_ModelFunctions/">Available functions</a></li></ul></li><li><a class="tocitem" href="../runlamem/">Run LaMEM</a></li><li><a class="tocitem" href="../readtimesteps/">Reading timesteps</a></li><li><a class="tocitem" href="../listfunctions/">List of functions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Create &amp; run LaMEM models from julia</a></li><li class="is-active"><a href>Example 4: 3D Subduction</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Example 4: 3D Subduction</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/JuliaGeodynamics/LaMEM.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/JuliaGeodynamics/LaMEM.jl/blob/main/scripts/Subduction3D.jl" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="3D-Subduction-example"><a class="docs-heading-anchor" href="#3D-Subduction-example">3D Subduction example</a><a id="3D-Subduction-example-1"></a><a class="docs-heading-anchor-permalink" href="#3D-Subduction-example" title="Permalink"></a></h1><p>This is a 3D subduction example for <code>LaMEM.jl</code> that illustrates how to use the julia interface. This is very similar to the setup described by Schellart and coworkers in a <a href="https://www.nature.com/articles/nature05615">2007 nature paper</a> in which they demonstrate that toroidal flow changes the slab curvature during subduction as a function of slab width.</p><h2 id="1.-Generate-main-model-setup"><a class="docs-heading-anchor" href="#1.-Generate-main-model-setup">1. Generate main model setup</a><a id="1.-Generate-main-model-setup-1"></a><a class="docs-heading-anchor-permalink" href="#1.-Generate-main-model-setup" title="Permalink"></a></h2><p>We first load the packages:</p><pre><code class="language-julia hljs">using LaMEM, GeophysicalModelGenerator</code></pre><p>Next, we generate the main model setup, specifying the resolution and grid dimensions. Note that a range of default values will be set, depending on the parameters you specify.</p><pre><code class="language-julia hljs">model = Model(
# Define the grid
Grid(nel=(128,32,64), x=[-3960, 500], y=[0,2640], z=[-660 ,0]),

# No slip lower boundary; the rest is free slip
BoundaryConditions(noslip = [0, 0, 0, 0, 1, 0]),

# We use a multigrid solver with 4 levels:
Solver(SolverType=&quot;multigrid&quot;, MGLevels=4, MGCoarseSolver=&quot;mumps&quot;,
PETSc_options=[ &quot;-snes_type ksponly&quot;,
&quot;-js_ksp_rtol 1e-3&quot;,
&quot;-js_ksp_atol 1e-4&quot;,
&quot;-js_ksp_monitor&quot;]),

# Output filename
Output(out_file_name=&quot;Subduction_3D&quot;, out_dir=&quot;Subduction_3D&quot;),

# Timestepping etc
Time(nstep_max=200, nstep_out=5, time_end=100, dt_min=1e-5),

# Scaling:
Scaling(GEO_units(length=1km, stress=1e9Pa) )
)</code></pre><h2 id="2.-Define-geometry"><a class="docs-heading-anchor" href="#2.-Define-geometry">2. Define geometry</a><a id="2.-Define-geometry-1"></a><a class="docs-heading-anchor-permalink" href="#2.-Define-geometry" title="Permalink"></a></h2><p>Next, we specify the geometry of the model, using the <code>AddBox!</code> function from <code>GeophysicalModelGenerator</code>. We start with the horizontal part of the slab. The function <code>AddBox!</code> allows you to specify a layered lithosphere; here we have a crust and mantle. It also allows specifying a thermal structure. Since the current setup is only mechanical, we don&#39;t specify that here.</p><pre><code class="language-julia hljs">AddBox!(model, xlim=(-3000,-1000), ylim=(0,1000), zlim=(-80,0), phase=LithosphericPhases(Layers=[20,60], Phases=[1,2]))</code></pre><p>The inclined part of the slab is generate by giving it a dip:</p><pre><code class="language-julia hljs">AddBox!(model, xlim=(-1000,-810), ylim=(0,1000), zlim=(-80,0), phase=LithosphericPhases(Layers=[20,60], Phases=[1,2]), DipAngle=16)</code></pre><p>There is a simple way to have a quick look at this setup by using the <code>Plots.jl</code> package:</p><pre><code class="language-julia hljs">using Plots
plot_cross_section(model, y=100, field=:phase)</code></pre><p>Which will give the following plot: <img src="../assets/SubductionSetup_3D.png" alt="2D cross section"/></p><h2 id="3.-Add-material-properties:"><a class="docs-heading-anchor" href="#3.-Add-material-properties:">3. Add material properties:</a><a id="3.-Add-material-properties:-1"></a><a class="docs-heading-anchor-permalink" href="#3.-Add-material-properties:" title="Permalink"></a></h2><p>We can specify material properties by using the <code>Phase</code> function</p><pre><code class="language-julia hljs">mantle = Phase(Name=&quot;mantle&quot;,ID=0,eta=1e21,rho=3200)
crust = Phase(Name=&quot;crust&quot;, ID=1,eta=1e21,rho=3280)
slab = Phase(Name=&quot;slab&quot;, ID=2,eta=2e23,rho=3280)</code></pre><p>and we can add them to the model with:</p><pre><code class="language-julia hljs">add_phase!(model, mantle, slab, crust)</code></pre><p>You can check that this is set with:</p><pre><code class="language-julia hljs">model</code></pre><pre><code class="language-julia hljs">LaMEM Model setup
|
|-- Scaling : GeoParams.Units.GeoUnits{GEO}
|-- Grid : nel=(128, 32, 64); xϵ(-3960.0, 500.0), yϵ(0.0, 2640.0), zϵ(-660.0, 0.0)
|-- Time : nstep_max=200; nstep_out=5; time_end=100.0; dt=0.05
|-- Boundary conditions : noslip=[0, 0, 0, 0, 1, 0]
|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options : multigrid solver; coarse grid solver=mumps; 4 levels
|-- Model setup options : Type=files;
|-- Output options : filename=Subduction_3D; pvd=1; avd=0; surf=0
|-- Materials : 3 phases;</code></pre><h2 id="4.-Run-the-model"><a class="docs-heading-anchor" href="#4.-Run-the-model">4. Run the model</a><a id="4.-Run-the-model-1"></a><a class="docs-heading-anchor-permalink" href="#4.-Run-the-model" title="Permalink"></a></h2><p>Add this stage, we are ready to run the simulation. On my machine it takes around 4 seconds per timestep on 8 cores:</p><pre><code class="language-julia hljs">run_lamem(model, 8)</code></pre><p>The results looks like this with paraview: <img src="../assets/Subduction_3D_pv.png" alt="3D subduction paraview"/> Note that this is a significantly higher resolution than the original paper, which was run on an HPC system (admittedly, this was 20 years ago).</p><p>The file <code>Subduction_3D.jl</code> in <code>/scripts</code> reproduces this example</p><h3 id="Markdown-page-generation"><a class="docs-heading-anchor" href="#Markdown-page-generation">Markdown page generation</a><a id="Markdown-page-generation-1"></a><a class="docs-heading-anchor-permalink" href="#Markdown-page-generation" title="Permalink"></a></h3><pre><code class="language-julia hljs">#This file was generated using Literate:
#Literate.markdown(&quot;Subduction3D.jl&quot;,&quot;../docs/src/&quot;,keepcomments=true, execute=false, codefence = &quot;```julia&quot; =&gt; &quot;```&quot;)</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../juliasetup_TMSubduction/">« Example 3: 2D Subduction</a><a class="docs-footer-nextpage" href="../juliasetup_pluto/">Notebooks »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Friday 15 March 2024 06:42">Friday 15 March 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file added v0.3.01/assets/FallingSphere_t20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added v0.3.01/assets/InitialSetupSphere.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added v0.3.01/assets/LaPalma_CrossSection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added v0.3.01/assets/LaPalma_topo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added v0.3.01/assets/SubductionSetup_3D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added v0.3.01/assets/Subduction_3D_pv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6443072

Please sign in to comment.