GeomConverter/src/org/lcsim/material
diff -u -r1.4 -r1.5
--- Material.java 30 Jun 2005 23:21:01 -0000 1.4
+++ Material.java 1 Jul 2005 00:06:26 -0000 1.5
@@ -13,6 +13,12 @@
*/
public class Material
{
+ /** Default temperature in kelvin = 1.0 */
+ public static final double DEFAULT_TEMPERATURE = 273.15;
+
+ /** Default pressure in atmospheres = 1.0 */
+ public static final double DEFAULT_PRESSURE = 1.0;
+
double _temp;
double _pressure;
double _density;
@@ -128,7 +134,7 @@
void addElement(MaterialElement element,
int nAtoms)
{
- System.out.println("Material.addElement() - composite add " + element.getName() + " to " + getName() );
+ //System.out.println("Material.addElement() - composite add " + element.getName() + " to " + getName() );
if ( _nElements < _nComponentsMax )
{
@@ -136,7 +142,7 @@
_atoms.add( _nElements, nAtoms);
_nComponents = ++_nElements;
- System.out.println("ncomp, nelem: " + _nComponents + " " + _nElements);
+ //System.out.println("ncomp, nelem: " + _nComponents + " " + _nElements);
}
else
{
@@ -145,7 +151,7 @@
if ( isFilled() )
{
- System.out.println("setting mass fractions");
+ //System.out.println("setting mass fractions");
double Zmol = 0;
double Amol = 0;
@@ -170,7 +176,7 @@
void addElement(MaterialElement element,
double fraction)
{
- System.out.println("Material.addElement() - fraction add " + element.getName() + " to " + getName() );
+ //System.out.println("Material.addElement() - fraction add " + element.getName() + " to " + getName() );
if ( _nComponents < _nComponentsMax )
{
@@ -208,7 +214,7 @@
void addMaterial(Material material,
double fraction)
{
- System.out.println("Material.addElement() - fraction add " + material.getName() + " to " + getName() );
+ //System.out.println("Material.addElement() - fraction add " + material.getName() + " to " + getName() );
if ( _atoms.size() > 0 )
{
@@ -238,7 +244,7 @@
/* Add a new element. */
else
{
- System.out.println("adding mass fraction: " + element.getName() + "=" + fraction * material.getMassFractions().get(i) );
+ //System.out.println("adding mass fraction: " + element.getName() + "=" + fraction * material.getMassFractions().get(i) );
_elements.add(element);
@@ -251,7 +257,7 @@
}
}
++_nComponents;
- System.out.println("ncomp, ncompmax: " + _nComponents + " " +_nComponentsMax);
+ //System.out.println("ncomp, ncompmax: " + _nComponents + " " +_nComponentsMax);
}
else
{
@@ -271,7 +277,7 @@
private void checkMassSum()
{
- System.out.println("checking mass sum for: " + getName() );
+ //System.out.println("checking mass sum for: " + getName() );
double weightSum = 0;
for ( int i = 0; i < _massFractions.size(); i++)
{
@@ -280,13 +286,13 @@
if ( abs(1 - weightSum) > 0.001 )
{
- System.err.println("bad weight sum: " + weightSum);
+ //System.err.println("bad weight sum: " + weightSum);
- System.out.println("listing weights...");
- for ( int i = 0; i < _massFractions.size(); i++)
- {
- System.out.println(_elements.get(i).getName() + " = " + _massFractions.get(i));
- }
+ //System.out.println("listing weights...");
+ //for ( int i = 0; i < _massFractions.size(); i++)
+ //{
+ //System.out.println(_elements.get(i).getName() + " = " + _massFractions.get(i));
+ //}
throw new RuntimeException("Mass fractions do not sum to 1 within 0.001 tolerance for this material: " + getName() );
}