A two-stage inverse method for the evaluation of volume fraction distributions in 2D and 3D functionally graded materials