Closed adtzlr closed 2 years ago
However, I'm not 100% sure if it is really useful to mimic a functionality of a package which does this close to perfection...
But I think this will improve the usage of FElupe anyway, so this and an additional (Bi)LinearFormMixed
, and probably BasisMixed
should be included in the future.
see progress in branch add-basis-flexible-weakform
How to deal with mixed formulations? A proposal for linear forms:
L = fe.LinearFormMixed(v=(basis_displacement, basis_pressure), grad_v=(True, False))
def linearform_mixed(v_, F, J):
grad_v, q = v_
return [fe.math.ddot(F, grad_v), fe.math.dot(J, q)]
F = displacement.extract()
L.integrate(linearform_mixed, F=F, J=fe.math.det(F))
L.assemble(linearform_mixed, F=F, J=fe.math.det(F))
And for bilinear forms use the upper triangle entries...?
All done, see d738e8b
FElupe does only provide form assemblers for a given formal architecture of weak form expressions (double-dot products), for example a linear form with the gradient of
v
:With some minor additions very flexible weak-form definitions similar to the interior-basis functionality of scikit-fem may be possible with FElupe. This is just a quick and dirty extension, notation and class methods may be improved in the future.
Using these two classes in the following example is already quite intuitive. Note that no fourth-order tensor has to be created for the assembly of the stiffness matrix.
checks are fine for both linear and bilinear forms: