def METHOD_NAME(thisDomain,     # domain ID to be calculated
                     nDomains,     # total number of domains
                     nNodesGlobal, # global number of nodes in this nodelist
                     xRangeTotal): # total simulation volume
    assert thisDomain >= 0 and thisDomain < nDomains
    assert nDomains > 0
    import random
    g = random.Random()
    globalNodeIDs = []
    xNodePositions = []
    dxNodes = (xRangeTotal[1] - xRangeTotal[0])/nNodesGlobal
    for globalNodeID in range(0, nNodesGlobal):
        mpi.barrier()
        domain0 = g.randint(0, nDomains - 1)
        domain = mpi.bcast(domain0)
        if domain == thisDomain:
            globalNodeIDs.append(globalNodeID)
            xNodePositions.append(xRangeTotal[0] + (globalNodeID + 0.5)*dxNodes)
    assert len(globalNodeIDs) == len(xNodePositions)
    assert mpi.allreduce(len(globalNodeIDs), mpi.SUM) == nNodesGlobal
    return globalNodeIDs, xNodePositions