From b5f1f309030388be812612f8759722d7fa7f0726 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Thu, 8 Feb 2018 12:13:03 +0200 Subject: [PATCH] Fix documentation It's a bad idea to generate figures automatically, the solution is too complex for travis-ci. Better to use static pictures. --- docs/make.jl | 6 - docs/src/figs/fig1.svg | 338 +++++++++++++++++++++++++++++++++++++++++ docs/src/figs/fig2.svg | 305 +++++++++++++++++++++++++++++++++++++ docs/src/figs/fig3.svg | 330 ++++++++++++++++++++++++++++++++++++++++ docs/src/theory.md | 27 ++-- 5 files changed, 985 insertions(+), 21 deletions(-) create mode 100644 docs/src/figs/fig1.svg create mode 100644 docs/src/figs/fig2.svg create mode 100644 docs/src/figs/fig3.svg diff --git a/docs/make.jl b/docs/make.jl index 92fcbc2..af6ad30 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -3,12 +3,6 @@ using Documenter, Mortar2D -if haskey(ENV, "TRAVIS") - println("inside TRAVIS, installing PyPlot + matplotlib") - Pkg.add("PyPlot") - run(`pip install matplotlib`) -end - makedocs(modules=[Mortar2D], format = :html, sitename = "Mortar2D", diff --git a/docs/src/figs/fig1.svg b/docs/src/figs/fig1.svg new file mode 100644 index 0000000..087013d --- /dev/null +++ b/docs/src/figs/fig1.svg @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/figs/fig2.svg b/docs/src/figs/fig2.svg new file mode 100644 index 0000000..c95a097 --- /dev/null +++ b/docs/src/figs/fig2.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/figs/fig3.svg b/docs/src/figs/fig3.svg new file mode 100644 index 0000000..4c6a19e --- /dev/null +++ b/docs/src/figs/fig3.svg @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/theory.md b/docs/src/theory.md index 3b73a53..9bef608 100644 --- a/docs/src/theory.md +++ b/docs/src/theory.md @@ -79,16 +79,12 @@ slave_elements = Dict(i => elements[i] for i in slave_element_ids) master_element_ids = [5, 6, 7, 8, 9] -element_types = Dict(i => :Seg2 for i=1:length(elements)); -``` +element_types = Dict(i => :Seg2 for i=1:length(elements)) -```@example 0 -using PyPlot # hide -include("plots.jl") # hide -plot1(plot_element_normals=true) # hide -savefig("fig1.svg"); nothing # hide +nothing # hide ``` -![](fig1.svg) + +![](figs/fig1.svg) For first order elements, normal direction is not unique. For that reason some preprocessing needs to be done to calculate unique nodal normals. @@ -103,12 +99,15 @@ in element ``e`` in node ``k``, and adj means adjacing elements. This is implemented in function `calculate_normals`: +```@setup 0 +using Mortar2D: calculate_normals, project_from_master_to_slave, project_from_slave_to_master, calculate_segments, calculate_mortar_matrices, calculate_mortar_assembly +``` + ```@example 0 -plot1(;plot_nodal_normals=true) # hide -savefig("fig2.svg"); nothing # hide normals = calculate_normals(slave_elements, element_types, coords) ``` -![](fig2.svg) + +![](figs/fig2.svg) This package follows the idea of continuous normal field, proposed by Yang et al., where all the quantities are projected using only slave side normals. If we wish to find the projection of a slave node ``\boldsymbol{x}_{\mathrm{s}}``, @@ -137,13 +136,11 @@ also linear if ``\boldsymbol{n}_{\mathrm{s1}}=\boldsymbol{n}_{\mathrm{s2}}``. These equations are solved in function `project_from_master_to_slave` and `project_from_slave_to_master`. They are used in function `calculate_segments`, which is used to calculate segmentation of interface. ```@example 0 -plot1(;plot_segmentation=true) # hide -savefig("fig3.svg"); nothing # hide segmentation = calculate_segments(slave_element_ids, master_element_ids, elements, element_types, coords, normals) - ``` -![](fig3.svg) + +![](figs/fig3.svg) After segmentation is calculated, it's possible to integrate over non-conforming surface to calculate mortar matrices ``\boldsymbol{D}``