-
Notifications
You must be signed in to change notification settings - Fork 13
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 function decorator for weakforms #208
Conversation
import new form decorator
Codecov Report
@@ Coverage Diff @@
## main #208 +/- ##
=======================================
Coverage 98.34% 98.35%
=======================================
Files 62 62
Lines 2543 2608 +65
=======================================
+ Hits 2501 2565 +64
- Misses 42 43 +1
Continue to review full report at Codecov.
|
Mixed-Field implementation is still broken as LinearFormMixed and BilinearFormMixed expect a list of weakforms. This can't be decorated. A new decorator has to be introduced... |
Mixed-Field Forms are applied on a helper function which returns a list of sub-forms (upper triangle part). mesh = fe.Cube(n=3)
region = fe.RegionHexahedron(mesh)
fieldmixed = fe.FieldsMixed(region, n=2)
F, p = fieldmixed.extract()
def a_uu(v, u, F, p):
return ddot(u, ddot(dya(F, F), v))
def a_up(v, r, F, p):
return dot(p, r) * ddot(F, v)
def a_pp(q, r, F, p):
return dot(p, q) * dot(r, p)
@fe.Form(v=fieldmixed, u=fieldmixed, grad_v=(True, False), grad_u=(True, False))
def a():
return (a_uu, a_up, a_pp)
a.assemble(v=fieldmixed, u=fieldmixed, args=(F, p)) |
introduce a new function decorator
@Form()
:fixes #207