Add switching and barrier function materials (#4355)
Register materials and add test (#4355)