Skip to content

Commit

Permalink
build based on 2e29dd1
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptodoctor committed Nov 6, 2023
1 parent f4f78b0 commit 7002783
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
(Tutorials) pkg> instantiate

# Type Ctrl+C to get back to command mode
julia&gt; include(&quot;deps/build.jl&quot;)</code></pre><p>Done!</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="pages/t001_poisson/">1 Poisson equation »</a></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="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> on <span class="colophon-date" title="Monday 28 August 2023 02:42">Monday 28 August 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
julia&gt; include(&quot;deps/build.jl&quot;)</code></pre><p>Done!</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="pages/t001_poisson/">1 Poisson equation »</a></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="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> on <span class="colophon-date" title="Monday 6 November 2023 19:26">Monday 6 November 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/notebooks/t011_fsi_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
{
"cell_type": "markdown",
"source": [
"We consider a free tranction condition at the channel outlet\n",
"We consider a free traction condition at the channel outlet\n",
"$$\n",
"n_{\\rm F} \\cdot \\boldsymbol{\\sigma}_{\\rm F} = \\mathbf{0}\\quad\\textrm{on }\\Gamma_{\\rm F,N}\n",
"$$"
Expand Down
2 changes: 1 addition & 1 deletion dev/pages/t001_poisson/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
h(x) = 3.0
a(u,v) = ∫( ∇(v)⋅∇(u) )*dΩ
b(v) = ∫( v*f )*dΩ + ∫( v*h )*dΓ</code></pre><p>Note that by using the integral function <code></code>, the Lebesgue measures <code></code>, <code></code>, and the gradient function <code></code>, the weak form is written with an obvious relation with the corresponding mathematical notation.</p><h2 id="FE-Problem-1"><a class="docs-heading-anchor" href="#FE-Problem-1">FE Problem</a><a class="docs-heading-anchor-permalink" href="#FE-Problem-1" title="Permalink"></a></h2><p>At this point, we can build the FE problem that, once solved, will provide the numerical solution we are looking for. A FE problem is represented in Gridap by types inheriting from the abstract type <code>FEOperator</code> (both for linear and nonlinear cases). Since we want to solve a linear problem, we use the concrete type <code>AffineFEOperator</code>, i.e., a problem represented by a matrix and a right hand side vector.</p><pre><code class="language-julia">op = AffineFEOperator(a,b,Ug,V0)</code></pre><p>Note that the <code>AffineFEOperator</code> object representing our FE problem is built from the function <code>a</code> and <code>b</code> representing the weak form and test and trial FE spaces <code>V0</code> and <code>Ug</code>.</p><h2 id="Solver-phase-1"><a class="docs-heading-anchor" href="#Solver-phase-1">Solver phase</a><a class="docs-heading-anchor-permalink" href="#Solver-phase-1" title="Permalink"></a></h2><p>We have constructed a FE problem, the last step is to solve it. In Gridap, FE problems are solved with types inheriting from the abstract type <code>FESolver</code>. Since this is a linear problem, we use a <code>LinearFESolver</code>:</p><pre><code class="language-julia">ls = LUSolver()
solver = LinearFESolver(ls)</code></pre><p><code>LinearFESolver</code> objects are built from a given algebraic linear solver. In this case, we use a LU factorization. Now we are ready to solve the FE problem with the FE solver as follows:</p><pre><code class="language-julia">uh = solve(solver,op)</code></pre><p>The <code>solve</code> function returns the computed numerical solution <code>uh</code>. This object is an instance of <code>FEFunction</code>, the type used to represent a function in a FE space. We can inspect the result by writing it into a <code>vtk</code> file:</p><pre><code class="language-julia">writevtk(Ω,&quot;results&quot;,cellfields=[&quot;uh&quot;=&gt;uh])</code></pre><p>which will generate a file named <code>results.vtu</code> having a nodal field named <code>&quot;uh&quot;</code> containing the solution of our problem (see next figure).</p><p><img src="../../assets/poisson/fig_uh.png" alt/></p><h2 id="References-1"><a class="docs-heading-anchor" href="#References-1">References</a><a class="docs-heading-anchor-permalink" href="#References-1" title="Permalink"></a></h2><p>[1] C. Johnson. <em>Numerical Solution of Partial Differential Equations by the Finite Element Method</em>. Dover Publications, 2009.</p><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="../../">« Introduction</a><a class="docs-footer-nextpage" href="../t002_validation/">2 Code validation »</a></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="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> on <span class="colophon-date" title="Monday 28 August 2023 02:42">Monday 28 August 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
solver = LinearFESolver(ls)</code></pre><p><code>LinearFESolver</code> objects are built from a given algebraic linear solver. In this case, we use a LU factorization. Now we are ready to solve the FE problem with the FE solver as follows:</p><pre><code class="language-julia">uh = solve(solver,op)</code></pre><p>The <code>solve</code> function returns the computed numerical solution <code>uh</code>. This object is an instance of <code>FEFunction</code>, the type used to represent a function in a FE space. We can inspect the result by writing it into a <code>vtk</code> file:</p><pre><code class="language-julia">writevtk(Ω,&quot;results&quot;,cellfields=[&quot;uh&quot;=&gt;uh])</code></pre><p>which will generate a file named <code>results.vtu</code> having a nodal field named <code>&quot;uh&quot;</code> containing the solution of our problem (see next figure).</p><p><img src="../../assets/poisson/fig_uh.png" alt/></p><h2 id="References-1"><a class="docs-heading-anchor" href="#References-1">References</a><a class="docs-heading-anchor-permalink" href="#References-1" title="Permalink"></a></h2><p>[1] C. Johnson. <em>Numerical Solution of Partial Differential Equations by the Finite Element Method</em>. Dover Publications, 2009.</p><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="../../">« Introduction</a><a class="docs-footer-nextpage" href="../t002_validation/">2 Code validation »</a></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="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> on <span class="colophon-date" title="Monday 6 November 2023 19:26">Monday 6 November 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/pages/t002_validation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
linreg[2]
end</code></pre><p>The slopes for the <span>$L^2$</span> error norm is computed as</p><pre><code class="language-julia">slope(hs,el2s1)
slope(hs,el2s2)</code></pre><p>and for the <span>$H^1$</span> error norm as</p><pre><code class="language-julia">slope(hs,eh1s1)
slope(hs,eh1s2)</code></pre><p>If your run these lines in a notebook, you will see that the slopes for the <span>$L^2$</span> and <span>$H^1$</span> error norms are 2 and 1 for <span>$k=1$</span> and 3 and 2 for <span>$k=2$</span> respectively.</p><p>Congrats, another tutorial done!</p><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="../t001_poisson/">« 1 Poisson equation</a><a class="docs-footer-nextpage" href="../t003_elasticity/">3 Linear elasticity »</a></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="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> on <span class="colophon-date" title="Monday 28 August 2023 02:42">Monday 28 August 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
slope(hs,eh1s2)</code></pre><p>If your run these lines in a notebook, you will see that the slopes for the <span>$L^2$</span> and <span>$H^1$</span> error norms are 2 and 1 for <span>$k=1$</span> and 3 and 2 for <span>$k=2$</span> respectively.</p><p>Congrats, another tutorial done!</p><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="../t001_poisson/">« 1 Poisson equation</a><a class="docs-footer-nextpage" href="../t003_elasticity/">3 Linear elasticity »</a></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="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> on <span class="colophon-date" title="Monday 6 November 2023 19:26">Monday 6 November 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/pages/t003_elasticity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
end
end</code></pre><p>Note that in this new version of the constitutive law, we have included a third argument that represents the integer value associated with a certain material. If the value corresponds to the one for aluminum (i.e., <code>tag == alu_tag</code>), then, we use the constitutive law for this material, otherwise, we use the law for steel.</p><p>Since we have constructed a new constitutive law, we need to re-define the bilinear form of the problem:</p><pre><code class="language-julia">a(u,v) = ∫( ε(v) ⊙ (σ_bimat∘(ε(u),tags)) )*dΩ</code></pre><p>In previous line, pay attention in the usage of the new constitutive law <code>σ_bimat</code>. Note that we have passed the vector <code>tags</code> containing the material identifiers in the last argument of the function`.</p><p>At this point, we can build the FE problem again and solve it</p><pre><code class="language-julia">op = AffineFEOperator(a,l,U,V0)
uh = solve(op)</code></pre><p>Once the solution is computed, we can store the results in a file for visualization. Note that, we are including the stress tensor in the file (computed with the bi-material law).</p><pre><code class="language-julia">writevtk(Ω,&quot;results_bimat&quot;,cellfields=
[&quot;uh&quot;=&gt;uh,&quot;epsi&quot;=&gt;ε(uh),&quot;sigma&quot;=&gt;σ_bimat∘(ε(uh),tags)])</code></pre><p>Tutorial done!</p><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="../t002_validation/">« 2 Code validation</a><a class="docs-footer-nextpage" href="../t004_p_laplacian/">4 p-Laplacian »</a></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="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> on <span class="colophon-date" title="Monday 28 August 2023 02:42">Monday 28 August 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
[&quot;uh&quot;=&gt;uh,&quot;epsi&quot;=&gt;ε(uh),&quot;sigma&quot;=&gt;σ_bimat∘(ε(uh),tags)])</code></pre><p>Tutorial done!</p><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="../t002_validation/">« 2 Code validation</a><a class="docs-footer-nextpage" href="../t004_p_laplacian/">4 p-Laplacian »</a></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="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> on <span class="colophon-date" title="Monday 6 November 2023 19:26">Monday 6 November 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/pages/t004_p_laplacian/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
Random.seed!(1234)
x = rand(Float64,num_free_dofs(Ug))
uh0 = FEFunction(Ug,x)
uh, = solve!(uh0,solver,op)</code></pre><p>We finish this tutorial by writing the computed solution for visualization (see next figure).</p><pre><code class="language-julia">writevtk(Ω,&quot;results&quot;,cellfields=[&quot;uh&quot;=&gt;uh])</code></pre><p><img src="../../assets/p_laplacian/sol-plap.png" alt/></p><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="../t003_elasticity/">« 3 Linear elasticity</a><a class="docs-footer-nextpage" href="../t005_hyperelasticity/">5 Hyper-elasticity »</a></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="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> on <span class="colophon-date" title="Monday 28 August 2023 02:42">Monday 28 August 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
uh, = solve!(uh0,solver,op)</code></pre><p>We finish this tutorial by writing the computed solution for visualization (see next figure).</p><pre><code class="language-julia">writevtk(Ω,&quot;results&quot;,cellfields=[&quot;uh&quot;=&gt;uh])</code></pre><p><img src="../../assets/p_laplacian/sol-plap.png" alt/></p><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="../t003_elasticity/">« 3 Linear elasticity</a><a class="docs-footer-nextpage" href="../t005_hyperelasticity/">5 Hyper-elasticity »</a></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="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> on <span class="colophon-date" title="Monday 6 November 2023 19:26">Monday 6 November 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 7002783

Please sign in to comment.