Hello again,
I am performing elasticity simulations with boundary forces. I can tell
sfepy is capable of this, and starting with the linear_elasticity.py
example has already provided a close approximation of what I need, but I
am not clear on a couple of things.
My main two related questions right now are:
1. Can sfepy apply forces to boundaries instead of to volumes
(effectively a von Neumann boundary condition)? What is the prescribed
way to do this? I did notice that there is a surface term similar to the
volume term, but I was not sure how to use it...
2. Also, what exactly are the "regions" in sfepy? Are they collections
of individual mesh elements? If so, is there any way of specifying
borders instead? Also, is there a good way way to visualize regions
and/or get at the raw data that makes them up? (I am having trouble
getting just the)
Thanks,
-David
BTW, I was not as familiar with quadrature, so I made a small visualizer
for the different quadrature tables (I know the formatting will probably
get eaten, but you should still get the idea):
import numpy as np
import matplotlib.pyplot as plt
from mayavi import mlab
import sfepy.fem
quadType='3_8'
order=5
qp=sfepy.fem.quadratures.quadrature_tables[quadType][order]
c=qp.coors
w=qp.weights
print c
print w
plt.cla()
mlab.clf()
if quadType=='1_2':
plt.plot(qp.bounds,[0,0])
for i in range(len(c)):
plt.plot(c[i],0,'k.',ms=w[i]*100)
elif quadType=='2_3':
plt.plot([0,1,0,0],[0,0,1,0])
for i in range(len(c)):
plt.plot(c[i][0],c[i][1],'k.',ms=w[i]*100)
elif quadType=='2_4':
plt.plot([0,1,1,0,0],[0,0,1,1,0])
for i in range(len(c)):
plt.plot(c[i][0],c[i][1],'k.',ms=w[i]*100)
elif quadType=='3_4':
mlab.plot3d([0,0,0], [1,0,0], [0,0,1], color=(0,0,1),tube_radius=0.025)
mlab.plot3d([0,1,0,0,1], [0,0,1,0,0], [0,0,0,1,0], color=(0,0,1),
tube_radius=0.025)
for i in range(len(c)):
#plt.plot(c[i][0],c[i][1],'k.',ms=w[i]*100)
print [c[i][0]],[c[i][1]],[c[i][2]],w[i]
mlab.points3d([c[i][0]],[c[i][1]],[c[i][2]],[w[i]],color=(1,1,1),scale_factor=2)
elif quadType=='3_8':
pts = [[i,j,k] for i in [0,1] for j in [0,1] for k in [0,1]]
lines = [[i,j] for i in pts for j in pts if
(pts.index(i)<pts.index(j) and sum(abs(np.array(i)-j))==1)]
for l in lines:
l=np.transpose(l)
mlab.plot3d(l[0], l[1], l[2], color=(0,0,1),tube_radius=0.025)
for i in range(len(c)):
#plt.plot(c[i][0],c[i][1],'k.',ms=w[i]*100)
print [c[i][0]],[c[i][1]],[c[i][2]],w[i]
mlab.points3d([c[i][0]],[c[i][1]],[c[i][2]],[w[i]],color=(1,1,1),scale_factor=2)