Fluctuations of the instantaneous local Lagrangian strain epsilon(ij)(r,t),
measured with respect to a static "reference" lattice, are used to obtain
accurate estimates of the elastic constants of model solids from atomistic
computer simulations. The measured strains are systematically coarse-graine
d by averaging them within subsystems (of size L-b) Of a system (of total s
ize L) in the canonical ensemble. Using a simple finite size scaling theory
we predict the behavior of the fluctuations <epsilon(ij)epsilon(kl)> as a
function of L-b/L and extract elastic constants of the system in the thermo
dynamic limit at nonzero temperature. Our method is simple to implement, ef
ficient, and general enough to be able to handle a wide class of model syst
ems, including those with singular potentials without any essential modific
ation. We illustrate the technique by computing isothermal elastic constant
s of "hard" and "soft" disk triangular solids in two dimensions from Monte
Carlo and molecular dynamics simulations. We compare our results with those
from earlier simulations and theory.