The basic answer to your question lies in the angle of the bonds in an H2O molecule. The molecule has an oxygen at the centre and two hydrogens that come out at either end forming a 104.5 degree angle. Other websites have some excellent pictures and explanations of water shape. This gives water most of its amazing properties. When it freezes, this angle opens up a bit to create approximately tetrahedral crystals that give the characteristic hexagonal shape to ice crystals. The ideal angle for a tetrahedron is 109.47 degrees, but in real life ice it turns out to be closer to 108 degrees. This 'opening up' is what makes ice less dense than liquid water. The energy that you are wondering about is the energy in the H-O bonds. There is some benefit energy-wise for the water molecules in a solid (ice) to open up somewhat, making the angle just a bit wider than what it is in liquid water. Now ice as we know it is only one form of crystalline water. There are at least 9 forms and maybe more. When you confine the water in a vessel as you describe, effectively increasing the pressure on the water as it freezes you would force a different phase of water. You have to look at a phase diagram for water and find the corresponding temperature and pressure to see what phase to expect. You can find example phase diagrams at this University of Southhampton website. Also have a look at this website created by a professor at Caltech which gives a good explanation of the physical properties of ice.
making a small donation to science.ca.