> On 2/2/19 12:32 AM, Praveen C wrote:
>> Thank you for this tip. For my need, I only require the starting global 
>> index 
>> on each partition since I am using local_element to do some operations like 
>> multiplying by a local time step which is different for each cell. The 
>> local_range function gave this info. Here is a sample usage in my code
>>
>> for(; cell!=endc; ++cell)
>> if(cell->is_locally_owned())
>>        {
>> constunsignedintcell_no = cell_number (cell);
>>
>>           cell->get_dof_indices (dof_indices);
>> for(unsignedinti=0; i<fe.dofs_per_cell; ++i)
>>           {
>> unsignedinti_loc = dof_indices[i] - local_range.first;
>>              newton_update.local_element(i_loc) = dt(cell_no) *
>>                                                   
>> right_hand_side.local_element(i_loc) *
>>                                                   
>> inv_mass_matrix[cell_no][i];
>>           }
>>        }
>>
>> If there is a possibility, I would like to request to retain this simple 
>> function in the library.
> No :-) The reason why it was scheduled for removal is that it only works in 
> case the locally owned range is really just a single interval. But that's not 
> always the case. 
To be fair, the current implementation of LA::dist::Vector only supports
that case. However, it is only present for that particular vector type,
which is the main reason why we did not want to expose those functions.
Instead of having a list of functions exposed, we opted for only
exposing the vector's partitioner. The safest approach is to use
something like

  i_loc =
LA::dist::Vector::get_partitioner()->global_to_local(dof_indices[i]);

The partitioner is part of the interface, and global_to_local() will be
stable even if we at some point decide to support non-contiguous range
within the vector.

Best,
Martin

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to