Hello Prof. Bangerth, Thank you for your reply. I am sorry I didn't really follow...
Here are the two ways. (i) set the inhomogeneity in the initial solution vector. in the constraints object we only need to store homogeneous constraints: constraints.add_lines(....) Then in the solve() function we have //...get the new newton_update vector from solving the equation constraints.distribute(newton_update); new_sln = old_sln + alpha* newton_update; (ii) do not touch the initial solution vector. in the constraints object we add inhomogeneous constraints constraints.add_lines(....) constraints.add_inhomogeneity(....) then in the solve() function we have //...get the new newton_update vector from solving the equation new_sln = old_sln + alpha* newton_update; constraints.distribute(new_sln); It seems to me that both ways are fine. Is there any particular reason that we prefer one than the other? Best, Yiyang On Thursday, October 26, 2017 at 10:23:43 AM UTC-5, Wolfgang Bangerth wrote: > > On 10/26/2017 09:16 AM, Yiyang Zhang wrote: > > > > I mean in the constraints objects, I also put the inhomogeneous > > constraints in, that is: > > > > constraints.add_lines(....) > > constraints.add_inhomogeneity(....) > > > > Then, if I use version A, every time I solve the equation, I will add > > the inhomogeneity to the newton_update. Is it the case? > > > > I assume what you means is putting the inhomogeneity directly into the > > initial solution, and then in the constraints object, we only have > > homogeneous constraints. Is this what you mean? > > > > That is the correct way of doing things. step-15 does it that way, for > example. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > <javascript:> > 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 dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.