Furthermore, the documentation for extract_dofs() states that
The size of selected_dofs must equal DoFHandler::n_dofs()
<http://www.dealii.org/developer/doxygen/deal.II/classDoFHandler.html#a54e7270f2ba6206604f794114b39a2aa>
while the error message tells me that the vector must have a size of
dof.n_locally_owned_dofs()
That is slightly confusing...
Am Freitag, 20. April 2018 06:08:47 UTC+2 schrieb Maxi Miller:
>
> I already suspected this. Do you have a suggestion how to solve it? Or a
> suggestion for a better approach?
> Thank you!
>
>
> Am Donnerstag, 19. April 2018 22:48:17 UTC+2 schrieb Wolfgang Bangerth:
>>
>> On 04/19/2018 07:15 AM, 'Maxi Miller' via deal.II User Group wrote:
>> > |
>> std::vector<bool>TE_value_mask(dof_handler.n_locally_owned_dofs()),
>> > TL_value_mask(dof_handler.n_locally_owned_dofs()),
>> > N_value_mask(dof_handler.n_locally_owned_dofs());
>> >
>> > DoFTools::extract_dofs(dof_handler,surface_N_mask,N_value_mask);
>> > DoFTools::extract_dofs(dof_handler,surface_TE_mask,TE_value_mask);
>> > DoFTools::extract_dofs(dof_handler,surface_TL_mask,TL_value_mask);
>> >
>> >
>> LinearAlgebraTrilinos::MPI::Vectorunified_test_vector(dof_handler.locally_owned_dofs(),mpi_communicator);
>>
>>
>> >
>> > for(autoindex :scaled_solution.locally_owned_elements())
>> > {
>> > if(N_value_mask[index])
>> > {
>> >
>> > unified_test_vector(index)=scaled_solution(index)*(unified_max_N_value
>> > -unified_min_N_value)*unified_N_value +unified_N_value;
>> > }
>> > |
>>
>> This cannot work (and is likely the cause for your issues):
>> `N_values_mask` is an array if size `dof_handler.n_locally_owned_dofs()`
>> whereas `unified_test_vector` is a vector if size
>> `dof_handler.n_dofs()`. For sequential computations, the two are the
>> same, but for parallel computations, the two are very different.
>>
>> What that means is that you cannot expect that `index` is a good index
>> for both. The way you define `index` is that it iterates over the index
>> set of locally owned elements (i.e., over indices between zero and
>> `dof_handler.n_dofs()`), and consequently the statement
>> N_value_mask[index]
>> is meaningless. You need to translate between the two.
>>
>> Best
>> W.
>>
>> --
>> ------------------------------------------------------------------------
>> Wolfgang Bangerth email: [email protected]
>> www: http://www.math.colostate.edu/~bangerth/
>>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.