From: David K. <dav...@ak...> - 2017-10-20 15:19:40
|
I'm using ExodusII_IO::copy_elemental_solution to copy element data to a new System object, and this works fine in serial using code like the below: ---------------------------------------------- Mesh mesh(comm); ExodusII_IO exo_io(mesh); if (comm.rank() == 0) { exo_io.read(path_to_mesh_file); } MeshCommunication().broadcast(mesh); mesh.prepare_for_use(); EquationSystems es(mesh); ExplicitSystem& materials_system = es->add_system<ExplicitSystem> ("data"); materials_system.add_variable ("data", CONSTANT, MONOMIAL); es->init(); exo_io.copy_elemental_solution(es, "data", "data"); ---------------------------------------------- However, in parallel I hit the error "ERROR, ExodusII file must be opened for reading before copying an elemental solution!" at the start of copy_elemental_solution. As far as I know (e.g. based on namebased_io.C) we should only call "read" on proc 0, so I don't see how to make this work in parallel, since in that case exo_io is only "opened for reading" on proc 0. Does anyone have any suggestions on this? (John, I gather that you were the author of most of the ExodusII reader stuff, so I thought you might know the answer?) Thanks! David |