Composite finite elements for problems containing small geometric details