replace ibmesh_cast_ptr<> with dynamic_cast<> in FEMSystem::build_context ()