A method has been developed to simulate the fluid dynamics of low Reynolds number flow around solid objects with complex shapes on a fixed cartesian grid. On grid points occupied by a solid objects the method enforces a fluid motion equal to the motion of the solid object, while the boundary conditions on the solid/fluid interface are enforced through a specific treatment of grid points close to the interface. The method is fairly easily implemented in both two and three dimensions, and validation studies of flow over a cylinder a sphere at different Reynolds numbers show good agreement with previous experimental and computational investigations. A flapping cantilever beam is then studied to assess its propulsive efficiency at a Reynolds number of 200. Two dimensional computations show that the propulsive efficiency increases with flapping amplitude and frequency, and that generation of lift and thrust is strongly coupled with wake dynamics. Three dimensional computations on a finite width cantilever show that the aspect ratio has a strong influence on the wake dynamics, and therefore also on the generation of lift and drag.