Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SAMPLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OTHgroup
SAMPLE
Commits
bdb2c562
Commit
bdb2c562
authored
Feb 13, 2024
by
richard_berger
Browse files
Options
Downloads
Patches
Plain Diff
(RB) Added Functions:
- getPotentialJumpFromDipoleMomentPerMolecule - addDipoleHomogeneousSystem
parent
17de7a6b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sample/helpers/MixedSampleHelper.py
+127
-0
127 additions, 0 deletions
sample/helpers/MixedSampleHelper.py
with
127 additions
and
0 deletions
sample/helpers/MixedSampleHelper.py
+
127
−
0
View file @
bdb2c562
...
...
@@ -16,6 +16,8 @@
#
# If you are using this software for scientific purposes, please cite it as:
# L Hoermann et al., Computer Physics Communications (2019), 143-155
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
os
...
...
@@ -253,6 +255,30 @@ class MixedSampleHelper:
return
dipolmoment_per_Molecule_eAnstrom_i
def
getPotentialJumpFromDipoleMomentPerMolecule
(
self
,
DipolePerMolecule_eA_i
,
geo_i
,
hash_i
):
"""
returns potentialjump_i [eV]
DipolePerMolecule_eA_i .. the dipole moment per molecule in [e*Angstrom]
"""
AreaAngstrom_i
=
np
.
linalg
.
norm
(
np
.
cross
(
geo_i
.
lattice_vectors
[
0
]
,
geo_i
.
lattice_vectors
[
1
])
)
Nmol_i
=
(
len
(
hash_i
)
-
4
)
/
2
potentialjump_eV_i
=
-
180.8
*
(
DipolePerMolecule_eA_i
*
Nmol_i
)
/
AreaAngstrom_i
#print('Nmol_i: ',Nmol_i)
#print('AreaAngstrom_i: ', AreaAngstrom_i)
#print('potentialjump_i: ',potentialjump_i)
return
potentialjump_eV_i
def
addDipole2Molecules
(
self
,
proj
,
CalculationsPathsList
,
...
...
@@ -327,6 +353,107 @@ class MixedSampleHelper:
property_key
=
property_key_potential_jump
)
return
dipole_config_set
,
dipole_values
,
potentialjump_values
def
addDipoleHomogeneousSystem
(
self
,
proj
,
CalculationsPathsList
,
property_key_dipole
,
property_key_potential_jump
=
'
PotentialJump
'
):
dipole_config_set
=
sample
.
ConfigurationSet
(
proj
)
failcounter
=
0
for
folder_i
in
CalculationsPathsList
:
print
(
'
folder_i:
'
,
folder_i
)
#folder_i = all_calcpathnames[400]
aimsout_i
=
AIMSOutput
(
os
.
path
.
join
(
folder_i
,
'
aims.out
'
))
geo_i
=
aimsout_i
.
getGeometryFile
()
#geo_i.visualize()
#plt.show()
hash_i
=
getHashFromGeometry
.
getHash
(
geometry_file
=
geo_i
,
geometries
=
proj
.
getLocalGeometries
(),
substrate
=
proj
.
getSubstrate
()
)
print
(
'
hash_i:
'
,
hash_i
)
### check if isslab ##########
Nmol_i
=
(
len
(
hash_i
)
-
4
)
/
2
if
Nmol_i
>
0
:
isslab_i
=
False
else
:
isslab_i
=
True
print
(
'
isslab_i:
'
,
isslab_i
)
if
isslab_i
==
False
and
aimsout_i
.
calculationExitedNormally
():
print
(
'
folder_i:
'
,
folder_i
)
# get the potential jump from aimsout file
potentialjump_i
=
aimsout_i
.
getPotentialJump
()
print
(
'
potentialjump_i:
'
,
potentialjump_i
)
#get the dipolemoment per molecule
dipolmoment_per_Molecule_eAnstrom_i
=
\
self
.
getDipoleMomentPerMoleculeFromPotentialJump
(
potentialjump_i
,
geo_i
,
hash_i
)
print
(
'
dipolmoment_per_Molecule_eAnstrom_i:
'
,
dipolmoment_per_Molecule_eAnstrom_i
)
print
(
''
)
dipole_config_set
.
add
(
hash_i
)
proj
.
addProperty
(
hashes
=
[
hash_i
],
values
=
[
dipolmoment_per_Molecule_eAnstrom_i
],
property_key
=
property_key_dipole
)
proj
.
addProperty
(
hashes
=
[
hash_i
],
values
=
[
potentialjump_i
],
property_key
=
property_key_potential_jump
)
dipole_values
=
proj
.
getProperty
(
hashes
=
dipole_config_set
.
hashes
(),
property_key
=
property_key_dipole
)
potentialjump_values
=
proj
.
getProperty
(
hashes
=
dipole_config_set
.
hashes
(),
property_key
=
property_key_potential_jump
)
return
dipole_config_set
,
dipole_values
,
potentialjump_values
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment