1# Compare both accepted states of the same mesh-stress discretisation.
2file(READ "${EP_INPUT}" input)
4 string(JSON input SET "${input}" meshes 0 file_name
5 "\"examples/cook_cantilever/cook.cub\"")
7foreach(solver explicit condensed)
8 set(run_input "${input}")
9 if(solver STREQUAL "condensed")
10 string(JSON run_input SET "${run_input}" petsc elastic ksp
11 "{\"type\":\"fgmres\",\"rtol\":1e-12,\"atol\":1e-12}")
12 string(JSON run_input SET "${run_input}" petsc elastic pc
13 "{\"type\":\"fieldsplit\",\"fieldsplit_type\":\"schur\"}")
14 string(JSON run_input SET "${run_input}" petsc elastic fieldsplit_0
15 "{\"ksp\":{\"type\":\"preonly\"}}")
16 string(JSON run_input SET "${run_input}" petsc elastic fieldsplit_1
17 "{\"pc\":{\"type\":\"ksp\"},\"ksp\":{\"type\":\"preonly\",\"pc\":{\"type\":\"lu\",\"factor_mat_solver_type\":\"mumps\"},\"mat_mumps_icntl_20\":0,\"mat_mumps_icntl_14\":800}}")
19 file(WRITE "${solver}.json" "${run_input}\n")
20 file(REMOVE "${solver}.vec" "${solver}.vec.info")
22 COMMAND "${EP_MPI_RUN}" ${EP_MPI_RUN_FLAGS} -np ${EP_RANKS}
23 "${EP_EXECUTABLE}" -json_config "${solver}.json"
24 -elastic_snes_view_solution "binary:${solver}.vec::append"
25 OUTPUT_FILE "${solver}.log" ERROR_FILE "${solver}.err"
26 RESULT_VARIABLE result)
27 if(NOT result EQUAL 0)
28 message(FATAL_ERROR "Auxiliary Cook ${solver} failed: ${result}; see ${solver}.log/.err")
32 COMMAND "${EP_MPI_RUN}" ${EP_MPI_RUN_FLAGS} -np ${EP_RANKS}
33 "${EP_COMPARE}" -compare_left explicit.vec -compare_right condensed.vec
34 -compare_count 2 -compare_tolerance 1e-10
35 RESULT_VARIABLE result)
37 message(FATAL_ERROR "Explicit and condensed solution vectors differ: ${result}")