Ejemplo n.º 1
0
def test_is_converged_all_not_converged():
    """returns False if no energies meet convergence criterion"""    
    tol =1e-8
    e0 = [1, 1, 1, 1] # dummy
    e1 = [1.10e-7, 0.80e-7, 5.0e-7, 1.0e-8]
    e2 = [2.15e-7, 1.75e-7, 6.0e-7, 3.0e-8]
    energies = [np.array(e0), np.array(e1), np.array(e2)]
    assert not eval_pp.is_converged(energies, tol)
Ejemplo n.º 2
0
def test_is_converged_converged():
    """returns True if all energies meet convergence criterion"""    
    tol =1e-8
    e0 = [1, 1, 1, 1] # dummy
    e1 = [1.10e-7, 0.80e-7, 5.0e-7, 1.0e-8]
    e2 = [1.15e-7, 0.75e-7, 5.0e-7, 1.5e-9]
    energies = [np.array(e0), np.array(e1), np.array(e2)]
    assert eval_pp.is_converged(energies, tol)
Ejemplo n.º 3
0
def test_is_converged_all_not_converged2():
    """
    returns False if energy doesn't meet convergence criterion
    but rtol is small.
    """    
    tol =1e-100
    e1 = [1.0e-7]
    e2 = [1.0000001e-7]
    energies = [np.array(e1), np.array(e2)]
    assert not eval_pp.is_converged(energies, tol)
Ejemplo n.º 4
0
def test_is_converged_all_not_converged():
    """returns false when only one gcut has run"""    
    tol =1e-8
    e0 = [1, 1, 1, 1]
    energies = [np.array(e0)]
    assert not eval_pp.is_converged(energies, tol)