  We develop a discretized theory of thermal Casimir interactions to
numerically calculate the interactions between fluctuating dielectrics. From a
constrained partition function we derive a surface free energy, while handling
divergences that depend on system size and discretization. We derive analytic
results for parallel plate geometry in order to check the convergence of the
numerical methods. We use the method to calculate vertical and lateral Casimir
forces for a set of grooves.
