Numerical realization of a fictitious domain approach used in shape optimization. Part I: Distributed controls