Package gov.nist.microanalysis.EPQLibrary

Examples of gov.nist.microanalysis.EPQLibrary.Material


        }

        // Geometry
        List<RegionBase> regions = mcss.getChamber().getSubRegions();
        RegionBase region;
        Material material;
        IMaterialScatterModel model;
        String key;
        for (int i = 0; i < regions.size(); i++) {
            key = "geometry.region." + i + ".";
            region = regions.get(i);
            material = region.getMaterial();
            model = region.getScatterModel();

            props.setProperty(key + "material.name", material.getName());
            props.setProperty(key + "material.density",
                    Double.toString(material.getDensity()));
            props.setProperty(key + "model.absorptionEnergy",
                    Double.toString(FromSI.eV(model.getMinEforTracking())));
        }

        // Model
View Full Code Here


            int index;
            String name;
            double density;
            Composition composition;
            Material material;
            for (Element materialElement : materialsElement.getChildren()) {
                try {
                    index =
                            materialElement.getAttribute("_index")
                                    .getIntValue();
                } catch (DataConversionException e) {
                    throw new IOException(e);
                }

                name = materialElement.getAttribute("name").getValue();

                try {
                    density =
                            materialElement.getAttribute("density")
                                    .getDoubleValue();
                } catch (DataConversionException e) {
                    throw new IOException(e);
                }

                composition = extractComposition(materialElement);
                composition.setName(name);

                material = new Material(composition, density);
                material.setName(name);

                materials.put(index, material);
            }

            return materials;
View Full Code Here

                        bodyElement.getAttribute("material").getIntValue();
            } catch (DataConversionException e) {
                throw new IOException(e);
            }

            Material material = materials.get(materialIndex);

            SpectrumProperties props = new SpectrumProperties();
            props.setCompositionProperty(
                    SpectrumProperties.MicroanalyticalComposition, material);
            props.setNumericProperty(SpectrumProperties.SpecimenDensity,
                    FromSI.gPerCC(material.getDensity()));

            return props;
        }
View Full Code Here

        // Setup
        mcss = new MonteCarloSS();
        mcss.setBeamEnergy(ToSI.keV(20.0));
        mcss.setElectronGun(new GaussianBeam(10e-9));

        Material mat = MaterialFactory.createPureElement(Element.Si);
        Shape shape =
                MultiPlaneShape.createSubstrate(new double[] { 0, 0, -1 },
                        new double[] { 0, 0, 0 });
        mcss.addSubRegion(mcss.getChamber(), mat, shape);
View Full Code Here

    }



    protected void createGeometry(Region chamber) throws EPQException {
        Material mat = MaterialFactory.createPureElement(Element.Au);
        IMaterialScatterModel model = new BasicMaterialModel(mat);

        double dim = 0.01; // 1 mm
        double[] dims = new double[] { dim, dim, dim };
        double[] pos = new double[] { 0.0, 0.0, -dim / 2.0 };
View Full Code Here


    protected static Element createMaterialsElement() throws EPQException {
        Element element = new Element("materials");

        Material mat = MaterialFactory.createCompound("Si3N4", 3.44);
        IMaterialScatterModel model = new BasicMaterialModel(mat);
        model.setMinEforTracking(ToSI.eV(1234));
        element.addContent(createMaterialElement(model, 1));

        mat = MaterialFactory.createCompound("Al2O3", 4.53);
View Full Code Here



    private static Element createMaterialElement(IMaterialScatterModel model,
            int index) {
        Material mat = model.getMaterial();

        Element element = new Element("material");
        element.setAttribute("_index", Integer.toString(index));
        element.setAttribute("name", mat.getName());
        element.setAttribute("density", Double.toString(mat.getDensity()));

        Element compositionElement = new Element("composition");
        Element elementElement;
        for (gov.nist.microanalysis.EPQLibrary.Element el : mat.getElementSet()) {
            elementElement = new Element("element");

            elementElement.setAttribute("z",
                    Integer.toString(el.getAtomicNumber()));
            elementElement.setAttribute("weightFraction",
                    Double.toString(mat.weightFraction(el, false)));

            compositionElement.addContent(elementElement);
        }
        element.addContent(compositionElement);
View Full Code Here

        RegionBase region = chamber.getSubRegions().get(0);

        IMaterialScatterModel model = region.getScatterModel();
        assertEquals(1234, FromSI.eV(model.getMinEforTracking()), 1e-4);

        Material mat = region.getMaterial();
        assertEquals("Si3N4", mat.getName());
        assertEquals(3.44, mat.getDensity(), 1e-2);
        assertEquals(2, mat.getElementSet().size());
    }
View Full Code Here

        RegionBase region = chamber.getSubRegions().get(0);

        IMaterialScatterModel model = region.getScatterModel();
        assertEquals(1234, FromSI.eV(model.getMinEforTracking()), 1e-4);

        Material mat = region.getMaterial();
        assertEquals("Si3N4", mat.getName());
        assertEquals(3.44, mat.getDensity(), 1e-2);
        assertEquals(2, mat.getElementSet().size());

        region = chamber.getSubRegions().get(1);

        model = region.getScatterModel();
        assertEquals(4321, FromSI.eV(model.getMinEforTracking()), 1e-4);

        mat = region.getMaterial();
        assertEquals("Al2O3", mat.getName());
        assertEquals(4.53, mat.getDensity(), 1e-2);
        assertEquals(2, mat.getElementSet().size());
    }
View Full Code Here

        RegionBase region = chamber.getSubRegions().get(0);

        IMaterialScatterModel model = region.getScatterModel();
        assertEquals(1234, FromSI.eV(model.getMinEforTracking()), 1e-4);

        Material mat = region.getMaterial();
        assertEquals("Si3N4", mat.getName());
        assertEquals(3.44, mat.getDensity(), 1e-2);
        assertEquals(2, mat.getElementSet().size());

        Shape shape = region.getShape();
        assertFalse(shape.contains(new double[] { 0.0, 0.0, 0.01 })); // above
        assertTrue(shape.contains(new double[] { 0.0, 0.0, -25e-9 })); // in
        assertFalse(shape.contains(new double[] { 0.0, 0.0, -0.01 })); // below

        // Test layer 2
        region = chamber.getSubRegions().get(1);

        model = region.getScatterModel();
        assertEquals(4321, FromSI.eV(model.getMinEforTracking()), 1e-4);

        mat = region.getMaterial();
        assertEquals("Al2O3", mat.getName());
        assertEquals(4.53, mat.getDensity(), 1e-2);
        assertEquals(2, mat.getElementSet().size());

        shape = region.getShape();
        assertFalse(shape.contains(new double[] { 0.0, 0.0, -25e-9 })); // above
        assertTrue(shape.contains(new double[] { 0.0, 0.0, -125e-9 })); // in
        assertFalse(shape.contains(new double[] { 0.0, 0.0, -0.01 })); // below

        // Test substrate
        region = chamber.getSubRegions().get(2);

        model = region.getScatterModel();
        assertEquals(50.0, FromSI.eV(model.getMinEforTracking()), 1e-4);

        mat = region.getMaterial();
        assertEquals("Pure gold", mat.getName());
        assertEquals(19300, mat.getDensity(), 1e-2);
        assertEquals(1, mat.getElementSet().size());
    }
View Full Code Here

TOP

Related Classes of gov.nist.microanalysis.EPQLibrary.Material

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.