Example #1
0
def simple_impactor_target(square_even_mesh):
    x = square_even_mesh.x_physical
    y = square_even_mesh.y_physical
    target = PySALEObject([(0, 0), (x, 0), (x, y / 2), (0, y / 2)])
    impactor = PySALEObject([(0, y / 2), (x, y / 2), (x, y), (0, y)])
    impactor.set_material(1)
    target.set_material(2)
    return target, impactor
Example #2
0
 def test_traits_transferred_even_for_diff_geometries(self, simple_object):
     new_object = PySALEObject(([0, 0], [0, 1], [.2, .2]))
     new_object.set_material(8)
     simple_object.set_material(7)
     simple_object.copy_properties_to_new_polygon(new_object)
     assert new_object.material == simple_object.material
     assert len(simple_object.exterior.coords) \
            != len(new_object.exterior.coords)
Example #3
0
================

This example is based on the iSALE example MesoParticles2D and uses
the same basic geometries. However in this script we demonstrate the
versatility of PySALESetup to affect things like the resolution with
ease
"""
from PySALESetup import PySALEObject, PySALEMesh, PySALEDomain
import matplotlib.pyplot as plt

# Create The geometries for the simulation
impactor = PySALEObject([(0., 0.003),
                         (0.001, 0.003),
                         (0.001, 0.005),
                         (0, 0.005)])
impactor.set_material(1)
impactor.set_velocity(0, -500.)

host = PySALEObject([(0, 0.001),
                     (0.001, 0.001),
                     (0.001, 0.003),
                     (0, 0.003)])
host.set_material(0)

back_plate = PySALEObject([(0, 0.0002),
                           (0.001, 0.0002),
                           (0.001, 0.001),
                           (0, 0.001)])
back_plate.set_material(1)

# Create a domain object which will perform the particle insertions