Developing an automatized optimization problem in FEniCS for parameter determination of metamaterials