Hi Bruno,
Thanks for your reply. Your understanding is exactly correct. I want to
convert the distributed Vector to a whole one with no distribution, and I
want to have the access to each component.
However, I do not quite understand the so-called sequential Vector. For the
system_rhs Vector I want, as long as I assemble it with "if
(cell->subdomain_id() == this_mpi_process)", and use "cell->get_dof_indices
(local_dof_indices)" to put the component into the corresponding global
position, I will have as many Vectors as the number of processors I use,
and each of them only stores the local components without assembly.
I have tried the following two ways to define the vector, and neither of
them gave me what I want.
(i) PETScWrappers::MPI::Vector system_rhs;
(ii) Vector<double> system_rhs;
Is sequential Vector different from the above two? And how should I define
it correctly? Thank you very much!
Best,
Chenchen
在 2016年5月27日星期五 UTC-4上午8:14:44,Bruno Turcksin写道:
>
> Chenchen,
>
> On Thursday, May 26, 2016 at 3:37:03 PM UTC-4, Chenchen Liu wrote:
>
>> I am modifying step-17 to do multiscale modeling. My goal is different
>> from the step-17, i.e., I don't want to store the matrix in distribution.
>> let's consider matrix-vector multiplication problem, [A]{u}={b}, in which
>> [A] has already been obtained as a full matrix without distribution, and
>> the rhs vector {b} needs to be assembled with distribution. My problem is
>> how to obtain the components of the rhs vector {b}, or how to convert the
>> distributed vector to a normal vector without distribution? I really need
>> this even of it is not efficient.
>>
>> If I understand correctly, you have distributed vector but you want every
> processor to own (know) the whole vector. Is that right? I think this (if
> you want to use deal.II sequential vector)
> https://www.dealii.org/8.4.1/doxygen/deal.II/classVector.html#aa5dbb7642901ec9bb2eeb85ff99ba89c
>
> or this (if you want to use PETSc sequential vector)
> https://www.dealii.org/8.4.1/doxygen/deal.II/classPETScWrappers_1_1Vector.html#a3b51db1336c02fd2c3ded73e05f4b7cf
>
> should work.
>
> Best,
>
> Bruno
>
--
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.