2 file(READ "${EP_JSON_CONFIG}" input)
3 string(JSON input SET "${input}" meshes 0 meshsets "${EP_MESHSETS}")
4 set(EP_JSON_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/incremental_plasticity.json")
5 file(WRITE "${EP_JSON_CONFIG}" "${input}\n")
9 set(EP_RUN_LOG incremental_nullspace_plastic.log)
11set(run_log "${CMAKE_CURRENT_BINARY_DIR}/${EP_RUN_LOG}")
14 "${EP_MPI_RUN}" ${EP_MPI_RUN_FLAGS} -np 1 "${EP_EXECUTABLE}"
15 -json_config "${EP_JSON_CONFIG}" ${EP_EXTRA_ARGUMENTS}
16 RESULT_VARIABLE run_result
17 OUTPUT_FILE "${run_log}"
18 ERROR_FILE "${run_log}")
20file(READ "${run_log}" run_output)
21if(NOT run_result EQUAL 0)
22 message(FATAL_ERROR "Plasticity solve failed (${run_result}):\n${run_output}")
24if(NOT run_output MATCHES
25 "plasticity incremental optimization converged: [^\n]*plastic flow active true")
27 "Expected a converged, validated increment with nonzero plastic flow:\n"
31set(acceptance "${CMAKE_MATCH_0}")
32if(NOT run_output MATCHES
33 "Incremental optimization completed [1-9][0-9]* physical steps at time [0-9.eE+-]+")
34 message(FATAL_ERROR "Plastic solve did not finish committing its physical steps:\n${run_output}")
36string(REGEX MATCHALL "plasticity TAO evaluation at iteration [^\n]*"
37 evaluations "${run_output}")
39 message(FATAL_ERROR "Plastic solve did not report objective evaluations")
41list(GET evaluations -1 final_evaluation)
42if(NOT final_evaluation MATCHES ", dissipation ([0-9.eE+-]+)\\)")
43 message(FATAL_ERROR "Missing final plastic dissipation: ${final_evaluation}")
45set(final_dissipation "${CMAKE_MATCH_1}")
46if(NOT final_dissipation GREATER 0)
47 message(FATAL_ERROR "Active plastic flow has nonpositive dissipation: ${final_evaluation}")
50message(STATUS "${acceptance}; final dissipation ${final_dissipation}")