from abapy.indentation import ParamInfiniteMesh from copy import copy # Let's create a mesh containing a surface: m = ParamInfiniteMesh(Na = 2, Nb = 2) print m.surfaces elem_to_remove = copy(m.sets['top_elem']) # Let's remove all elements in the surface: for e in elem_to_remove: m.drop_element(e) # We can see that sets and surfaces are removed when they become empty print m.surfaces
from abapy.mesh import RegularQuadMesh from abapy.indentation import ParamInfiniteMesh import matplotlib.pyplot as plt point = (0., 0., 0.) normal = (1., 0., 0.) m0 = ParamInfiniteMesh() x0, y0, z0 = m0.get_edges() m1 = m0.apply_reflection(normal = normal, point = point) x1, y1, z1 = m1.get_edges() plt.plot(x0, y0) plt.plot(x1, y1) plt.gca().set_aspect('equal') plt.show()
from abapy.mesh import RegularQuadMesh from abapy.indentation import ParamInfiniteMesh import matplotlib.pyplot as plt point = (0., 0., 0.) normal = (1., 0., 0.) m0 = ParamInfiniteMesh() x0, y0, z0 = m0.get_edges() m1 = m0.apply_reflection(normal=normal, point=point) x1, y1, z1 = m1.get_edges() plt.plot(x0, y0) plt.plot(x1, y1) plt.gca().set_aspect('equal') plt.show()