mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-27 12:16:56 +00:00
feat(topology): Add type-level nnodes() method
- Add nnodes(::Type{<:AbstractTopology{N}}) method for type queries
- Enables compile-time node count without instantiation
- Example: nnodes(Triangle{3}) returns 3
- Complements existing instance method for dispatch consistency
This commit is contained in:
@@ -177,6 +177,22 @@ Concrete types inherit this implementation automatically.
|
||||
"""
|
||||
nnodes(::AbstractTopology{N}) where N = N
|
||||
|
||||
"""
|
||||
nnodes(::Type{<:AbstractTopology{N}}) -> Int
|
||||
|
||||
Number of nodes for a topology type (compile-time constant from type parameter).
|
||||
|
||||
# Examples
|
||||
|
||||
```julia
|
||||
nnodes(Triangle{3}) # 3
|
||||
nnodes(Triangle{6}) # 6
|
||||
nnodes(Quadrilateral{4}) # 4
|
||||
nnodes(Quadrilateral{9}) # 9
|
||||
```
|
||||
"""
|
||||
nnodes(::Type{<:AbstractTopology{N}}) where N = N
|
||||
|
||||
"""
|
||||
dim(topology::AbstractTopology) -> Int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user