Skip to content

Commit

Permalink
Add more block_labels methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyxpp committed Jun 13, 2023
1 parent 38475a8 commit 9e286b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ blocks(bcp::BlockCopolymer) = bcp.blocks
blocks(::SmallMolecule) = []
blocks(c::Component) = blocks(c.molecule)

block_labels(sm::SmallMolecule) = [label(sm)]
block_labels(bcp::BlockCopolymer) = [b.label for b in bcp.blocks]
block_labels(c::Component) = block_labels(molecule(c))
block_labels(label::Symbol, s::PolymerSystem) = block_labels(molecule(label, s))
block_label(b::AbstractBlock) = b.label
block_ids(bcp::BlockCopolymer) = collect(1:nblocks(bcp))
block_id(label::Symbol, bcp::BlockCopolymer) = findfirst(block_labels(bcp) .== label)
Expand Down

0 comments on commit 9e286b1

Please sign in to comment.