I want to produce connecting RBE3s from nodes of hexa element to parallel shell mesh

Jouher_20929
Jouher_20929 Altair Community Member
edited October 2020 in Community Q&A

I want to produce connecting RBE3s from nodes of hexa element to parallel shell mesh

<?xml version="1.0" encoding="UTF-8"?>Capturez.PNG

Answers

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited March 2018
    • Loop over HEX nodes
    • For each node, look for nearest shell elem
    • Build RBE3 for current hex node & found shell elem

    That's all :P/emoticons/default_tongue.png' srcset='/emoticons/tongue@2x.png 2x' title=':P' width='20' />

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited March 2018

    Hi, I have tried this logic. But, it tokk 45 minutes to run a full frontcradle. See some other logic.

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited March 2018

    Hi, I have tried this logic. But, it tokk 45 minutes to run a full frontcradle. See some other logic.

     

    So share your code?

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited March 2018

    package require hwat
    *createmark nodes 1 displayed
    set nd [hm_getmark nodes 1]
    *displaycollectorwithfilter components 'none' '' 1 0
    *displaycollectorwithfilter components 'all' '' 1 0
    foreach NodeId $nd {
    lassign [join [hm_nodevalue $NodeId]] x y z
    set AttachedShellElemId [::hwat::utils::GetClosestElement $x $y $z ShellComps]
    *createmark nodes 1 'by element' $AttachedShellElemId
    set comid [hm_getvalue elems id=$AttachedShellElemId dataname=collector.id]
    set coname1 [hm_getvalue elems id=$AttachedShellElemId dataname=collector.name]
    set nide1 [hm_getmark nodes 1]
    set nod1 [lindex $nide1 0]
    set nod2 [lindex $nide1 1]
    set nod3 [lindex $nide1 2]
    set x1 [hm_getentityvalue nodes $nod1 'x' 0];
    set y1 [hm_getentityvalue nodes $nod1 'y' 0];
    set z1 [hm_getentityvalue nodes $nod1 'z' 0];
    lassign [hm_nodelist $AttachedShellElemId] NodeElem1
    set N1x [hm_getvalue elems id=$AttachedShellElemId dataname=normalx]
    set N1y [hm_getvalue elems id=$AttachedShellElemId dataname=normaly]
    set N1z [hm_getvalue elems id=$AttachedShellElemId dataname=normalz]
    *createmark nodes 1 $NodeId
    *duplicatemark nodes 1 28
    set new_node [hm_getmark nodes 1]
    *createplane 1 $N1x $N1y $N1z $x1 $y1 $z1
    *createvector 1 $N1x $N1y $N1z
    *projectmarktoplane nodes 1 1 1 1
    *createmark assemblies 2 'ShellComps'
    *createmark components 1 $coname1
    *assemblyremovemark 2 components 1
    *createmark components 2 $coname1
    *assemblyaddmark 2 components 2


    set AttachedShellElemId1 [::hwat::utils::GetClosestElement $x $y $z ShellComps]
      
    *createmark nodes 1 'by element' $AttachedShellElemId1
     set comid1 [hm_getvalue elems id=$AttachedShellElemId1 dataname=collector.id]
     set coname2 [hm_getvalue elems id=$AttachedShellElemId1 dataname=collector.name]
    set nide2 [hm_getmark nodes 1]
    set nodd1 [lindex $nide2 0]
    set nodd2 [lindex $nide2 1]
    set nodd3 [lindex $nide2 2]
    set x2 [hm_getentityvalue nodes $nodd1 'x' 0];
    set y2 [hm_getentityvalue nodes $nodd1 'y' 0];
    set z2 [hm_getentityvalue nodes $nodd1 'z' 0];
    lassign [hm_nodelist $AttachedShellElemId1] NodeElem1
    set N2x [hm_getvalue elems id=$AttachedShellElemId1 dataname=normalx]
    set N2y [hm_getvalue elems id=$AttachedShellElemId1 dataname=normaly]
    set N2z [hm_getvalue elems id=$AttachedShellElemId1 dataname=normalz]
    *clearmark nodes 1
    *createmark nodes 1 $NodeId
    *duplicatemark nodes 1 28
    set new_node1 [hm_getmark nodes 1]
    *createplane 1 $N2x $N2y $N2z $x2 $y2 $z2
    *createvector 1 $N2x $N2y $N2z
    *projectmarktoplane nodes 1 1 1 1

    set m1 [hm_getdistance nodes $NodeId  $new_node 0]
    set M1 [lindex $m1 0]
    set m2 [hm_getdistance nodes $NodeId  $new_node1 0]
    set M2 [lindex $m2 0]

    *createmark assemblies 2 'ShellComps'
     *createmark components 1 all
     *assemblyremovemark 2 components 1
     *createmark components 2 all
     *assemblyaddmark 2 components 2

    ##Final Step

    if {$M1 < $M2} {


    *createmark assemblies 2 'coname'
    *createmark components 1 $coname1
    *assemblyremovemark 2 components 1
    *createmark components 2 $coname1
    *assemblyaddmark 1 components 2
    } elseif {$M1 > $M2} {
    *createmark assemblies 2 'coname'
    *createmark components 1 $coname2
    *assemblyremovemark 2 components 1
    *createmark components 2 $coname2
    *assemblyaddmark 1 components 2
    }

    ############RBe3

    set AttachedShellElemId3 [::hwat::utils::GetClosestElement $x $y $z ShellComps]
    *createmark nodes 1 'by element' $AttachedShellElemId3
    set nide3 [hm_getmark nodes 1]
    set nod31 [lindex $nide3 0]
    set nod32 [lindex $nide3 1]
    set nod33 [lindex $nide3 2]
    *createmark nodes 1 $nod31 $nod32 $nod33
    *createarray 3 123 123 123
    *createdoublearray 3 1 1 1
    *rbe3 1 1 3 1 3 $NodeId 123456 1

    *createmark assemblies 2 'coname'
    *createmark components 1 all
    *assemblyremovemark 2 components 1
    *createmark components 2 all
    *assemblyaddmark 1 components 2

    *createmark assemblies 2 'ShellComps'
      *createmark components 1 RBE3
      *assemblyremovemark 2 components 1
      *createmark components 2 RBE3
      *assemblyaddmark 2 components 2

    *createmark assemblies 2 'ShellComps'
      *createmark components 1 SpotWeld
      *assemblyremovemark 2 components 1
      *createmark components 2 SpotWeld
      *assemblyaddmark 2 components 2

    }