You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ProjectorToP1discont.m
    path of file: ./repos/Swan/Topology Optimization/Operators/Projectors
    
    the code of the file until where you have to start completion: classdef ProjectorToP1discont < handle
    % OBJECTIU: encara no fa falta resoldre el sistema matricial. Simplement
    % fer switch depenent de la funcio d'entrada (P0 o P1) i trobar "a lo
    % cutre" la P1discont. Ja mes endavant fem
    
function xFun = project(obj,cParams) % THIS WILL BE DELETED ONCE RHS IS OK
            origin = cParams.origin;
            x      = cParams.x;
            connec = obj.mesh.connec;
            switch origin
                case {'P0'}
                    dim      = 1;
                    ndim  = size(x.fValues, 1);
                    nnodeElem = size(connec,2);
                    fEl = squeeze(x.fValues(dim,:,:));
                    fRepeated = zeros(ndim, size(fEl,1), nnodeElem);
                    for idim = 1:ndim
                        fEl = squeeze(x.fValues(idim,:,:));
                        for iNode = 1:nnodeElem
                            fRepeated(idim, :,iNode) = fEl;
                        end