Ejemplo n.º 1
0
def test_input_lines(db_test_app, get_potential_data, potential_type,
                     file_regression):
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(type=potential.type,
                              structure=potential.structure,
                              data=potential.data)
    file_regression.check(six.ensure_text(node.get_input_potential_lines()))
Ejemplo n.º 2
0
def test_input_lines(
    db_test_app,  # pylint: disable=unused-argument
    get_potential_data,
    potential_type,
    file_regression,
):
    """Test that one can get the potential lines for a given aiida-lammps potential"""
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(
        potential_type=potential.type,
        data=potential.data,
    )
    file_regression.check(node.get_input_lines())
Ejemplo n.º 3
0
def test_potential_files(
    db_test_app,  # pylint: disable=unused-argument
    get_potential_data,
    potential_type,
    file_regression,
):
    """Test that one can read the potential content."""
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(
        potential_type=potential.type,
        data=potential.data,
    )
    file_regression.check(node.get_object_content('potential.pot', 'r'))
Ejemplo n.º 4
0
def test_init(db_test_app, get_potential_data, potential_type,
              data_regression):
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(type=potential.type,
                              structure=potential.structure,
                              data=potential.data)
    data_regression.check(node.attributes)
Ejemplo n.º 5
0
def test_init(
    db_test_app,  # pylint: disable=unused-argument
    get_potential_data,
    potential_type,
    data_regression,
):
    """Test that the potential can be generated"""
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(
        potential_type=potential.type,
        data=potential.data,
    )
    data_regression.check(node.attributes)
Ejemplo n.º 6
0
options.account = ''
options.qos = ''
options.resources = {
    'num_machines': 1,
    'num_mpiprocs_per_machine': 1,
    'parallel_env': 'localmpi',
    'tot_num_mpiprocs': 1
}
#options.queue_name = 'iqtc04.q'
options.max_wallclock_seconds = 3600
inputs.metadata.options = options

# Setup code
inputs.code = Code.get_from_string(codename)

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(structure=structure,
                                      type='lennard_jones',
                                      data={'1  1': '0.01029   3.4    2.5'})

inputs.parameters = Dict(dict=parameters_opt)

# run calculation
result, node = run_get_node(LammpsOptimizeCalculation, **inputs)
print('results:', result)
print('node:', node)

# submit to deamon
#submit(LammpsOptimizeCalculation, **inputs)
Ejemplo n.º 7
0
    options = AttributeDict()
    options.account = ''
    options.qos = ''
    options.resources = {
        'num_machines': 1,
        'num_mpiprocs_per_machine': 1,
        'parallel_env': 'localmpi',
        'tot_num_mpiprocs': 1,
    }
    # options.queue_name = 'iqtc04.q'
    options.max_wallclock_seconds = 3600
    inputs.metadata.options = options

    # Setup code
    inputs.code = Code.get_from_string(codename)

    # setup nodes
    inputs.structure = structure
    inputs.potential = EmpiricalPotential(type=potential['pair_style'],
                                          data=potential['data'])

    inputs.parameters = Dict(dict=parameters_opt)

    # run calculation
    result, node = run_get_node(LammpsOptimizeCalculation, **inputs)
    print('results:', result)
    print('node:', node)

    # submit to deamon
    # submit(LammpsOptimizeCalculation, **inputs)
Ejemplo n.º 8
0
options.account = ''
options.qos = ''
options.resources = {'num_machines': 1, 'num_mpiprocs_per_machine': 1,
                     'parallel_env': 'localmpi', 'tot_num_mpiprocs': 1}
#options.queue_name = 'iqtc04.q'
options.max_wallclock_seconds = 3600
inputs.metadata.options = options

# Setup code
inputs.code = Code.get_from_string(codename)

# setup nodes
inputs.structure = structure
#inputs.potential = Dict(dict=potential)
inputs.potential = EmpiricalPotential(structure=structure,
                                      type='eam',
                                      data=eam_data)

print(inputs.potential.get_potential_file())
print(inputs.potential.atom_style)
print(inputs.potential.default_units)

inputs.parameters = Dict(dict=parameters_opt)

# run calculation
result, node = run_get_node(LammpsOptimizeCalculation, **inputs)
print('results:', result)
print('node:', node)

# submit to deamon
#submit(LammpsOptimizeCalculation, **inputs)
Ejemplo n.º 9
0
def test_list_potentials():
    assert set(EmpiricalPotential.list_types()).issuperset(
        ["eam", "lennard_jones", "reaxff", "tersoff"])
Ejemplo n.º 10
0
def test_potential_files(db_test_app, get_potential_data, potential_type,
                         file_regression):
    potential = get_potential_data(potential_type)
    node = EmpiricalPotential(type=potential.type, data=potential.data)
    file_regression.check(node.get_object_content("potential.pot", "r"))
Ejemplo n.º 11
0
def test_load_type():
    EmpiricalPotential.load_type("eam")
Ejemplo n.º 12
0
    'num_mpiprocs_per_machine': 1,
    'parallel_env': 'localmpi',
    'tot_num_mpiprocs': 1
}
#options.queue_name = 'iqtc04.q'
options.max_wallclock_seconds = 3600
inputs.metadata.options = options

# Setup code
inputs.code = Code.get_from_string(codename)

# setup nodes
inputs.structure = structure
#inputs.potential = Dict(dict=potential)
inputs.potential = EmpiricalPotential(structure=structure,
                                      type='tersoff',
                                      data=tersoff_gan)

inputs.parameters = Dict(dict=parameters_opt)

print(inputs.potential.get_potential_file())
print(inputs.potential.atom_style)
print(inputs.potential.default_units)

# run calculation
result, node = run_get_node(LammpsOptimizeCalculation, **inputs)
print('results:', result)
print('node:', node)

# submit to deamon
#submit(LammpsOptimizeCalculation, **inputs)
Ejemplo n.º 13
0
    options = AttributeDict()
    options.account = ""
    options.qos = ""
    options.resources = {
        "num_machines": 1,
        "num_mpiprocs_per_machine": 1,
        "parallel_env": "localmpi",
        "tot_num_mpiprocs": 1,
    }
    # options.queue_name = 'iqtc04.q'
    options.max_wallclock_seconds = 3600
    inputs.metadata.options = options

    # Setup code
    inputs.code = Code.get_from_string(codename)

    # setup nodes
    inputs.structure = structure
    inputs.potential = EmpiricalPotential(type=potential["pair_style"],
                                          data=potential["data"])

    inputs.parameters = Dict(dict=parameters_md)

    # run calculation
    result, node = run_get_node(LammpsMDCalculation, **inputs)
    print("results:", result)
    print("node:", node)

    # submit to deamon
    # submit(LammpsOptimizeCalculation, **inputs)
Ejemplo n.º 14
0
def test_load_type():
    """Test that an specific potential can be loaded"""
    EmpiricalPotential.load_type('eam')
Ejemplo n.º 15
0
def test_list_potentials():
    """Test that all the supported potential types are recognized."""
    assert set(EmpiricalPotential.list_types()).issuperset(
        ['eam', 'lennard_jones', 'reaxff', 'tersoff'])