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
87a6c136
Commit
87a6c136
authored
8 years ago
by
sjplimp
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@15356
f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent
cff65b95
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Makefile
+3
-1
3 additions, 1 deletion
src/Makefile
src/library.cpp
+29
-0
29 additions, 0 deletions
src/library.cpp
src/library.h
+2
-0
2 additions, 0 deletions
src/library.h
with
34 additions
and
1 deletion
src/Makefile
+
3
−
1
View file @
87a6c136
# LAMMPS multiple-machine -*- Makefile -*-
SHELL
=
/bin/bash
PYTHON
=
python
#.IGNORE:
# Definitions
...
...
@@ -198,7 +200,7 @@ mpi-stubs:
# install LAMMPS shared lib and Python wrapper for Python usage
install-python
:
@
python
../python/install.py
@
$(
PYTHON
)
../python/install.py
# Create a tarball of src dir and packages
...
...
This diff is collapsed.
Click to expand it.
src/library.cpp
+
29
−
0
View file @
87a6c136
...
...
@@ -28,6 +28,8 @@
#include
"input.h"
#include
"variable.h"
#include
"modify.h"
#include
"output.h"
#include
"thermo.h"
#include
"compute.h"
#include
"fix.h"
#include
"comm.h"
...
...
@@ -149,9 +151,19 @@ void *lammps_extract_global(void *ptr, char *name)
if
(
strcmp
(
name
,
"xz"
)
==
0
)
return
(
void
*
)
&
lmp
->
domain
->
xz
;
if
(
strcmp
(
name
,
"yz"
)
==
0
)
return
(
void
*
)
&
lmp
->
domain
->
yz
;
if
(
strcmp
(
name
,
"natoms"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
natoms
;
if
(
strcmp
(
name
,
"nbonds"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
nbonds
;
if
(
strcmp
(
name
,
"nangles"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
nangles
;
if
(
strcmp
(
name
,
"ndihedrals"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
ndihedrals
;
if
(
strcmp
(
name
,
"nimpropers"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
nimpropers
;
if
(
strcmp
(
name
,
"nlocal"
)
==
0
)
return
(
void
*
)
&
lmp
->
atom
->
nlocal
;
if
(
strcmp
(
name
,
"ntimestep"
)
==
0
)
return
(
void
*
)
&
lmp
->
update
->
ntimestep
;
// NOTE: we cannot give access to the thermo "time" data by reference,
// as that is a recomputed property. only "atime" can be provided as pointer.
// please use lammps_get_thermo() defined below to access all supported
// thermo keywords by value
if
(
strcmp
(
name
,
"atime"
)
==
0
)
return
(
void
*
)
&
lmp
->
update
->
atime
;
return
NULL
;
}
...
...
@@ -383,6 +395,23 @@ int lammps_set_variable(void *ptr, char *name, char *str)
return
err
;
}
/* ----------------------------------------------------------------------
return the current value of a thermo keyword as double.
unlike lammps_extract_global() this does not give access to the
storage of the data in question, and thus needs to be called
again to retrieve an updated value. The upshot is that it allows
accessing information that is only computed on-the-fly.
------------------------------------------------------------------------- */
double
lammps_get_thermo
(
void
*
ptr
,
char
*
name
)
{
LAMMPS
*
lmp
=
(
LAMMPS
*
)
ptr
;
double
dval
;
lmp
->
output
->
thermo
->
evaluate_keyword
(
name
,
&
dval
);
return
dval
;
}
/* ----------------------------------------------------------------------
return the total number of atoms in the system
useful before call to lammps_get_atoms() so can pre-allocate vector
...
...
This diff is collapsed.
Click to expand it.
src/library.h
+
2
−
0
View file @
87a6c136
...
...
@@ -39,7 +39,9 @@ void *lammps_extract_fix(void *, char *, int, int, int, int);
void
*
lammps_extract_variable
(
void
*
,
char
*
,
char
*
);
int
lammps_set_variable
(
void
*
,
char
*
,
char
*
);
double
lammps_get_thermo
(
void
*
,
char
*
);
int
lammps_get_natoms
(
void
*
);
void
lammps_gather_atoms
(
void
*
,
char
*
,
int
,
int
,
void
*
);
void
lammps_scatter_atoms
(
void
*
,
char
*
,
int
,
int
,
void
*
);
...
...
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