make it possible to not pass dimgrid to grid constructor.
If not provided by users an attempt is made to extract the dimension from constructor arguments given if possible
If not provided by users an attempt is made to extract the dimension from constructor arguments given if possible