Coverage for gamdpy/simulation_boxes/simulationbox.py: 68%

40 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1 

2from abc import ABC, abstractmethod 

3 

4class SimulationBox(ABC): 

5 """ 

6 Abstract Base Class specifying the requirements for a SimulationBox 

7 """ 

8 

9 

10 def make_device_copy(self): 

11 """ Creates a new device copy of the simbox data and returns it to the caller. 

12 To be used by neighbor list for recording the box state at time of last rebuild""" 

13 pass 

14 

15 @abstractmethod 

16 def get_name(self): 

17 pass 

18 

19 @abstractmethod 

20 def copy_to_device(self): 

21 pass 

22 

23 @abstractmethod 

24 def copy_to_host(self): 

25 pass 

26 

27 

28 @abstractmethod 

29 def get_volume_function(self) -> callable: 

30 """ 

31 Returns the function which calculates the volume of the simulation box 

32 """ 

33 pass 

34 

35 @abstractmethod 

36 def get_volume(self) -> float: 

37 """ 

38 Calculate and return the volume, on the host 

39 """ 

40 pass 

41 

42 @abstractmethod 

43 def scale(self, scale_factor): 

44 """ 

45 Rescale the box by a factor scale_factor, in all directions, if scale_factor is a single float 

46 or by a different factor in each direction if scale_factor is an array of length D 

47 """ 

48 pass 

49 

50 @abstractmethod 

51 def get_dist_sq_dr_function(self) -> callable: 

52 """Generates function dist_sq_dr which computes displacement and distance for one neighbor """ 

53 pass 

54 

55 @abstractmethod 

56 def get_dist_sq_function(self) -> callable: 

57 """Generates.function dist_sq_function which computes distance squared for one neighbor """ 

58 pass 

59 

60 @abstractmethod 

61 def get_apply_PBC(self) -> callable: 

62 pass 

63 

64 #@abstractmethod 

65 #def get_dist_moved_sq_function(self) -> callable: 

66 # pass 

67 

68 @abstractmethod 

69 def get_dist_moved_exceeds_limit_function(self) -> callable: 

70 pass 

71 

72 @abstractmethod 

73 def get_loop_x_addition(self) -> int: 

74 pass 

75 

76 @abstractmethod 

77 def get_loop_x_shift_function(self) -> callable: 

78 pass