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
cb8c51e3
Commit
cb8c51e3
authored
6 years ago
by
Gareth Tribello
Browse files
Options
Downloads
Patches
Plain Diff
Got rid of some of the hard-coded units in the plumed interface
parent
badfdd74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/USER-PLUMED/fix_plumed.cpp
+17
-29
17 additions, 29 deletions
src/USER-PLUMED/fix_plumed.cpp
with
17 additions
and
29 deletions
src/USER-PLUMED/fix_plumed.cpp
+
17
−
29
View file @
cb8c51e3
...
...
@@ -102,39 +102,27 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
// LAMMPS units wrt kj/mol - nm - ps
// Set up units
if
(
force
->
boltz
==
1.
0
)
{
if
(
strcmp
(
update
->
unit_style
,
"lj"
)
==
0
)
{
// LAMMPS units lj
p
->
cmd
(
"setNaturalUnits"
);
}
else
{
// Conversion factor from LAMMPS energy units to kJ mol-1 (units of PLUMED)
double
energyUnits
=
1.0
;
double
lengthUnits
=
1.0
;
double
timeUnits
=
1.0
;
if
(
force
->
boltz
==
0.0019872067
)
{
// LAMMPS units real :: kcal/mol; angstrom; fs
energyUnits
=
4.184
;
lengthUnits
=
0.1
;
timeUnits
=
0.001
;
}
else
if
(
force
->
boltz
==
8.617343e-5
)
{
// LAMMPS units metal :: eV; angstrom; ps
energyUnits
=
96.48530749925792
;
lengthUnits
=
0.1
;
timeUnits
=
1.0
;
}
else
if
(
force
->
boltz
==
1.3806504e-23
)
{
// LAMMPS units si :: Joule, m; s
energyUnits
=
0.001
;
lengthUnits
=
1.e-9
;
timeUnits
=
1.e-12
;
}
else
if
(
force
->
boltz
==
1.3806504e-16
)
{
// LAMMPS units cgs :: erg; cms;, s
energyUnits
=
6.0221418e13
;
lengthUnits
=
1.e-7
;
timeUnits
=
1.e-12
;
}
else
if
(
force
->
boltz
==
3.16681534e-6
)
{
// LAMMPS units electron :: Hartree, bohr, fs
energyUnits
=
2625.5257
;
lengthUnits
=
0.052917725
;
timeUnits
=
0.001
;
}
else
error
->
all
(
FLERR
,
"Odd LAMMPS units, plumed cannot work with that"
);
// LAMMPS units real :: kcal/mol;
if
(
strcmp
(
update
->
unit_style
,
"real"
)
==
0
)
energyUnits
=
4.184
;
// LAMMPS units metal :: eV;
else
if
(
strcmp
(
update
->
unit_style
,
"metal"
)
==
0
)
energyUnits
=
96.48530749925792
;
// LAMMPS units si :: Joule;
else
if
(
strcmp
(
update
->
unit_style
,
"si"
)
==
0
)
energyUnits
=
0.001
;
// LAMMPS units cgs :: erg;
else
if
(
strcmp
(
update
->
unit_style
,
"cgs"
)
==
0
)
energyUnits
=
6.0221418e13
;
// LAMMPS units electron :: Hartree;
else
if
(
strcmp
(
update
->
unit_style
,
"electron"
)
==
0
)
energyUnits
=
2625.5257
;
else
error
->
all
(
FLERR
,
"Odd LAMMPS units, plumed cannot work with that"
);
// Conversion factor from LAMMPS length units to nm (units of PLUMED)
double
lengthUnits
=
0.1
/
force
->
angstrom
;
// Conversion factor from LAMMPS time unit to ps (units of PLUMED)
double
timeUnits
=
0.001
/
force
->
femtosecond
;
p
->
cmd
(
"setMDEnergyUnits"
,
&
energyUnits
);
p
->
cmd
(
"setMDLengthUnits"
,
&
lengthUnits
);
p
->
cmd
(
"setMDTimeUnits"
,
&
timeUnits
);
...
...
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