Joss:
It is not very clear to me what is the order followed when using
multi-components. As an example to put my question more clear I cann
point to step-29 where there are 2 components used.
My common sense would be that the system_matrix global operator would
have first real and then the imaginar components. However, printing the
matrix and looking at it, I can see the values are somehow intercalated
(rows and columns).
*Could someone please clarify this?*
The way we typically like to think about this is that the DoFHandler
chooses "some" order that simply is what it is. If you want something
specific, you need to say so explicitly. In your case, if you want all
of the real components first and then all of the imaginary components,
then you need to say that that is what you want, and the way to do that
is DoFRenumbering::component_wise(). This function is used in any number
of tutorial programs, see for example step-20 and step-22.
I would also like to ask how can I get the mass matrix of one of the
components. Using the following for each cell and locating for the
global matrix I get the two components (again not sure how the order is...)
/Mass_matrix(i,j)+=((fe_values.shape_value(i, q_point) *
fe_values.shape_value(j, q_point)) * fe_values.JxW(q_point));/
This results in a different matrix than you want: If the matrix was
structured by component (i.e., it is a 2x2 block matrix), then each of
the four blocks will end up with a mass matrix. That's likely not what
you intended.
On the other hand...
On the other hand, using the following, does not allow me to use the
local_dof_indices function, as using only one component, the dof is half:
/Mass_matrix(i,j)+=((fe_values.shape_value_component(i, q_point,0) *
fe_values.shape_value(j, q_point,0)) * fe_values.JxW(q_point));/
...this will only put a mass matrix into the top left block.
The general strategy to working with all multi-component problems is to
use the "extractors". See again step-20, step-22, and the documentation
module about vector-valued problems.
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/491091e7-4ec5-f61b-3290-7bc9015f23a6%40colostate.edu.