Add thermodynamic potentials

Not ready to be merged. Opening for comments/suggestions.
I copied this from the helper functions, and it's there as a reminder to implement averaging schemes for all the other parameters. I depluralised because I prefer my elements to be called something like base_material[1]. As long as no one is unhappy with my choice, base_material will be the correct attribute name.