Hi Roy, Thanks for your help with this. I tried using the old node ids for the new mesh, but it fails on the following assertion:
Assertion `!obj || procid == min_procid' failed. [1] src/mesh/parallel_mesh.C, line 773, compiled Apr 16 2015 at 17:13:24 with this backtrace: Stack frames: 11 0: libMesh::print_trace(std::ostream&) 1: libMesh::write_traceout() 2: libMesh::MacroFunctions::report_error(char const*, int, char const*, char const*) 3: void libMesh::ParallelMesh::libmesh_assert_valid_parallel_object_ids<libMesh::Elem>(libMesh::mapvector<libMesh::Elem*, unsigned int> const&) const 4: libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids() const 5: libMesh::ParallelMesh::renumber_nodes_and_elements() 6: libMesh::MeshBase::prepare_for_use(bool) 7: ./submesh_test() [0x6cb527] 8: ./submesh_test() [0x6ca494] 9: __libc_start_main 10: ./submesh_test() [0x435a49] Stack frames: 14 0: libMesh::print_trace(std::ostream&) 1: libMesh::write_traceout() 2: libMesh::libmesh_terminate_handler() 3: /usr/lib64/libstdc++.so.6() [0x32beabcbe6] 4: /usr/lib64/libstdc++.so.6() [0x32beabcc13] 5: /usr/lib64/libstdc++.so.6() [0x32beabcd0e] 6: void libMesh::ParallelMesh::libmesh_assert_valid_parallel_object_ids<libMesh::Elem>(libMesh::mapvector<libMesh::Elem*, unsigned int> const&) const 7: libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids() const 8: libMesh::ParallelMesh::renumber_nodes_and_elements() 9: libMesh::MeshBase::prepare_for_use(bool) 10: ./submesh_test() [0x6cb527] 11: ./submesh_test() [0x6ca494] 12: __libc_start_main 13: ./submesh_test() [0x435a49] Can you help with fixing this? I'm not familiar with how the ids are set. Thanks, Harshad On Wed, May 13, 2015 at 6:09 PM, Roy Stogner <[email protected]> wrote: > > On Wed, 13 May 2015, Harshad Sahasrabudhe wrote: > > @Roy, do you have any suggestions how this should be fixed? If we have >> the same node ids for submesh before renumbering, there will be gaps in >> the ids (some ids not pointing to any nodes). Is this acceptable before >> renumbering? >> > > Yes; it's even unavoidable when doing adaptive coarsening. Half the > point of renumbering is simply to close up those gaps so as to prevent > transient AMR numberings from becoming ludicrously sparse. > > Sorry I've had to put this aside for the moment; I got a scary amount > of work dropped on me this afternoon. I'll try to get back to it > tomorrow. In the meantime if you want to investigate yourself, the > "set new ids to old id values in create_submesh()" idea is still IMHO > the most promising. > --- > Roy > > > On Wed, May 13, 2015 at 3:13 PM, Harshad Sahasrabudhe < >> [email protected]> wrote: >> Not sure if this is the best way to send code, but since the >> mailing list eats attachments, I'll print the test code here: >> #include "libmesh/parallel_mesh.h" >> #include "libmesh/libmesh.h" >> #include "libmesh/mesh.h" >> #include "libmesh/mesh_generation.h" >> #include "libmesh/node.h" >> #include "libmesh/elem.h" >> #include "libmesh/multi_predicates.h" >> >> int main(int argc, char *argv[]) >> { >> MPI_Init(&argc, &argv); >> LibMeshInit *libmeshhandle = new LibMeshInit(argc, argv, >> MPI_COMM_WORLD); >> >> Mesh* parent_mesh = new Mesh(libmeshhandle->comm()); >> Mesh* sub_mesh = new Mesh(libmeshhandle->comm()); >> double xmin, xmax, ymin, ymax, zmin, zmax; >> >> libMesh::MeshTools::Generation::build_cube( *parent_mesh, >> 20, 20, 20, >> 0,20, >> 0,20, >> 0,20, >> HEX8); >> >> parent_mesh->print_info(); >> >> xmin = 5; xmax = 15; >> ymin = 5; ymax = 15; >> zmin = 5; zmax = 15; >> >> mapvector<Elem*> submesh_elements; >> MeshBase::element_iterator it = >> parent_mesh->active_local_elements_begin(); >> const MeshBase::element_iterator it_end = >> parent_mesh->active_local_elements_end(); >> >> for(;it != it_end; it++) >> { >> Elem* el = *it; >> unsigned int n_nodes = el->n_nodes(); >> for(unsigned int i=0; i<n_nodes; i++) >> { >> Node &nd = *(el->get_node(i)); >> double nd_x = nd(0); >> double nd_y = nd(1); >> double nd_z = nd(2); >> if(nd_x > xmin && nd_x < xmax && >> nd_y > ymin && nd_y < ymax && >> nd_z > zmin && nd_z < zmax) >> { >> submesh_elements[el->id()] = el; >> break; >> } >> } >> } >> >> Predicates::Active<mapvector<Elem*>::const_veclike_iterator > p; >> MeshBase::const_element_iterator >> submesh_begin(submesh_elements.begin(), submesh_elements.end(), p); >> MeshBase::const_element_iterator submesh_end(submesh_elements.end(), >> submesh_elements.end(), p); >> >> parent_mesh->create_submesh(*sub_mesh, submesh_begin, submesh_end); >> >> sub_mesh->print_info(); >> >> delete sub_mesh; >> delete parent_mesh; >> >> delete libmeshhandle; >> MPI_Finalize(); >> } >> >> On Wed, May 13, 2015 at 2:02 PM, John Peterson <[email protected]> >> wrote: >> >> >> On Wed, May 13, 2015 at 11:13 AM, Bhalla, Amneet Pal Singh < >> [email protected]> wrote: >> I have commented out the line in src/base/libMesh.C which >> calls >> MPI_Abort(libMesh::GLOBAL_COMM_WORLD, 1) to get a backtrace… >> >> >> b MPI_Abort >> >> in the debugger is a good one, too. >> >> -- >> John >> >> >> >> >> ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
