-
Notifications
You must be signed in to change notification settings - Fork 38
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
Deviatoric and volumetric part of second order tensor for dimension not equal to 3 #214
Comments
Hi Timo! Good catch here. I agree that the deviator is only correct for dim=3 and that your suggested fix is the correct one. Regarding the mean, I am not sure which definition is applied here. I would have expected that the mean of a second order tensor (in a staistical sense) should still be the sum of its entries over the number of entries. Am I missing something? Edit: PRs are always welcome! Feel free to reach out if you get stuck somewhere. |
I believe these are both intentional. If you consider 2D just as a special case, with all 3-components to be zero, then it should still be divided by 3, not 2.
This definition comes from "mean stress" which is usually defined like this.
Would be great to clarify this in the documentation though, if you want to work on a PR! |
I think quite some code depends on the current behavior, since e.g. I'm not saying that you are wrong @TmNmr regarding the definition, but changing this will silently lead to wrong results in code that currently gives the right result. So we would need to add some safeguards to avoid this if we decide to change the definition. I'm not sure how to do that? |
Thanks for elaborating Fredrik. Should we clarify the mean in the docs? I think this is really not obvious.
I think the just stated motivation is the missing (crucual) piece of information in the doc string. Do you think we should add it here? Maybe we should also add clarification of plain strain and plane stress in Tensors.jl, since this seems to be a common point for errors when doing mechanics in the plane. Do you think we should open a separate issue on this for more discussion?
This is a good point. I guess we can still resolve this by
What do you think @fredrikekre @KnutAM ? |
I think the problem is that users would only have a problem with this if they don't expect it to be 3 by default, so I'm not sure if a new alternative name solves it. Perhaps just adding a Of course, the current behavior, that |
I'm not sure if I can follow. The current implementation is only valid if one assumes that 2D is a special case in the sense of plane strain elasticity, isnt it? |
Not only: As @fredrikekre says, it just assumes that you have a 3d case with zeros for the values that are not present. So for calculating the deviatoric stress in 2d, it assumes plane stress. But in this case, dividing by dim=2 would be wrong for both plane stress and plane strain... I'm trying to come up with an example where it is desirable to have the definition "dividing by dim", but I guess my brain is too much into mechanics to come up with a good example now. Does anyone else have a concrete example? |
What do you mean with "valid" here? I mean, there are two questions:
|
I would have thought that a (at least one) popular definition is that the trace is zero, which it isn't in the current implementation/definition combo. I know another colleague at our institute who recently struggled with the behavior that the trace isn't zero for a two dimensional deviatoric tensor. Back then I didn't know where it was coming from. To my feeling its a little arbitrary where we assume that 2D is a special case of 3D and add implicitly the third dimension and in other cases we don't, e.g. in the trace. I guess because there is some trade off in terms of generality/user friendliness.
I don't know where @TmNmr needs it but I'd think that there are more continuum mechanical problems with vectorial unknowns that are beyond balance of linear momentum, maybe that's not true I'm not saying that it needs to be changed, but I definitely think it's not an obvious behavior, especially since it isn't the same behavior everywhere in terms of adding the third dimension implicitly or not. It is stated here https://ferrite-fem.github.io/Tensors.jl/stable/man/other_operators/#Deviatoric-tensor but it could be more clear that this is the same behavior for all dimensions |
My application was to study properties (notions of (semi)convexity) of parameter dependent functions |
Hi,$3$ .
I just stumbled over an issue which might lead to unexpected results for second order tensors with dimensions not equal to
To the best of my knowledge, the deviatoric part for a second order tensor$X \in \mathbb{R}^{d \times d}$ is defined by
$$\mathrm{dev}_d (X) = X - \frac{1}{d} \mathrm{tr} (X) I_d$$ with $I_d \in \mathbb{R}^{d\times d}$ denoting the identity tensor. My guess is that the denominator $3$ in the functions
dev
andmean
could be changed todim
in order to make them applicable for general dimensions.Tensors.jl/src/math_ops.jl
Lines 297 to 306 in 258540f
Tensors.jl/src/math_ops.jl
Line 250 in 258540f
If interested I could work on a PR.
The text was updated successfully, but these errors were encountered: