Exemplo n.º 1
0
    def __init__(self, model, DEM_parameters):
        self.model = model
        self.main_path = self.GetMainPath()
        self.mdpas_folder_path = self.main_path

        self.DEM_parameters = DEM_parameters  # TODO, can be improved
        self.project_parameters = DEM_parameters
        default_input_parameters = self.GetDefaultInputParameters()
        self.DEM_parameters.ValidateAndAssignDefaults(default_input_parameters)
        self.FixParametersInconsistencies()

        self.do_print_results_option = self.DEM_parameters[
            "do_print_results_option"].GetBool()
        if not "WriteMdpaFromResults" in self.DEM_parameters.keys():
            self.write_mdpa_from_results = False
        else:
            self.write_mdpa_from_results = self.DEM_parameters[
                "WriteMdpaFromResults"].GetBool()
        self.creator_destructor = self.SetParticleCreatorDestructor()
        self.dem_fem_search = self.SetDemFemSearch()
        self.procedures = self.SetProcedures()
        self.SetAnalyticParticleWatcher()
        self.PreUtilities = PreUtilities()
        self.aux = AuxiliaryUtilities()

        # Set the print function TO_DO: do this better...
        self.KratosPrintInfo = self.procedures.KratosPrintInfo

        # Creating necessary directories:
        self.problem_name = self.GetProblemTypeFileName()

        [self.post_path, self.data_and_results,
         self.graphs_path] = self.procedures.CreateDirectories(
             str(self.main_path),
             str(self.problem_name),
             do_print_results=self.do_print_results_option)[:-1]

        # Prepare modelparts
        self.CreateModelParts()

        if self.do_print_results_option:
            self.SetGraphicalOutput()
        self.report = DEM_procedures.Report()
        self.parallelutils = DEM_procedures.ParallelUtils()
        self.materialTest = DEM_procedures.MaterialTest()
        self.translational_scheme = self.SetTranslationalScheme()
        self.rotational_scheme = self.SetRotationalScheme()

        # Define control variables
        self.p_frequency = 100  # activate every 100 steps
        self.step_count = 0
        self.p_count = self.p_frequency

        #self._solver = self._GetSolver()
        self.SetDt()
        self.SetFinalTime()
        self.AddVariables()
        super(DEMAnalysisStage, self).__init__(model, self.DEM_parameters)
Exemplo n.º 2
0
    def __init__(self, model, path = ""):

        self.model = model
        self.path_for_tests = path
        self.main_path = self.GetMainPath()
        self.LoadParametersFile()
        self.solver_strategy = self.SetSolverStrategy()
        self.creator_destructor = self.SetParticleCreatorDestructor()
        self.dem_fem_search = self.SetDemFemSearch()
        self.procedures = self.SetProcedures()
        self.SetAnalyticParticleWatcher()
        self.PreUtilities = PreUtilities()
        self.aux = AuxiliaryUtilities()



        # Set the print function TO_DO: do this better...
        self.KratosPrintInfo = self.procedures.KratosPrintInfo

        # Creating necessary directories:
        self.problem_name = self.GetProblemTypeFilename()

        [self.post_path,
        self.data_and_results,
        self.graphs_path,
        MPI_results] = self.procedures.CreateDirectories(str(self.main_path), str(self.problem_name))

        # Prepare modelparts
        self.CreateModelParts()

        self.SetGraphicalOutput()
        self.report = DEM_procedures.Report()
        self.parallelutils = DEM_procedures.ParallelUtils()
        self.materialTest = DEM_procedures.MaterialTest()
        self.translational_scheme = self.SetTranslationalScheme()
        self.rotational_scheme = self.SetRotationalScheme()

        # Define control variables
        self.p_frequency = 100   # activate every 100 steps
        self.step_count = 0
        self.p_count = self.p_frequency

        self.solver = self.SetSolver()
        self.SetDt()
        self.SetFinalTime()