Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix documentation, all docstrings in output #39

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: linux-macos-windows
name: ci
on:
pull_request:
branches:
Expand All @@ -20,17 +20,30 @@ jobs:
- 'nightly'
os:
- ubuntu-latest
- macos-latest
- windows-latest
- macOS-13 # intel
- macOS-14 # arm
arch:
- x64
- aarch64
exclude:
- os: ubuntu-latest
arch: aarch64
- os: windows-latest
arch: aarch64
- os: macOS-13
arch: aarch64
- os: macOS-14
version: 1.6
- os: macOS-14
arch: x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -41,20 +54,14 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
env:
PYTHON: ""
- uses: julia-actions/julia-runtest@v1
env:
PYTHON: ""
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
- uses: codecov/codecov-action@v4
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand All @@ -63,16 +70,13 @@ jobs:
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
env:
PYTHON: ""
# - run: |
# julia --project=docs -e '
# using Documenter: doctest
# using MYPACKAGE
# doctest(MYPACKAGE)'
- run: julia --project=docs docs/make.jl
env:
PYTHON: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}


6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
QUARRY
.project.jl
test/*testfile*
docs/build
docs/src/examples
docs/src/*examples
*~
Manifest.toml
.repl_history.jl

quarry
22 changes: 14 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableGrids"
uuid = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
authors = ["Juergen Fuhrmann <[email protected]>", "Christian Merdon <[email protected]>", "Johannes Taraz <[email protected]>"]
version = "1.3.1"
version = "1.3.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -17,27 +17,33 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"

[weakdeps]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"

[extensions]
ExtendableGridsGmshExt = "Gmsh"

[compat]
AbstractTrees = "0.3,0.4"
Bijections = "0.1.4"
Dates = "1.6"
DocStringExtensions = "0.8,0.9"
ElasticArrays = "1"
Gmsh = "0.2.2"
InteractiveUtils = "1.6"
LinearAlgebra = "1.6"
Printf = "1.6"
Random = "1.6"
Requires = "1.3"
SparseArrays = "1.6"
StaticArrays = "1"
StatsBase = "0.34"
UUIDs = "1.6"
WriteVTK = "1.14"
julia = "1.6"

[extensions]
ExtendableGridsGmshExt = "Gmsh"

[extras]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"

[weakdeps]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Additional functionality:

Companion packages:
- Visualization of these grids and of functions on them is avaialable in [GridVisualize.jl](https://github.com/j-fu/GridVisualize.jl).
- The differently licensed [SimplexGridFactory](https://github.com/j-fu/SimplexGridFactory.jl) contains an API which allows to
- [SimplexGridFactory](https://github.com/j-fu/SimplexGridFactory.jl) contains an API which allows to
create `ExtendableGrid` objects with [Triangulate.jl](https://github.com/JuliaGeometry/Triangulate.jl) which wraps the Triangle mesh generator
by J. Shewchuk and [TetGen.jl](https://github.com/JuliaGeometry/TetGen.jl) which wraps the TetGen mesh generator by H. Si.
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ using Documenter, ExtendableGrids, ExampleJuggler, Gmsh
import CairoMakie
CairoMakie.activate!(; type = "svg", visible = false)
ExampleJuggler.verbose!(true)

ExtendableGridsGmshExt=Base.get_extension(ExtendableGrids, :ExtendableGridsGmshExt)
function mkdocs()
cleanexamples()
generated_examples = @docscripts(joinpath(@__DIR__, "..", "examples"),
["examples1d.jl", "examples2d.jl", "examples3d.jl", "gmsh.jl"],
Plotter=CairoMakie)
makedocs(; sitename = "ExtendableGrids.jl",
modules = [ExtendableGrids, Base.get_extension(ExtendableGrids, :ExtendableGridsGmshExt)],
modules = [ExtendableGrids,ExtendableGridsGmshExt],
clean = false,
warnonly = true,
doctest = true,
authors = "J. Fuhrmann, Ch. Merdon, J. Taraz",
repo = "https://github.com/j-fu/ExtendableGrids.jl",
Expand All @@ -31,6 +30,7 @@ function mkdocs()
"cellfinder.md",
"arraytools.md",
"gridconstructors.md",
"output.md",
"refinement.md",
"regionedit.md",
"tokenstream.md",
Expand Down
29 changes: 29 additions & 0 deletions docs/src/gmsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@ ExtendableGrids.simplexgrid_from_gmsh
ExtendableGrids.simplexgrid_to_gmsh
ExtendableGrids.mixedgrid_from_gmsh
ExtendableGrids.mixedgrid_to_gmsh
ExtendableGrids.seal!
```



## Internals
### Gmsh extension
```@docs
ExtendableGridsGmshExt.gmshfile_to_mixedgrid
ExtendableGridsGmshExt.take_second
ExtendableGridsGmshExt.gmshfile_to_simplexgrid
ExtendableGridsGmshExt.test_gmsh_init
ExtendableGridsGmshExt.mixedgrid_to_gmshfile
ExtendableGridsGmshExt.multiply_indices
ExtendableGridsGmshExt.mod_to_mixedgrid
ExtendableGridsGmshExt.simplexgrid_to_gmshfile
ExtendableGridsGmshExt.simplexgrid_to_mod
ExtendableGridsGmshExt.mod_to_simplexgrid
ExtendableGridsGmshExt.incomplete_mod_to_simplexgrid
ExtendableGridsGmshExt.use_geoms
ExtendableGridsGmshExt.use_vta
```

### seal! method
```@docs
ExtendableGrids.faces_of_ndim_simplex
ExtendableGrids.assemble_bfaces_direct
ExtendableGrids.decode
ExtendableGrids.encode
ExtendableGrids.faces_of_ndim_simplex_direct
ExtendableGrids.assemble_bfaces
```
11 changes: 9 additions & 2 deletions docs/src/gridconstructors.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Grid constructors

## Tensor product simplex grids

## API
```@docs
simplexgrid
glue
```

## Various special grids
```@autodocs
Private = false
Modules = [ExtendableGrids]
Pages = ["simplexgrid.jl","commongrids.jl"]
Pages = ["commongrids.jl"]
```

6 changes: 6 additions & 0 deletions docs/src/output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Grid output

```@docs
Base.write
writeVTK
```
4 changes: 1 addition & 3 deletions src/ExtendableGrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export seemingly_equal, numbers_match
include("subgrid.jl")
export subgrid
export ParentGrid
export NodeParents, CellParents, FaceParents, BFaceParents, EdgeParents, BEdgeParents
export NodeParents, CellParents, FaceParents, BFaceParents
export ParentGridRelation, SubGrid, BoundarySubGrid, RefinedGrid

include("shape_specs.jl")
Expand All @@ -93,7 +93,6 @@ export num_edges
export local_cellfacenodes
export local_celledgenodes
export facetype_of_cellface
export Volume4ElemType
export Normal4ElemType!
export Tangent4ElemType!
export xrefFACE2xrefCELL
Expand Down Expand Up @@ -167,7 +166,6 @@ export glue, geomspace, linspace
include("simplexgrid.jl")
export simplexgrid, geomspace, glue
export XCoordinates, YCoordinates, ZCoordinates
export writefile

include("tokenstream.jl")
export TokenStream, gettoken, expecttoken, trytoken
Expand Down
47 changes: 33 additions & 14 deletions src/commongrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ function reference_domain(EG::Type{<:AbstractElementGeometry}, T::Type{<:Real} =
end

"""
````
Triangle(coords) -> ExtendableGrid{T,Int32}
````
grid_triangle(coords::AbstractArray{T,2}) where {T}

Generates a single triangle with the given coordinates, that should be a 2 x 3 array
with the coordinates of the three vertices, e.g. coords = [0.0 0.0; 1.0 0.0; 0.0 1.0]'.
Expand All @@ -51,12 +49,20 @@ function grid_triangle(coords::AbstractArray{T,2}) where {T}
return xgrid
end

# unit cube as one cell with six boundary regions (bottom, front, right, back, left, top)
"""
grid_unitcube(EG::Type{<:Hexahedron3D}; scale = [1,1,1], shift = [0,0,0])

Unit cube as one cell with six boundary regions (bottom, front, right, back, left, top)
"""
function grid_unitcube(EG::Type{<:Hexahedron3D}; scale = [1,1,1], shift = [0,0,0])
return reference_domain(EG; scale = scale, shift = shift)
end

# unit cube as six tets with six boundary regions (bottom, front, right, back, left, top)
"""
grid_unitcube(::Type{Tetrahedron3D}; scale = [1,1,1], shift = [0,0,0])

Unit cube as six tets with six boundary regions (bottom, front, right, back, left, top)
"""
function grid_unitcube(::Type{Tetrahedron3D}; scale = [1,1,1], shift = [0,0,0])
xgrid=ExtendableGrid{Float64,Int32}()
xCoordinates=Array{Float64,2}([0 0 0; 1 0 0; 1 1 0; 0 1 0; 0 0 1; 1 0 1; 1 1 1; 0 1 1]')
Expand All @@ -80,14 +86,18 @@ function grid_unitcube(::Type{Tetrahedron3D}; scale = [1,1,1], shift = [0,0,0])
return xgrid
end



# unit square as one cell with four boundary regions (bottom, right, top, left)
"""
grid_unitsquare(EG::Type{<:Quadrilateral2D}; scale = [1,1], shift = [0,0])
Unit square as one cell with four boundary regions (bottom, right, top, left)
"""
function grid_unitsquare(EG::Type{<:Quadrilateral2D}; scale = [1,1], shift = [0,0])
return reference_domain(EG; scale = scale, shift = shift)
end

# unit square as two triangles with four boundary regions (bottom, right, top, left)
"""
grid_unitsquare(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
Unit square as two triangles with four boundary regions (bottom, right, top, left)
"""
function grid_unitsquare(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
xgrid=ExtendableGrid{Float64,Int32}()
xCoordinates=Array{Float64,2}([0 0; 1 0; 1 1; 0 1; 0.5 0.5]')
Expand All @@ -107,7 +117,10 @@ function grid_unitsquare(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
end


# unit square as two triangles with four boundary regions (bottom, right, top, left)
"""
grid_lshape(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
Lshape domain
"""
function grid_lshape(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
xgrid=ExtendableGrid{Float64,Int32}()
xCoordinates=Array{Float64,2}([0 0; 1 0; 1 1; 0 1; -1 1; -1 0; -1 -1; 0 -1]')
Expand All @@ -126,7 +139,11 @@ function grid_lshape(::Type{<:Triangle2D}; scale = [1,1], shift = [0,0])
return xgrid
end

# unit suqare as mixed triangles and squares with four boundary regions (bottom, right, top, left)
"""
grid_unitsquare_mixedgeometries()

Unit suqare as mixed triangles and squares with four boundary regions (bottom, right, top, left)
"""
function grid_unitsquare_mixedgeometries()

xgrid=ExtendableGrid{Float64,Int32}()
Expand Down Expand Up @@ -155,10 +172,12 @@ function grid_unitsquare_mixedgeometries()
return xgrid
end

#################################
# Specific tensor product grids #
#################################

"""
ringsector(rad,ang; eltype=Triangle2D)

Sector of ring or full ring (if `ang[begin]-ang[end]≈2π`)
"""
function ringsector(rad,ang; eltype=Triangle2D)
Tv=Float32
Ti=Int32
Expand Down
1 change: 0 additions & 1 deletion src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ exports grid and optional provided data as a vtk file

Each '(key, value)' pair adds another data entry to the vtk file via WriteVTK functionality.
"""

function writeVTK(filename::String, grid::ExtendableGrid{Tc, Ti}; kwargs...) where {Tc, Ti}
ncells = num_cells(grid) # get number of cells in grid
coords = grid[Coordinates] # get coordinates
Expand Down
12 changes: 6 additions & 6 deletions src/simplexgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,11 @@ end


"""
function glue(g1,g2;
g1regions=1:num_bfaceregions(g1),
g2regions=1:num_bfaceregions(g2),
interface=0,
tol=1.0e-10)
glue(g1,g2;
g1regions=1:num_bfaceregions(g1),
g2regions=1:num_bfaceregions(g2),
interface=0,
tol=1.0e-10)

Merge two grids along their common boundary facets.

Expand All @@ -666,7 +666,7 @@ Merge two grids along their common boundary facets.
Deprecated:
- breg: old notation for interface
"""
function glue(g1,g2;
function glue(g1::ExtendableGrid,g2::ExtendableGrid;
g1regions=1:num_bfaceregions(g1),
g2regions=1:num_bfaceregions(g2),
breg=nothing,
Expand Down
Loading
Loading