def calc_gauss_amp(node_xyz, center=(0.0, 0.0, -2.0), sigma=(1.0, 1.0, 1.0),
amp=1.0, amp_cut=0.05, sym="qsym"):
"""calculated the Gaussian amplitude at the node
:param node_xyz: list of x,y,z node coordinates
:param center: list of x,y,z for Gaussian center
:param sigma: list of x,y,z Guassian width
:param amp: peak Gaussian source amplitude
:param amp_cut: lower threshold (pct of max) for amplitude creating a
point load
:param qsym: mesh symemetry (qsym, hsym, none)
:returns: nodeGaussAmp - point load amplitude at the specified node
"""
from math import pow, exp
exp1 = pow((node_xyz[1] - center[0]) / sigma[0], 2)
exp2 = pow((node_xyz[2] - center[1]) / sigma[1], 2)
exp3 = pow((node_xyz[3] - center[2]) / sigma[2], 2)
nodeGaussAmp = amp * exp(-(exp1 + exp2 + exp3))
if (nodeGaussAmp / amp) < amp_cut:
nodeGaussAmp = None
else:
nodeGaussAmp = sym_scale_amp(node_xyz, nodeGaussAmp, sym)
return nodeGaussAmp
评论列表
文章目录