def SearchContact(self): if self.echo_level > 0: print(self._class_prefix() + " [ Contact Search (call:", str(self.counter) + ") ]") self.wall_contact_model = KratosContact.ClearPointContactConditions( self.main_model_part, self.echo_level) self.wall_contact_model.ExecuteInitialize() # serial for wall in self.parametric_walls: wall.ExecuteSearch() # parallel (not working pickling instances not enabled) # walls_number = len(self.parametric_walls) # if(walls_number>8): # walls_number = 8 # pool = Pool(walls_number) # pool.map(self.ExecuteSearch,self.parametric_walls) # pool.close() # pool.joint() self.wall_contact_model.ExecuteFinalize() self.counter += 1 # schedule next search if (self.search_frequency > 0.0): # note: if == 0 always active if (self.search_control_is_time): time = self.main_model_part.ProcessInfo[ KratosMultiphysics.TIME] while (self.next_search <= time): self.next_search += self.search_frequency else: while self.next_search <= self.step_count: self.next_search += self.search_frequency
def SearchContact(self): if (self.echo_level > 0): print("::[Walls_Process]:: CONTACT SEARCH...( call:", self.counter, ")") self.wall_contact_model = KratosContact.ClearPointContactConditions( self.main_model_part, self.echo_level) self.wall_contact_model.ExecuteInitialize() #serial for wall in self.parametric_walls: wall.ExecuteSearch() #parallel (not working pickling instances not enabled) #walls_number = len(self.parametric_walls) #if(walls_number>8): # walls_number = 8 #pool = Pool(walls_number) #pool.map(self.ExecuteSearch,self.parametric_walls) #pool.close() #pool.joint() self.wall_contact_model.ExecuteFinalize() self.counter += 1 # schedule next search if (self.search_frequency > 0.0): # note: if == 0 always active if (self.search_control_is_time): while (self.next_search <= time): self.next_search += self.search_frequency else: while self.next_search <= self.step_count: self.next_search += self.search_frequency