Measurement of heavy flavor production and azimuthal anisotropy in small and large systems with ATLAS