Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed comfixed for pbc

  • Loading branch information...
commit b3f77012eedfbe29a689c2f5bbac4dfd11e7f337 1 parent 00e4f0f
@arnolda arnolda authored
View
2  NEWS
@@ -31,6 +31,8 @@ New user-visible features
User-visible changes
--------------------
+* comfixed now works with periodic boundary conditions.
+
* The pressure contribution due to rigid bodies constructed by means of the
virtual sites relative mechanism is included, both for pressure and stress
tensor. Note that the corresponding contribution for rigid bonds is still not implemented.
View
14 doc/ug/inter.tex
@@ -2072,14 +2072,22 @@ \subsection{Fixing the center of mass}
all the forces acting on particles of type \var{typeid1} are
calculated. These include all the forces due to other interaction
types and also the thermostat. Next a force equal in magnitude, but in
-the oppositte direction is applied on the particles. This force is
-divided equally on all the particles of type \var{typeid1}, since
-currently there is no mass concept in \es. Note that the syntax of the
+the opposite direction is applied to all the particles. This force is
+divided on the particles of type \var{typeid1} relative to
+their respective mass. Under periodic boundary conditions, this fixes
+the itinerant center of mass, that is, the one obtained from the
+unfolded coordinates.
+
+Note that the syntax of the
declaration of comfixed interaction requires the same particle type to
be input twice. If different particle types are given in the input,
the program exits with an error message. \var{flag} can be set to 1
(which turns on the interaction) or 0 (to turn off the interaction).
+
+Since the necessary communication is lacking at present, this interaction
+only works on a single node.
+
\subsection{Pulling particles apart}
\begin{essyntax}
inter \var{typeid1} \var{typeid2}
View
4 src/comfixed.cpp
@@ -43,10 +43,6 @@ int comfixed_set_params(int part_type_a, int part_type_b, int flag)
if (n_nodes > 1)
return 2;
- if (PERIODIC(0) || PERIODIC(1) || PERIODIC(2)) {
- return 3;
- }
-
data->COMFIXED_flag = flag;
/* broadcast interaction parameters */
View
5 src/forces.cpp
@@ -149,11 +149,6 @@ void force_calc()
#if defined(LB_GPU) || (defined(ELECTROSTATICS) && defined(CUDA))
copy_forces_from_GPU();
#endif
-
-/* this must be the last force to be calculated (Mehmet)*/
-#ifdef COMFIXED
- calc_comfixed();
-#endif
}
View
10 src/integrate.cpp
@@ -221,6 +221,11 @@ void integrate_vv(int n_steps)
calc_and_apply_mol_constraints();
#endif
+ /* should be pretty late, since it needs to zero out the total force */
+#ifdef COMFIXED
+ calc_comfixed();
+#endif
+
rescale_forces();
recalc_forces = 0;
@@ -339,6 +344,11 @@ void integrate_vv(int n_steps)
calc_and_apply_mol_constraints();
#endif
+ /* should be pretty late, since it needs to zero out the total force */
+#ifdef COMFIXED
+ calc_comfixed();
+#endif
+
if (check_runtime_errors())
break;
View
3  src/tcl/comfixed_tcl.cpp
@@ -71,9 +71,6 @@ int tclcommand_inter_parse_comfixed(Tcl_Interp * interp,
case 2:
Tcl_AppendResult(interp, "works only with a single CPU", (char *) NULL);
return 0;
- case 3:
- Tcl_AppendResult(interp, "works only with non periodic BC", (char *) NULL);
- return 0;
}
return 2;
Please sign in to comment.
Something went wrong with that request. Please try again.