Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
soap-plus-plus
Commits
12daccc3
Commit
12daccc3
authored
Feb 20, 2017
by
Carl Poelking
Browse files
Extended cube-file output interface.
parent
30eeab2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/soap/spectrum.cpp
View file @
12daccc3
...
...
@@ -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
)
...
...
src/soap/spectrum.hpp
View file @
12daccc3
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment