Structure-preserving finite element methods for fluids