get_curve_edges(curve) does not seem to work

Topics related to importing and exporting file formats, etc.

get_curve_edges(curve) does not seem to work

Postby luca.heltai » Sun Nov 11, 2018 7:40 am

I have the following snippet in a custom export file that I have written to export VTK files for the deal.II library

Code: Select all
sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
        curves = cubit.get_sideset_curves(sideset_id)
        for curve in curves:
            edges = get_curve_edges(curve)

Unfortunatly the above code returns an empty list of edges, indepdently on what I pass to it.

I worked around it by using the following:
Code: Select all
sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
            group_id = cubit.get_id_from_name("temp_edges")
            if group_id != 0:
                cubit.silent_cmd("delete group " + str(group_id))
            cubit.silent_cmd(
                "group 'temp_edges' add edge all in curve " + str(curve))
            group_id = cubit.get_id_from_name("temp_edges")
            edges = cubit.get_group_edges(group_id)

which works, but seems a little bit of a hack.

Is there a reason why the first code does not produce the expected output?
luca.heltai
 
Posts: 1
Joined: Thu Nov 08, 2018 11:57 am

Re: get_curve_edges(curve) does not seem to work

Postby csimsoft Moderator » Tue Dec 04, 2018 1:38 pm

It looks like you were missing the "cubit." before "get_curve_edges()". Try this:

sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
curves = cubit.get_sideset_curves(sideset_id)
print "\nCurves in sideset {0}: {1}".format(sideset_id, curves)
for curve in curves:
edges = cubit.get_curve_edges(curve)
print "Edges in curve {0}: {1}".format(curve, edges)
csimsoft
csimsoft Moderator
 
Posts: 292
Joined: Tue Feb 14, 2012 5:59 pm
Location: American Fork, UT


Return to Importing/Exporting

Who is online

Users browsing this forum: No registered users and 1 guest

cron

Search / Mark

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 83 on Tue Nov 13, 2018 11:44 am

Users browsing this forum: No registered users and 1 guest