An investigation has been launched following the "intentional damage" of a Royal Navy warship at a shipyard.