Skip to content

Remve dim parameter from AbstractDim - #41

Open
lijas wants to merge 5 commits into
mainfrom
eb_2d
Open

Remve dim parameter from AbstractDim#41
lijas wants to merge 5 commits into
mainfrom
eb_2d

Conversation

@lijas

@lijas lijas commented Jan 20, 2022

Copy link
Copy Markdown
Collaborator

It is a bit cleaner like this I think :)

@codecov-commenter

codecov-commenter commented Jan 20, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.88889% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.95%. Comparing base (aee7b47) to head (897fe87).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/wrappers.jl 63.88% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   91.78%   88.95%   -2.84%     
==========================================
  Files          12       12              
  Lines         426      353      -73     
==========================================
- Hits          391      314      -77     
- Misses         35       39       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lijas
lijas requested a review from kimauth February 18, 2022 14:47
@lijas

lijas commented Feb 19, 2022

Copy link
Copy Markdown
Collaborator Author

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

kimauth commented Apr 1, 2022

Copy link
Copy Markdown
Owner

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

lijas commented Apr 1, 2022

Copy link
Copy Markdown
Collaborator Author

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

@kimauth

kimauth commented Apr 8, 2022

Copy link
Copy Markdown
Owner

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