Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MDANSE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scientific Software
MDANSE
Commits
3c7e2cc1
Commit
3c7e2cc1
authored
Sep 26, 2018
by
eric pellegrini
Committed by
Remi Perenon
Jan 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored disf with external loop in q
parent
9d752529
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
Src/Framework/Jobs/DynamicIncoherentStructureFactor.py
Src/Framework/Jobs/DynamicIncoherentStructureFactor.py
+34
-29
No files found.
Src/Framework/Jobs/DynamicIncoherentStructureFactor.py
View file @
3c7e2cc1
...
@@ -52,7 +52,7 @@ class DynamicIncoherentStructureFactor(IJob):
...
@@ -52,7 +52,7 @@ class DynamicIncoherentStructureFactor(IJob):
Initialize the input parameters and analysis self variables
Initialize the input parameters and analysis self variables
"""
"""
self
.
numberOfSteps
=
self
.
configuration
[
'atom_selection'
][
'selection_length'
]
self
.
numberOfSteps
=
self
.
configuration
[
"q_vectors"
][
"n_shells"
]
self
.
_nQShells
=
self
.
configuration
[
"q_vectors"
][
"n_shells"
]
self
.
_nQShells
=
self
.
configuration
[
"q_vectors"
][
"n_shells"
]
...
@@ -88,34 +88,41 @@ class DynamicIncoherentStructureFactor(IJob):
...
@@ -88,34 +88,41 @@ class DynamicIncoherentStructureFactor(IJob):
#. atomicSF (numpy.array): The atomic structure factor
#. atomicSF (numpy.array): The atomic structure factor
"""
"""
# get atom index
shell
=
self
.
configuration
[
"q_vectors"
][
"shells"
][
index
]
indexes
=
self
.
configuration
[
'atom_selection'
][
"indexes"
][
index
]
masses
=
self
.
configuration
[
'atom_selection'
][
"masses"
][
index
]
if
not
shell
in
self
.
configuration
[
"q_vectors"
][
"value"
]:
return
index
,
None
else
:
qVectors
=
self
.
configuration
[
"q_vectors"
][
"value"
][
shell
][
"q_vectors"
]
disf_per_q_shell
=
{}
for
element
in
self
.
configuration
[
'atom_selection'
][
'unique_names'
]:
disf_per_q_shell
[
element
]
=
numpy
.
zeros
((
self
.
_nFrames
,),
dtype
=
numpy
.
float
)
for
i
,
atom_indexes
in
enumerate
(
self
.
configuration
[
'atom_selection'
][
"indexes"
]):
masses
=
self
.
configuration
[
'atom_selection'
][
"masses"
][
i
]
element
=
self
.
configuration
[
'atom_selection'
][
"names"
][
i
]
series
=
read_atoms_trajectory
(
self
.
configuration
[
"trajectory"
][
"instance"
],
series
=
read_atoms_trajectory
(
self
.
configuration
[
"trajectory"
][
"instance"
],
indexes
,
atom_
indexes
,
first
=
self
.
configuration
[
'frames'
][
'first'
],
first
=
self
.
configuration
[
'frames'
][
'first'
],
last
=
self
.
configuration
[
'frames'
][
'last'
]
+
1
,
last
=
self
.
configuration
[
'frames'
][
'last'
]
+
1
,
step
=
self
.
configuration
[
'frames'
][
'step'
],
step
=
self
.
configuration
[
'frames'
][
'step'
],
weights
=
masses
)
weights
=
[
masses
]
)
series
=
self
.
configuration
[
'projection'
][
"projector"
](
series
)
series
=
self
.
configuration
[
'projection'
][
"projector"
](
series
)
atomicSF
=
numpy
.
zeros
((
self
.
_nQShells
,
self
.
_nFrames
),
dtype
=
numpy
.
float64
)
for
i
,
q
in
enumerate
(
self
.
configuration
[
"q_vectors"
][
"shells"
]):
if
not
q
in
self
.
configuration
[
"q_vectors"
][
"value"
]:
continue
qVectors
=
self
.
configuration
[
"q_vectors"
][
"value"
][
q
][
"q_vectors"
]
rho
=
numpy
.
exp
(
1j
*
numpy
.
dot
(
series
,
qVectors
))
rho
=
numpy
.
exp
(
1j
*
numpy
.
dot
(
series
,
qVectors
))
res
=
correlation
(
rho
,
axis
=
0
,
average
=
1
)
res
=
correlation
(
rho
,
axis
=
0
,
average
=
1
)
atomicSF
[
i
,:
]
+=
res
disf_per_q_shell
[
element
]
+=
res
return
index
,
atomicSF
return
index
,
disf_per_q_shell
def
combine
(
self
,
index
,
x
):
def
combine
(
self
,
index
,
x
):
...
@@ -126,10 +133,8 @@ class DynamicIncoherentStructureFactor(IJob):
...
@@ -126,10 +133,8 @@ class DynamicIncoherentStructureFactor(IJob):
#. x (any): The returned result(s) of run_step
#. x (any): The returned result(s) of run_step
"""
"""
element
=
self
.
configuration
[
'atom_selection'
][
"names"
][
index
]
for
k
,
v
in
x
.
items
():
self
.
_outputData
[
"f(q,t)_%s"
%
k
][
index
,:]
+=
v
self
.
_outputData
[
"f(q,t)_%s"
%
element
]
+=
x
def
finalize
(
self
):
def
finalize
(
self
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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