Package org.jmol.adapter.writers
Class QCJSONWriter
- java.lang.Object
-
- org.jmol.util.JSONWriter
-
- org.jmol.adapter.writers.QCJSONWriter
-
public class QCJSONWriter extends JSONWriter
A very experimental class for writing QCJSON files. This standard is in the process of being developed, so any of this could change at any time. All we have here is Bob Hanson's experiment with getting Jmol to save and restore structures, vibrations, and molecular orbitals. Data set Bob is using is at https://sourceforge.net/p/jmol/code/HEAD/tree/trunk/Jmol-datafiles/qcjson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classQCJSONWriter.SparseArray
-
Field Summary
Fields Modifier and Type Field Description private intbasisIDprivate int[][]dfCoefMapsprivate booleanfilterMOsprivate Map<String,String>htBasisMapprivate static Map<String,String>integrationKeyMapprivate Map<String,Object>moBasesprivate javajs.util.Lst<int[]>shellsprivate Viewervwr-
Fields inherited from class org.jmol.util.JSONWriter
indent, oc
-
-
Constructor Summary
Constructors Constructor Description QCJSONWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringaddBasis(Map<String,Object> moData)Add a basis to the associative array moBases keyed on its hashcodevoidcloseSchema()private ObjectfixCoefficients(double[] coeffs)Jmol allows for a set of arrays that map coefficient indicies with nonstandard order to Gaussian/Molden order.private static Map<String,String>fixIntegration()When an MO is calculated in Jmol, Jmol will check the integration so that it can be checked to be close to 1.0000.private StringformatNumber(float x)protected ObjectgetAndCheckValue(Map<String,Object> map, String key)private ObjectgetAuxiliaryData(int modelIndex, String key)ObjectgetProperty(int modelIndex, String key)private booleanhaveMOData(int modelIndex)private booleanisVibration(int modelIndex)voidopenSchema()voidset(Viewer viewer, OutputStream os)private voidsetDFCoord(Map<String,Object> moData)StringtoString()voidwriteAtoms(int modelIndex)voidwriteBonds(int modelIndex)voidwriteJob(int iJob)voidwriteJobMetadata()voidwriteJobs()voidwriteJSON()voidwriteMagic()private voidwriteMapKeyValueUnits(String key, Object value, String units)voidwriteMOBases()private voidwriteMOData(int modelIndex)intwriteModel(int modelIndex)voidwriteModelMetadata(int modelIndex)voidwriteModels()voidwriteObject(Object o)private voidwritePrefix_Units(String prefix, String units)voidwriteSchemaMetadata()voidwriteTopology(int modelIndex)intwriteVibrations(int modelIndex)-
Methods inherited from class org.jmol.util.JSONWriter
append, arrayAdd, arrayClose, arrayOpen, closeStream, mapAddKey, mapAddKeyValue, mapAddKeyValueRaw, mapAddMapAllExcept, mapClose, mapOpen, setModifyKeys, setStream, setWhiteSpace, setWriteNullAsString, writeArray, writeBoolean, writeList, writeMap, writeNull, writeNumber, writeString, writeString
-
-
-
-
Field Detail
-
filterMOs
private boolean filterMOs
-
vwr
private Viewer vwr
-
basisID
private int basisID
-
shells
private javajs.util.Lst<int[]> shells
-
dfCoefMaps
private int[][] dfCoefMaps
-
-
Method Detail
-
set
public void set(Viewer viewer, OutputStream os)
-
writeJSON
public void writeJSON()
-
writeSchemaMetadata
public void writeSchemaMetadata()
-
openSchema
public void openSchema()
-
writeMagic
public void writeMagic()
-
closeSchema
public void closeSchema()
-
writeJobs
public void writeJobs()
-
writeJob
public void writeJob(int iJob)
-
writeJobMetadata
public void writeJobMetadata()
-
writeModels
public void writeModels()
-
writeModel
public int writeModel(int modelIndex)
-
writeTopology
public void writeTopology(int modelIndex)
-
isVibration
private boolean isVibration(int modelIndex)
-
writeModelMetadata
public void writeModelMetadata(int modelIndex)
-
writeAtoms
public void writeAtoms(int modelIndex)
-
formatNumber
private String formatNumber(float x)
-
writeBonds
public void writeBonds(int modelIndex)
-
writeVibrations
public int writeVibrations(int modelIndex)
-
haveMOData
private boolean haveMOData(int modelIndex)
-
writeMOData
private void writeMOData(int modelIndex)
-
fixIntegration
private static Map<String,String> fixIntegration()
When an MO is calculated in Jmol, Jmol will check the integration so that it can be checked to be close to 1.0000. This integration value is saved back in the MO data, but it is not a standard key. (As though anything is here!) So we set a key mapping to replace it.- Returns:
- the "integration" key map
-
getAndCheckValue
protected Object getAndCheckValue(Map<String,Object> map, String key)
- Overrides:
getAndCheckValuein classJSONWriter
-
fixCoefficients
private Object fixCoefficients(double[] coeffs)
Jmol allows for a set of arrays that map coefficient indicies with nonstandard order to Gaussian/Molden order. Here we do the conversion upon writing so that the order is always Gaussian/Molden order.- Parameters:
coeffs-- Returns:
-
addBasis
private String addBasis(Map<String,Object> moData)
Add a basis to the associative array moBases keyed on its hashcode- Parameters:
moData-- Returns:
- ID for this basis.
-
writeMOBases
public void writeMOBases()
-
writeObject
public void writeObject(Object o)
- Overrides:
writeObjectin classJSONWriter
-
-