Esempio n. 1
0
def test__configure():
    # this test are the submethods in the configure() method
    engine = PyposmatEngine(filename_in=_pyposmat_config_fn,
                            filename_out='pyposmat.config.out')
    engine.create_base_directories()
    engine.read_configuration_file()
    engine.configure_qoi_manager()
    engine.configure_task_manager()
Esempio n. 2
0
def test__configure_qoi_manager():
    engine = PyposmatEngine(filename_in=config_fn,
                            filename_out='pyposmat.config.out')
    engine.create_base_directories()
    engine.read_configuration_file()
    engine.configure_qoi_manager()

    from pypospack.qoi import QoiManager
    assert type(engine.qoi_manager) is QoiManager

    cleanup_simulation_directories()
Esempio n. 3
0
    def configure_qoi_manager(self,qois=None,use_fitting_qois=True,use_testing_qois=False):

        if qois is not None:
            _qois = copy.deepcopy(qois)
        else:
            _qois = OrderedDict()

            if use_fitting_qois:
                for k,v in self.configuration.qois.items():
                    _qois[k]=v

            if use_testing_qois:
                for k,v in self.configuration.qois_validation.items():
                    _qois[k]=v
        PyposmatEngine.configure_qoi_manager(self,_qois)
Esempio n. 4
0
def test__configure_qoi_manager():
    engine = PyposmatEngine(filename_in=_pyposmat_config_fn,
                            filename_out='pyposmat.config.out')
    engine.read_configuration_file()
    engine.configure_qoi_manager()
from pypospack.exceptions import LammpsSimulationError

filename_in = "pypospack.config.in"
filename_out = "pypospack.results.out"

a0 = 3.52
r0 = 1 / (2**0.5) * a0
parameters = OrderedDict()
parameters['p_NiNi_phi0'] = 1.0
parameters['p_NiNi_gamma'] = 2.0
parameters['p_NiNi_r0'] = r0
parameters['d_Ni_rho0'] = 1.0
parameters['d_Ni_beta'] = 4.0
parameters['d_Ni_r0'] = r0
parameters['e_Ni_latticetype'] = 'fcc'
parameters['e_Ni_ecoh'] = -4.45
parameters['e_Ni_B'] = 188.
parameters['e_Ni_a0'] = a0

if __name__ == "__main__":
    engine = PyposmatEngine(filename_in=filename_in, filename_out=filename_out)
    engine.read_configuration_file(
        filename=os.path.join('data', 'pyposmat.config.in'))
    engine.configure_qoi_manager()
    engine.configure_task_manager()
    try:
        engine.evaluate_parameter_set(parameters=parameters)
    except LammpsSimulationError as e:
        print('lammps_simulation_error')