@@ -141,6 +141,7 @@ def __init__(
141141 perturbed_system = None ,
142142 terminal_flip_frequency = None ,
143143 terminal_flip_angle = None ,
144+ terminal_flip_max_mobile_atoms = None ,
144145 gcmc = False ,
145146 gcmc_frequency = None ,
146147 gcmc_selection = None ,
@@ -391,6 +392,11 @@ def __init__(
391392 ``"180 degrees"``. If None (the default), the angle is determined
392393 automatically for each group from its geometry.
393394
395+ terminal_flip_max_mobile_atoms: int or None
396+ Maximum number of mobile atoms allowed in a terminal ring group.
397+ Groups with more mobile atoms than this threshold are skipped during
398+ detection. Defaults to None (no limit).
399+
394400 gcmc: bool
395401 Whether to perform Grand Canonical Monte Carlo (GCMC) water insertions/deletions.
396402
@@ -575,6 +581,7 @@ def __init__(
575581 self .perturbed_system = perturbed_system
576582 self .terminal_flip_frequency = terminal_flip_frequency
577583 self .terminal_flip_angle = terminal_flip_angle
584+ self .terminal_flip_max_mobile_atoms = terminal_flip_max_mobile_atoms
578585 self .gcmc = gcmc
579586 self .gcmc_frequency = gcmc_frequency
580587 self .gcmc_selection = gcmc_selection
@@ -2064,6 +2071,26 @@ def terminal_flip_angle(self, terminal_flip_angle):
20642071 else :
20652072 self ._terminal_flip_angle = None
20662073
2074+ @property
2075+ def terminal_flip_max_mobile_atoms (self ):
2076+ return self ._terminal_flip_max_mobile_atoms
2077+
2078+ @terminal_flip_max_mobile_atoms .setter
2079+ def terminal_flip_max_mobile_atoms (self , terminal_flip_max_mobile_atoms ):
2080+ if terminal_flip_max_mobile_atoms is not None :
2081+ if not isinstance (terminal_flip_max_mobile_atoms , int ):
2082+ try :
2083+ terminal_flip_max_mobile_atoms = int (terminal_flip_max_mobile_atoms )
2084+ except :
2085+ raise ValueError (
2086+ "'terminal_flip_max_mobile_atoms' must be of type 'int'"
2087+ )
2088+ if terminal_flip_max_mobile_atoms < 1 :
2089+ raise ValueError (
2090+ "'terminal_flip_max_mobile_atoms' must be greater than 0"
2091+ )
2092+ self ._terminal_flip_max_mobile_atoms = terminal_flip_max_mobile_atoms
2093+
20672094 @property
20682095 def gcmc (self ):
20692096 return self ._gcmc
0 commit comments