VTK: Domains/Chemistry/vtkBlueObeliskData.h Source File

| VTK 9.3.1

vtkBlueObeliskData.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
27 #ifndef vtkBlueObeliskData_h
28 #define vtkBlueObeliskData_h
29
30 #include "vtkDomainsChemistryModule.h" // For export macro
31 #include "vtkNew.h" // For vtkNew
32 #include "vtkObject.h"
33
34 #include <mutex> // for std::mutex
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkAbstractArray;
38 class vtkFloatArray;
39 class vtkStringArray;
40 class vtkUnsignedShortArray;
41
42 // Hidden STL reference: std::vector<vtkAbstractArray*>
43 class MyStdVectorOfVtkAbstractArrays;
44
45 class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
46 {
47 public:
48 vtkTypeMacro(vtkBlueObeliskData, vtkObject);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50 static vtkBlueObeliskData* New();
51
57 void Initialize();
58
62 bool IsInitialized() { return this->Initialized; }
63
65
69 void LockWriteMutex();
71
73
77 void UnlockWriteMutex();
79
81
85 vtkGetMacro(NumberOfElements, unsigned short);
87
89
92 vtkGetNewMacro(Symbols, vtkStringArray);
93 vtkGetNewMacro(LowerSymbols, vtkStringArray);
94 vtkGetNewMacro(Names, vtkStringArray);
95 vtkGetNewMacro(LowerNames, vtkStringArray);
96 vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray);
97 vtkGetNewMacro(ElectronicConfigurations, vtkStringArray);
98 vtkGetNewMacro(Families, vtkStringArray);
100
101 vtkGetNewMacro(Masses, vtkFloatArray);
102 vtkGetNewMacro(ExactMasses, vtkFloatArray);
103 vtkGetNewMacro(IonizationEnergies, vtkFloatArray);
104 vtkGetNewMacro(ElectronAffinities, vtkFloatArray);
105 vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray);
106 vtkGetNewMacro(CovalentRadii, vtkFloatArray);
107 vtkGetNewMacro(VDWRadii, vtkFloatArray);
108 vtkGetNewMacro(DefaultColors, vtkFloatArray);
109 vtkGetNewMacro(BoilingPoints, vtkFloatArray);
110 vtkGetNewMacro(MeltingPoints, vtkFloatArray);
111
112 vtkGetNewMacro(Periods, vtkUnsignedShortArray);
113 vtkGetNewMacro(Groups, vtkUnsignedShortArray);
114
119 static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
120
121 protected:
122 friend class vtkBlueObeliskDataParser;
123
124 vtkBlueObeliskData();
125 ~vtkBlueObeliskData() override;
126
127 bool Initialized;
128
133 virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000);
134
138 virtual void Reset();
139
143 virtual void Squeeze();
144
145 unsigned short NumberOfElements;
146
147 // Lists all arrays
148 MyStdVectorOfVtkAbstractArrays* Arrays;
149
150 // Atomic Symbols
151 vtkNew<vtkStringArray> Symbols;
152 vtkNew<vtkStringArray> LowerSymbols;
153
154 // Element Names
155 vtkNew<vtkStringArray> Names;
156 vtkNew<vtkStringArray> LowerNames;
157
158 // Misc Strings
159 vtkNew<vtkStringArray> PeriodicTableBlocks;
160 vtkNew<vtkStringArray> ElectronicConfigurations;
161 vtkNew<vtkStringArray> Families; // Non-Metal, Noblegas, Metalloids, etc
162
163 // Misc Data
164 vtkNew<vtkFloatArray> Masses; // amu
165 vtkNew<vtkFloatArray> ExactMasses; // amu
166 vtkNew<vtkFloatArray> IonizationEnergies; // eV
167 vtkNew<vtkFloatArray> ElectronAffinities; // eV
168 vtkNew<vtkFloatArray> PaulingElectronegativities; // eV
169 vtkNew<vtkFloatArray> CovalentRadii; // Angstrom
170 vtkNew<vtkFloatArray> VDWRadii; // Angstom
171 vtkNew<vtkFloatArray> DefaultColors; // rgb 3-tuples, [0.0,1.0]
172 vtkNew<vtkFloatArray> BoilingPoints; // K
173 vtkNew<vtkFloatArray> MeltingPoints; // K
174 vtkNew<vtkUnsignedShortArray> Periods; // Row of periodic table
175 vtkNew<vtkUnsignedShortArray> Groups; // Column of periodic table
176
177 void PrintSelfIfExists(const char*, vtkObject*, ostream&, vtkIndent);
178
179 private:
180 vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
181 void operator=(const vtkBlueObeliskData&) = delete;
182
183 std::mutex NewWriteMutex;
184 };
185
186 VTK_ABI_NAMESPACE_END
187 #endif
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:76
vtkBlueObeliskDataParser
Fill a vtkBlueObeliskData container with data from the BODR XML dataset.
Definition: vtkBlueObeliskDataParser.h:40
vtkBlueObeliskData
Contains chemical data from the Blue Obelisk Data Repository.
Definition: vtkBlueObeliskData.h:46
vtkBlueObeliskData::UnlockWriteMutex
void UnlockWriteMutex()
Unlock the mutex that protects the arrays during a call to Initialize().
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Names, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Masses, vtkFloatArray)
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(VDWRadii, vtkFloatArray)
vtkBlueObeliskData::New
static vtkBlueObeliskData * New()
vtkBlueObeliskData::NumberOfElements
unsigned short NumberOfElements
Definition: vtkBlueObeliskData.h:145
vtkBlueObeliskData::CovalentRadii
vtkNew< vtkFloatArray > CovalentRadii
Definition: vtkBlueObeliskData.h:169
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(ElectronAffinities, vtkFloatArray)
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(IonizationEnergies, vtkFloatArray)
vtkBlueObeliskData::Allocate
virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000)
Allocate enough memory in each array for sz elements.
vtkBlueObeliskData::ElectronAffinities
vtkNew< vtkFloatArray > ElectronAffinities
Definition: vtkBlueObeliskData.h:167
vtkBlueObeliskData::BoilingPoints
vtkNew< vtkFloatArray > BoilingPoints
Definition: vtkBlueObeliskData.h:172
vtkBlueObeliskData::Reset
virtual void Reset()
Reset each array.
vtkBlueObeliskData::Initialize
void Initialize()
Fill this object using an internal vtkBlueObeliskDataParser instance.
vtkBlueObeliskData::PaulingElectronegativities
vtkNew< vtkFloatArray > PaulingElectronegativities
Definition: vtkBlueObeliskData.h:168
vtkBlueObeliskData::GenerateHeaderFromXML
static bool GenerateHeaderFromXML(std::istream &xml, std::ostream &header)
Static method to generate the data header file used by this class from the BODR elements....
vtkBlueObeliskData::VDWRadii
vtkNew< vtkFloatArray > VDWRadii
Definition: vtkBlueObeliskData.h:170
vtkBlueObeliskData::IsInitialized
bool IsInitialized()
Check if this object has been initialized yet.
Definition: vtkBlueObeliskData.h:62
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Periods, vtkUnsignedShortArray)
vtkBlueObeliskData::LowerSymbols
vtkNew< vtkStringArray > LowerSymbols
Definition: vtkBlueObeliskData.h:152
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Groups, vtkUnsignedShortArray)
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(BoilingPoints, vtkFloatArray)
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(ExactMasses, vtkFloatArray)
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Symbols, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::Initialized
bool Initialized
Definition: vtkBlueObeliskData.h:127
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(CovalentRadii, vtkFloatArray)
vtkBlueObeliskData::Periods
vtkNew< vtkUnsignedShortArray > Periods
Definition: vtkBlueObeliskData.h:174
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(Families, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::ExactMasses
vtkNew< vtkFloatArray > ExactMasses
Definition: vtkBlueObeliskData.h:165
vtkBlueObeliskData::PeriodicTableBlocks
vtkNew< vtkStringArray > PeriodicTableBlocks
Definition: vtkBlueObeliskData.h:159
vtkBlueObeliskData::Names
vtkNew< vtkStringArray > Names
Definition: vtkBlueObeliskData.h:155
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(DefaultColors, vtkFloatArray)
vtkBlueObeliskData::LowerNames
vtkNew< vtkStringArray > LowerNames
Definition: vtkBlueObeliskData.h:156
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(ElectronicConfigurations, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::Arrays
MyStdVectorOfVtkAbstractArrays * Arrays
Definition: vtkBlueObeliskData.h:148
vtkBlueObeliskData::Masses
vtkNew< vtkFloatArray > Masses
Definition: vtkBlueObeliskData.h:164
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::Symbols
vtkNew< vtkStringArray > Symbols
Definition: vtkBlueObeliskData.h:151
vtkBlueObeliskData::ElectronicConfigurations
vtkNew< vtkStringArray > ElectronicConfigurations
Definition: vtkBlueObeliskData.h:160
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(MeltingPoints, vtkFloatArray)
vtkBlueObeliskData::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBlueObeliskData::Families
vtkNew< vtkStringArray > Families
Definition: vtkBlueObeliskData.h:161
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(LowerNames, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::Groups
vtkNew< vtkUnsignedShortArray > Groups
Definition: vtkBlueObeliskData.h:175
vtkBlueObeliskData::Squeeze
virtual void Squeeze()
Free any unused memory in the member arrays.
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(LowerSymbols, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkBlueObeliskData::LockWriteMutex
void LockWriteMutex()
Lock the mutex that protects the arrays during a call to Initialize().
vtkBlueObeliskData::MeltingPoints
vtkNew< vtkFloatArray > MeltingPoints
Definition: vtkBlueObeliskData.h:173
vtkBlueObeliskData::vtkGetNewMacro
vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray)
vtkBlueObeliskData::PrintSelfIfExists
void PrintSelfIfExists(const char *, vtkObject *, ostream &, vtkIndent)
vtkBlueObeliskData::DefaultColors
vtkNew< vtkFloatArray > DefaultColors
Definition: vtkBlueObeliskData.h:171
vtkBlueObeliskData::IonizationEnergies
vtkNew< vtkFloatArray > IonizationEnergies
Definition: vtkBlueObeliskData.h:166
vtkBlueObeliskData::vtkBlueObeliskData
vtkBlueObeliskData()
vtkBlueObeliskData::~vtkBlueObeliskData
~vtkBlueObeliskData() override
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkNew< vtkStringArray >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkUnsignedShortArray
dynamic, self-adjusting array of unsigned short
Definition: vtkUnsignedShortArray.h:32
vtkBlueObeliskData_::ExactMasses
static const float ExactMasses[119][1]
Definition: vtkBlueObeliskDataInternal.h:988
vtkBlueObeliskData_::Periods
static const unsigned short Periods[119][1]
Definition: vtkBlueObeliskDataInternal.h:2086
vtkBlueObeliskData_::Families
static const char * Families[119]
Definition: vtkBlueObeliskDataInternal.h:744
vtkBlueObeliskData_::ElectronicConfigurations
static const char * ElectronicConfigurations[119]
Definition: vtkBlueObeliskDataInternal.h:622
vtkBlueObeliskData_::IonizationEnergies
static const float IonizationEnergies[119][1]
Definition: vtkBlueObeliskDataInternal.h:1110
vtkBlueObeliskData_::PeriodicTableBlocks
static const char * PeriodicTableBlocks[119]
Definition: vtkBlueObeliskDataInternal.h:500
vtkBlueObeliskData_::ElectronAffinities
static const float ElectronAffinities[119][1]
Definition: vtkBlueObeliskDataInternal.h:1232
vtkBlueObeliskData_::MeltingPoints
static const float MeltingPoints[119][1]
Definition: vtkBlueObeliskDataInternal.h:1964
vtkBlueObeliskData_::DefaultColors
static const float DefaultColors[119][3]
Definition: vtkBlueObeliskDataInternal.h:1720
vtkBlueObeliskData_::BoilingPoints
static const float BoilingPoints[119][1]
Definition: vtkBlueObeliskDataInternal.h:1842
vtkBlueObeliskData_::LowerSymbols
static const char * LowerSymbols[119]
Definition: vtkBlueObeliskDataInternal.h:134
vtkBlueObeliskData_::Names
static const char * Names[119]
Definition: vtkBlueObeliskDataInternal.h:256
vtkBlueObeliskData_::VDWRadii
static const float VDWRadii[119][1]
Definition: vtkBlueObeliskDataInternal.h:1598
vtkBlueObeliskData_::Masses
static const float Masses[119][1]
Definition: vtkBlueObeliskDataInternal.h:866
vtkBlueObeliskData_::CovalentRadii
static const float CovalentRadii[119][1]
Definition: vtkBlueObeliskDataInternal.h:1476
vtkBlueObeliskData_::PaulingElectronegativities
static const float PaulingElectronegativities[119][1]
Definition: vtkBlueObeliskDataInternal.h:1354
vtkBlueObeliskData_::Groups
static const unsigned short Groups[119][1]
Definition: vtkBlueObeliskDataInternal.h:2208
vtkBlueObeliskData_::LowerNames
static const char * LowerNames[119]
Definition: vtkBlueObeliskDataInternal.h:378
vtkBlueObeliskData_::Symbols
static const char * Symbols[119]
Definition: vtkBlueObeliskDataInternal.h:12
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkNew.h
vtkObject.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315