Skip to content
Snippets Groups Projects
Commit 398f3173 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

remove trailing whitespace

parent 798fcacd
No related branches found
No related tags found
No related merge requests found
...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment