Learn R Programming

nanop (version 2.0-1)

simPart: Functions to simulate the atomic positions in a nanoparticle

Description

Functions to simulate the deterministic atomic positions in a nanoparticle and displace those positions stochastically to model thermal effects

Usage

simPart(atoms, sym = "fcc", latticep = 4.08, r=10,  
    atomsShell=NA, symShell = NA, latticepShell = NA, rcore = NA, 
    shell=NA, box=NA, ellipse=NA, pDimer=0, pStack=0, 
    rcenter=FALSE, center=c(0,0,0), 
    move=TRUE, rotShell=FALSE, rcenterShell=FALSE)
						
displacePart(nanop, sigma=NA, rcenter=FALSE, latticep=4.08)

Arguments

Value

numeric matrix with three columns in which each row represents an atomic position and list of the following attributes that describe particle properties:"nStacks"number of stacking faults simulated in the particle."rowcore"number of atoms within the core."rowshell"number of atoms within the shell."center"position of the particle center."nAtomTypes"number of different atom types in the particle, e.g. for a core/shell particle with "Cu"/"ZnS" symmetry nAtomTypes=3."atomType"vector of length rowcore+rowshell that flags atoms in the particle with their atom type numbers. Atoms in the core are numbered with notation $1,2, \ldots$, while atoms in the shell have numbers $-1,-2, \ldots$, e.g. for a core/shell particle with "Cu"/"ZnS" symmetry vector atomType consists of elements {1, -1, -2}"scatterLength"numeric vector describing neutron scattering lengths for all atom types in the particle."scatterFactor"list describing X-ray scattering factor parameters. See calcTotalScatt for details."sigma"see sigma argument."layer_end", "layer_start"numeric vectors that are used if vector r length is greater than 1. In that case for optimization purposes only one particle with the biggest value of radius r is generated, together with the information on how to extract atomic positions for the subparticle with given radius. E.g. if r=c(8, 11.1, 16), nanop is an object that contains resulting matrix, "layer_start=c(1,11,72)" and "layer_end=c(1024,1065,2048)" then nanop[11:1065,] gives atomic coordinates for the subparticle with radius r=11.1."layerS_end", "layerS_start"numeric vectors. Indicates layers for the particle shell."dimer"logical indicating whether the particle is a cluster of two spherical particles."r"If shape="sphere" particle radius (radii). If shape="ellipse" elliptic radii. If shape="box" parallelepiped half-dimensions."rcore"If shape="sphere" core radius (radii). If shape="ellipse" core elliptic radii. If shape="box" core half-dimensions."shape"particle shape."sym"particle (core) symmetry."symShell"particle shell symmetry."atomsCore"names of the chemical elements in the particle core."atomsShell"names of the chemical elements in the particle shell.

Rdversion

1.1

Examples

Run this code
## Uncomment all plotPart() calls for 3D visualization

## create CdSe nanoparticle:
## CdSe particle has wurtzite structure
## Zn and S atoms could be used to create base matrix
## (see getBase() )
Cd_base <- getBase("Zn")  #get fractional coordinates for Zn
Cd_scL <- getScatterLength("Cd") #get scattering parameters for Cd
Cd_scF <- getScatterFactor("Cd")

Cd <- createAtom("Cd", base=Cd_base, scatterLength=Cd_scL, 
    scatterFactor=Cd_scF, sigma=0.01)

Se_base <- getBase("S")
Se_scL <- getScatterLength("Se")
Se_scF <- getScatterFactor("Se")

Se <- createAtom("Se", base=Se_base, scatterLength=Se_scL, 
    scatterFactor=Se_scF, sigma=0.008)

## atoms Cd and Se now can be used as arguments in simPart
part <- simPart(atoms=list(Cd, Se), latticep=c(4.3, 7.02), 
    sym="hcp")
#plotPart(part)

## Deterministic particle 
## Particle with uniform displacements 
Cu <- createAtom("Cu")
part <- simPart(atoms=list(Cu), atomsShell=list(Cu), rcore=8, 
    latticep=5)
partx <- displacePart(part, sigma=.02) 
#plotPart(partx, radius=.4, box=TRUE)

## Particle with displacements in the core different 
## from displacements in the shell
## create rock salt structure
Zn <- createAtom("Zn")
S <- createAtom("S")
part <- simPart(atoms=list(Zn,S), atomsShell=list(Cd, Se), r=14, 
    rcore=10, sym="hcp", latticep=c(3.1, 4.1), symShell="hcp", 
    latticepShell=c(4.3, 7.02))
partx <- displacePart(part, sigma=c(.01, .005, .012, .012)) 
## first elements in sigma and correspond to Zn atoms,
## second - to S atoms, third - to Cd atoms, last - to Se atoms.
attributes(part)$atomType
## elements '1' indicate Zn atoms in the total matrix, '2' indicate  
## S atoms, '-1' indicate Cd atoms, and '-2' indicate Se atoms.
#plotPart(partx, radius=.4)

## Particles with radii drawn from a log-Normal size-distribution
## and constant thickness 0.8
r <- exp(rnorm(10, log(10), log(1.1)))
part <- simPart(r=r, shell=0.8, atoms=list(Cu), 
    atomsShell=list(Cu))
## particle attributes
attributes(part)
## Extract second subparticle
t1 <- attributes(part)$layer_start[2]
t2 <- attributes(part)$layer_end[2]
part2 <- part[t1:t2, ]
## In order to use part2 as an argument for calcTotalScatt() or  
## other functions certain attributes should be set up 
## (see calcTotalScatt).
## To avoid extraction of every subparticle use option 
##  kind="fast_av" in calcTotalScatt() function.

Run the code above in your browser using DataLab