How to use find_atom command in bond_harmonic (fix/property information)

Hi all,
I need to add an additional per-atom vector to store information about atoms, when I compute bond_harmonic style potential. These values should change during the simulation. I defined the new per-atom vector in input script as
"fix 1 all property/atom i_flag "

Now I add these lines in compute function of bond_harmonic.cpp
int index,flag,cols;
const char *name;
flag=0; //integer array
cols=0; // per atom array
name =“i_flag” ;
int idx = atom->find_custom(name, flag, cols);
int *ilist = atom->ivector[idx];
ilist[0]=4;
It compiles and create executable, but when I try to run it, I get segmentation error. Because the value of idx is “-1”, because it is a null pointer. How do I fix this error. What is the ‘name’ in the find_custom command. Do I need to change any other .cpp files for my use. Please clarify.
Thank you for your time
Best,
Parvathy

It is “flag”.

Please note that the arguments ‘flag’, and ‘cols’ are outputs not inputs. The find_custom() method reports in them, whether ‘name’ corresponds to integer or floating point data and whether it is a vector or a per-atom array.

Thank you Axel. It got fixed.