Giter Site home page Giter Site logo

Comments (5)

drobnyjt avatar drobnyjt commented on August 22, 2024 1

Yes, that's correct - the material properties are listed as [tungsten, hydrogen], so n has the following structure:

[
    [n(W), n(H)], #number densities of first layer in 1/Å^3
    [n(W), n(H)]  #number densities of second layer in 1/Å^3
] 

from rustbca.

drobnyjt avatar drobnyjt commented on August 22, 2024

Hey @HexSygon - thanks for opening an issue. The easiest way to learn what the arguments do is to refer to the docstrings using help(compound_bca_list_1D_py), although I admit there are likely other functions missing docstrings in libRustBCA:

>>> help(compound_bca_list_1D_py)
Help on built-in function compound_bca_list_1D_py in module libRustBCA:

compound_bca_list_1D_py(ux, uy, uz, energies, Z1, m1, Ec1, Es1, Z2, m2, Ec2, Es2, Eb2, n2, dx)
    compound_bca_list_1D_py(ux, uy,  uz, energies, Z1, m1, Ec1, Es1, Z2, m2, Ec2, Es2, Eb2 n2, dx)
    runs a BCA simulation for a list of particles and outputs a list of sputtered, reflected, and implanted particles.
    Args:
       ux (list(f64)): initial ion directions x. ux != 0.0 to avoid gimbal lock
       uy (list(f64)): initial ion directions y.
       uz (list(f64)): initial ion directions z.
       energies (list(f64)): initial ion energies in eV.
       Z1 (list(f64)): initial ion atomic numbers.
       m1 (list(f64)): initial ion masses in amu.
       Ec1 (list(f64)): ion cutoff energies in eV. If ion energy < Ec1, it stops in the material.
       Es1 (list(f64)): ion surface binding energies. Assumed planar.
       Z2 (list(f64)): target material species atomic numbers.
       m2 (list(f64)): target material species masses in amu.
       Ec2 (list(f64)): target material species cutoff energies in eV. If recoil energy < Ec2, it stops in the material.
       Es2 (list(f64)): target species surface binding energies. Assumed planar.
       Eb2 (list(f64)): target material species bulk binding energies in eV.
       n2 (list(list(f64))): target material species atomic number densities in inverse cubic Angstroms.
       dx (list(f64)): target material layer thicknesses starting at surface.
    Returns:
       output (NX9 list of f64): each row in the list represents an output particle (implanted,
       sputtered, or reflected). Each row consists of:
         [Z, m (amu), E (eV), x, y, z, (angstrom), ux, uy, uz]
       incident (list(bool)): whether each row of output was an incident ion or originated in the target
    stopped (list(bool)): whether each row of output is associated with a particle that stopped in the target

>>>

In this case, the last argument, dx, is a list that contains the thickness of each layer in the target. That is, the first layer is 50 angstroms and the second layer is 1e6 angstroms. It looks like the documentation is missing the unit in the docstring, so I'll be sure to fix that for the next version. Hope this helps.

from rustbca.

HexSygon avatar HexSygon commented on August 22, 2024

Thank you for this, very helpful. @drobnyjt

Is there a way to make a mixed layer of two materials?

I thought that this code was doing this, but it appears that it is just one layer stacked on top of a different material layer correct?

from rustbca.

drobnyjt avatar drobnyjt commented on August 22, 2024

You're very welcome; the answer is yes, and the documentation should probably be updated to make that clear.

When you define the material parameters, e.g., the atomic numbers, like so:
Z2 = [1, 16, 22], each element become a species included in the simulation.

Compounds made up of those elements are specified using the n2 argument, for the number densities. In the 1D material case, n2 is a list of lists made up of the number density of each element of each layer. If you have 5 layers, len(n2)=5, one for each layer. The index of each sub-list of n2 corresponds to the elements specified in Z2, m2, etc, so if you have three elements specified in Z2, len(n2[i])=3 for i = 0, 1, 2.

For example, if Z2 = [1, 16, 22], and I want a material with 3 layers, one of TiO, one of TiH2, and one of pure titanium (assuming a constant number density of titanium for convenience):

n2 = [ 
    [0.0, 0.0567, 0.0567], # 0 Hydrogen, 1 Oxygen, 1 Titanium
    [0.1134, 0.0, 0.0567]. # 2 Hydrogen, 0 Oxygen, 1 Titanium
    [0.0, 0.0, 0.0567],    # 0 Hydrogen, 0 Oxygen, 1 Titanium
]

Hopefully this way of specifying the composition of each layer makes sense.

from rustbca.

HexSygon avatar HexSygon commented on August 22, 2024

Is this part of the code under line 153 of test_rustbca.py correct?

[[target['n']/1030, target['n']/1030], [target['n']/10**30, 0.0]], [50.0, 1e6]

It's commented that the target is tungsten with a 50 Angstrom layer of W-H on top, but does that match the code above?

Is [target['n']/1030, target['n']/1030] supposed to refer to [n(tungsten), n(hydrogen)] ?

from rustbca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.