function [uOnCell1,uOnCellminus1,uCell]= transformedFieldScatteredField(U,A,B,F,mesh_points_x,alpha,index)

int_after = cell(1,length(alpha.nodes));
int_before = cell(1,length(alpha.nodes));
int_cell = cell(1,length(alpha.nodes));

for j=1:length(alpha.nodes)
    w = A{j}\(F{j}+B{j}*U);
    int_after{j}  = alpha.weights(j) .* exp(1i * alpha.nodes(j) * (mesh_points_x + 2*pi)).'.* w(index);
    int_before{j} = alpha.weights(j) .* exp(1i * alpha.nodes(j) * (mesh_points_x - 2*pi)).'.* w(index);
    int_cell{j} = alpha.weights(j) .* exp(1i * alpha.nodes(j) * (mesh_points_x)).'.* w(index);
end

uOnCell1 = zeros(length(index),1);
uOnCellminus1 = zeros(length(index),1);
uCell = zeros(length(index),1);

for j = 1:length(alpha.nodes)
    uOnCell1 = uOnCell1 + int_after{j};
    uOnCellminus1 = uOnCellminus1 + int_before{j};
    uCell = uCell + int_cell{j};
end

end