def get_forces(self, a=None):
if a is None:<EOL><INDENT>a = self.a<EOL><DEDENT>forces = np.zeros([len(a), <NUM_LIT:3>], dtype=float)<EOL>if self.mask is None:<EOL><INDENT>forces[self.mask] = self.force<EOL><DEDENT>else:<EOL><INDENT>forces[:] = self.force<EOL><DEDENT>return forces<EOL>
Calculate atomic forces.