Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/ComputationalModels/PostProcessors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,16 @@ end

function Piola(physmodel::ThermoElectroMechano,kine::NTuple{3,KinematicModel}, uh, φh, θh, Ω, dΩ, Λ=1.0)
DΨ = physmodel(Λ)

F, _, _ = get_Kinematics(kine[1])
E = get_Kinematics(kine[2])
∂Ψu = DΨ[2]
refL2 = ReferenceFE(lagrangian, Float64, 0)
ref = ReferenceFE(lagrangian, Float64, 1)
VL2 = FESpace(Ω, refL2, conformity=:L2)
V = FESpace(Ω, ref, conformity=:H1)
n1 = VectorValue(1.0, 0.0, 0.0)
n2 = VectorValue(0.0, 1.0, 0.0)
n3 = VectorValue(0.0, 0.0, 1.0)
σ11h = interpolate_everywhere(L2_Projection(n1 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n1), dΩ, VL2), V)
σ12h = interpolate_everywhere(L2_Projection(n1 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n2), dΩ, VL2), V)
σ13h = interpolate_everywhere(L2_Projection(n1 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n3), dΩ, VL2), V)
σ22h = interpolate_everywhere(L2_Projection(n2 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n2), dΩ, VL2), V)
σ23h = interpolate_everywhere(L2_Projection(n2 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n3), dΩ, VL2), V)
σ33h = interpolate_everywhere(L2_Projection(n3 ⋅ ((∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)) * n3), dΩ, VL2), V)
ph = interpolate_everywhere(L2_Projection(tr ∘ (∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)), dΩ, VL2), V)
return (σ11h, σ12h, σ13h, σ22h, σ23h, σ33h, ph)
σh = ∂Ψu ∘ (F∘(∇(uh)'), E∘(∇(φh)), θh)
interpolate_L2_tensor(σh, Ω, dΩ)
end


function Cauchy(args...)
@warn "The function Cauchy is deprecated and will be removed at the end of November 25. Please, replace it by Piola."
@warn "The function Cauchy is deprecated. Shortly it'll be J^-1*P*F^-T."
Piola(args...)
end

Expand Down
2 changes: 1 addition & 1 deletion test/data/ViscoElasticSimulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function visco_elastic_simulation(;t_end=15, writevtk=true, verbose=true)
F,_,_ = get_Kinematics(k)

function driverpost(post)
σh11, _... = Cauchy(cons_model, Kinematics(Mechano,Solid),uh, unh, state_vars, Ω, dΩ, 0.0, Δt)
σh11, _... = Piola(cons_model, Kinematics(Mechano,Solid),uh, unh, state_vars, Ω, dΩ, 0.0, Δt)
σΓ1 = sum(∫(σh11)dΓ1) / sum(∫(1.0)dΓ1)
push!(σΓ, σΓ1)
push!(λx, 1.0 + component_LInf(uh, :x, Ω) / long)
Expand Down