function  [S, Global_Area , BoundaryIdxGlobal,BoundaryCurveLengths] = UpdateAreaEdgeLength(BoundaryCandidatesIdx, MeshSize, VoronoiCells, Vertices, NatNeighborBoundaryPairs, Directions, MidPoints, Front,RankineHugoniot, GetRealBoundaryIdxGlobal, InteriorCandidatesIdx,Global_Area)    

% Area and edge lenght of boundary CVs 
if RankineHugoniot
    [S_Boundary, Area, ~,BoundaryIdxGlobal,BoundaryCurveLengths] = GetBoundaryVolumes(BoundaryCandidatesIdx, MeshSize, VoronoiCells, Vertices, NatNeighborBoundaryPairs, Directions, MidPoints, Front,GetRealBoundaryIdxGlobal);
else
    [S_Boundary, Area,~,BoundaryIdxGlobal,BoundaryCurveLengths] = GetBoundaryVolumes(BoundaryCandidatesIdx, MeshSize, VoronoiCells, Vertices, NatNeighborBoundaryPairs, Directions, MidPoints, Front,GetRealBoundaryIdxGlobal);
end

% edge lengths of all shared faces between CVs
S = [MeshSize*ones(4*length(InteriorCandidatesIdx),1); S_Boundary];

% insert boundary CV areas into the global area array
Global_Area(BoundaryCandidatesIdx) = Area;

end