style: Move the dynamic cast into the if statement
style: Move the dynamic cast into the if statement

Co-authored-by: Will Pazner <4f124e54453bec073c75086466c483140cd0ffd3@users.noreply.github.com>
mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem