this.NODE(this.ELEM{el}(1),2)];
            
                % Get the nodes of the borders
                NdBorders = [this.ELEM{el}(1:nLinNodes), this.ELEM{el}(1)];
            
                % Loop through the edges of the element
                for j = 1:nEdges
            
                    % coordinates of the edge
                    edgeX = [cX(j) , cX(j+1)];
                    edgeY = [cY(j) , cY(j+1)];
            
                    % select the edge
                    if dir == 1
      