Dear Smail, I haven't had the chance to look at your codes, but it's possible to make a subclass of DirichletBC that imposes boundary conditions on Hermite function spaces on an interval. For example, to fix the derivative at the left end-point of an interval, in the past I did import firedrake.utils as utils class FixHermiteDerivativeValue(DirichletBC): @utils.cached_property def nodes(self): if V.mesh().mpi_comm().size > 1: raise NotImplementedError return [1] # the derivative component of the first vertex at x = 0 If you wanted to set the function value, the method should return [0], etc. Hope this helps! Patrick On 11/04/2025 09:11, Smail Merabet wrote:
Dear firedrake users,
I try to solve a fourth-order 1d nonlinear problem using the Hermite element in firedrake. The functional space for the weak solution is: $$\mathcal{H}\times \mathcal{H}/times H^{2}_{0} $$ where, $$ \mathcal{H} = \left\lbrace f\in H^2([0,\ell]), \; f(0)=0, \; f'(0)=0 \right\rbrace. $$ I can't impose the boundary conditions correctly. When I compile the code, I get the following error: FiniteElement('Hermite', interval, 3), name=None, index=1, component=None), IndexedProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x125a2ce80>, FiniteElement('Hermite', interval, 3), name=None, index=2, component=None), name='None_None_None'), Mesh(VectorElement(FiniteElement('Lagrange', interval, 1), dim=1), 0)), 9) defined on incompatible FunctionSpace!
Note the same problem was implemented using FEniCS with C0-interior penalty method, in the reference (sec. 3 eq 3.12-3.13):
Enhanced models for the nonlinear bending of planar rods: localization phenomena and multistability by: Matteo Brunetti , Antonino Favata and Stefano Vidoli.
I attached the codes to this email.
Thanks in advance Smail MERABET
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake