On Tuesday, August 16, 2016 at 2:47:18 AM UTC-7, Daniel Arndt wrote:
>
> Bruce,
>
> [...]  3. Like in 2., but for adding values to individual elements. Use 
>> VectorOperation::add.
>>
>> I guess 3) is obscure. Does this mean that you are adding a new element 
>> where none existed before or that you are incrementing an existing element? 
>> If the former, aren't the total number of elements in a vector specified 
>> when you declare the vector size so how do you add more elements?
>>
> This does not mean that you want to modify the size of a vector or the 
> underlying distribution pattern. It just means that after you modify some 
> element of a vector using its original value, e.g. vec(5)+=2, you need to 
> call compress(VectorOperation::add).
>  
>
>>
>> The results coming from p_local_solution look good (smooth) and appear to 
>> have been scaled, only the results for p_local_rho have a problem. I've 
>> tried to create a simple reproducer but so far haven't had any success. 
>> I'll keep trying.
>>
> As you already figured, DataOut needs a ghosted vector containing all the 
> elements on locally owned cells for proper output. If I read your code 
> correctly, only p_local_solution and rho have ghost elements while 
> p_local_rho and phi are completely distributed, i.e. the don't have ghost 
> elements. Hence, I am not surprised that the visualization of p_local_rho 
> looks incorrect.
>
Actually, I'm adding rho to the DataOut object, not p_local_rho, so all 
vectors added to the DataOut object are ghosted. The problem seems to be 
when I scale values. If I use *= to modify the values, then it works okay, 
but if I use my own hand-rolled code to do it, it fails to update the 
processor boundaries. I've attached a code that shows what is happening. It 
is a little on the long side but the important stuff is in the vecScale and 
write_grid routines. At this point, I have a working solution, but I'd be 
interested in understanding why my approach fails.

Bruce



> Best,
> Daniel
>

-- 
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.

Attachment: iotest.tar
Description: Unix tar archive

Reply via email to