Skip to content

Commit 3ca6af4

Browse files
refactor(tubular): replace tag with cmp and rename TubularPartSpec to TubularLayerSpec
1 parent b2ee3bc commit 3ca6af4

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

src/cablebuilder/tubular.jl

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,45 @@ function Base.convert(
1616
return TubularShape{L, T}(convert(T, r_in(s)), convert(T, r_ex(s)))
1717
end
1818

19-
@inline r_in(s::TubularShape) = s.r_in
20-
@inline r_ex(s::TubularShape) = s.r_ex
21-
2219
# ---------------------------------------------------------
2320
# The Payload (Does NOT subtype AbstractSpec)
2421
# ---------------------------------------------------------
2522
struct TubularBuilder{P, Tgeom <: Real, Tmat <: Real}
26-
tag::Symbol
23+
cmp::Symbol
2724
t::Tgeom
2825
mat::Material{Tmat}
2926
end
3027

3128
@inline function TubularBuilder{P}(
32-
tag::Symbol,
29+
cmp::Symbol,
3330
t::Tgeom,
3431
mat::Material{Tmat},
3532
) where {P, Tgeom, Tmat}
36-
return TubularBuilder{P, Tgeom, Tmat}(tag, t, mat)
33+
return TubularBuilder{P, Tgeom, Tmat}(cmp, t, mat)
3734
end
3835

3936
# # It waits peacefully until the materializer hands it current_r
4037
@inline function (b::TubularBuilder{P})(current_r::T) where {P, T <: Real}
4138
r_ex = current_r + b.t
42-
return P(b.tag, TubularShape{Concentric}(current_r, r_ex), b.mat)
39+
return P(b.cmp, TubularShape{Concentric}(current_r, r_ex), b.mat)
4340
end
4441

4542
# ---------------------------------------------------------
4643
# The Blueprint (Subtypes AbstractSpec)
4744
# ---------------------------------------------------------
48-
struct TubularPartSpec{P, Ttag, Tt, M <: AbstractSpec{Material}} <:
45+
struct TubularLayerSpec{P, Tcmp, Tt, M <: AbstractSpec{Material}} <:
4946
AbstractSpec{TubularBuilder{P}}
50-
tag::Ttag
47+
cmp::Tcmp
5148
t::Tt
5249
mat::M
5350
end
5451

55-
@inline function TubularPartSpec(
52+
@inline function TubularLayerSpec(
5653
::Type{P},
57-
tag::Ttag,
54+
cmp::Tcmp,
5855
t::Tt,
5956
mat::M,
6057
) where
61-
{P, Ttag, Tt, M <: AbstractSpec{Material}}
62-
return TubularPartSpec{P, Ttag, Tt, M}(tag, t, mat)
58+
{P, Tcmp, Tt, M <: AbstractSpec{Material}}
59+
return TubularLayerSpec{P, Tcmp, Tt, M}(cmp, t, mat)
6360
end

0 commit comments

Comments
 (0)