feat(dofs): add DOF system main entry point

New 40-line main entry point for DOF system:
- Includes api.jl (DOF{T,E} abstract type)
- Includes fields.jl (field specification system)
- Documents multi-field philosophy (single-field is special case)
- Defines module structure and dependencies
- Already integrated in JuliaFEM.jl (line 313)

Provides unified type-level field specification system for finite elements.
This commit is contained in:
Jukka Aho
2025-12-15 06:08:09 +02:00
parent d85d96b899
commit 2c1701e6a5
+40
View File
@@ -0,0 +1,40 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE
"""
DOF System - Type-Level Field Specifications
Main entry point for the DOF system.
# Philosophy (November 2025)
**Multi-field is fundamental! Single-field is just a special case with one key.**
Field specifications are `DOFSet` types (currently implemented as NamedTuples), used purely at the type level:
```julia
# Clean syntax using abstract DOF{T,E} types:
(T = DOF{Float64, Vertex}, u = DOF{Vec{3,Float64}, Vertex})
# Using DOFSet macro (preferred):
S = @DOFSet{T::DOF{Temperature, Vertex}, u::DOF{Displacement{3}, Vertex}}
# Used in Element type parameter:
Element{Tetrahedron{4}, Lagrange{1}, S}
```
**Note**: `@NamedTuple` also works (since `DOFSet = NamedTuple`), but `@DOFSet` is preferred for future compatibility.
# Module Structure
- `api.jl`: DOF{T,E} abstract type + dof_size() utility
- `fields.jl`: Field specification system (@DOFSet, ndofs, etc.)
"""
# DOF{T,E} abstract type (type-level specification only)
include("api.jl")
# Field specification system (@DOFSet macro, ndofs, etc.)
include("fields.jl")
# Note: dof_connectivity.jl is included later in JuliaFEM.jl after Element is defined
# Note: dof_manager.jl is included later in JuliaFEM.jl after Mesh is defined