An implantable device to treat obesity and a method of using the same, the device (31) is able to create a repetitive mechanical constraint on a gastrointestinal organ wall and includes: an energy source (36), and a mechanical stimulation element (35).