示例#1
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" %
              datetime.now().isoformat(sep=" "))

        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(
            num_successful_realizations,
            self.ert().getEnsembleSize())
        if not success:
            print(
                "Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!"
            )
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" %
              datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#2
0
文件: simulations.py 项目: Thif/ert-1
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        if self.ert().getEnkfSimulationRunner().isHookPreSimulation():
            self.ert().getEnkfSimulationRunner().runHookWorkflow()

        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        if self.ert().getEnkfSimulationRunner().isHookPostSimulation():
            self.ert().getEnkfSimulationRunner().runHookWorkflow()

        print("Ensemble Experiment post processing!")
        simulation_runner.runPostHookWorkflow()

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#3
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()
        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        iteration_count = 0
        active_realization_mask = BoolVector(default_value = True, initial_size = self.ert().getEnsembleSize())
        simulation_runner.createRunPath(active_realization_mask, iteration_count)

        simulation_runner.runWorkflows(HookRuntime.PRE_SIMULATION)

        print("Start simulations!")
        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(num_successful_realizations, self.ert().getEnsembleSize())
        if not success:
            print("Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#4
0
文件: smoother.py 项目: bramirex/ert
    def update(self, line):
        arguments = splitArguments(line)

        if len(arguments) == 1:
            case_name = arguments[0]
            target_fs = self.ert().getEnkfFsManager().getFileSystem(case_name)
            simulation_runner = EnkfSimulationRunner(self.ert())
            success = simulation_runner.smootherUpdate(target_fs)

            if not success:
                self.lastCommandFailed("Unable to perform update")

        else:
            self.lastCommandFailed("Expected one argument: <target_fs> received: '%s'" % line)
示例#5
0
    def update(self, line):
        arguments = splitArguments(line)

        if len(arguments) == 1:
            case_name = arguments[0]
            target_fs = self.ert().getEnkfFsManager().getFileSystem(case_name)
            simulation_runner = EnkfSimulationRunner(self.ert())
            success = simulation_runner.smootherUpdate(target_fs)

            if not success:
                self.lastCommandFailed("Unable to perform update")

        else:
            self.lastCommandFailed("Expected one argument: <target_fs> received: '%s'" % line)
示例#6
0
    def __init__(self, model_config, site_config, strict=True):
        c_ptr = EnKFMain.cNamespace().bootstrap(site_config, model_config,
                                                strict, False)
        super(EnKFMain, self).__init__(c_ptr)

        self.__simulation_runner = EnkfSimulationRunner(self)
        self.__fs_manager = EnkfFsManager(self)
示例#7
0
    def do_ensemble_experiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))
        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runPostWorkflow()

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#8
0
文件: simulations.py 项目: chflo/ert
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#9
0
    def __init__(self, model_config, strict=True):
        c_ptr = EnKFMain.cNamespace().bootstrap(model_config, strict, False)
        super(EnKFMain, self).__init__(c_ptr)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
示例#10
0
    def __init__(self, model_config, strict=True, verbose=True):
        c_ptr = self._alloc(model_config, strict, verbose)
        super(EnKFMain, self).__init__(c_ptr)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
            self.__es_update = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
            self.__es_update = ESUpdate(self)

        self.__key_manager = KeyManager(self)
示例#11
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()
        print("Ensemble Experiment started at: %s" %
              datetime.now().isoformat(sep=" "))

        print("Create the run path!")
        iteration_count = self.ert().analysisConfig().getAnalysisIterConfig(
        ).getNumIterations()
        active_realization_mask = BoolVector.createActiveMask(
            "0-%d" % self.ert().getEnsembleSize())
        # Note that 0(zero) is used and not iteration_count
        simulation_runner.createRunPath(active_realization_mask, 0)

        print("Ensemble Experiment pre processing!")
        simulation_runner.runWorkflows(HookRuntime.PRE_SIMULATION)

        print("Start simulations!")
        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(
            num_successful_realizations,
            self.ert().getEnsembleSize())
        if not success:
            print(
                "Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!"
            )
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" %
              datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
示例#12
0
文件: enkf_main.py 项目: kgreg1/ert
    def __init__(self, model_config, strict=True, verbose=True):
        if model_config is not None and not isfile(model_config):
            raise IOError('No such configuration file "%s".' % model_config)
        c_ptr = self._alloc(model_config, strict, verbose)
        if c_ptr:
            super(EnKFMain, self).__init__(c_ptr)
        else:
            raise ValueError(
                'Failed to construct EnKFMain instance from config %s.' %
                model_config)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
            self.__es_update = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
            self.__es_update = ESUpdate(self)

        self.__key_manager = KeyManager(self)
示例#13
0
 def createCReference(cls, c_pointer, parent=None):
     obj = super(EnKFMain, cls).createCReference(c_pointer, parent)
     obj.__simulation_runner = EnkfSimulationRunner(obj)
     obj.__fs_manager = EnkfFsManager(obj)
     return obj