Nonlocal damage model based on displacement averaging