<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></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 21. Sep 2017, at 16:02, Mark Adams <<a href="mailto:mfadams@lbl.gov" class="">mfadams@lbl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class="h5"><blockquote type="cite" class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><blockquote type="cite" class=""><br class=""></blockquote></div></blockquote></div></div></div></blockquote></div></div><div class="">That depends on the type of plasticity. For a linear hardening formulation it is correct that I could just apply a local operator. I’d be happy with that for now. </div></div></div></blockquote><div class=""><br class=""></div><div class="">I would just do this for now and get it working.</div></div></div></div></div></blockquote><div><br class=""></div><br class=""><div>I agree, and the local version would be enough for me to continue for now. The issue was that I could not get DMProjectField to work to calculate my stress so I decided to just do a solve and set the residual of the fields to </div><div><i class="">f0[]=u[]-calculatedstress[]</i></div><div>and</div><div><i class="">f0[] = u[uOff[1]]-calculatedplasticstrain[]</i></div><div>respectively.</div><div><br class=""></div><div>My <i class="">calculatedplasticstrain</i> was equal to the one from the last step in case of elastic behaviour. In case of plastic behaviour it was the one from the last step plus a positive increment. Yet I ended up with negative plastic strains.</div><div><br class=""></div><div>I wouldn’t need to do a global solve if I managed to just project the correct stresses and strains in the auxiliary field. I don’t even want to do it. I just couldn’t get DMProjectFields to give me the correct gradients and tried this as a workaround.</div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="">But I’d still need to save stress state and plastic strain to determine whether or not I’m dealing with a plasticity. I don’t know how to do that inside the residual evaluation. Plus DMProjectField seems to have problems evaluating the gradient when boundary conditions are imposed.</div></div></div></blockquote><div class=""><br class=""></div><div class="">After you get the local version working try your nonlocal thing without BCs. You may find bugs while you do this that are causing your problem, and if not we can think more about it.</div></div></div></div></div></blockquote><div><br class=""></div><div>I don’t understand what you mean by “without BC”. If I don’t impose boundary conditions there is nothing to solve. The DMProjectField thing does work without boundary conditions if you mean that. It is only when I impose Dirichlet BC on the dm that I get the wrong gradients. </div><div>This is also true if I use a second, unconstrained dm_unconstrained to project the fields but the original vector comes from a constrained dm.</div><div>I also tried creating a second vector on dm_unconstrained and using DMGlobalToLocal to transfer from the original vector to the second, unconstrained one and then this one as input for DMProjectField. It does not prevent the gradient issue from happening. </div><div><br class=""></div><div>I use petsc from bitbucket origin/master</div><br class=""></div><div><br class=""></div><div>Thanks,</div><div>Max</div><div><br class=""></div><div> </div><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Max</div><span class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="">I evaluate the current trial stress by adding a stress increment assuming elastic behaviour. If the trial stress lies beyond the yield stress I calculate the corrected stress to evaluate my residual for the displacements. But now I somehow need to update my plastic strain and the stress in the auxiliary fields. So in tspoststep I created another SNES to now calculate the stress and plastic strain while the displacement is the auxiliary field. </div><div class=""><br class=""></div>I’m sure there’s an elegant solution on how to update internal variables but I have not found it.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Max<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class=""> <span class="m_-2403979162494160701m_820538064167687730Apple-converted-space"> </span>Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Thanks,<br class="">Max</blockquote></div><br class=""><br clear="all" class=""><span class="m_-2403979162494160701HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div>--<span class="m_-2403979162494160701m_820538064167687730Apple-converted-space"> </span><br class=""><div class="m_-2403979162494160701m_820538064167687730gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.caam.rice.edu/~mk51/" target="_blank" class="">http://www.caam.rice.edu/~mk51<wbr class="">/</a></div></div></div></font></span></div></div></div></blockquote></div><br class=""></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="m_-2403979162494160701Apple-converted-space"> </span><br class=""><div class="m_-2403979162494160701gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.caam.rice.edu/~mk51/" target="_blank" class="">http://www.caam.rice.edu/~<wbr class="">mk51/</a></div></div></div></div></div></div></blockquote></span></div><br class=""></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>