Is there a smarter way to select and *get? #4140
Unanswered
francesco123212
asked this question in
Q&A
Replies: 1 comment
-
I have modified my get_IDs(string) function as follows and it is already much faster, but the mapdl.nsel(), mapdl.lsel(), mapdl.nsle(),... are still very slow. function get_IDs(string::String; method::String="database")
if string == "NODE" && method == "apimesh"
IDsList = mapdl.mesh.nnum
count = int(length(IDsList))
return count, IDsList
elseif string == "ELEM" && method == "apimesh"
IDsList = mapdl.mesh.enum
count = int(length(IDsList))
return count, IDsList
elseif string == "KP" && method == "geometrymesh"
IDsList = mapdl.geometry.knum
count = int(length(IDsList))
return count, IDsList
elseif string == "LINE" && method == "geometrymesh"
IDsList = mapdl.geometry.lnum
count = int(length(IDsList))
return count, IDsList
elseif string == "AREA" && method == "geometrymesh"
IDsList = mapdl.geometry.anum
count = int(length(IDsList))
return count, IDsList
elseif string == "VOLU" && method == "geometrymesh"
IDsList = mapdl.geometry.vnum
count = int(length(IDsList))
return count, IDsList
end
count = get_count(string, check=false)
IDsList = zeros(Int,count)
ID = 0
for i in 1:count
ID = int(mapdl.get("tmp",string,ID,"NXTH"))
IDsList[i] = ID
end
return count, IDsList
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a question concerning speed. I have implemented a procedure that does the following:
To speed up things I interact with the database only to get element and node IDs, then I ask for the coordinates using
mapdl.mesh.nodes
which I noted is much much faster. So I kinda have the following pseudo-code:where the function is defined as follows
get_IDsList()
so I am basically interacting with the database a lot, and it seems to be very timeconsuming (#757). Is there a smarter way to do this? Maybe I can speedup the get_IDs bit by doing:
But still, I have all the slow nodes/elements selections.
Thanks all for ur support :)
Beta Was this translation helpful? Give feedback.
All reactions