  We present a finite element discretization of a non-linear diffusion equation
used in the field of critical phenomena and, more recently, in the context of
Dynamic Density Functional Theory. The discretized equation preserves the
structure of the continuum equation. Specifically, it conserves the total
number of particles and fulfills an H-theorem as the original partial
differential equation. Guided by the Theory of Coarse-Graining, we discuss the
inclusion of thermal fluctuations in the non-linear diffusion equation. This
sheds light on the meaning of such a fluctuating hydrodynamics equation and to
the limitations of the approximations involved. The methodology proposed for
the introduction of thermal fluctuations in finite element methods is general
and valid for both regular and irregular grids in arbitrary dimensions. We
focus here on simulations of the Ginzburg-Landau free energy functional using
both regular and irregular 1D grids. Convergence of the numerical results is
obtained for the static and dynamic structure factors as the resolution of the
grid is increased.
