On 02/06/2018 10:31 AM, Dulcimer0909 wrote:
The initialization of the cell_matrix and cell_rhs and cell_rhs_1 are
being done in the beginning.
> for(const auto &cell: dof_handler.active_cell_iterators())
> {
> fe_values.reinit(cell);
> cell_matrix = 0;
> cell_rhs = 0;
> cell_rhs_1 = 0;
I know -- but you copy everything into system_rhs, and there is no place
before the loop over all cells where you have
system_rhs = 0;
In other words, you add the cell contributions to whatever *was already*
in the vector *before* the loop.
For the assembly of cell_rhs_1, I agree it should generally be only over
i and not over j but as mentioned in the tutorial in the space
discretization section
(
https://dealii.org/8.5.0/doxygen/deal.II/step_23.html#Spacediscretization )
the right hand side has
M and A matrices which can only be accessed within the j loop.
Yes. So when you build M and A, you need a loop over i and a loop over
j. But when you build the vectors, you only need a loop over i.
That's like all other tutorial programs do it as well -- take a look at
step-3, step-4, etc.
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.