From 4fa9a09dbc8f14f00dacf125213262e982393ae9 Mon Sep 17 00:00:00 2001 From: Knut Andreas Meyer Date: Tue, 4 Oct 2022 23:05:07 +0200 Subject: [PATCH] Fix doc formatting (#14) * Fix docstrings for inclusion in Ferrite.jl's docs * Bump version --- Project.toml | 2 +- src/FerriteMeshParser.jl | 35 ++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Project.toml b/Project.toml index 5eeb240..b852824 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/FerriteMeshParser.jl b/src/FerriteMeshParser.jl index 42dbbc8..17ef22d 100644 --- a/src/FerriteMeshParser.jl +++ b/src/FerriteMeshParser.jl @@ -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) @@ -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}()