This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

exposing DirichletBC dofs and corresponding coefs to python

+2 votes

Is there an easy way to display the dof indices where a DirichletBC is applied and corresponding values in python? I would like to use that information to apply the boundary condition to a numpy array.

asked Jul 5, 2017 by chaffra FEniCS User (1,830 points)

1 Answer

+2 votes

Hello,

By using get_boundary_values() , you get the index for DOF on boundary...

documentation: http://fenics.readthedocs.io/projects/dolfin/en/latest/apis/api_fem.html?highlight=get_boundary_values()#_CPPv2NK6dolfin11DirichletBC6dolfin11DirichletBC19get_boundary_valuesER3Map

I think that's what you want...

Regards,
Leonardo

answered Jul 6, 2017 by lhdamiani FEniCS User (2,580 points)
...