Skip to content

Commit

Permalink
Started reformatting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Dec 10, 2024
1 parent b460249 commit b0329b6
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 10 deletions.
159 changes: 157 additions & 2 deletions docs/src/ReferenceFEs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,162 @@ CurrentModule = Gridap.ReferenceFEs

# Gridap.ReferenceFEs

```@autodocs
Modules = [ReferenceFEs,]
## Polytopes

```@docs
Polytope
Base.==
test_polytope
```

### Polytope Geometry

```@docs
get_edge_tangent
get_facet_normal
get_facet_orientations
get_vertex_coordinates
get_face_coordinates
get_bounding_box
```

### Polytope Topology

```@docs
num_dims
num_faces
num_facets
num_edges
num_vertices
get_faces
get_dimranges
get_dimrange
get_facedims
get_reffaces
get_face_dimranges
get_face_type
get_face_vertices
get_face_vertex_permutations
get_vertex_permutations
get_offsets
get_offset
is_n_cube
is_simplex
simplexify
```

### Extrusion Polytopes

```@docs
ExtrusionPolytope
get_extrusion
HEX_AXIS
TET_AXIS
VERTEX
SEGMENT
TRI
QUAD
TET
HEX
WEDGE
PYRAMID
next_corner!
```

### General Polytopes

```@docs
GeneralPolytope
Polygon
Polyhedron
get_graph
get_metadata
isopen
isactive
check_polytope_graph
simplexify_interior
simplexify_surface
```

## Quadratures

```@docs
Quadrature
get_coordinates
get_weights
get_name
num_points
num_point_dims
num_dims
test_quadratures
GenericQuadrature
```

### Available Quadratures

```@docs
TensorProduct
Duffy
Strang
XiaoGimbutas
```

## ReferenceFEs

```@docs
ReferenceFE
ReferenceFEName
GenericReferenceFE
num_dims
num_cell_dims
num_point_dims
num_faces
num_vertices
num_edges
num_facets
num_dofs
get_polytope
get_prebasis
get_shapefuns
get_dof_basis
compute_shapefuns
compute_dofs
Conformity
get_face_dofs
get_face_own_dofs
get_face_own_dofs_permutations
test_reference_fe
```

### Nodal ReferenceFEs

```@docs
LagrangianRefFE
is_first_order
is_P
is_Q
is_S
compute_monomial_basis
compute_own_nodes
compute_face_orders
compute_nodes
compute_own_nodes_permutations
compute_lagrangian_reffaces
VERTEX1
SEG2
QUAD4
TRI3
TET4
HEX8
```

### Moment-Based ReferenceFEs

```@docs
MomentBasedReferenceFE
RaviartThomasRefFE
NedelecRefFE
BDMRefFE
ArnoldWintherRefFE
MardalTaiWintherRefFE
```
10 changes: 10 additions & 0 deletions src/ReferenceFEs/DuffyQuadratures.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

"""
struct Duffy <: QuadratureName
Duffy quadrature rule for simplices, obtained as the mapped
tensor product of 1d Gauss-Jacobi and Gauss-Legendre quadratures.
# Constructor:
Quadrature(p::Polytope,duffy,degree::Integer;T::Type{<:AbstractFloat}=Float64)
"""
struct Duffy <: QuadratureName end

const duffy = Duffy()
Expand Down
10 changes: 10 additions & 0 deletions src/ReferenceFEs/StrangQuadratures.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@

"""
struct Strang <: QuadratureName
Strang quadrature rule for simplices.
# Constructor:
Quadrature(p::Polytope,strang,degree::Integer;T::Type{<:AbstractFloat}=Float64)
"""
struct Strang <: QuadratureName end

const strang = Strang()

function Quadrature(p::Polytope,::Strang,degree::Integer;T::Type{<:AbstractFloat}=Float64)
Expand Down
10 changes: 10 additions & 0 deletions src/ReferenceFEs/TensorProductQuadratures.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

"""
struct TensorProduct <: QuadratureName
Tensor product quadrature rule for n-cubes, obtained as the
tensor product of 1d Gauss-Legendre quadratures.
# Constructor:
Quadrature(p::Polytope{D},tensor_product,degrees::Union{Integer,NTuple{D,Integer}};T::Type{<:AbstractFloat}=Float64) where D
"""
struct TensorProduct <: QuadratureName end

const tensor_product = TensorProduct()
Expand Down
28 changes: 20 additions & 8 deletions src/ReferenceFEs/XiaoGimbutasQuadratures.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@

"""
struct XiaoGimbutas <: QuadratureName end
Xiao-Gimbutas symmetric quadrature rule for simplices.
# Constructor:
`Quadrature(p::Polytope,xiao_gimbutas::XiaoGimbutas,degree::Integer;T::Type{<:AbstractFloat}=Float64)`
# Reference:
`A numerical algorithm for the construction of efficient quadrature rules in two and higher dimensions`,
Hong Xiao, Zydrunas Gimbutas, Computers & Mathematics with Applications, (2010),
DOI : https://doi.org/10.1016/j.camwa.2009.10.027
Adapted from: https://github.com/FEniCS/basix/blob/main/cpp/basix/quadrature.cpp
"""
struct XiaoGimbutas <: QuadratureName end

const xiao_gimbutas = XiaoGimbutas()

# Reference:
# `A numerical algorithm for the construction of efficient quadrature rules in two and higher dimensions`,
# Hong Xiao, Zydrunas Gimbutas, Computers & Mathematics with Applications, (2010)
# DOI : https://doi.org/10.1016/j.camwa.2009.10.027
# Adapted from:
# https://github.com/FEniCS/basix/blob/main/cpp/basix/quadrature.cpp
function Quadrature(
p::Polytope,::XiaoGimbutas,degree::Integer;T::Type{<:AbstractFloat}=Float64
)
msg = """\n
`strang` quadrature rule only available for simplices.
`xiao_gimbutas` quadrature rule only available for simplices.
Use `tensor_product` for n-cubes.
"""
@assert is_simplex(p) msg
Expand All @@ -24,7 +36,7 @@ function Quadrature(
x, w = _xiaogimbutas_quad_tet(degree)
else
msg = """\n
`strang` quadrature rule only available for tris and tets.
`xiao_gimbutas` quadrature rule only available for tris and tets.
Use `duffy` for other simplices.
"""
@unreachable msg
Expand Down

0 comments on commit b0329b6

Please sign in to comment.