Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

34 ramberg osgood plasticity #45

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

pdiercks
Copy link
Collaborator

@pdiercks pdiercks commented Feb 5, 2024

Hi @srosenbu ,

this is a draft for the ramberg osgood example. It's now working with dolfinx version 0.6.0, but the formulation is not incremental and the compilation of the forms has to be explicitly called by the user at the moment. Also, I would like to reduce the complexity and remove certain parts of the code that are not necessary here.

We could also have a talk in the next days and add a general fenics_constitutive.interfaces.IncrSmallStrainProblem, such that the class is simply imported here (and potentially in the other examples).

Also, I did not generate the documentation yet.

@pdiercks pdiercks self-assigned this Feb 5, 2024
@pdiercks pdiercks requested a review from srosenbu February 5, 2024 17:24
Copy link
Member

@srosenbu srosenbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I can trust the ro.png, this seems to work, which is nice:)
We should just have a disussion on what belongs in the example and what in the package.

"""


class RambergOsgood3D(object):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried using @jitclass here? In my memory jitclass was not as fast as jit functions, but maybe they have progressed in the last years.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not try jitclass yet, but I also think, in the old version I did not use a class, because it was user to jit a function. I have no strong opinion on this. I can try @jitclass, but would not want to start a comparison of performance here.

examples/ramberg_osgood.py Outdated Show resolved Hide resolved
examples/ramberg_osgood.py Outdated Show resolved Hide resolved
examples/ramberg_osgood.py Outdated Show resolved Hide resolved
examples/ramberg_osgood.py Outdated Show resolved Hide resolved
self.QT_views.append((QT_parent, QT_child, QT_sub))
self._tangent.append(df.fem.Function(QT_sub))

self.stress = df.fem.Function(QV)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want this problem definition to work with incremental laws, we need the stress two times. One time for the updated state and one for the initial state. Same for history variables

self.stress.x.scatter_forward()
self.tangent.x.scatter_forward()

def eps(self, u):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On main, there is already a pre-defined mandel strain function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like

from .stress_strain import ufl_mandel_strain

inside interfaces.py will lead to a circular import.

My current solution is to let IncrSmallStrainProblem.eps be an abstractmethod that the user has to implement. I would consider this the safer option. If there was some default eps and the user does not have to think about it, then this could potentially lead to the IncrSmallStrainProblem computing mandel strain, although user has implemented some material routine expecting standard voigt basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants