Dear STKO team,
I am running modal analysis of a model to which I gradually introduce geometrical alterations to analyze their influence on the frequencies and mode shapes. I have created a selection set with the nodes that I use to record the eigen vectors, and by using the Labels visualization tool I find the node IDs manually. However, with every alteration in the geometry, the mesh changes and so does the IDs of the nodes and I have to repeat the process for each model.
Is there any script that I could use to query the node ID based on their coordinates?
how to query node ID through its coordinates
Re: how to query node ID through its coordinates
There are many ways to do it, depending on the scenario.
Can you better describe in detail what you want to do?
Is it something you need in STKO pre processor? STKO post processor? in OpenSees for some custom operation?
Can you better describe in detail what you want to do?
Is it something you need in STKO pre processor? STKO post processor? in OpenSees for some custom operation?
Re: how to query node ID through its coordinates
Dear STKO team,
Thank you for your reply.
I need it in pre-processor.
I have a micromodel of an arch like this: and I have a set of nodes where I want to record the eigen vectors: through this script:
Then I gradually remove some joints to simulate a crack opening:
and I want to run the modal analysis again and compare the results recorded over the same nodes with the original model. However, with every removed joint, I have to remesh, so the numbering of the nodes changes, and I have to repeat the process of finding the Node IDs for each model.
So my question was if there is a smarter way to do it, for example, to query the Node ID based on the x,y,z coordinates of the nodes, as those don't change.
Thank you again,
Viktoria
Thank you for your reply.
I need it in pre-processor.
I have a micromodel of an arch like this: and I have a set of nodes where I want to record the eigen vectors: through this script:
Code: Select all
proc modal { num_modes filename1 {eig_solver -genBandArpack}} {
# begin
puts "\nRunning modal analysis ..."
# get all node tags
set nodes [getNodeTags]
if {[llength $nodes] == 0} {
error "modal - Error: no node in model"
}
# check problem size (2D or 3D) from the first node, we do not support mixed dimesions!!
set ndm [llength [nodeCoord [lindex $nodes 0]]]
# compute total masses
if {$ndm == 3} {
set ndf_max 6
set total_mass {0.0 0.0 0.0 0.0 0.0 0.0}
set mass_labels {"MX" "MY" "MZ" "MRX" "MRY" "MRZ"}
set mass_labels1 {"MODE" "MX" "MY" "MZ" "MRX" "MRY" "MRZ"}
} else {
set ndf_max 3
set total_mass {0.0 0.0 0.0}
set mass_labels {"MX" "MY" "MRZ"}
set mass_labels1 {"MODE" "MX" "MY" "MRZ"}
}
foreach node $nodes {
set indf [llength [nodeDisp $node]]
for {set i 0} {$i < $indf} {incr i} {
set imass [nodeMass $node [expr $i+1]]
set imass_total [lindex $total_mass $i]
lset total_mass $i [expr $imass_total + $imass]
}
}
# some constants
set pi [expr acos(-1.0)]
#modalDamping 0.02 0.02
# solve the eigenvalue problem
set lambdas [eigen $eig_solver $num_modes]
if {[llength $lambdas] != $num_modes} {
error "modal - Error: something went wrong in the eigen analysis"
}
#open a new document to record the values of the eigenvectors
set fp1 [open $filename1 w]
#set nodes_x {8} where we are interested in recording the eigenvectors TO BE EDITED!!!!
set nodes_x {1070 831 1024 864 793 920 422 915 874 928 805 721 446 440 1185 506 29 392 458 761 1091 548 1142 1038 432 1035 536 216 1148 747 166 174 851 187 801 862 715 560}
# process each mode of vibration
for {set imode 0} {$imode < $num_modes} {incr imode} {
# compute i-mode eigen analysis derived data
set lambda [lindex $lambdas $imode]
set omega [expr {sqrt($lambda)}]
set omega [expr {sqrt($lambda)}]
set frequency [expr $omega / 2.0 / $pi]
set period [expr 1.0 / $frequency]
foreach node $nodes_x {
# get eigenvector
puts $node
set V [nodeEigenvector $node [expr $imode+1]]
puts $fp1 "$node $V"
}
}
# done
close $fp1
puts "\nModal Analysis done\n"
}
#ask for the number of modes you want to extract TO BE EDITED!
modal 6 "_eigenvectors.txt" "_frequencies.txt"
recordThank you again,
Viktoria
Re: how to query node ID through its coordinates
The easiest way is to:
- create a selection set with the nodes you want
- create a region analysisStep, and in the region you can tell STKO to generate a tcl list, give it a name
- In your tcl script you can now reference that list
Re: how to query node ID through its coordinates
It works, thank you very much for your help
Re: how to query node ID through its coordinates
You're welcome