Re: [Libmesh-users] Query if a Processor Owns a Given Element in a Parallel Mesh

2015-09-01 Thread Roy Stogner
On Tue, 1 Sep 2015, Dafang Wang wrote: > My current solution is to iterate over all the local elements on each > processor in order > to find the i-th element. This is cumbersome. And inefficient. > I am asking if libmesh provides a function for such needs. Yes, that's what query_elem(i) is f

Re: [Libmesh-users] Query if a Processor Owns a Given Element in a Parallel Mesh

2015-09-01 Thread Dafang Wang
Hi Derek, Iterating over elements is NOT what I want to do. I want to operate on the i-th element, supposing that I know the index i. I cannot use Mesh.elem(i) because it is unknown which processor owns the element i. My current solution is to iterate over all the local elements on each proce

Re: [Libmesh-users] Query if a Processor Owns a Given Element in a Parallel Mesh

2015-09-01 Thread Derek Gaston
What are you actually trying to do? I figured you were iterating over elements and then needing to know if the element you are currently on is owned by the local processor or not... Derek On Tue, Sep 1, 2015 at 6:24 PM Dafang Wang wrote: > Hi Derek, > > Thanks for your quick response. What if

Re: [Libmesh-users] Query if a Processor Owns a Given Element in a Parallel Mesh

2015-09-01 Thread Dafang Wang
Hi Derek, Thanks for your quick response. What if the elem pointer is not available, i.e., how can I obtain the i-th element in a parallel mesh without iterating over the mesh? Shall I use mesh.query_elem()? Cheers, Dafang On 9/1/2015 5:17 PM, Derek Gaston wrote: > if (elem->processor_id() =

Re: [Libmesh-users] Query if a Processor Owns a Given Element in a Parallel Mesh

2015-09-01 Thread Derek Gaston
if (elem->processor_id() == mesh.processor_id()) On Tue, Sep 1, 2015 at 5:12 PM Dafang Wang wrote: > Hi, > > I am wondering how to query whether a processor owns a given element in a > parallel mesh, > assuming that the finite-element mesh is partitioned across multiple > processors. One way I >