From the Gridap.jl tutorial, I am struggling to compute the Von Mises stresses. I would love to get the feedback from the community on how to compute the Von Mises Stresses in the correct way. In this particular case I am not able to take the square root of j_2:
using LinearAlgebra: tr
hydrostatic_σ = tr(σ ∘ (ε(uh))) / 3
deviatoric_σ = σ ∘ (ε(uh)) - hydrostatic_σ
j_2 = 1/2 * deviatoric_σ ⊙ deviatoric_σ # deviatoric stress invariant = j_2 = 1/2 ∑σ_dev_ij^2
sigma_vm = sqrt.(3/2 * j_2) ## DOES NOT WORK
The error is:
ERROR: LoadError: MethodError: no method matching length(::Gridap.CellData.OperationCellField{ReferenceDomain})
Can I get a check from you?
uhis aCellFieldtype, therefore the deviatoric stress invariantj_2will be as well. Hence the calculations should be intsnciated using the function composition operator∘as follow.Credit due to JordiManyer (Jordi Manyer Fuertes) from the Gridap.jl gitter community