From 0bcf9b3944e840ed3462aa82d73af769221222ac Mon Sep 17 00:00:00 2001 From: Damir Akchurin Date: Sat, 4 Jan 2025 17:15:18 -0500 Subject: [PATCH] - Bump up the version - Add model dimensionality checks --- Project.toml | 2 +- src/Models.jl | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 0d0e9d9..e5017e0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Hephaestus" uuid = "88b3b2ed-56ea-4eac-b1de-e42ac45953c8" authors = ["Damir Akchurin "] -version = "0.2.0" +version = "0.3.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/Models.jl b/src/Models.jl index 8f7fcfa..9684e71 100644 --- a/src/Models.jl +++ b/src/Models.jl @@ -20,13 +20,19 @@ struct Model{D} distloads::Vector{DistributedLoad} # Constructor: - Model(D::Int) = new{D}( + function Model(D::Int) + # Check the dimension of the model: + @assert D ∈ [2, 3] "Invalid model dimensionality. The model dimensional must be either 2 or 3." + + # Initialize the model: + new{D}( Vector{Node}(), Vector{Section}(), Vector{Material}(), Vector{Element}(), Vector{ConcentratedLoad}(), Vector{DistributedLoad}()) + end end """