Flow dynamics of a pitching foil by eulerian and lagrangian viewpoints