Commit 12daccc3 authored by Carl Poelking's avatar Carl Poelking
Browse files

Extended cube-file output interface.

parent 30eeab2e
......@@ -209,14 +209,26 @@ void Spectrum::writeDensityOnGrid(int slot_idx, std::string center_type, std::st
AtomicSpectrum *atomic_spectrum = this->getAtomic(slot_idx, center_type);
// WRITE CUBE FILES
if (atomic_spectrum) {
atomic_spectrum->getQnlm(density_type)->writeDensityOnGrid(
"density.expanded.cube", _options, _structure, atomic_spectrum->getCenter(), true);
//atomic_spectrum->getQnlm(density_type)->writeDensityOnGrid(
// "density.expanded.cube", _options, _structure, atomic_spectrum->getCenter(), true);
atomic_spectrum->getQnlm(density_type)->writeDensityOnGrid(
"density.explicit.cube", _options, _structure, atomic_spectrum->getCenter(), false);
}
return;
}
void Spectrum::writeDensityCubeFile(int atom_idx, std::string density_type, std::string filename, bool from_expansion) {
if (atom_idx < _atomspec_array.size()) {
AtomicSpectrum *atomic_spectrum = this->_atomspec_array[atom_idx];
atomic_spectrum->getQnlm(density_type)->writeDensityOnGrid(
filename, _options, _structure, atomic_spectrum->getCenter(), from_expansion);
}
else {
throw soap::base::OutOfRange("Spectrum::writeDensityCubeFile");
}
return;
}
void Spectrum::writeDensityOnGridInverse(int slot_idx, std::string center_type, std::string type1, std::string type2) {
AtomicSpectrum *atomic_spectrum = this->getAtomic(slot_idx, center_type);
AtomicSpectrum inverse_atomic_spectrum(atomic_spectrum->getCenter(), atomic_spectrum->getBasis());
......@@ -301,6 +313,7 @@ void Spectrum::registerPython() {
.def("save", &Spectrum::save)
.def("load", &Spectrum::load)
.def("writeDensityOnGrid", &Spectrum::writeDensityOnGrid)
.def("writeDensityCubeFile", &Spectrum::writeDensityCubeFile)
.def("writeDensity", &Spectrum::writeDensity)
.def("writePowerDensity", &Spectrum::writePowerDensity)
.def("writeDensityOnGridInverse", &Spectrum::writeDensityOnGridInverse)
......
......@@ -56,6 +56,7 @@ public:
AtomicSpectrum *getAtomic(int slot_idx, std::string center_type);
AtomicSpectrum *getGlobal() { assert(_global_atomic && "Compute first"); return _global_atomic; }
void writeDensityOnGrid(int slot_idx, std::string center_type, std::string density_type);
void writeDensityCubeFile(int atom_idx, std::string density_type, std::string filename, bool from_expansion);
void writeDensityOnGridInverse(int slot_idx, std::string center_type, std::string type1, std::string type2);
void writeDensity(int slot_idx, std::string center_type, std::string density_type);
void writePowerDensity(int slot_idx, std::string center_type, std::string type1, std::string type2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment