function out = w03perF1(x,xL,bc0,bcL,n)
% 
%  initial data functions (djm: 21 sept 2010)
% 

switch n
    case{1}
        slope = (2+sign(x-6));
        out1 = (1/2 - abs(x-6)./slope);
        out2 = (1/2 - abs(x+1));

        slope = (2+sign(2*xL+x-6));
        out3 = (1/2 - abs(2*xL+x-6)./slope);
        out4 = (1/2 - abs(-2*xL+x+1));

        out = out1.*(out1>0) + bc0*sign(out2).*(out2>0)/2;
        out = out + bc0*bcL*(out3).*(out3>0);
        out = out + bcL*sign(out4).*(out4>0)/2;
    case{2}
        x = -x;

        slope = (2+sign(x-6));
        out1 = (1/2 - abs(x-6)./slope);
        out2 = (1/2 - abs(x+1));

        slope = (2+sign(2*xL+x-6));
        out3 = (1/2 - abs(2*xL+x-6)./slope);
        out4 = (1/2 - abs(-2*xL+x+1));

        out = bc0*out1.*(out1>0) + sign(out2).*(out2>0)/2;
        out = out + bcL*(out3).*(out3>0);
        out = out + bc0*bcL*sign(out4).*(out4>0)/2;
end

