def infl_near(point): out = 0 target = paraBEM.Vector3(*point) for i, pan in enumerate(panels): out += mue[i] * doublet_3_0_sphere(target, pan) return out
v1 = paraBEM.PanelVector3(-0.5, -0.5, 0) v2 = paraBEM.PanelVector3(0.5, -0.5, 0) v3 = paraBEM.PanelVector3(0.5, 0.5, 0) v4 = paraBEM.PanelVector3(-0.5, 0.5, 0) p = paraBEM.Panel3([v1, v2, v3, v4]) # p = paraBEM.Panel3([v1, v2, v3]) # triangle p.potential = 1. n = 50 a = numpy.linspace(-1, 1, n).tolist() b = [paraBEM.PanelVector3(i, j, k) for i in a for j in a for k in a] pot = [doublet_3_0_sphere(i, p) for i in b] vel = [doublet_3_0_vsaero_v(i, p) for i in b] writer = VtkWriter() with open(check_path("results/panel_influence.vtk"), "w") as _file: writer.structed_grid(_file, "duplet", [n, n, n]) writer.points(_file, b) writer.data(_file, pot, name="potential", _type="SCALARS", data_type="POINT_DATA") writer.data(_file, vel, name="velocity", _type="VECTORS",
import paraBEM from paraBEM import pan3d pnt1 = paraBEM.PanelVector3(-0.4, -0.5, 0) pnt2 = paraBEM.PanelVector3(0.5, -0.2, 0) pnt3 = paraBEM.PanelVector3(0.3, 0.5, 0) pnt4 = paraBEM.PanelVector3(-0.5, 0.5, 0) pnt5 = paraBEM.PanelVector3(0.0, 0, 1) pnt6 = paraBEM.PanelVector3(0.3, 0.3, 0.3) source = paraBEM.Panel3([pnt1, pnt2, pnt3, pnt4]) checklist = [pnt1, pnt2, pnt3, pnt4, pnt5, pnt6, source.center] for trg_pnt in checklist: dip = pan3d.doublet_3_0_sphere(trg_pnt, source) print(trg_pnt, ": doublet:", dip)
import paraBEM from paraBEM.pan3d import doublet_3_0_vsaero, doublet_3_0_vsaero_v, doublet_3_0_sphere from paraBEM.vtk_export import VtkWriter import numpy from paraBEM.utils import check_path v1 = paraBEM.PanelVector3(-0.5, -0.5, 0) v2 = paraBEM.PanelVector3(0.5, -0.5, 0) v3 = paraBEM.PanelVector3(0.5, 0.5, 0) v4 = paraBEM.PanelVector3(-0.5, 0.5, 0) p = paraBEM.Panel3([v1, v2, v3, v4]) # p = paraBEM.Panel3([v1, v2, v3]) # triangle p.potential = 1. n = 50 a = numpy.linspace(-1, 1, n).tolist() b = [paraBEM.PanelVector3(i, j, k) for i in a for j in a for k in a] pot = [doublet_3_0_sphere(i, p) for i in b] vel = [doublet_3_0_vsaero_v(i, p) for i in b] writer = VtkWriter() with open(check_path("results/panel_influence.vtk"), "w") as _file: writer.structed_grid(_file, "duplet", [n, n, n]) writer.points(_file, b) writer.data(_file, pot, name="potential", _type="SCALARS", data_type="POINT_DATA") writer.data(_file, vel, name="velocity", _type="VECTORS", data_type="POINT_DATA")