How to assign locally value functions to elements in a P0 space

Hi FreeFem community.

Im trying to define a criteria to remove boundary elements of a 3d mesh by obtaining the number of faces in contact to an adjacent mesh. As the trunc operator needs to define previously a function to establish the criteria to know which elements have to be removed. In my case this function is necessarily to be a logical function which has to be 1 in those elements which satisfy the aformentined condition, and 0 otherwise. It has to be defined in a P0 finite element space to be locally in the center of the element. Is there a command in freefem to assign the values of the function locally without solving a PDE equation?

Thank you very much in advance
Best Regards
Jacob

if you now the number of the element
fespace Ph(Th,P0);
Ph u; // finite element P0

int kr = Th(0.55, 0.6).nuTriangle;

u[][k]=1 ; // for example

Thank you very much for your answer. I tried these commands in my code and it worked properly.

Best Regards
Jacob