def __init__(self, Model, path=""): # Initialize solutions if path == "": DEMProjectParametersFile = open("ProjectParametersDEM.json", 'r') else: DEMProjectParametersFile = open( os.path.join(path, "ProjectParametersDEM.json"), 'r') DEM_project_parameters = KratosMultiphysics.Parameters( DEMProjectParametersFile.read()) self.FEM_Solution = FEM.FEM_for_PFEM_coupling_Solution(Model, path) self.DEM_Solution = DEM.DEM_for_coupling_Solution( Model, DEM_project_parameters) # Initialize Remeshing files self.DoRemeshing = self.FEM_Solution.ProjectParameters["AMR_data"][ "activate_AMR"].GetBool() if self.DoRemeshing: self.mmg_parameter_file = open("MMGParameters.json", 'r') self.mmg_parameters = KratosMultiphysics.Parameters( self.mmg_parameter_file.read()) self.RemeshingProcessMMG = MMG.MmgProcess(Model, self.mmg_parameters) self.domain_size = self.FEM_Solution.main_model_part.ProcessInfo[ KratosMultiphysics.DOMAIN_SIZE] self.InitializePlotsFiles() self.echo_level = 0 self.is_slave = False
def __init__(self, Model): # Initialize solutions self.FEM_Solution = FEM.FEM_for_coupling_Solution(Model) self.DEM_Solution = DEM.DEM_for_coupling_Solution(Model) # Initialize Remeshing files self.DoRemeshing = self.FEM_Solution.ProjectParameters["AMR_data"]["activate_AMR"].GetBool() if self.DoRemeshing: self.mmg_parameter_file = open("MMGParameters.json",'r') self.mmg_parameters = KratosMultiphysics.Parameters(self.mmg_parameter_file.read()) self.RemeshingProcessMMG = MMG.MmgProcess(Model, self.mmg_parameters) self.InitializePlotsFiles() self.echo_level = 0 self.domain_size = self.FEM_Solution.main_model_part.ProcessInfo[KratosMultiphysics.DOMAIN_SIZE]