[petsc-users] Hints for using petscfe for plasticity -- how to update/access internal variables?
Maximilian Hartig
imilian.hartig at gmail.com
Thu Sep 21 10:47:51 CDT 2017
> On 21. Sep 2017, at 16:02, Mark Adams <mfadams at lbl.gov> wrote:
>
>>>
>
> 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.
>
> I would just do this for now and get it working.
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
f0[]=u[]-calculatedstress[]
and
f0[] = u[uOff[1]]-calculatedplasticstrain[]
respectively.
My calculatedplasticstrain 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.
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.
>
> 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.
>
> 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.
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.
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.
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.
I use petsc from bitbucket origin/master
Thanks,
Max
>
>
> Thanks,
> Max
>>
>> Thanks,
>>
>> Matt
>>
>> 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.
>>
>> I’m sure there’s an elegant solution on how to update internal variables but I have not found it.
>>
>> Thanks,
>> Max
>>>
>>> Thanks,
>>>
>>> Matt
>>>
>>> Thanks,
>>> Max
>>>
>>>
>>>
>>> --
>>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
>>> -- Norbert Wiener
>>>
>>> http://www.caam.rice.edu/~mk51/ <http://www.caam.rice.edu/~mk51/>
>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
>> -- Norbert Wiener
>>
>> http://www.caam.rice.edu/~mk51/ <http://www.caam.rice.edu/~mk51/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170921/8a8b0563/attachment.html>
More information about the petsc-users
mailing list