Skip to content

Commit

Permalink
Add comment about required to check constructor type stability
Browse files Browse the repository at this point in the history
  • Loading branch information
KnutAM committed Feb 10, 2024
1 parent 8e39887 commit 2938bb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Plastic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function MMB.vector2material(v::AbstractVector, m::Plastic; offset=0)
kinematic, nkinparam = vector2materialtuple(v, m.kinematic, offset=i); i+=nkinparam

overstress = vector2material(v, m.overstress, offset=i); # i += get_num_params(m.overstress)

# The following constructor call doesn't seem to be type stable when used in e.g. differentiate_material.
# Should be checked for (a) v and m same eltype and (b) v Dual and m Float64 eltypes.
return Plastic(;elastic, yield, isotropic, kinematic, overstress)
end

Expand Down

0 comments on commit 2938bb7

Please sign in to comment.