Systematic generation of moment invariant bases for 2D and 3D tensor fields. (March 2022)