Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear elasticity example #799

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Linear elasticity example #799

wants to merge 13 commits into from

Conversation

kimauth
Copy link
Member

@kimauth kimauth commented Sep 27, 2023

Here is a first suggestion for a linear elasticity example. The explanations could probably use a bit more work and I believe the logo.geo file for generating the mesh should be stored somewhere else? It's a start anyways :)

@termi-official
Copy link
Member

I guess this should be the second tutorial and it is the step from a scalar-valued linear PDE to a vector-valued linear PDE? So the "new concents" would be a first contact with Tensors.jl and how to treat vector-valued problems in general?

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6731c5d) 92.25% compared to head (5bde8aa) 92.67%.
Report is 16 commits behind head on master.

❗ Current head 5bde8aa differs from pull request most recent head ea3cffe. Consider uploading reports for the commit ea3cffe to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #799      +/-   ##
==========================================
+ Coverage   92.25%   92.67%   +0.42%     
==========================================
  Files          33       33              
  Lines        4942     4955      +13     
==========================================
+ Hits         4559     4592      +33     
+ Misses        383      363      -20     

see 12 files with indirect coverage changes

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

#
# The strong form of the balance of momentum is given by
# ```math
# -\boldsymbol{\sigma} \cdot \boldsymbol{\nabla} = \boldsymbol{b} \quad \textbf{x} \in \Omega,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# -\boldsymbol{\sigma} \cdot \boldsymbol{\nabla} = \boldsymbol{b} \quad \textbf{x} \in \Omega,
# -\boldsymbol{\nabla} \cdot \boldsymbol{\sigma}(\boldsymbol{u}(\textbf{x})) = \boldsymbol{b}(\textbf{x}) \quad \textbf{x} \in \Omega,

maybe to highlight the dependencies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left out the dependencies on x in order to make it more readable and easier to recognize. Do you think it's important for understanding? Perhaps an alternative is to highlight that in the variable explanation, i.e. something like "where \sigma(x) is the stress tensor" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(The "x in Omega" at the end of the equation should go away though if I don't have x in the equation itself.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if someone without continuum mechanics background reads this, then he will have a hard time to follow due to the recursion. I usually prefer putting the dependence on the solution variable explictily in the equations, so it is clearer which terms are linear/nonlinear functions in the solution variables and which are independent. We can also add a bit more explanation below.

Co-authored-by: Maximilian Köhler <maximilian.koehler@ruhr-uni-bochum.de>
Copy link
Member

@fredrikekre fredrikekre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to add a note about plane strain/stress in this example too.

# The resulting weak form is given given as follows: Find ``\boldsymbol{u} \in \mathbb{U}`` such that
# ```math
# \int_\Omega
# \boldsymbol{\sigma} : \left(\delta \boldsymbol{u} \otimes \boldsymbol{\nabla} \right)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testfunction to the left, please :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following either, why do you want the test function to the left?

for q_point in 1:getnquadpoints(cellvalues)
dΩ = getdetJdV(cellvalues, q_point)
for i in 1:n_basefuncs
∇Nᵢ = shape_gradient(cellvalues, q_point, i)# shape_symmetric_gradient(cellvalues, q_point, i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be the symmetric gradient, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit undecisive what's the better way to write this. It's only valid to use symmetric gradient because of the symmetry of dsigma_depsilon. But of course that's symmetric in this case and it's also pretty common to use the symmetric version there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use the formally correct version in the implementation and elaborate in a note why the other choice is in this specific case also okay. What do you think?

@kimauth
Copy link
Member Author

kimauth commented Nov 2, 2023

Added a Neumann boundary condition instead of the Dirichlet boundary condition. Still need to add some explanation for that + a new picture.

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.

None yet

5 participants