Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MODELS
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tadah
MODELS
Commits
3a902209
Commit
3a902209
authored
3 months ago
by
mkirsz
Browse files
Options
Downloads
Patches
Plain Diff
For some flexibility...
parent
7346a316
No related branches found
Branches containing commit
No related tags found
1 merge request
!15
added bitmap for checking is calc initalised for atoms, fixed return to...
Pipeline
#49842
passed
3 months ago
Stage: build_debug
Stage: run_unit_tests
Stage: build_release
Stage: trigger
Pipeline: MD
#49844
Pipeline: MLIP
#49843
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/d2_base.cpp
+5
-0
5 additions, 0 deletions
src/d2_base.cpp
src/d_base.cpp
+26
-4
26 additions, 4 deletions
src/d_base.cpp
src/dm_base.cpp
+6
-1
6 additions, 1 deletion
src/dm_base.cpp
with
37 additions
and
5 deletions
src/d2_base.cpp
+
5
−
0
View file @
3a902209
#include
<tadah/models/descriptors/d2/d2_base.h>
std
::
vector
<
std
::
string
>
D2_Base
::
get_init_atoms
(
Config
&
c
)
{
if
(
!
c
.
exist
(
"TYPE2B"
))
{
std
::
cerr
<<
"Warning: TYPE2B key was not found. "
"Atom pairs must be initialized manually."
<<
std
::
endl
;
return
{};
}
std
::
vector
<
std
::
string
>
init_atoms
(
c
.
size
(
"TYPE2B"
));
c
.
get
(
"TYPE2B"
,
init_atoms
);
init_atoms
.
erase
(
init_atoms
.
begin
(),
init_atoms
.
begin
()
+
nparams
+
1
);
...
...
This diff is collapsed.
Click to expand it.
src/d_base.cpp
+
26
−
4
View file @
3a902209
...
...
@@ -115,10 +115,32 @@ void D_Base::init_for_atoms(const std::vector<std::string> &Zs) {
if
(
Zs
.
size
()
%
2
!=
0
)
{
throw
std
::
invalid_argument
(
"The vector size must be even."
);
}
for
(
size_t
i
=
0
;
i
<
Zs
.
size
();
i
+=
2
)
{
int
Zi
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
]).
Z
;
int
Zj
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
+
1
]).
Z
;
init_for_atoms
(
Zi
,
Zj
);
for
(
size_t
i
=
0
;
i
<
Zs
.
size
();
i
+=
2
)
{
if
(
Zs
[
i
]
==
"*"
&&
is_number
(
Zs
[
i
+
1
]))
{
int
Zj
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
+
1
]).
Z
;
for
(
int
Zi
=
1
;
Zi
<
119
;
++
Zi
)
{
init_for_atoms
(
Zi
,
Zj
);
}
}
else
if
(
Zs
[
i
+
1
]
==
"*"
&&
is_number
(
Zs
[
i
]))
{
int
Zi
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
]).
Z
;
for
(
int
Zj
=
1
;
Zj
<
119
;
++
Zj
)
{
init_for_atoms
(
Zi
,
Zj
);
}
}
else
if
(
Zs
[
i
]
==
"*"
&&
Zs
[
i
+
1
]
==
"*"
)
{
for
(
int
Zi
=
1
;
Zi
<
119
;
++
Zi
)
{
for
(
int
Zj
=
Zi
;
Zj
<
119
;
++
Zj
)
{
init_for_atoms
(
Zi
,
Zj
);
}
}
}
else
{
int
Zi
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
]).
Z
;
int
Zj
=
PeriodicTable
::
find_by_symbol
(
Zs
[
i
+
1
]).
Z
;
init_for_atoms
(
Zi
,
Zj
);
}
}
}
std
::
vector
<
std
::
string
>
D_Base
::
get_init_atoms
(
Config
&
c
,
std
::
string
type
)
{
...
...
This diff is collapsed.
Click to expand it.
src/dm_base.cpp
+
6
−
1
View file @
3a902209
...
...
@@ -3,8 +3,13 @@ void DM_Base::set_rfidx(size_t rfidx_) { rfidx=rfidx_; }
size_t
DM_Base
::
get_rfidx
()
{
return
rfidx
;
}
std
::
vector
<
std
::
string
>
DM_Base
::
get_init_atoms
(
Config
&
c
)
{
if
(
!
c
.
exist
(
"TYPEMB"
))
{
std
::
cerr
<<
"Warning: TYPEMB key was not found. "
"Atom pairs must be initialized manually."
<<
std
::
endl
;
return
{};
}
std
::
vector
<
std
::
string
>
init_atoms
(
c
.
size
(
"TYPEMB"
));
c
.
get
(
"TYPEMB"
,
init_atoms
);
init_atoms
.
erase
(
init_atoms
.
begin
(),
init_atoms
.
begin
()
+
nparams
+
1
);
init_atoms
.
erase
(
init_atoms
.
begin
(),
init_atoms
.
begin
()
+
nparams
+
1
);
return
init_atoms
;
}
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