Perhaps Piecewise
:
tmax = 25;
xmax = 6*Sqrt[tmax];
ic[t_?NumericQ] := Piecewise[{{-1, t > 0}}, 0];
sol = NDSolve[{D[c[x, t], t] == D[c[x, t], {x, 2}] - c[x, t]^2,
c[x, 0] == 0, Derivative[1, 0][c][0, t] == ic[t], c[xmax, t] == 0},
c, {x, 0, xmax}, {t, 0, tmax}]
Plot3D[Evaluate[c[x, t] /. sol], {x, 0, xmax}, {t, 0, tmax},
PlotRange -> All]
Or Interpolation[]
:
ic = Interpolation[{{{0.}, 0.}, {{0.001}, -1., 0., 0.}, {{100.}, -1.}}];
(* other code stays the same *)