Skip to content

Commit

Permalink
Fix doc formatting (#14)
Browse files Browse the repository at this point in the history
* Fix docstrings for inclusion in Ferrite.jl's docs
* Bump version
  • Loading branch information
KnutAM authored Oct 4, 2022
1 parent ef23843 commit 4fa9a09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FerriteMeshParser"
uuid = "0f8c756f-80dd-4a75-85c6-b0a5ab9d4620"
authors = ["Knut Andreas Meyer and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
Ferrite = "c061ca5d-56c9-439f-9c0e-210fe06d3992"
Expand Down
35 changes: 22 additions & 13 deletions src/FerriteMeshParser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,21 @@ include("abaqusreader.jl")
include("gridcreator.jl")

"""
function get_ferrite_grid(filename; meshformat=AutomaticMeshFormat(), user_elements=Dict{String,DataType}(), generate_facesets=true)
Greate a `Ferrite.Grid` by reading in the file specified by `filename`.
## Optional arguments (default)
* `meshformat` (`FerriteMeshParser.AutomaticMeshFormat()`): Which format the mesh
is given in, normally automatically detected by the file extension
* `user_elements` (`Dict{String,DataType}()`): Used to add extra elements not supported,
might require separate cell constructor.
* `generate_facesets` (`true`): Should facesets be detected automatically from all nodesets?
function get_ferrite_grid(
filename;
meshformat=AutomaticMeshFormat(),
user_elements=Dict{String,DataType}(),
generate_facesets=true
)
Greate a `Ferrite.Grid` by reading in the file specified by `filename`.
Optional arguments:
* `meshformat`: Which format the mesh
is given in, normally automatically detected by the file extension
* `user_elements`: Used to add extra elements not supported,
might require a separate cell constructor.
* `generate_facesets`: Should facesets be automatically generated from all nodesets?
"""
function get_ferrite_grid(filename; meshformat=AutomaticMeshFormat(), user_elements::Dict{String,DataType}=Dict{String,DataType}(), generate_facesets::Bool=true)
Expand All @@ -52,14 +57,18 @@ function get_ferrite_grid(filename; meshformat=AutomaticMeshFormat(), user_eleme
end

"""
create_faceset(grid::Ferrite.AbstractGrid, nodeset::Set{Int}, cellset::Union{Nothing,Set{Int}}=nothing)
create_faceset(
grid::Ferrite.AbstractGrid,
nodeset::Set{Int},
cellset::Union{Nothing,Set{Int}}=nothing
)
Find the faces in the grid for which all nodes are in `nodeset`. Return them as a `Set{FaceIndex}`.
A `cellset` can be given to only look only for faces amongst those cells to speed up the computation.
Otherwise the search is over all cells.
This function is normally only required if calling `get_ferrite_grid` with `generate_facesets=false`.
The created `faceset` can be added to the grid as `merge!(getfacesets(grid), Dict("facesetkey" => faceset`
This function is normally only required when calling `get_ferrite_grid` with `generate_facesets=false`.
The created `faceset` can be added to the grid as `merge!(getfacesets(grid), Dict("facesetkey" => faceset))`
"""
function create_faceset(grid::Ferrite.AbstractGrid, nodeset::Set{Int}, ::Nothing=nothing)
faceset = Set{FaceIndex}()
Expand Down

2 comments on commit 4fa9a09

@KnutAM
Copy link
Member Author

@KnutAM KnutAM commented on 4fa9a09 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/69529

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.3 -m "<description of version>" 4fa9a09dbc8f14f00dacf125213262e982393ae9
git push origin v0.1.3

Please sign in to comment.