Domains and hysteresis in patterned soft magnetic elements