Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
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
Container Registry
Model registry
Operate
Environments
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
multiscale
lammps
Commits
8e9d4f5b
Commit
8e9d4f5b
authored
6 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
modify bond style hybrid, so it can handle bond style quartic as a sub-style
parent
f68d77c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bond_hybrid.cpp
+20
-0
20 additions, 0 deletions
src/bond_hybrid.cpp
src/bond_hybrid.h
+1
-1
1 addition, 1 deletion
src/bond_hybrid.h
with
21 additions
and
1 deletion
src/bond_hybrid.cpp
+
20
−
0
View file @
8e9d4f5b
...
@@ -33,6 +33,7 @@ BondHybrid::BondHybrid(LAMMPS *lmp) : Bond(lmp)
...
@@ -33,6 +33,7 @@ BondHybrid::BondHybrid(LAMMPS *lmp) : Bond(lmp)
{
{
writedata
=
0
;
writedata
=
0
;
nstyles
=
0
;
nstyles
=
0
;
has_quartic
=
-
1
;
}
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
...
@@ -171,6 +172,7 @@ void BondHybrid::settings(int narg, char **arg)
...
@@ -171,6 +172,7 @@ void BondHybrid::settings(int narg, char **arg)
delete
[]
styles
;
delete
[]
styles
;
for
(
int
i
=
0
;
i
<
nstyles
;
i
++
)
delete
[]
keywords
[
i
];
for
(
int
i
=
0
;
i
<
nstyles
;
i
++
)
delete
[]
keywords
[
i
];
delete
[]
keywords
;
delete
[]
keywords
;
has_quartic
=
-
1
;
}
}
if
(
allocated
)
{
if
(
allocated
)
{
...
@@ -214,14 +216,26 @@ void BondHybrid::settings(int narg, char **arg)
...
@@ -214,14 +216,26 @@ void BondHybrid::settings(int narg, char **arg)
i
=
0
;
i
=
0
;
while
(
i
<
narg
)
{
while
(
i
<
narg
)
{
for
(
m
=
0
;
m
<
nstyles
;
m
++
)
for
(
m
=
0
;
m
<
nstyles
;
m
++
)
if
(
strcmp
(
arg
[
i
],
keywords
[
m
])
==
0
)
if
(
strcmp
(
arg
[
i
],
keywords
[
m
])
==
0
)
error
->
all
(
FLERR
,
"Bond style hybrid cannot use same bond style twice"
);
error
->
all
(
FLERR
,
"Bond style hybrid cannot use same bond style twice"
);
if
(
strcmp
(
arg
[
i
],
"hybrid"
)
==
0
)
if
(
strcmp
(
arg
[
i
],
"hybrid"
)
==
0
)
error
->
all
(
FLERR
,
"Bond style hybrid cannot have hybrid as an argument"
);
error
->
all
(
FLERR
,
"Bond style hybrid cannot have hybrid as an argument"
);
if
(
strcmp
(
arg
[
i
],
"none"
)
==
0
)
error
->
all
(
FLERR
,
"Bond style hybrid cannot have none as an argument"
);
if
(
strcmp
(
arg
[
i
],
"none"
)
==
0
)
if
(
strcmp
(
arg
[
i
],
"none"
)
==
0
)
error
->
all
(
FLERR
,
"Bond style hybrid cannot have none as an argument"
);
error
->
all
(
FLERR
,
"Bond style hybrid cannot have none as an argument"
);
// register index of quartic bond type,
// so that bond type 0 can be mapped to it
if
(
strncmp
(
arg
[
i
],
"quartic"
,
7
)
==
0
)
has_quartic
=
m
;
styles
[
nstyles
]
=
force
->
new_bond
(
arg
[
i
],
1
,
dummy
);
styles
[
nstyles
]
=
force
->
new_bond
(
arg
[
i
],
1
,
dummy
);
force
->
store_style
(
keywords
[
nstyles
],
arg
[
i
],
0
);
force
->
store_style
(
keywords
[
nstyles
],
arg
[
i
],
0
);
...
@@ -283,6 +297,12 @@ void BondHybrid::init_style()
...
@@ -283,6 +297,12 @@ void BondHybrid::init_style()
{
{
for
(
int
m
=
0
;
m
<
nstyles
;
m
++
)
for
(
int
m
=
0
;
m
<
nstyles
;
m
++
)
if
(
styles
[
m
])
styles
[
m
]
->
init_style
();
if
(
styles
[
m
])
styles
[
m
]
->
init_style
();
// bond style quartic will set broken bonds to bond type 0, so we need
// to create an entry for it in the bond type to sub-style map
if
(
has_quartic
>=
0
)
map
[
0
]
=
has_quartic
;
}
}
/* ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/bond_hybrid.h
+
1
−
1
View file @
8e9d4f5b
...
@@ -47,7 +47,7 @@ class BondHybrid : public Bond {
...
@@ -47,7 +47,7 @@ class BondHybrid : public Bond {
private:
private:
int
*
map
;
// which style each bond type points to
int
*
map
;
// which style each bond type points to
int
has_quartic
;
// which style, if any is a quartic bond style
int
*
nbondlist
;
// # of bonds in sub-style bondlists
int
*
nbondlist
;
// # of bonds in sub-style bondlists
int
*
maxbond
;
// max # of bonds sub-style lists can store
int
*
maxbond
;
// max # of bonds sub-style lists can store
int
***
bondlist
;
// bondlist for each sub-style
int
***
bondlist
;
// bondlist for each sub-style
...
...
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