Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
qbox
qbox-public
Commits
13f0713c
Commit
13f0713c
authored
11 months ago
by
Francois Gygi
Browse files
Options
Download
Email Patches
Plain Diff
Cleanup Atomset.cpp
parent
6b46f047
master
rel1_78_4
rel1_78_3
rel1_78_2
rel1_78_1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/AtomSet.cpp
+17
-34
src/AtomSet.cpp
with
17 additions
and
34 deletions
+17
-34
src/AtomSet.cpp
+
17
-
34
View file @
13f0713c
...
...
@@ -57,9 +57,8 @@ bool AtomSet::addSpecies(Species* sp, string name)
// Check if s and sp are compatible: zval must be equal
if
(
s
->
zval
()
!=
sp
->
zval
()
)
{
cout
<<
" AtomSet::addSpecies: species do not have the same"
<<
" number of valence electrons. Cannot redefine species"
<<
endl
;
return
false
;
throw
runtime_error
(
"AtomSet::addSpecies: species do not have the same"
" number of valence electrons. Cannot redefine species"
);
}
int
is
=
isp_
[
s
->
name
()];
...
...
@@ -92,10 +91,7 @@ bool AtomSet::addAtom(Atom *a)
if
(
findAtom
(
a
->
name
())
)
{
// this name is already in the atom list, reject atom definition
if
(
MPIdata
::
onpe0
()
)
cout
<<
" AtomSet:addAtom: atom "
<<
a
->
name
()
<<
" is already defined"
<<
endl
;
return
false
;
throw
runtime_error
(
"AtomSet::addAtom: atom already defined"
);
}
// check if species is defined
...
...
@@ -104,10 +100,7 @@ bool AtomSet::addAtom(Atom *a)
if
(
!
s
)
{
// species not found, cannot define atom
if
(
MPIdata
::
onpe0
()
)
cout
<<
" AtomSet:addAtom: species "
<<
spname
<<
" is undefined"
<<
endl
;
return
false
;
throw
runtime_error
(
"AtomSet::addAtom: species is undefined"
);
}
// add an atom to the atom_list
...
...
@@ -165,9 +158,7 @@ bool AtomSet::delAtom(string name)
}
// this name was not found in the atom list
if
(
MPIdata
::
onpe0
()
)
cout
<<
" AtomSet:delAtom: no such atom: "
<<
name
<<
endl
;
return
false
;
throw
runtime_error
(
"AtomSet::delAtom: no such atom"
);
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -181,7 +172,7 @@ Atom *AtomSet::findAtom(string name) const
return
atom_list
[
is
][
ia
];
}
}
return
0
;
return
nullptr
;
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -191,7 +182,7 @@ Species *AtomSet::findSpecies(string name) const
if
(
is
>=
0
)
return
species_list
[
is
];
else
return
0
;
return
nullptr
;
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -295,25 +286,17 @@ bool AtomSet::reset(void)
atom_list
.
resize
(
0
);
species_list
.
resize
(
0
);
spname
.
resize
(
0
);
for
(
map
<
string
,
int
>::
iterator
i
=
na_
.
begin
();
i
!=
na_
.
end
();
i
++
)
na_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
isp_
.
begin
();
i
!=
isp_
.
end
();
i
++
)
isp_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
is_
.
begin
();
i
!=
is_
.
end
();
i
++
)
is_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
na_
.
begin
();
i
!=
na_
.
end
();
++
i
)
na_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
ia_
.
begin
();
i
!=
ia_
.
end
();
i
++
)
ia_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
isp_
.
begin
();
i
!=
isp_
.
end
();
++
i
)
isp_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
is_
.
begin
();
i
!=
is_
.
end
();
++
i
)
is_
.
erase
(
i
);
for
(
map
<
string
,
int
>::
iterator
i
=
ia_
.
begin
();
i
!=
ia_
.
end
();
++
i
)
ia_
.
erase
(
i
);
nel_
=
0
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets