Skip to content

Conversation

lijas
Copy link
Collaborator

@lijas lijas commented Jan 20, 2022

It is a bit cleaner like this I think :)

@codecov-commenter
Copy link

Codecov Report

Merging #41 (6c7278d) into main (57ceea5) will decrease coverage by 0.33%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   92.07%   91.74%   -0.34%     
==========================================
  Files          11       12       +1     
  Lines         404      436      +32     
==========================================
+ Hits          372      400      +28     
- Misses         32       36       +4     
Impacted Files Coverage Δ
src/wrappers.jl 78.78% <63.63%> (-2.88%) ⬇️
src/CohesiveMaterials/XuNeedleman.jl 95.23% <0.00%> (ø)
src/CrystalViscoPlastic/CrystalViscoPlasticRed.jl 98.63% <0.00%> (+0.01%) ⬆️
src/CrystalViscoPlastic/CrystalViscoPlastic.jl 98.55% <0.00%> (+0.02%) ⬆️
src/Plastic.jl 98.33% <0.00%> (+0.02%) ⬆️
src/FiniteStrain/yeoh.jl 95.65% <0.00%> (+0.19%) ⬆️
src/FiniteStrain/stvenant.jl 95.23% <0.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57ceea5...6c7278d. Read the comment docs.

@lijas lijas requested a review from kimauth February 18, 2022 14:47
@lijas
Copy link
Collaborator Author

lijas commented Feb 19, 2022

Seems to be type stable:


mat = LinearElastic(E = 1.0, ν = 0.3)
ε = rand(SymmetricTensor{2,2,Float64})
state = initial_material_state(mat)

@code_warntype material_response(PlaneStrain(), mat, ε, state)

Static Parameters
  d = 2
  T = Float64
Arguments
  #self#::Core.Const(MaterialModels.material_response)
  dimstate::Core.Const(PlaneStress())
  m::LinearElastic
  Δε::SymmetricTensor{2, 2, Float64, 3}
  state::Core.Const(LinearElasticState())
Body::Tuple{SymmetricTensor{2, 2, Float64, 3}, SymmetricTensor{4, 2, Float64, 9}, LinearElasticState}
1 ─ %1 = (#self#)(dimstate, m, Δε, state, MaterialModels.nothing)::Tuple{SymmetricTensor{2, 2, Float64, 3}, SymmetricTensor{4, 2, Float64, 9}, LinearElasticState}
└──      return %1

@kimauth
Copy link
Owner

kimauth commented Apr 1, 2022

Though this would mean that the dimension is not available at compile time anymore I think.

Perhaps fixable by defining

getdim(::Type{UniaxialStrain}) = 1

and so on?

@lijas
Copy link
Collaborator Author

lijas commented Apr 1, 2022

Hmm, if I remember correctly it everything was type-stable. Maybe because it is a singleton? I can double check

@kimauth
Copy link
Owner

kimauth commented Apr 8, 2022

What would I use for generic 2D cases that are neither plane strain nor plane stress now (like 2D cohesive elements)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants