Hi Robert,
Thanks for the response to my last post. Your help has allowed my to obtain the results i was hoping for.
I have been able to probe some of the file however, i am having difficulting probing temperaure from an electric-thermal problem.
The error i am getting is : ValueError: incompatible data shape! (5693 (variable) == 6224 (data)), which is to do the the DOF of the variable but i can figure out how to solve it.
I have atttached my mesh, file, and probe file.
https://www.mediafire.com/file/n9qj8iox15z00jg/big_wire.mesh/file
https://www.mediafire.com/file/t5qsv2xxyj7oiuk/probe_wire.py/file
Hi py17js,
The error is caused by the mesh - there are vertices that are not in any elements and/or double vertices (two vertices in single spatial position).
The double vertices can be fixed by
python3 script/convert_mesh.py -m big_wire.mesh big_wire-new.mesh
but even after that there are some extra vertices. Nevertheless, the probe seems to work after some modifications:
def probe_hook(data, probe, label, problem): import matplotlib.pyplot as plt import matplotlib.font_manager as fm
def get_it(name, var_name):
var = problem.create_variables([var_name])[var_name]
var.set_data(data[name].data[var.field.vertex_remap_i])
pars, vals = probe(var)
vals = vals.squeeze()
return pars, vals
results = {}
results['Temperature'] = get_it('T', 'T')
print(results)
fig = plt.figure()
plt.clf()
fig.subplots_adjust(hspace=0.4)
plt.subplot(111)
pars, vals = results['Temperature']
plt.plot(pars, vals, label=r'$T$',
lw=1, ls='-', marker='+', ms=3)
plt.ylabel('T')
plt.xlabel('probe %s' % label, fontsize=8)
plt.legend(loc='best', prop=fm.FontProperties(size=10))
return plt.gcf(), results
You can check your mesh using
python3 script/show_mesh_info.py -d big_wire.mesh
- among other things it outputs the mesh Euler characteristic, which should be 1 for a simple block mesh. It is 532 for your mesh and 13 for the mesh with double vertices merged. So while the example seems to work, try fixing the mesh first.
r.
On 08. 03. 21 14:33, py17js@leeds.ac.uk wrote:
Hi Robert,
Thanks for the response to my last post. Your help has allowed my to obtain the results i was hoping for.
I have been able to probe some of the file however, i am having difficulting probing temperaure from an electric-thermal problem.
The error i am getting is : ValueError: incompatible data shape! (5693 (variable) == 6224 (data)), which is to do the the DOF of the variable but i can figure out how to solve it.
I have atttached my mesh, file, and probe file.
https://www.mediafire.com/file/n9qj8iox15z00jg/big_wire.mesh/file
https://www.mediafire.com/file/t5qsv2xxyj7oiuk/probe_wire.py/file
https://www.mediafire.com/file/0v35d0v9taloiph/wire.py/file
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/ Member address: cimrman3@ntc.zcu.cz
participants (2)
-
py17js@leeds.ac.uk
-
Robert Cimrman