Maxi, citing from the documentation of step-23[1]: "In a very similar vein, we are also too lazy to write the code to assemble mass and Laplace matrices, although it would have only taken copying the relevant code from any number of previous tutorial programs. Rather, we want to focus on the things that are truly new to this program and therefore use the MatrixCreator::create_mass_matrix and MatrixCreator::create_laplace_matrix functions." It comes just handy that we have an easy way to get the required matrices without having to write the assembly loops ourselves. Mutiplying the finite element vector old_solution_u by the laplace matrix is the same as assembling the right-hand side (\nabla phi, \nabla old_solution_u).
The point in this example is that you don't have to assemble the laplace matrix for each time step anew. How you do this is totally up to you. In create MatrixCreator::create_laplace_matrix we apply some more optimizations so this might be faster then writing the assembly loop yourself. In the end, you should have a lot of time steps and assembling this matrix once should negligible in comparison to the time you spend in the solver. Hence, my advice would be to use whatever is easier for you. Best, Daniel [1] https://www.dealii.org/8.5.0/doxygen/deal.II/step_23.html#Includefiles Am Freitag, 18. August 2017 17:26:37 UTC+2 schrieb Maxi Miller: > > I am trying to develop my own code based on example 23 (\partial_t U = > i/(2k)\nabla^2U), and am trying to understand the purpose of the > laplace-matrix. Why is it used in order to multiply in both sides, in > comparison with the weak formulation (\nabla\phi_i,\nabla\phi_j) and the > assembly of the usual cell matrix? Assumed I have to split my U into a real > and an imaginary value, is the approach with the Laplace-matrix better, or > the split into the weak formulation and the accompanying matrices on both > sides? > -- 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.
