HCELL always assumes periodic boundary conditions on the lattice. If you want other boundary conditions, you must reset them after each iteration. For example, if you want the first and the last site to be kept at a fixed value equal to 1, you have to do the following
CArule1d rule(1,18); Lattice lat(50); r250_init(1234); lat.PreciseSeed(0.5); lat[0]=1; lat[49]=1; for(int j=1; j<20 ; j++) { Evolve(&lat, rule); lat.Print(); lat[0]=1; lat[49]=1; }