Hello Bruno, 

Thank you for your quick reply!

ii) ConstraintMatrix::distribute() and Newton's method
> In a Newton's method solver, we have:
>
> version A:
> //...get the new newton_update vector from solving the equation
> constraints.distribute(newton_update);
> new_sln = old_sln + alpha* newton_update;
>
> version B:
> //...get the new newton_update vector from solving the equation
> new_sln = old_sln + alpha* newton_update;
> constraints.distribute(new_sln);
>
> In the tutorials it seems version A is more commonly used. However, it 
> seems to me that if there are inhomogeneous constraints, then only version 
> B is correct. Is it right? I don't know how the distribute() function is 
> implemented, but based on the documentation it seems version B is a more 
> logical and universal way.
>
Version A should work all the time. You impose the inhomogeneous 
> constraints the first time you solve the problem, so now you don't want 
> your newton_update to modify the solution where it is correct. So you 
> impose _homogeneous_ constraints on your update, i.e, you add zero. Does 
> that make sense?


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?

Best,
Yiyang



On Thursday, October 26, 2017 at 8:19:57 AM UTC-5, Bruno Turcksin wrote:
>
> Yiyang,
>
> On Wednesday, October 25, 2017 at 8:07:46 PM UTC-4, Yiyang Zhang wrote:
>
>> locally_relevant_sln_with_ghost_new = 
>> locally_relevant_sln_with_ghost_old; //This and the following one are 
>> rarely seen in the tutorials. Does this mean the vector is exactly copied? 
>> i.e. both locally_owned_dofs and the ghost_dofs are all copied?
>>
> Yes. 
>
>> distributed_sln_new = locally_relevant_sln_with_ghost_new; //Does this 
>> mean the locally_owned_dofs are copied, while the ghosts are neglected?
>>
> That's correct. 
>
>>
>> ii) ConstraintMatrix::distribute() and Newton's method
>> In a Newton's method solver, we have:
>>
>> version A:
>> //...get the new newton_update vector from solving the equation
>> constraints.distribute(newton_update);
>> new_sln = old_sln + alpha* newton_update;
>>
>> version B:
>> //...get the new newton_update vector from solving the equation
>> new_sln = old_sln + alpha* newton_update;
>> constraints.distribute(new_sln);
>>
>> In the tutorials it seems version A is more commonly used. However, it 
>> seems to me that if there are inhomogeneous constraints, then only version 
>> B is correct. Is it right? I don't know how the distribute() function is 
>> implemented, but based on the documentation it seems version B is a more 
>> logical and universal way.
>>
> Version A should work all the time. You impose the inhomogeneous 
> constraints the first time you solve the problem, so now you don't want 
> your newton_update to modify the solution where it is correct. So you 
> impose _homogeneous_ constraints on your update, i.e, you add zero. Does 
> that make sense?
>
>>
>> iii) solve system with inhomogeneous constraints
>> I have a problem with inhomogeneous constraints. I did some tests and it 
>> seems that sometimes the solver collapses due to convergence(?) while 
>> sometimes it doesn't, for example depending on the mesh.
>> May I ask, with inhomogeneous constraints, do I need to, say, choose 
>> different preconditioner, or providing the preconditioner with 
>> AdditionalData?
>>
>  The fact that you use inhomogeneous constraints is not a reason on itself 
> to change the preconditioner. However, different meshes may make the 
> problem harder to solve. You may also have a hard time capturing boundary 
> layer. Without knowing anything about your problem it is hard to say why a 
> solver fails.
>
> Best,
>
> Bruno
>

-- 
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.

Reply via email to