Array with nodes from named selection with APDL block in Workbench

BassaSelim3BassaSelim3 Member Posts: 7

Hello to everybody,

I am trying to create an array with all nodes and their eigenvectors for each mode, which are in my named selection. I already have this solution:

ALLSEL

CMSEL,S,FL,NODE 

*GET,nodemax,NODE,0,COUNT              

*GET,maxmodes,ACTIVE,0,SOLU,NCMSS           

*DIM,Eig,ARRAY,nodemax,3*maxmodes+1

*VGET,nodelist, NODE,,NLIST

*DO,q,1,nodemax

  Eig(q,1)=nodelist(q)

  *DO,k,1,maxmodes,1                   

    SET,1,k                          

    n=k-1                          

    *GET,Eig(q,2+3*n),NODE,nodelist(q),U,X               

    *GET,Eig(q,3+3*n),NODE,nodelist(q),U,Y

    *GET,Eig(q,4+3*n),NODE,nodelist(q),U,Z

  *ENDDO

*ENDDO

For a few hundred nodes in the named selection this works fine. For larger models and more nodes in my named selection the simulation goes forever. I think it is because of the two Do loops.

In Addition I created an other APDL Block which works with one Do- Loop and the commands *VMASK and *VGET. But since the command *VGET needs an Input from where it should start:

*VGET,Eig(1,2+3*n),NODE,1,U,X

I could only creat an Array with zeros for the unselected nodes with this command in the Do- Loop:

*VMASK,maskarray(1) $ *VGET,Eig(1,2+3*n),NODE,1,U,X

This way the simulation is much faster, but there is the problem with the zeros in my array

So here are my questions:

  1. Is it possible to create a large array with only the nodes in my named selction in a suitable timeperiod?
  2. If not, how can I delete the rows with zeros in my array with apdl commands?

Thanks to all of you

Best Answer

  • SheldonISheldonI Posts: 130Ansys Employee
    Accepted Answer

    Hi @BassaSelim3 ,

    You can 'compress' out the zeros with *VFUN,,COMP and using your masking vector (*VMASK). Please see the documentation for *VFUN for details.

    That being said, however, you usually don't want to do this since you lose information about your node number (your node number is the 'index' of the array, but by compressing out zeros, the 'index' no longer has meaning, and you don't know the corresponding node number).

    If you want to write out data to file with *VWRITE, for example, just use *VMASK with *VWRITE, so only non-zero values are written out. This is much easier than compressing the vector to remove non-zero values, and it keeps the node ID information (array index number = node ID number).

    Regards,

    Sheldon

Sign In or Register to comment.