Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
ec43b0af
Commit
ec43b0af
authored
5 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] Fixed DataSet creation from .xyz input files.
parent
bd127a4e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/DataSet/DataSet.h
+0
-1
0 additions, 1 deletion
src/DataSet/DataSet.h
src/Reader/XYZReader.cpp
+7
-19
7 additions, 19 deletions
src/Reader/XYZReader.cpp
with
7 additions
and
20 deletions
src/DataSet/DataSet.h
+
0
−
1
View file @
ec43b0af
...
@@ -376,7 +376,6 @@ namespace lib4neuro {
...
@@ -376,7 +376,6 @@ namespace lib4neuro {
*/
*/
LIB4NEURO_API
void
MPI_gather_data_on_master
(
);
LIB4NEURO_API
void
MPI_gather_data_on_master
(
);
[[
nodiscard
]]
LIB4NEURO_API
arma
::
Mat
<
double
>*
get_inputs_matrix
();
[[
nodiscard
]]
LIB4NEURO_API
arma
::
Mat
<
double
>*
get_inputs_matrix
();
[[
nodiscard
]]
LIB4NEURO_API
arma
::
Mat
<
double
>*
get_outputs_matrix
();
[[
nodiscard
]]
LIB4NEURO_API
arma
::
Mat
<
double
>*
get_outputs_matrix
();
...
...
This diff is collapsed.
Click to expand it.
src/Reader/XYZReader.cpp
+
7
−
19
View file @
ec43b0af
...
@@ -208,34 +208,27 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY
...
@@ -208,34 +208,27 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY
/* Save Cartesian coordinates into the vector */
/* Save Cartesian coordinates into the vector */
for
(
auto
el
:
*
this
->
element_list
)
{
/* Iterate over particles */
for
(
auto
el
:
*
this
->
element_list
)
{
/* Iterate over particles */
for
(
unsigned
int
i
=
0
;
i
<
n_coords_per_particle
;
i
++
)
{
/* Iterate over all coordinates of a single particle */
for
(
unsigned
int
i
=
0
;
i
<
n_coords_per_particle
;
i
++
)
{
/* Iterate over all coordinates of a single particle */
if
(
this
->
ignore_charge
&&
i
<
3
)
{
/* Skip charge */
cartesian_coords
.
at
(
i
)
=
configuration
.
first
.
at
(
idx
);
cartesian_coords
.
at
(
i
)
=
configuration
.
first
.
at
(
idx
);
}
idx
++
;
idx
++
;
}
}
if
(
this
->
ignore_charge
)
{
idx
++
;
//skips charge - TODO add support for charge!
}
particles
.
emplace_back
(
std
::
make_pair
(
el
,
cartesian_coords
));
particles
.
emplace_back
(
std
::
make_pair
(
el
,
cartesian_coords
));
}
}
// std::vector<std::vector<double>> coords_check;
// std::vector<double> single_coords_check;
/* Transform Cartesian coordinates into ACSFs */
/* Transform Cartesian coordinates into ACSFs */
std
::
vector
<
double
>
single_particle_coords
;
std
::
vector
<
double
>
single_particle_coords
;
// double coord_val;
std
::
vector
<
std
::
pair
<
ELEMENT_SYMBOL
,
std
::
vector
<
double
>>>
acsf_coords_prep
;
std
::
vector
<
std
::
pair
<
ELEMENT_SYMBOL
,
std
::
vector
<
double
>>>
acsf_coords_prep
;
for
(
size_t
i
=
0
;
i
<
particles
.
size
();
i
++
)
{
/* Iterate over all the particles */
for
(
size_t
i
=
0
;
i
<
particles
.
size
();
i
++
)
{
/* Iterate over all the particles */
// single_coords_check.clear();
single_particle_coords
.
clear
();
single_particle_coords
.
clear
();
/* Compute vector of ACSF coordinates for a single particle */
/* Compute vector of ACSF coordinates for a single particle */
for
(
auto
sym_func
:
*
element_description
[
particles
.
at
(
i
).
first
]
->
getSymmetryFunctions
())
{
for
(
auto
sym_func
:
*
element_description
[
particles
.
at
(
i
).
first
]
->
getSymmetryFunctions
())
{
// coord_val = sym_func->eval(i, particles);
// acsf_coords.emplace_back(coord_val);
// single_coords_check.emplace_back(coord_val);
single_particle_coords
.
emplace_back
(
sym_func
->
eval
(
i
,
particles
));
single_particle_coords
.
emplace_back
(
sym_func
->
eval
(
i
,
particles
));
}
}
// coords_check.emplace_back(single_coords_check);
/* Store coordinates in a canonic order */
/* Store coordinates in a canonic order */
unsigned
int
element_ind
=
0
;
unsigned
int
element_ind
=
0
;
...
@@ -256,9 +249,6 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY
...
@@ -256,9 +249,6 @@ void lib4neuro::XYZReader::transform_input_to_acsf(std::unordered_map<ELEMENT_SY
break
;
break
;
}
}
// std::cout << arma::norm(arma::conv_to<arma::Col<double>>::from(single_particle_coords)) << " "
// << arma::norm(arma::conv_to<arma::Col<double>>::from(acsf_coords_prep.at(element_ind-1).second)) << std::endl;
if
(
arma
::
norm
(
arma
::
conv_to
<
arma
::
Col
<
double
>>::
from
(
single_particle_coords
))
>
if
(
arma
::
norm
(
arma
::
conv_to
<
arma
::
Col
<
double
>>::
from
(
single_particle_coords
))
>
arma
::
norm
(
arma
::
conv_to
<
arma
::
Col
<
double
>>::
from
(
acsf_coords_prep
.
at
(
element_ind
-
1
).
second
)))
{
arma
::
norm
(
arma
::
conv_to
<
arma
::
Col
<
double
>>::
from
(
acsf_coords_prep
.
at
(
element_ind
-
1
).
second
)))
{
break
;
break
;
...
@@ -317,9 +307,7 @@ lib4neuro::ELEMENT_SYMBOL lib4neuro::XYZReader::get_element_symbol(std::string s
...
@@ -317,9 +307,7 @@ lib4neuro::ELEMENT_SYMBOL lib4neuro::XYZReader::get_element_symbol(std::string s
std
::
shared_ptr
<
lib4neuro
::
DataSet
>
std
::
shared_ptr
<
lib4neuro
::
DataSet
>
lib4neuro
::
XYZReader
::
get_acsf_data_set
(
std
::
unordered_map
<
ELEMENT_SYMBOL
,
Element
*>&
element_description
)
{
lib4neuro
::
XYZReader
::
get_acsf_data_set
(
std
::
unordered_map
<
ELEMENT_SYMBOL
,
Element
*>&
element_description
)
{
// if(acsf_data_set == nullptr) {
this
->
transform_input_to_acsf
(
element_description
);
this
->
transform_input_to_acsf
(
element_description
);
// }
return
this
->
acsf_data_set
;
return
this
->
acsf_data_set
;
}
}
...
...
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