An efficient finite elements electromagnetic analysis for geometries with small variations