Skip to content

Commit

Permalink
Update documentation (#9)
Browse files Browse the repository at this point in the history
- try `Documenter.jl` native document generation
- add custom `make.jl` and `deploy.jl` to override default process
- add `index.md` and `api.md` for startings
  • Loading branch information
ahojukka5 committed Jul 31, 2017
1 parent 70be565 commit 0fd4fbd
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 16 deletions.
11 changes: 11 additions & 0 deletions docs/deploy.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/Mortar2D.jl/blob/master/LICENSE

using Documenter

deploydocs(
repo = "github.com/JuliaFEM/Mortar2D.jl.git",
julia = "0.6",
target = "build",
deps = nothing,
make = nothing)
12 changes: 12 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/Mortar2D.jl/blob/master/LICENSE

using Documenter, Mortar2D

makedocs(modules=[Mortar2D],
format = :html,
sitename = "Mortar2D",
pages = [
"Introduction" => "index.md",
"API" => "api.md",
])
23 changes: 23 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# API documentation

```@meta
DocTestSetup = quote
using Mortar2D
using Mortar2D: calculate_normals, project_from_master_to_slave, project_from_slave_to_master, calculate_segments, calculate_mortar_matrices, calculate_mortar_assembly
end
```

```@docs
Mortar2D.calculate_normals
Mortar2D.project_from_master_to_slave
Mortar2D.project_from_slave_to_master
Mortar2D.calculate_segments
Mortar2D.calculate_mortar_matrices
Mortar2D.calculate_mortar_assembly
```

## Index

```@index
```

Binary file added docs/src/figs/contact_segmentation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 28 additions & 13 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
# Mortar2D.jl documentation

![Typical 2d segmentation](figs/contact_segmentation.png)
```@contents
Pages = ["index.md", "api.md"]
```

```@meta
DocTestSetup = quote
using Mortar2D
end
```
Mortar2D.jl is a julia package to calculate discrete projections between
non-conforming finite element mesheds. The resulting "mortar matrices" can
be used to tie non-conforming finite element meshes together which are meshed
separately to construct bigger models.

## Constants
Using mortar methods in mesh tie problems results variationally consistent
solution. Mathematically, goal is to solve mixed problem with primary field
variable and Lagrange multipliers, which have a physical meaning (e.g. contact
pressure if unknown field is displacement). The problem arising is a typical
saddle point problem with zeros on diagonal.

```@docs
```
Mortar2D.jl is part of JuliaFEM. All codes are MIT licensed.

## Functions

```@docs
```
## Installing and testing package

## Index
Installing package goes same way like other packages in julia, i.e.
```julia
julia> Pkg.add("Mortar2D")
```

```@index
Testing package can be done using `Pkg.test`, i.e.
```julia
julia> Pkg.test("Mortar2D")
```

## Contributing

Have a new great idea and want to share it with the open source community?
From [here](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md)
and [here](https://juliadocs.github.io/Documenter.jl/stable/man/contributing/)
you can look for coding style. [Here](https://docs.julialang.org/en/stable/manual/packages/#Making-changes-to-an-existing-package-1) is explained how to contribute to
open source project, in general.

21 changes: 18 additions & 3 deletions src/calculate_normals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@
# License is MIT: see https://github.com/JuliaFEM/Mortar2D.jl/blob/master/LICENSE

"""
calculate_normals(elements::Dict{Int, Vector{Int}}, element_types::Dict{Int, Symbol}, X::Dict{Int, Vector{Float64})
calculate_normals(elements::Dict{Int, Vector{Int}},
element_types::Dict{Int, Symbol},
X::Dict{Int, Vector{Float64})
Given elements, element types and node locations, calculate nodal normals by
first calculating normal directions for each element and then averaging them
in nodes. As a result we get unique normal direction defined to each node.
# References
# Example
```jldoctest
X = Dict(1 => [7.0, 7.0], 2 => [4.0, 3.0], 3 => [0.0, 0.0])
elements = Dict(1 => [1, 2], 2 => [2, 3])
element_types = Dict(1 => :Seg2, 2 => :Seg2)
normals = calculate_normals(elements, element_types, X)
# output
Dict{Int64,Array{Float64,1}} with 3 entries:
2 => [0.707107, -0.707107]
3 => [0.6, -0.8]
1 => [0.8, -0.6]
```
- Yang2005
"""
function calculate_normals{T<:Integer,P<:AbstractFloat}(elements::Dict{T, Vector{T}},
element_types::Dict{T, Symbol},
Expand Down

0 comments on commit 0fd4fbd

Please sign in to comment.