Solution (source code)

= Solution

<homeotropic anchoring> favors the <nematic director> normal to a surface. For a flat wall at $z=0$, uniform $\mathbf n=\hat{\mathbf z}$ is a simple compatible profile, shown as perpendicular rods. If a remote wall demands another orientation, elastic bending interpolates between the boundaries.

A common surface energy is $f_s=(W/2)[1-(\mathbf n\cdot\boldsymbol\nu)^2]$, with wall normal $\boldsymbol\nu$ and $W>0$. Its minima have $\mathbf n$ parallel or antiparallel to $\boldsymbol\nu$. The profile is controlled jointly by this preference and <Frank elastic energy>.