
% In this section you may modify the mesh in any way that does not
% alter the set of nodes.

    if (Steps(m)==0) && m.globalDynamicProps.doinit  % Initialisation code.
        % Put any code here that should only be performed at the start of
        % the simulation, for example, to set up initial morphogen values.
        id_a_p((m.nodes(:,1)>0)&(m.nodes(:,1)<=2))=1;
        id_b_p((m.nodes(:,1)>-2)&(m.nodes(:,1)<=0))=1;
        id_subdivide_p((m.nodes(:,1)>=-2)&(m.nodes(:,1)<=2))=1;
        P=m.nodes(:,1);
    end
    if realtime<=1
        kapar_p(:) = 0;
        kaper_p(:) = 0;
        kbpar_p(:) = 0;
        kbper_p(:) = 0;
        knor_p(:)  = 0;
    else
        kapar_p(:) = 0.05*id_a_p;
        kaper_p(:) = 0;
        kbpar_p(:) = 0.05*id_b_p;
        kbper_p(:) = 0;
        knor_p(:)  = 0;
    end