@@ -445,10 +445,6 @@ def load_matrix_from_file(
445445 * ``"STIFF"`` - Stiffness matrix
446446 * ``"MASS"`` - Mass matrix
447447 * ``"DAMP"`` - Damping matrix
448- * ``"NOD2BCS"`` - Mapping vector relating the full set of
449- nodal DOFs to the subset that the solver uses
450- * ``"USR2BCS"`` - Mapping vector relating the full set of
451- external nodal DOFs to the subset that the solver uses
452448 * ``"GMAT"`` - Constraint equation matrix
453449 * ``"K_RE"`` - Real part of the stiffness matrix
454450 * ``"K_IM"`` - Imaginary part of the stiffness matrix
@@ -472,8 +468,8 @@ def load_matrix_from_file(
472468 "STIFF" ,
473469 "MASS" ,
474470 "DAMP" ,
475- "NOD2BCS" ,
476- "USR2BCS" ,
471+ # "NOD2BCS", # Not allowed since #990
472+ # "USR2BCS",
477473 "GMAT" ,
478474 "K_RE" ,
479475 "K_IM" ,
@@ -648,7 +644,7 @@ def damp(self, dtype=np.double, fname="file.full", asarray=False):
648644 fname = self ._load_file (fname )
649645 return self .load_matrix_from_file (dtype , fname , "DAMP" , asarray )
650646
651- def get_vec (self , dtype = np . double , fname = "file.full" , mat_id = "RHS" , asarray = False ):
647+ def get_vec (self , dtype = None , fname = "file.full" , mat_id = "RHS" , asarray = False ):
652648 """Load a vector from a file.
653649
654650 Parameters
@@ -664,8 +660,10 @@ def get_vec(self, dtype=np.double, fname="file.full", mat_id="RHS", asarray=Fals
664660
665661 * ``"RHS"`` - Load vector
666662 * ``"GVEC"`` - Constraint equation constant terms
667- * ``"BACK"`` - nodal mapping vector (internal to user)
663+ * ``"BACK"`` - nodal mapping vector (internal to user).
664+ If this is used, the default ``dtype`` is ``np.int32``.
668665 * ``"FORWARD"`` - nodal mapping vector (user to internal)
666+ If this is used, the default ``dtype`` is ``np.int32``.
669667 asarray : bool, optional
670668 Return a `scipy` array rather than an APDLMath matrix.
671669
@@ -686,13 +684,24 @@ def get_vec(self, dtype=np.double, fname="file.full", mat_id="RHS", asarray=Fals
686684 "Call MAPDL to extract the %s vector from the file %s" , mat_id , fname
687685 )
688686
687+ if mat_id .upper () not in ["RHS" , "GVEC" , "BACK" , "FORWARD" ]:
688+ raise ValueError (
689+ f"The 'mat_id' value ({ mat_id } ) is not allowed."
690+ 'Only "RHS", "GVEC", "BACK", or "FORWARD" are allowed.'
691+ )
692+
693+ if mat_id .upper () in ["BACK" , "FORWARD" ] and not dtype :
694+ dtype = np .int32
695+ else :
696+ dtype = np .double
697+
689698 fname = self ._load_file (fname )
690699 self ._mapdl .run (
691700 f"*VEC,{ name } ,{ MYCTYPE [dtype ]} ,IMPORT,FULL,{ fname } ,{ mat_id } " , mute = True
692701 )
693702 ans_vec = AnsVec (name , self ._mapdl )
694703 if asarray :
695- return self ._mapdl ._vec_data (ans_vec .id )
704+ return self ._mapdl ._vec_data (ans_vec .id ). astype ( dtype , copy = False )
696705 return ans_vec
697706
698707 def set_vec (self , data , name = None ):
0 commit comments