Yeah! .block(0) is essential. Without this, the data obtained is garbage!

 

Thanks for this great hint!

 

From: Wolfgang Bangerth
Sent: Wednesday, August 18, 2021 8:37 PM
To: [email protected]
Subject: Re: [deal.II] How to watch the variable of BlockVector type?

 

On 8/18/21 7:18 PM, Michael Lee wrote:

>

>            BlockVector<double> & system_rhs;

>            system_rhs.reinit(dofs_per_block);

>

> For normal vectors, I can use *((double(*)[10]) v.begin()), but it does not

> work for BlockVector. I'm using VS code.

 

Try *( (double(*)[10]) v.block(0).begin())

 

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

To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/46c327fa-1d8c-0eb9-d03e-40e5c3611447%40colostate.edu.

 

--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/B0E16C6C-D172-4D48-BD6D-30EEC923A16A%40hxcore.ol.

Reply via email to