In this article, we present a practical and efficient numerical method for the Cahn–
Hilliard (CH) equation in the two- and three-dimensional complex domains. We
propose a simple mathematical model for the binary mixture in the complex do-
mains. The model is based on the ternary CH system. An arbitrary domain is
represented by the third phase, which is fixed during the temporal evolution of the
other phases. Using the local conservation of the sum of the phases, we only need to
solve a binary CH equation with a source term. For the numerical solution, we use
a practically unconditionally gradient stable scheme for the multi-component CH
system. Computational experiments are presented to demonstrate the performance
and effectiveness of the proposed method. The numerical results confirm that the
proposed algorithm can deal with the complex domains efficiently.