Skip to content

Commit

Permalink
add output for material states in fe part
Browse files Browse the repository at this point in the history
  • Loading branch information
lijas committed Oct 31, 2023
1 parent 315e7c4 commit a88c6a7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/parts/fepart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,28 @@ function eval_part_node_data(part::Part, nodeoutput::VTKNodeOutput{<:StressOutpu
return data[part.geometry.nodemapper]
end

function eval_part_node_data(part::Part, nodeoutput::VTKNodeOutput{<:MaterialStateOutput{MaterialState_t}}, state, globaldata) where MaterialState_t

#Extract stresses to interpolate
_cellid = first(part.cellset)
first_state = first(state.partstates[_cellid].materialstates)
if !hasproperty(first_state, nodeoutput.type.field)
return
end

qpdata = Vector{MaterialState_t}[]
for (ic, cellid) in enumerate(part.cellset)
matstates = state.partstates[cellid].materialstates
field_states = getproperty.(matstates, nodeoutput.type.field)
push!(qpdata, field_states)
end

data = zeros(MaterialState_t, getnnodes(globaldata.grid))
_collect_nodedata!(data, part, qpdata, globaldata)
return data[part.geometry.nodemapper]

end

function post_part!(dh, part::Part, states::StateVariables)

end
Expand Down

0 comments on commit a88c6a7

Please sign in to comment.