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
398f3173
Commit
398f3173
authored
6 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
remove trailing whitespace
parent
798fcacd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/Developer/developer.tex
+10
-10
10 additions, 10 deletions
doc/src/Developer/developer.tex
with
10 additions
and
10 deletions
doc/src/Developer/developer.tex
+
10
−
10
View file @
398f3173
...
@@ -449,15 +449,15 @@ Writing fixes is a flexible way of extending LAMMPS. Users can
...
@@ -449,15 +449,15 @@ Writing fixes is a flexible way of extending LAMMPS. Users can
implement many things using fixes:
implement many things using fixes:
\begin{itemize}
\begin{itemize}
\item
changing particles attributes (positions, velocities, forces, etc.).
\item
changing particles attributes (positions, velocities, forces, etc.).
Example: FixFreeze.
Example: FixFreeze.
\item
reading/writing data. Example: FixRestart.
\item
reading/writing data. Example: FixRestart.
\item
implementing boundary conditions. Example: FixWall.
\item
implementing boundary conditions. Example: FixWall.
\item
saving information about particles for future use (previous positions,
\item
saving information about particles for future use (previous positions,
for instance). Example: FixStoreState.
for instance). Example: FixStoreState.
\end{itemize}
\end{itemize}
All fixes are derived from class Fix and must have constructor with the
All fixes are derived from class Fix and must have constructor with the
signature: FixMine(class LAMMPS *, int, char **).
signature: FixMine(class LAMMPS *, int, char **).
Every fix must be registered in LAMMPS by writing the following lines
Every fix must be registered in LAMMPS by writing the following lines
...
@@ -478,7 +478,7 @@ included in the file "style\_fix.h". In case if you use LAMMPS make,
...
@@ -478,7 +478,7 @@ included in the file "style\_fix.h". In case if you use LAMMPS make,
this file is generated automatically - all files starting with prefix
this file is generated automatically - all files starting with prefix
fix
\_
are included, so call your header the same way. Otherwise, donÕt
fix
\_
are included, so call your header the same way. Otherwise, donÕt
forget to add your include into "style
\_
fix.h".
forget to add your include into "style
\_
fix.h".
Let's write a simple fix which will print average velocity at the end
Let's write a simple fix which will print average velocity at the end
of each timestep. First of all, implement a constructor:
of each timestep. First of all, implement a constructor:
...
@@ -487,11 +487,11 @@ of each timestep. First of all, implement a constructor:
...
@@ -487,11 +487,11 @@ of each timestep. First of all, implement a constructor:
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
: Fix(lmp, narg, arg)
: Fix(lmp, narg, arg)
{
{
if (narg < 4)
if (narg < 4)
error->all(FLERR,"Illegal fix print command");
error->all(FLERR,"Illegal fix print command");
nevery = atoi(arg[3]);
nevery = atoi(arg[3]);
if (nevery <= 0)
if (nevery <= 0)
error->all(FLERR,"Illegal fix print command");
error->all(FLERR,"Illegal fix print command");
}
}
\end{verbatim}
\end{verbatim}
...
@@ -545,7 +545,7 @@ void FixPrintVel::end_of_step()
...
@@ -545,7 +545,7 @@ void FixPrintVel::end_of_step()
{
{
// for add3, scale3
// for add3, scale3
using namespace MathExtra;
using namespace MathExtra;
double** v = atom->v;
double** v = atom->v;
int nlocal = atom->nlocal;
int nlocal = atom->nlocal;
double localAvgVel[4]; // 4th element for particles count
double localAvgVel[4]; // 4th element for particles count
...
@@ -559,7 +559,7 @@ void FixPrintVel::end_of_step()
...
@@ -559,7 +559,7 @@ void FixPrintVel::end_of_step()
MPI
_
Allreduce(localAvgVel, globalAvgVel, 4, MPI
_
DOUBLE, MPI
_
SUM, world);
MPI
_
Allreduce(localAvgVel, globalAvgVel, 4, MPI
_
DOUBLE, MPI
_
SUM, world);
scale3(1.0 / globalAvgVel[3], globalAvgVel);
scale3(1.0 / globalAvgVel[3], globalAvgVel);
if (comm->me == 0)
{
if (comm->me == 0)
{
printf("
\%
e,
\%
e,
\%
e
\n
",
printf("
\%
e,
\%
e,
\%
e
\n
",
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
}
}
}
}
...
@@ -671,7 +671,7 @@ int FixSavePos::pack_exchange(int i, double *buf)
...
@@ -671,7 +671,7 @@ int FixSavePos::pack_exchange(int i, double *buf)
buf[m++] = x[i][0];
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = x[i][2];
return m;
return m;
}
}
...
...
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