def getDens(mCM):
    """
    return density based on type(mCM['dens'])

    mCM['dens'] can be a number or a function

    Parameters:
        mCM, multi-component material dictionary - see init 
    """
    if type(mCM['dens']) in [float, int]:
        dens = mCM['dens']
    else:
        dens = mCM['dens'](mCM)
    return dens