@@ -20,6 +20,16 @@ def sum_length(start_size: float, count: int, c2c_expansion: float) -> float:
20
20
return length
21
21
22
22
23
+ def sum_count (lengths : List [float ], chops : List [Chop ]):
24
+ count = 0
25
+
26
+ for i , chop in enumerate (chops ):
27
+ length = lengths [i ]
28
+ count += chop .calculate (length ).count
29
+
30
+ return count
31
+
32
+
23
33
class ChopParams (abc .ABC ):
24
34
@abc .abstractmethod
25
35
def get_count (self , length : float ) -> int :
@@ -154,17 +164,16 @@ def get_count(self, length: float):
154
164
155
165
if remaining_length <= 0 :
156
166
warnings .warn ("Stopping chops at boundary layer (not enough space)!" , stacklevel = 1 )
157
- # return chops
158
- return 0
167
+ return sum_count ([length ], chops )
159
168
160
169
# buffer
161
170
buffer , buffer_size = self ._get_buffer_chop (last_bl_size )
162
171
buffer .length_ratio = buffer_size / length
163
172
chops .append (buffer )
164
173
if buffer_size >= remaining_length :
165
174
warnings .warn ("Stopping chops at buffer layer (not enough space)!" , stacklevel = 1 )
166
- # return chops
167
- return 1
175
+
176
+ return sum_count ([ self . boundary_layer_thickness , buffer_size ], chops )
168
177
169
178
# bulk
170
179
remaining_length = remaining_length - buffer_size
@@ -173,7 +182,7 @@ def get_count(self, length: float):
173
182
chops .append (bulk )
174
183
175
184
# return chops
176
- return 1
185
+ return sum_count ([ self . boundary_layer_thickness , buffer_size , remaining_length ], chops )
177
186
178
187
def get_chops (self , count : int , length : float ) -> List [Chop ]:
179
188
raise NotImplementedError ("TODO!" )
0 commit comments