@@ -418,9 +418,8 @@ def nnum_all(self) -> np.ndarray:
418418
419419 nnum = self ._mapdl .get_array ("NODE" , item1 = "NLIST" )
420420 nnum = nnum .astype (np .int32 )
421- if nnum .size == 1 :
422- if nnum [0 ] == 0 :
423- nnum = np .empty (0 , np .int32 )
421+ if nnum .size == 1 and nnum [0 ] == 0 :
422+ nnum = np .empty (0 , np .int32 )
424423
425424 self ._ignore_cache_reset = False
426425
@@ -441,9 +440,8 @@ def enum_all(self) -> np.ndarray:
441440
442441 enum = self ._mapdl .get_array ("ELEM" , item1 = "ELIST" )
443442 enum = enum .astype (np .int32 )
444- if enum .size == 1 :
445- if enum [0 ] == 0 :
446- enum = np .empty (0 , np .int32 )
443+ if enum .size == 1 and enum [0 ] == 0 :
444+ enum = np .empty (0 , np .int32 )
447445
448446 self ._ignore_cache_reset = False
449447 return enum
@@ -551,7 +549,7 @@ def nodes_rotation(self):
551549 """Returns an array of node rotations"""
552550 return self ._mapdl .nlist (kinternal = "" ).to_array ()[:, 4 :]
553551
554- def _load_nodes (self , chunk_size = DEFAULT_CHUNKSIZE ):
552+ def _load_nodes (self , chunk_size = None ):
555553 """Loads nodes from server.
556554
557555 Parameters
@@ -565,8 +563,8 @@ def _load_nodes(self, chunk_size=DEFAULT_CHUNKSIZE):
565563 np.ndarray
566564 Numpy array of nodes
567565 """
568- if self . _chunk_size :
569- chunk_size = self ._chunk_size
566+ if not chunk_size :
567+ chunk_size = self ._chunk_size or DEFAULT_CHUNKSIZE
570568
571569 request = anskernel .StreamRequest (chunk_size = chunk_size )
572570 chunks = self ._mapdl ._stub .Nodes (request )
@@ -606,7 +604,7 @@ def _elem_off(self):
606604 def _elem_off (self , value ):
607605 self ._cache_elem_off = value
608606
609- def _load_elements_offset (self , chunk_size = DEFAULT_CHUNKSIZE ):
607+ def _load_elements_offset (self , chunk_size = None ):
610608 """Loads elements from server
611609
612610 Parameters
@@ -639,8 +637,8 @@ def _load_elements_offset(self, chunk_size=DEFAULT_CHUNKSIZE):
639637 Array of indices indicating the start of each element.
640638
641639 """
642- if self . _chunk_size :
643- chunk_size = self ._chunk_size
640+ if not chunk_size :
641+ chunk_size = self ._chunk_size or DEFAULT_CHUNKSIZE
644642
645643 request = anskernel .StreamRequest (chunk_size = chunk_size )
646644 chunks = self ._mapdl ._stub .LoadElements (request )
@@ -664,7 +662,7 @@ def _load_elements_offset(self, chunk_size=DEFAULT_CHUNKSIZE):
664662 elems_ [indx_elem ] = self .enum
665663 return elems_ , offset
666664
667- def _load_element_types (self , chunk_size = DEFAULT_CHUNKSIZE ):
665+ def _load_element_types (self , chunk_size = None ):
668666 """Loads element types from the MAPDL server.
669667
670668 Returns
@@ -677,6 +675,9 @@ def _load_element_types(self, chunk_size=DEFAULT_CHUNKSIZE):
677675 int
678676 Size of the chunks to request from the server.
679677 """
678+ if not chunk_size :
679+ chunk_size = self ._chunk_size or DEFAULT_CHUNKSIZE
680+
680681 request = anskernel .StreamRequest (chunk_size = chunk_size )
681682 chunks = self ._mapdl ._stub .LoadElementTypeDescription (request )
682683 data = parse_chunks (chunks , np .int32 )
0 commit comments