def METHOD_NAME(self, parentSubsteps, groups):
    group, substeps = groups[0]
    stepsPerParentStep = substeps/parentSubsteps
    if stepsPerParentStep < 1 or stepsPerParentStep != int(stepsPerParentStep):
        raise ValueError("The number for substeps for each group must be a multiple of the number for the previous group")
    stepsPerParentStep = int(stepsPerParentStep) # needed for Python 3.x
    if group < 0 or group > 31:
        raise ValueError("Force group must be between 0 and 31")
    for i in range(stepsPerParentStep):
        self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m")
        if len(groups) == 1:
            self.addComputePerDof("x1", "x")
            self.addComputePerDof("x", "x+(dt/"+str(substeps)+")*v")
            self.addConstrainPositions();
            self.addComputePerDof("v", "(x-x1)/(dt/"+str(substeps)+")");
        else:
            self.METHOD_NAME(substeps, groups[1:])
        self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m")