refactor: unify field ordering

[skip ci]
This commit is contained in:
nebmit 2024-03-12 15:03:50 +01:00
parent deb71df259
commit 65a16cac1c
No known key found for this signature in database
3 changed files with 13 additions and 16 deletions

View File

@ -2,12 +2,12 @@ using Pkg
using Documenter using Documenter
pkg_path = abspath(joinpath(@__DIR__, "..")) pkg_path = abspath(joinpath(@__DIR__, ".."))
Pkg.develop(path=pkg_path) Pkg.develop(path = pkg_path)
using TUG using TUG
makedocs( makedocs(
sitename="TUG Documentation", sitename = "TUG Documentation",
modules=[TUG], modules = [TUG],
format=Documenter.HTML(), format = Documenter.HTML(),
remotes=nothing remotes = nothing,
) )

View File

@ -46,10 +46,7 @@ struct BoundaryElement{T}
end end
function BoundaryElement{T}(value::T)::BoundaryElement{T} where {T} function BoundaryElement{T}(value::T)::BoundaryElement{T} where {T}
if value < 0 new{T}(TUG.CONSTANT, value)
throw(ArgumentError("No negative concentration allowed."))
end
new{T}(CONSTANT, value)
end end
end end
@ -114,14 +111,14 @@ It includes the dimension of the grid and boundary elements for each side.
""" """
struct Boundary{T} struct Boundary{T}
dim::UInt8 dim::UInt8
cols::UInt32
rows::UInt32 rows::UInt32
cols::UInt32
boundaries::Vector{Vector{BoundaryElement{T}}} boundaries::Vector{Vector{BoundaryElement{T}}}
function Boundary{T}(grid::Grid{T})::Boundary{T} where {T} function Boundary{T}(grid::Grid{T})::Boundary{T} where {T}
dim = grid.dim dim = grid.dim
cols = grid.cols
rows = grid.rows rows = grid.rows
cols = grid.cols
boundaries = Vector{Vector{BoundaryElement{T}}}(undef, 4) boundaries = Vector{Vector{BoundaryElement{T}}}(undef, 4)
if dim == 1 if dim == 1
@ -136,7 +133,7 @@ struct Boundary{T}
throw(ArgumentError("Only 1- and 2-dimensional grids are defined!")) throw(ArgumentError("Only 1- and 2-dimensional grids are defined!"))
end end
new{T}(dim, cols, rows, boundaries) new{T}(dim, rows, cols, boundaries)
end end
end end

View File

@ -9,14 +9,14 @@ export clone,
getAlphaX_t, getAlphaX_t,
getAlphaY_t, getAlphaY_t,
getConcentrations, getConcentrations,
setConcentrations!,
setAlphaX!,
setAlphaY!,
getDomainCol, getDomainCol,
getDomainRow, getDomainRow,
getDeltaCol, getDeltaCol,
getDeltaRow, getDeltaRow,
getDim getDim,
setAlphaX!,
setAlphaY!,
setConcentrations!
include("Boundary.jl") include("Boundary.jl")