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
base: master
Are you sure you want to change the base?
Conversation
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 ReportAll modified and coverable lines are covered by tests ✅
❗ 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 ☔ View full report in Codecov by Sentry. |
# | ||
# The strong form of the balance of momentum is given by | ||
# ```math | ||
# -\boldsymbol{\sigma} \cdot \boldsymbol{\nabla} = \boldsymbol{b} \quad \textbf{x} \in \Omega, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# -\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?
There was a problem hiding this comment.
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" ?
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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>
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Added a Neumann boundary condition instead of the Dirichlet boundary condition. Still need to add some explanation for that + a new picture. |
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 :)