  We propose a new numerical method to solve the Cahn-Hilliard equation coupled
with non-linear wetting boundary conditions. We show that the method is
mass-conservative and that the discrete solution satisfies a discrete energy
law similar to the one satisfied by the exact solution. We perform several
tests inspired by realistic situations to verify the accuracy and performance
of the method: wetting of a chemically heterogeneous substrate in three
dimensions, wetting-driven nucleation in a complex two-dimensional domain and
three-dimensional diffusion through a porous medium.
