@@ -62,10 +62,12 @@ Consider the following 2D mesh:
6262The 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
7173where 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
106108As 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}
112114end
113115```
114116
@@ -119,7 +121,7 @@ We start with the utility functions that are associated with the cells of the gr
119121``` julia
120122Ferrite. getcells (grid:: SmallGrid ) = grid. cells_test
121123Ferrite. 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
123125Ferrite. getcelltype (grid:: SmallGrid ) = eltype (grid. cells_test)
124126Ferrite. getcelltype (grid:: SmallGrid , i:: Int ) = typeof (grid. cells_test[i])
125127```
@@ -131,8 +133,8 @@ Ferrite.getnodes(grid::SmallGrid) = grid.nodes_test
131133Ferrite. getnodes (grid:: SmallGrid , v:: Union{Int, Vector{Int}} ) = grid. nodes_test[v]
132134Ferrite. getnnodes (grid:: SmallGrid ) = length (grid. nodes_test)
133135Ferrite. 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
138140These definitions make many of Ferrite functions work out of the box, e.g. you can now call
0 commit comments