Dirichlet BC from array

Is it possible in fenics to apply Dirichlet boundary conditions from a given boundary value array?

You need to create a mapping between the array and the degrees of freedom you would like to apply the values to. Thus you should map the array into a dolfin.Function, using setValuesLocal Where the first array is the function values, the second array is the dof indices. For usage of setValuesLocal, see for instance How to modify the value of a Function object? - #2 by dokken

1 Like