Source code: joelib/desc/types/AtomVanDerWaalsVolume.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: AtomVanDerWaalsVolume.java,v $
3 // Purpose: Atom Van der Waals volume.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.6 $
8 // $Date: 2003/08/19 13:11:25 $
9 // $Author: wegner $
10 //
11 // Copyright (c) Dept. Computer Architecture, University of Tuebingen, Germany
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation version 2 of the License.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 ///////////////////////////////////////////////////////////////////////////////
22 package joelib.desc.types;
23
24
25 /*==========================================================================*
26 * IMPORTS
27 *==========================================================================*/
28 import joelib.data.JOEElementTable;
29
30 import joelib.desc.DescDescription;
31 import joelib.desc.DescriptorHelper;
32 import joelib.desc.DescriptorInfo;
33 import joelib.desc.SimpleDynamicAtomProperty;
34
35 import joelib.desc.result.DynamicArrayResult;
36
37 import joelib.molecule.JOEAtom;
38 import joelib.molecule.JOEMol;
39
40 import joelib.util.iterator.AtomIterator;
41
42 import org.apache.log4j.Category;
43
44
45 /*==========================================================================*
46 * CLASS DECLARATION
47 *==========================================================================*/
48
49 /**
50 * Atom Van der Waals volume.
51 *
52 * @author wegnerj
53 * @license GPL
54 * @cvsversion $Revision: 1.6 $, $Date: 2003/08/19 13:11:25 $
55 */
56 public class AtomVanDerWaalsVolume extends SimpleDynamicAtomProperty
57 {
58 //~ Static fields/initializers /////////////////////////////////////////////
59
60 /*-------------------------------------------------------------------------*
61 * public static member variables
62 *-------------------------------------------------------------------------*/
63
64 /**
65 * Obtain a suitable logger.
66 */
67 private static Category logger = Category.getInstance(
68 "joelib.desc.types.AtomVanDerWaalsVolume");
69 public static final String DESC_KEY = "Atom_van_der_waals_volume";
70
71 //~ Constructors ///////////////////////////////////////////////////////////
72
73 /*-------------------------------------------------------------------------*
74 * private variables
75 *-------------------------------------------------------------------------*/
76 /*-------------------------------------------------------------------------*
77 * constructor
78 *-------------------------------------------------------------------------*/
79
80 /**
81 * Constructor for the KierShape1 object
82 */
83 public AtomVanDerWaalsVolume()
84 {
85 if (logger.isDebugEnabled())
86 {
87 logger.debug("Initialize " + this.getClass().getName());
88 }
89
90 descInfo = DescriptorHelper.generateDescInfo(DESC_KEY, this.getClass(),
91 DescriptorInfo.TYPE_NO_COORDINATES, null,
92 "joelib.desc.result.AtomDynamicResult");
93 }
94
95 //~ Methods ////////////////////////////////////////////////////////////////
96
97 /*-------------------------------------------------------------------------*
98 * public methods
99 *-------------------------------------------------------------------------*/
100 public Object getAtomPropertiesArray(JOEMol mol)
101 {
102 // get Van der Waals volume for all atoms
103 JOEAtom atom;
104 AtomIterator ait = mol.atomIterator();
105 double[] volumes = (double[]) DynamicArrayResult.getNewArray(DynamicArrayResult.DOUBLE,
106 mol.numAtoms());
107 int i = 0;
108
109 while (ait.hasNext())
110 {
111 atom = ait.nextAtom();
112 volumes[i++] = JOEElementTable.instance().correctedVdwRad(atom.getAtomicNum(),
113 atom.getHyb());
114 }
115
116 return volumes;
117 }
118 }
119 ///////////////////////////////////////////////////////////////////////////////
120 // END OF FILE.
121 ///////////////////////////////////////////////////////////////////////////////