gov.nist.microanalysis.NISTMonte
Class MonteCarloSS.Region

java.lang.Object
  extended by gov.nist.microanalysis.NISTMonte.MonteCarloSS.Region
All Implemented Interfaces:
ITransform
Enclosing class:
MonteCarloSS

public final class MonteCarloSS.Region
extends java.lang.Object
implements ITransform

A Region represents a homogeneous volume of sample. Regions are described by a Shape, a Material and a list of fully contained child Regions.

Copyright: Not subject to copyright - 2004

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Constructor Summary
MonteCarloSS.Region(MonteCarloSS.Region parent, Material material, MonteCarloSS.Shape shape)
          Region - Creates a region based on the specified Material (defines the composition and density) and the specified Shape (defines the morphology.)
 
Method Summary
protected  double calculateEnergyLoss(double len, double kE)
          calculateEnergyLoss - Calculate the amount of kinetic energy lost when an electron of the specified kinetic energy (kE) traverses a distance (len) in this Region.
 void clearSubRegions()
          clearSubRegions - Clear all the fully contained Regions within this Region.
 MonteCarloSS.Region findEndOfStep(double[] pos0, double[] pos1)
          findEndOfStep - Given a starting point (pos0) and a candidate ending point (pos1), findEndOfStep checks the parent Region and each sub-Region to determine whether the line segment intesects the boundary of any Regions.
 double getAtomsPerCubicMeter(Element el)
           
 Material getMaterial()
          getMaterial - Get the material of which this Region is constructed.
 MonteCarloSS.Shape getShape()
          getShape - Returns the instance of the Shape interface that defines the shape of this Region.
 java.util.List getSubRegions()
          getSubRegions - Returns an immutable list of the sub-regions associated with this region.
 void removeSubRegion(MonteCarloSS.Region subRegion)
          removeSubRegion - Remove the specified subRegion from the list of fully contained Regions within this Region.
 void rotate(double[] pivot, double phi, double theta, double psi)
          rotate - Rotate the object around the specified point by phi about the z-axis followed by theta round the y-axis followed by psi around the z-axis.
 void translate(double[] distance)
          translate - Translate this object by the distance specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonteCarloSS.Region

public MonteCarloSS.Region(MonteCarloSS.Region parent,
                           Material material,
                           MonteCarloSS.Shape shape)
Region - Creates a region based on the specified Material (defines the composition and density) and the specified Shape (defines the morphology.)

Parameters:
parent - Region
material - Material
shape - Shape
Method Detail

getMaterial

public Material getMaterial()
getMaterial - Get the material of which this Region is constructed.

Returns:
Material

removeSubRegion

public void removeSubRegion(MonteCarloSS.Region subRegion)
removeSubRegion - Remove the specified subRegion from the list of fully contained Regions within this Region.

Parameters:
subRegion - Region

clearSubRegions

public void clearSubRegions()
clearSubRegions - Clear all the fully contained Regions within this Region.


getSubRegions

public java.util.List getSubRegions()
getSubRegions - Returns an immutable list of the sub-regions associated with this region.

Returns:
An immutable List

findEndOfStep

public MonteCarloSS.Region findEndOfStep(double[] pos0,
                                         double[] pos1)
findEndOfStep - Given a starting point (pos0) and a candidate ending point (pos1), findEndOfStep checks the parent Region and each sub-Region to determine whether the line segment intesects the boundary of any Regions. Intersecting a boundary indicates that the step traverses between two Regions. If the segment intersects either the edge of this region or a sub-Region then findEndOfStep returns the intersecting Region. Otherwise findEndOfStep returns this. If the segment intersects a new Region, pos1 will be foreshortened to the border of the new Region.

Parameters:
pos0 - double[] - The fixed initial point.
pos1 - double[] - [In] The candidate end point [Out] The foreshortened end point
Returns:
Region - The Region in which the [Out] pos1 is found

getShape

public MonteCarloSS.Shape getShape()
getShape - Returns the instance of the Shape interface that defines the shape of this Region.

Returns:
Shape

calculateEnergyLoss

protected double calculateEnergyLoss(double len,
                                     double kE)
calculateEnergyLoss - Calculate the amount of kinetic energy lost when an electron of the specified kinetic energy (kE) traverses a distance (len) in this Region.

Parameters:
len - double - A distance in meters
kE - double - An energy in joules
Returns:
double - The energy loss in joules

getAtomsPerCubicMeter

public double getAtomsPerCubicMeter(Element el)

rotate

public void rotate(double[] pivot,
                   double phi,
                   double theta,
                   double psi)
Description copied from interface: ITransform
rotate - Rotate the object around the specified point by phi about the z-axis followed by theta round the y-axis followed by psi around the z-axis. These is the standard Euler angle rotation. The rotation matrix is...
[ cos(phi)*cos(th)*cos(psi)-sin(phi)*sin(psi) -sin(phi)*cos(th)*cos(psi)-cos(phi)*sin(psi) sin(th)*cos(psi) ]
[ sin(phi)*cos(psi)+cos(phi)*cos(th)*sin(psi) -sin(phi)*cos(th)*sin(psi)+cos(phi)*cos(psi) sin(th)*sin(psi) ]
[ -cos(phi)*sin(th) sin(th)*sin(phi) cos(th) ]

Specified by:
rotate in interface ITransform
Parameters:
pivot - double[] - a three-vector specifying the point around which the rotation is performed
phi - double
theta - double
psi - double

translate

public void translate(double[] distance)
Description copied from interface: ITransform
translate - Translate this object by the distance specified.

Specified by:
translate in interface ITransform
Parameters:
distance - double[] - A three-vector specifying how much to translate