def create_hex_lattice(lat_length, cyl_length): ca = np.cos(0.0) sa = np.sin(0.0) ca3 = 0.5 * np.cos(0.0) sa3 = 0.5 * np.tan(0.0 + hex_angle) a1 = ba.kvector_t(cyl_length, 0.0, 0.0) a2 = ba.kvector_t(0.0, lat_length * ca, lat_length * sa) a3 = ba.kvector_t(0.0, lat_length * ca3, lat_length * sa3) result = ba.Lattice(a1, a2, a3) return result
def get_sample(): # Defining Materials m_air = ba.HomogeneousMaterial("Air", 0.0, 0.0) m_particle = ba.HomogeneousMaterial("Particle", 0.0006, 2e-08) m_substrate = ba.HomogeneousMaterial("Substrate", 6e-06, 2e-08) # Defining Layers l_air = ba.Layer(m_air) l_substrate = ba.Layer(m_substrate) # Spherical particles, form the base of the mesocrystal ff_sphere = ba.FormFactorFullSphere(particle_radius) sphere = ba.Particle(m_particle, ff_sphere) # mesocrystal lattice (cubic lattice for this example) lattice_a = ba.kvector_t(lattice_length, 0.0, 0.0) lattice_b = ba.kvector_t(0.0, lattice_length, 0.0) lattice_c = ba.kvector_t(0.0, 0.0, lattice_length) lattice = ba.Lattice(lattice_a, lattice_b, lattice_c) # crystal structure crystal = ba.Crystal(sphere, lattice) # uncomment to add variance of displacement in each dimension (sigma^2) # crystal.setDWFactor(2) # for BornAgain 1.16 and below # crystal.setPositionVariance(2) # for BornAgain 1.17+ # mesocrystal # meso_ff = ba.FormFactorBox(meso_length, meso_width, meso_height) # Box # meso_ff = ba.FormFactorCylinder(meso_width/2.0, meso_height) # Cylinder # meso_ff = ba.FormFactorTruncatedSphere(meso_width/2.0, meso_height) # Tr. Sphere # meso_ff = ba.FormFactorGauss(meso_width, meso_height) # Gauss meso_ff = ba.FormFactorLorentz(meso_width, meso_height) # Lorentz meso = ba.MesoCrystal(crystal, meso_ff) layout = ba.ParticleLayout() layout.addParticle(meso) # Adding layouts to layers l_air.addLayout(layout) # Defining Multilayers multilayer = ba.MultiLayer() multilayer.addLayer(l_air) multilayer.addLayer(l_substrate) # print(multilayer.parametersToString()) return multilayer
def get_sample(): """ Returns a sample with a cylindrically shaped mesocrystal on a substrate. """ # defining materials m_ambience = ba.HomogeneousMaterial("Air", 0.0, 0.0) m_substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-8) m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8) # mesocrystal lattice lattice_basis_1 = ba.kvector_t(5.0, 0.0, 0.0) lattice_basis_2 = ba.kvector_t(0.0, 5.0, 0.0) lattice_basis_3 = ba.kvector_t(0.0, 0.0, 5.0) lattice = ba.Lattice(lattice_basis_1, lattice_basis_2, lattice_basis_3) # spherical particle that forms the base of the mesocrystal sphere_ff = ba.FormFactorFullSphere(2 * nm) sphere = ba.Particle(m_particle, sphere_ff) # crystal structure crystal = ba.Crystal(sphere, lattice) # mesocrystal meso_ff = ba.FormFactorCylinder(20 * nm, 50 * nm) meso = ba.MesoCrystal(crystal, meso_ff) particle_layout = ba.ParticleLayout() particle_layout.addParticle(meso) air_layer = ba.Layer(m_ambience) air_layer.addLayout(particle_layout) substrate_layer = ba.Layer(m_substrate) multi_layer = ba.MultiLayer() multi_layer.addLayer(air_layer) multi_layer.addLayer(substrate_layer) return multi_layer