Hamed, As you can see my assembly in the first post, my system_matrix and > system_rhs are not made directly from cell_system_matrix or > cell_system_rhs, but they are the result of some manipulations on > mass_matrix, laplase_matrix and nl_matrix (the same approach as step_25) > that have already been assembled (in the red part of the code). > > To simplify the question, lets say we want to apply any sort of > constraints in the assembly part of step-25. I was wondering how to do use > ConstraintMatrix::distribute_local_to_global, while there is no > cell_system_matrix and cell_system_rhs. > This is only (directly) possible if you are not using inhomogeneous constraints. In that case, you can call ConstraintMatrix::distribute_local_to_global separately for matrix and right-hand side. In case you have inhomogeneous constraints, you can first create a vector that has the appropriate constraints: inhom_constraints.distribute(u_inhom) Afterwards you are just solving for the difference (u-u_inhom) that takes homogeneous constraints: A*(u-u_inhom) = f-A*u_inhom u=(u-u_inhom)+u_inhom
This approach should also work if A and f are linear combination of matrices resp. right-hand sides for which you used ConstraintMatrix::distribute_local_to_global individually. 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.
