From 739c0cedc8f7735d7f32942bca5ae896c8bb45c4 Mon Sep 17 00:00:00 2001 From: Olli Date: Sun, 9 Oct 2016 14:51:06 +0300 Subject: [PATCH] fixed 3d, since there is no dev field anymore --- src/problems_elasticity.jl | 5 +++-- ...test_elasticplastic_3d_linear_with_surface_load.jl | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/problems_elasticity.jl b/src/problems_elasticity.jl index 764125a..1a12c5a 100644 --- a/src/problems_elasticity.jl +++ b/src/problems_elasticity.jl @@ -510,7 +510,9 @@ function assemble{El<:Elasticity3DVolumeElements}(problem::Problem{Elasticity}, 0.0 0.0 0.0 0.0 0.5-nu 0.0 0.0 0.0 0.0 0.0 0.0 0.5-nu] - if "plasticity" in keys(element.dev) + element_keys = get_keys(element) + + if "plasticity" in element_keys plastic_def = element.dev["plasticity"] calculate_stress! = plastic_def["stress"] params = plastic_def["params"] @@ -530,7 +532,6 @@ function assemble{El<:Elasticity3DVolumeElements}(problem::Problem{Elasticity}, Dtan = D end - println(round(stress_vec, 4)) :strain in props.store_fields && update!(ip, "strain", time => strain_vec) :stress in props.store_fields && update!(ip, "stress", time => stress_vec) :stress11 in props.store_fields && update!(ip, "stress11", time => stress_vec[1]) diff --git a/test/test_elasticplastic_3d_linear_with_surface_load.jl b/test/test_elasticplastic_3d_linear_with_surface_load.jl index 010eed1..38f3102 100644 --- a/test/test_elasticplastic_3d_linear_with_surface_load.jl +++ b/test/test_elasticplastic_3d_linear_with_surface_load.jl @@ -21,10 +21,13 @@ using JuliaFEM.Testing update!([element1], "youngs modulus", 200e3) update!([element1], "poissons ratio", 0.3) - element1.dev["plastdicity"] = Dict{Any, Any}("stress" => JuliaFEM.ideal_plasticity!, - "yield_surface" => Val{:von_mises}, - "params" => Dict("yield_stress" => 500.0)) - + plastic_parameters = Dict{Any, Any}("type" => JuliaFEM.ideal_plasticity!, + "yield_surface" => Val{:von_mises}, + "params" => Dict("yield_stress" => 175.0)) + to_integ_points = Dict() + map(x-> to_integ_points[x] = plastic_parameters, get_connectivity(element)) + update!(element, "plasticity", to_integ_points) + elasticity_problem = Problem(Elasticity, "solve continuum block", 3) elasticity_problem.properties.finite_strain = false elasticity_problem.properties.geometric_stiffness = false