Suggestion: Do one loop over nodes adding all indices for each variable at each node, then a loop over elements adding all indices for each variable at each element (not at the nodes of each element, but at the element-considered-as-DofObject itself). That way you don't get any duplicates, don't need std::set, and you're O(N) rather than O(N log N).
Even if you need a sorted list, a sort on the final vector may be faster than building up a sorted set one element at a time. --- Roy On Wed, 13 Jun 2012, Dmitry Karpeev wrote: > So, I basically found a workaround. It's not the most efficient, by from my > (imperfect) understanding of the libMesh code, there might not be a more > efficient way. You can find the details in src/solvers/petscdmlibmesh.C. > > Dmitry. > > On Wed, Jun 13, 2012 at 9:39 AM, Derek Gaston <[email protected]> wrote: > >> Dmitry - did you ever figure this out? I need to do the same thing... >> anyone know of a shortcut? >> >> Derek >> >> On Fri, Mar 2, 2012 at 9:25 AM, Dmitry Karpeev <[email protected]>wrote: >> >>> Dear All, >>> What's the fastest way to build a list of ALL local dof indices >>> corresponding to a given system variable? >>> I figured one way is to loop over the local elements, call >>> dof_map.dof_indices(elem, elemlist, varid), combine elemlists and >>> eliminate >>> the duplicates. >>> Is there a better way? >>> >>> Thanks. >>> Dmitry. >>> >>> ------------------------------------------------------------------------------ >>> Virtualization & Cloud Management Using Capacity Planning >>> Cloud computing makes use of virtualization - but cloud computing >>> also focuses on allowing computing to be delivered as a service. >>> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >>> _______________________________________________ >>> Libmesh-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/libmesh-users >>> >> >> > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Libmesh-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libmesh-users > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
