Skip to content

Commit

Permalink
Merge 4200451 into 44055b7
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojukka5 authored Aug 6, 2017
2 parents 44055b7 + 4200451 commit c6b44ae
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 87 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

[![Build Status](https://travis-ci.org/JuliaFEM/FEMQuad.jl.svg?branch=master)](https://travis-ci.org/JuliaFEM/FEMQuad.jl)[![Coverage Status](https://coveralls.io/repos/github/JuliaFEM/FEMQuad.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaFEM/FEMQuad.jl?branch=master)[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliafem.github.io/FEMQuad.jl/stable)[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliafem.github.io/FEMQuad.jl/latest)[![Issues](https://img.shields.io/github/issues/JuliaFEM/FEMQuad.jl.svg)](https://github.com/JuliaFEM/FEMQuad.jl/issues)

This package contains various of integration schemes for cartesian and tetrahedron domains. The most common integration rules are tabulated and focus is on speed.
FEMQuad.jl contains various of integration schemes for cartesian and tetrahedron
domains. The most common integration rules are tabulated and focus is on speed.

Usage is straightforward. For example, to integrate function
`f(x) = 1 + x[1] + x[2] + x[1]*x[2]` in a standard rectangular domain `[-1,1]^2`,
4 point Gauss-Legendre integration rule is needed:

Usage is straightforward. For example, to integrate function f(x) = 1 + x[1] + x[2] + x[1]*x[2] in standard rectangular domain [-1,1]^2, 4 point Gauss-Legendre integration rule is needed:
```julia
using FEMQuad
f(x) = 1 + x[1] + x[2] + x[1]*x[2]
Expand All @@ -14,7 +18,10 @@ for (w, gp) in get_quadrature_points(Val{:GLQUAD4})
end
```

Result can be verified to be 4. w is integration weight, gp is integration point location and :GLQUAD4 is integration rule used. In the same principle we have integration rules for tetrahedrons, hexahedrons and so on. For example, :GLTET15 is 15-point tetrahedron rule.
Result can be verified to be 4. `w` is integration weight, `gp` is integration point
location and `GLQUAD4` is the integration rule used. In the same principle we have
integration rules for tetrahedrons, hexahedrons and so on. For example, `GLTET15` is
a 15-point tetrahedron rule.

## References
- Wikipedia contributors. "Gaussian quadrature." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 24 Jul. 2017. Web. 29 Jul. 2017.
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/FEMQuad.jl/blob/master/LICENSE

using Documenter

deploydocs(
repo = "github.com/JuliaFEM/FEMQuad.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/FEMQuad.jl/blob/master/LICENSE

using Documenter, FEMQuad

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

```@meta
DocTestSetup = quote
using FEMQuad
end
```

## Index

```@index
```

## Functions

### Gauss-Legendre rules in segments

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG2}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG3}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG5}})
```

### Gauss-Legendre rules in triangles

These rules are from literature.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI3}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI3B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI4B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI6}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI7}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI12}})
```

### Gauss-Legendre rules in quadrangles

These rules are get from 1d quadratures by using tensor production.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD9}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD16}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD25}})
```

### Gauss-Legendre rules in tetrahedrons

These rules are from literature.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLTET1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET5}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET15}})
```

### Gauss-Legendre rules in hexahedrons

These rules are get from 1d quadratures by using tensor production.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX8}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX27}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX81}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX243}})
```

### Gauss-Legendre rules in prismatic domain

These rules for wedge are mainly tensor products of triangular domain and 1d domain

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLWED6}})
FEMQuad.get_quadrature_points(::Type{Val{:GLWED6B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLWED21}})
```

### Gauss-Legendre rules in pyramidal domains

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLPYR5}})
FEMQuad.get_quadrature_points(::Type{Val{:GLPYR5B}})
```

103 changes: 19 additions & 84 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,29 @@
# FEMQuad.jl documentation

```@contents
Pages = ["index.md", "api.md"]
```

```@meta
DocTestSetup = quote
using FEMQuad
end
```

## Functions

### Gauss-Legendre rules in segments

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG2}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG3}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLSEG5}})
```

### Gauss-Legendre rules in triangles

These rules are from literature.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI3}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI3B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI4B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI6}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI7}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTRI12}})
```

### Gauss-Legendre rules in quadrangles

These rules are get from 1d quadratures by using tensor production.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD9}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD16}})
FEMQuad.get_quadrature_points(::Type{Val{:GLQUAD25}})
```
FEMQuad.jl contains various of integration schemes for cartesian and tetrahedron
domains. The most common integration rules are tabulated and focus is on speed.

### Gauss-Legendre rules in tetrahedrons
Usage is straightforward. For example, to integrate function
`f(x) = 1 + x[1] + x[2] + x[1]*x[2]` in standard rectangular domain `[-1,1]^2`,
4 point Gauss-Legendre integration rule is needed:

These rules are from literature.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLTET1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET4}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET5}})
FEMQuad.get_quadrature_points(::Type{Val{:GLTET15}})
```

### Gauss-Legendre rules in hexahedrons

These rules are get from 1d quadratures by using tensor production.

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX1}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX8}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX27}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX81}})
FEMQuad.get_quadrature_points(::Type{Val{:GLHEX243}})
```

### Gauss-Legendre rules in prismatic domain

These rules for wedge are mainly tensor products of triangular domain and 1d domain

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLWED6}})
FEMQuad.get_quadrature_points(::Type{Val{:GLWED6B}})
FEMQuad.get_quadrature_points(::Type{Val{:GLWED21}})
```

### Gauss-Legendre rules in pyramidal domains

```@docs
FEMQuad.get_quadrature_points(::Type{Val{:GLPYR5}})
FEMQuad.get_quadrature_points(::Type{Val{:GLPYR5B}})
```julia
using FEMQuad
f(x) = 1 + x[1] + x[2] + x[1]*x[2]
I = 0.0
for (w, gp) in get_quadrature_points(Val{:GLQUAD4})
I += w*f(gp)
end
```

## Index
Result can be verified to be 4. `w` is integration weight, `gp` is integration point
location and `GLQUAD4` is integration rule used. In the same principle we have
integration rules for tetrahedrons, hexahedrons and so on. For example, `GLTET15`
is 15-point tetrahedron rule.

```@index
```
## References
- Wikipedia contributors. "Gaussian quadrature." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 24 Jul. 2017. Web. 29 Jul. 2017.

0 comments on commit c6b44ae

Please sign in to comment.