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

Add hess argument to Region(hess=False) #836

Merged
merged 16 commits into from
Aug 27, 2024
Merged

Add hess argument to Region(hess=False) #836

merged 16 commits into from
Aug 27, 2024

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Aug 27, 2024

The element must provide a hessian-method for Region(hess=True).

  • Extend the __repr__ method of Region by hessian evaluated: True
  • Add Tests

Hessian-based (HuHu-) Regularization

$$ \Pi = \int_V \frac{1}{2}\ \mathbb{H}(\boldsymbol{u}) \vdots \mathbb{H}(\boldsymbol{u})\ dV $$

see https://en.wikipedia.org/wiki/Third_medium_contact_method

import felupe as fem

mesh = fem.Cube()
region = fem.RegionHexahedron(mesh, hess=True)
displacement = fem.Field(region, dim=3)
field = fem.FieldContainer([displacement])

@fem.Form(v=field, u=field)
def bilinearform():
    return [lambda v, u: dddot(hess(v), hess(u))]

@fem.Form(v=field)
def linearform():
    u = field[0]
    return [lambda v: dddot(hess(v), hess(u))]

matrix = bilinearform.assemble(v=field, u=field)
vector = linearform.assemble(v=field)

@adtzlr adtzlr added the enhancement New feature or request label Aug 27, 2024
@adtzlr adtzlr self-assigned this Aug 27, 2024
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.52%. Comparing base (7cabbfd) to head (c182d75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #836      +/-   ##
==========================================
+ Coverage   97.48%   97.52%   +0.04%     
==========================================
  Files         147      147              
  Lines        5601     5665      +64     
==========================================
+ Hits         5460     5525      +65     
+ Misses        141      140       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adtzlr adtzlr merged commit faed66b into main Aug 27, 2024
6 checks passed
@adtzlr adtzlr deleted the add-region-hessian branch August 27, 2024 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant