<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 12. Sep 2017, at 21:26, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 12, 2017 at 12:52 PM, Maximilian Hartig <span dir="ltr" class=""><<a href="mailto:imilian.hartig@gmail.com" target="_blank" class="">imilian.hartig@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br class="">
<br class="">
in my attempt to use an incremental formulation for elastoplasticity I wanted to create an auxiliary field in which the stresses from the past tilmestep are stored. I managed to create an auxiliary DM on which I have a field for the displacement, one for the stress and one for the inner variables. I transfer the displacements to a global vector on the auxiliary field, then calculate the stresses and inner variables using the DMProjectField function. Transfer of the displacements works fine and they are correct. The problem is with the stresses. While on some gauss points I get the correct stress, others have random stresses. I construct the strain using the gradient of the displacements and I believe this is where the problem lies. However, I have not been able to pinpoint it.<br class="">
When I just transfer the displacements to the auxiliary fields and then use a_x in the residual function instead, the stresses are correct. Is there a trick with using u_x in the DMProjectField?<br class=""></blockquote><div class=""><br class=""></div><div class="">Its possible that there is a bug. Just so I understand, you are saying that DMProjectField() has the wrong gradient of the input Vec?</div><div class="">It would really be great if you could demonstrate it with a standalone example.</div></div></div></div></div></blockquote><div><br class=""></div>That is correct, and I suspect it has something to do with the Dirichlet boundary conditions I impose.</div><div>If I comment out the following line, projected result and expected result are the same:</div><div><br class=""></div><div> ierr = DMAddBoundary(dm, PETSC_TRUE, "fixed", "Face Sets",0,Ncomp,restrictall,(void (*)()) zero_vector, Nfid,fid,NULL);CHKERRQ(ierr);</div><div><br class=""></div><div>Please find attached the test example and the test mesh. I run it with:</div><div><br class=""></div><div> -disp_petscspace_order 2 -stress_petscspace_order 2</div><div><br class=""></div><div>Thanks,</div><div>Max</div><div><br class=""></div><div></div></body></html>