Challenge

Week - 11 - Element quality check

AIM: To create a macro for element quality check.

PROCEDURE:

CODE:

#setting up the window
set a .element
catch {destroy $a}
toplevel $a -class TopLevel
wm title $a "Quality Check"
#size of a window tab is defined:
wm geometry $a 390x500+50+50; update
wm resizable $a 0 0
wm deiconify $a

#creating label

label $a.001 -text "2D Element Check" -bg grey -font {Arial 10 }; place $a.001 -x 20 -y 10 -width 170 -height 30

#creating entry box and button for 2D element check:

entry $a.01 -textvariable "::mil" -font {arial 10}; place $a.01 -x 150 -y 50 -width 40 -height 30
button $a.02 -text "Min Length" -command "minl" -font {arial 10} ; place $a.02 -x 20 -y 50 -width 100 -height 30

entry $a.03 -textvariable "::mal" -font {arial 10}; place $a.03 -x 150 -y 90 -width 40 -height 30
button $a.04 -text "Max Length" -command "maxl" -font {arial 10} ; place $a.04 -x 20 -y 90 -width 100 -height 30

entry $a.05 -textvariable "::wa" -font {arial 10}; place $a.05 -x 150 -y 130 -width 40 -height 30
button $a.06 -text "Warpage" -command "warpage" -font {arial 10} ; place $a.06 -x 20 -y 130 -width 100 -height 30

entry $a.07 -textvariable "::as" -font {arial 10}; place $a.07 -x 150 -y 170 -width 40 -height 30
button $a.08 -text "Aspect" -command "aspect" -font {arial 10} ; place $a.08 -x 20 -y 170 -width 100 -height 30

entry $a.09 -textvariable "::sk" -font {arial 10}; place $a.09 -x 150 -y 210 -width 40 -height 30
button $a.10 -text "Skewness" -command "skew" -font {arial 10} ; place $a.10 -x 20 -y 210 -width 100 -height 30

entry $a.11 -textvariable "::ja" -font {arial 10}; place $a.11 -x 150 -y 250 -width 40 -height 30
button $a.12 -text "Jacobian" -command "jacob" -font {arial 10} ; place $a.12 -x 20 -y 250 -width 100 -height 30

entry $a.13 -textvariable "::miq" -font {arial 10}; place $a.13 -x 150 -y 290 -width 40 -height 30
button $a.14 -text "Min Angle Quad" -command "minq" -font {arial 9} ; place $a.14 -x 20 -y 290 -width 100 -height 30

entry $a.15 -textvariable "::maq" -font {arial 10}; place $a.15 -x 150 -y 330 -width 40 -height 30
button $a.16 -text "Max Angle Quad" -command "maxq" -font {arial 9} ; place $a.16 -x 20 -y 330 -width 100 -height 30

entry $a.17 -textvariable "::mit" -font {arial 10}; place $a.17 -x 150 -y 370 -width 40 -height 30
button $a.18 -text "Min Angle Tria" -command "mint" -font {arial 9} ; place $a.18 -x 20 -y 370 -width 100 -height 30

entry $a.19 -textvariable "::mat" -font {arial 10}; place $a.19 -x 150 -y 410 -width 40 -height 30
button $a.20 -text "Max Angle Tria" -command "maxt" -font {arial 9} ; place $a.20 -x 20 -y 410 -width 100 -height 30

#Creating label for 3D check:

label $a.002 -text "3D Element Check" -bg grey -font {Arial 10}; place $a.002 -x 200 -y 10 -width 170 -height 30

#creating entry box and button for 3D element check:

entry $a.21 -textvariable "::tet" -font {arial 10}; place $a.21 -x 330 -y 50 -width 40 -height 30
button $a.22 -text "Tet Collapse" -command "tetc" -font {arial 9} ; place $a.22 -x 200 -y 50 -width 100 -height 30

entry $a.23 -textvariable "::war3" -font {arial 10}; place $a.23 -x 330 -y 90 -width 40 -height 30
button $a.24 -text "Warpage" -command "warpage3d" -font {arial 9} ; place $a.24 -x 200 -y 90 -width 100 -height 30

entry $a.25 -textvariable "::asp3" -font {arial 10}; place $a.25 -x 330 -y 130 -width 40 -height 30
button $a.26 -text "Aspect" -command "aspect3d" -font {arial 9} ; place $a.26 -x 200 -y 130 -width 100 -height 30

#procedure for minimum length

proc minl {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::mil 2 1 2 0 " Min length "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for maximum length

proc maxl {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::mal 2 0 2 0 " Max length "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for warpage 2D

proc warpage {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestwarpage elements 1 $::wa 2 2 0 "Warpage"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure Aspect ration 2D

proc aspect {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestaspect elements 1 $::as 2 2 0 " Aspect"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for skewness

proc skew {} {
*clearmarkall 1
*clearmarkall 2
*createmark elements 1 "displayed"
*elementtestskew elements 1 $::sk 2 2 0 " Skew "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for jacobian

proc jacob {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestjacobian elements 1 $::ja 2 2 0 " Jacobian "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for minimum quad angle

proc minq {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::miq 0 2 1 2 0 " Min angle Quad "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for maximum quand angle

proc maxq {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::maq 0 2 0 2 0 " Max angle Quad"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for minimum tria angle

proc mint {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::mit 1 2 1 2 0 " Min angle Tria "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for maximum trai angle

proc maxt {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::mat 1 2 0 2 0 " Max angle Tria "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for tet collapse

proc tetc {} {
*clearmarkall 1
*clearmarkall 2
*createmark elements 1 "displayed"
*elementtesttetracollapse elements 1 $::tet 2 0 " 3D Tetra Collapse "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for warpage 3D

proc warpage3d {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestwarpage elements 1 $::war3 2 4 0 "3D Warpage"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

#procedure for aspect ratio 3D

proc aspect3d {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestaspect elements 1 $::asp3 2 4 0 " 3D Aspect Ratio "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}

RESULT:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.