An elegy is a poem of mourning; this is often the poet mourning one person, but the definition also includes Thomas Gray's 'Elegy Written in a Country Churchyard', which mourns all the occupants of that churchyard, and looks into the future to mourn the poet's own death. The difference between an elegy and a eulogy is that the latter is a speech given to honour someone's best qualities, often (but not necessarily) after their death.
As well as referring to a mourning or pensive mood, 'Elegiac' can refer to a classical metre, this being a couplet of one dactylic hexameter followed by a dactylic pentameter, and in this case need not carry any sense of sadness. But this is rare in contemporary usage.
There are several elegies to be found within the Archive; Brian Patten's 'Blake's Purest Daughter', for example, or Fleur Adcock's 'For Meg'.