Skip to content

Commit fd7999d

Browse files
committed
Format markdown files
1 parent 41f2921 commit fd7999d

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ more discussion).
161161
# Linear Lagrange interpolation for a vector problem on the triangle (vector dimension
162162
# same as the reference dimension)
163163
ip_scalar = Lagrange{RefTriangle, 1}()
164-
ip_vector = ip_scalar ^ 2 # or VectorizedInterpolation{2}(ip_scalar)
164+
ip_vector = ip_scalar^2 # or VectorizedInterpolation{2}(ip_scalar)
165165
```
166166

167167
- **Quadrature**: remove the first parameter (the reference dimension) and use new reference

docs/src/topics/assembly.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the row/column which corresponds to the degrees of freedom for the cell:
1414

1515
```julia
1616
K[celldofs, celldofs] += ke
17-
f[celldofs] += fe
17+
f[celldofs] += fe
1818
```
1919

2020
where `celldofs` is the vector containing the degrees of freedom for the cell.
@@ -57,7 +57,7 @@ which perform the following operations in an efficient manner:
5757

5858
```julia
5959
K[celldofs, celldofs] += ke
60-
f[celldofs] += fe
60+
f[celldofs] += fe
6161
```
6262

6363
## Pseudo-code for efficient assembly

docs/src/topics/boundary_conditions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ the relevant `facetset` by using the [`FacetIterator`](@ref).
123123
For a scalar field, this can be done as
124124

125125
```julia
126-
grid = generate_grid(Quadrilateral, (3,3))
126+
grid = generate_grid(Quadrilateral, (3, 3))
127127
dh = DofHandler(grid); push!(dh, :u, 1); close!(dh)
128128
fv = FacetValues(QuadratureRule{RefQuadrilateral}(2), Lagrange{RefQuadrilateral, 1}())
129129
f = zeros(ndofs(dh))
@@ -326,7 +326,7 @@ initial conditions can be specified by the [`apply_analytical!`](@ref) function.
326326
For example, specify the initial pressure as a function of the y-coordinate
327327
```julia
328328
ρ = 1000; g = 9.81 # density [kg/m³] and gravity [N/kg]
329-
grid = generate_grid(Quadrilateral, (10,10))
329+
grid = generate_grid(Quadrilateral, (10, 10))
330330
dh = DofHandler(grid); add!(dh, :u, 2); add!(dh, :p, 1); close!(dh)
331331
u = zeros(ndofs(dh))
332332
apply_analytical!(u, dh, :p, x -> ρ * g * x[2])

docs/src/topics/grid.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ Consider the following 2D mesh:
6262
The cells of the grid can be described in the following way
6363

6464
```julia
65-
cells = [Quadrilateral((1, 2, 5, 4)),
66-
Quadrilateral((2, 3, 6, 5)),
67-
Quadrilateral((4, 5, 8, 7)),
68-
Quadrilateral((5, 6, 9, 8))]
65+
cells = [
66+
Quadrilateral((1, 2, 5, 4)),
67+
Quadrilateral((2, 3, 6, 5)),
68+
Quadrilateral((4, 5, 8, 7)),
69+
Quadrilateral((5, 6, 9, 8)),
70+
]
6971
```
7072

7173
where each `Quadrilateral <: AbstractCell` is defined by the tuple of node IDs.
@@ -106,9 +108,9 @@ In case that certain structures are preserved from the `Ferrite.Grid` type, you
106108
As a starting point, we choose a minimal working example from the test suite:
107109

108110
```julia
109-
struct SmallGrid{dim,N,C<:Ferrite.AbstractCell} <: Ferrite.AbstractGrid{dim}
110-
nodes_test::Vector{NTuple{dim,Float64}}
111-
cells_test::NTuple{N,C}
111+
struct SmallGrid{dim, N, C <: Ferrite.AbstractCell} <: Ferrite.AbstractGrid{dim}
112+
nodes_test::Vector{NTuple{dim, Float64}}
113+
cells_test::NTuple{N, C}
112114
end
113115
```
114116

@@ -119,7 +121,7 @@ We start with the utility functions that are associated with the cells of the gr
119121
```julia
120122
Ferrite.getcells(grid::SmallGrid) = grid.cells_test
121123
Ferrite.getcells(grid::SmallGrid, v::Union{Int, Vector{Int}}) = grid.cells_test[v]
122-
Ferrite.getncells(grid::SmallGrid{dim,N}) where {dim,N} = N
124+
Ferrite.getncells(grid::SmallGrid{dim, N}) where {dim, N} = N
123125
Ferrite.getcelltype(grid::SmallGrid) = eltype(grid.cells_test)
124126
Ferrite.getcelltype(grid::SmallGrid, i::Int) = typeof(grid.cells_test[i])
125127
```
@@ -131,8 +133,8 @@ Ferrite.getnodes(grid::SmallGrid) = grid.nodes_test
131133
Ferrite.getnodes(grid::SmallGrid, v::Union{Int, Vector{Int}}) = grid.nodes_test[v]
132134
Ferrite.getnnodes(grid::SmallGrid) = length(grid.nodes_test)
133135
Ferrite.get_coordinate_eltype(::SmallGrid) = Float64
134-
Ferrite.get_coordinate_type(::SmallGrid{dim}) where dim = Vec{dim,Float64}
135-
Ferrite.nnodes_per_cell(grid::SmallGrid, i::Int=1) = Ferrite.nnodes(grid.cells_test[i])
136+
Ferrite.get_coordinate_type(::SmallGrid{dim}) where {dim} = Vec{dim, Float64}
137+
Ferrite.nnodes_per_cell(grid::SmallGrid, i::Int = 1) = Ferrite.nnodes(grid.cells_test[i])
136138
```
137139

138140
These definitions make many of Ferrite functions work out of the box, e.g. you can now call

0 commit comments

Comments
 (0)