get_n() function needs to be public.
1) derive from abstract class.
2) initialize dof in the constructor.
3) use get_n() function everywhere.