Permalink
Browse files

Merge branch 'master' of git://github.com/espressomd/espresso

  • Loading branch information...
2 parents 8871877 + bd5e4e6 commit 77237009a71317c29385fb90d59bad6b7291a375 @RudolfWeeber committed Aug 16, 2011
Showing with 68 additions and 56 deletions.
  1. +1 −1 doc/ug/analysis.tex
  2. +5 −0 doc/ug/inter.tex
  3. +18 −17 doc/ug/setup.tex
  4. +18 −8 scripts/vtf.tcl
  5. +17 −24 src/energy.c
  6. +5 −3 src/p3m.c
  7. +4 −3 src/statistics.h
View
@@ -640,7 +640,7 @@ \section{Analyze groups of particles (molecules)}
length \var{chain\_length} which start with the particle with particle
number \var{chain\_start} and are consecutively numbered (\ie the last
particle in that topology has number $\var{chain\_start} +
-\var{n\_chains}*\var{chain\_length}$).
+\var{n\_chains}*\var{chain\_length} - 1$).
Variant \variant{2} synchronizes topology and particle data, assigning \var{mol\_id} values to particles.
View
@@ -1018,6 +1018,11 @@ \section{Coulomb interaction}
\end{equation}
where $l_B = e_o^2 / (4 \pi \epsilon k_B T)$ denotes the Bjerrum
length, which measures the strength of the electrostatic interaction.
+As a special case, when the internal variable \var{temperature}
+is set to zero, the value of bjerrum length you enter
+is treated as $l_B k_B T$ rather than $l_B$. This occurs when the
+thermostat is switched off and \es performs an NVE integration
+(see also Section~\ref{sec:thermostat}).
Computing electrostatic interactions is computationally very
expensive. \es{} features some state-of-the-art algorithms to deal
View
@@ -134,6 +134,7 @@ \section{\texttt{setmd}: Setting global variables.}
\end{globvar}
\section{\texttt{thermostat}: Setting up the thermostat}
+\label{sec:thermostat}
\newescommand{thermostat}
The \keyword{thermostat} command is used to change settings of the
@@ -149,6 +150,23 @@ \section{\texttt{thermostat}: Setting up the thermostat}
on one by one. Note that there is only one temperature for all
thermostats.
+\begin{essyntax}
+ \variant{1} thermostat
+ \variant{2} thermostat off
+ \variant{3} thermostat \var{parameters}
+\end{essyntax}
+
+Variant \variant{1} returns the thermostat parameters. A TCL list is given containing all
+the parameters needed to set the specific thermostat. (exactly the
+same as the input command line, without the preceding
+\texttt{thermostat}).
+
+Variant \variant{2} turns off all thermostats and sets all thermostat
+variables to zero. Setting temperature to zero also affects the way in which
+electrostatics are handled (see also Section~\ref{sec:inter-electrostatics}).
+
+Variant \variant{3} sets up one of the thermostats described below.
+
\subsection{Langevin thermostat}
\begin{essyntax}
thermostat langevin \var{temperature} \var{gamma}
@@ -326,23 +344,6 @@ \subsection{Isotropic NPT thermostat}
systems nor is it maintained regularly. If you use it and notice
strange behaviour, please contribute to solving the problem.
-\subsection{Turning off all thermostats}
-\begin{essyntax}
- thermostat off
-\end{essyntax}
-
-Turns off all thermostats and sets all thermostat variables to zero.
-
-\subsection{Getting the parameters}
-\begin{essyntax}
- thermostat
-\end{essyntax}
-
-Returns the thermostat parameters. A TCL list is given containing all
-the parameters needed to set the specific thermostat. (exactly the
-same as the input command line, without the preceding
-\texttt{thermostat}).
-
\section{\texttt{nemd}: Setting up non-equilibrium MD}
\newescommand{nemd}
\label{sec:NEMD}
View
@@ -1,11 +1,3 @@
-#############################################################
-# #
-# vtf.tcl #
-# ======= #
-# #
-# Functions that allow writing VTF files. #
-# #
-#############################################################
#
# Copyright (C) 2006,2007,2008,2009,2010,2011 Olaf Lenz
#
@@ -24,6 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+#############################################################
+# #
+# vtf.tcl #
+# ======= #
+# #
+# Functions that allow writing VTF files. #
+# #
+#############################################################
# Write the structure information of the current system to the given file
# OPTIONS:
@@ -149,6 +149,7 @@ proc writevsf { file args } {
set to 0
set prev_type "na"
+ # Output the type
for { set pid 0 } { $pid <= $max_pid } { incr pid } {
if { [part $pid] != "na" } then {
# look for the type
@@ -169,6 +170,15 @@ proc writevsf { file args } {
}
puts $file [get_atom_record $from $to $prev_type]
+ if { [has_feature "ELECTROSTATICS"] } {
+ # Output the charge
+ for { set pid 0 } { $pid <= $max_pid } { incr pid } {
+ if { [part $pid] != "na" } then {
+ puts $file "atom [vtfpid $pid] q [part $pid print q]"
+ }
+ }
+ }
+
# Print bond data
for { set from 0 } { $from <= $max_pid } { incr from } {
if { [part $from] != "na" } then {
View
@@ -260,18 +260,14 @@ static void tclcommand_analyze_print_all(Tcl_Interp *interp)
#if defined(ELECTROSTATICS) || defined(DIPOLES)
if(
-#ifdef ELECTROSTATICS
- coulomb.method != COULOMB_NONE
-#else
- 0
+#if defined(ELECTROSTATICS) && defined(DIPOLES)
+ coulomb.method != COULOMB_NONE || coulomb.Dmethod != DIPOLAR_NONE
+#elif defined(ELECTROSTATICS)
+ coulomb.method != COULOMB_NONE
+#elif defined(DIPOLES)
+ coulomb.Dmethod != DIPOLAR_NONE
#endif
- ||
-#ifdef DIPOLES
- coulomb.Dmethod != DIPOLAR_NONE
-#else
- 0
-#endif
- ) {
+ ) {
/* total Coulomb energy */
value = 0;
for (i = 0; i < total_energy.n_coulomb; i++)
@@ -281,34 +277,31 @@ static void tclcommand_analyze_print_all(Tcl_Interp *interp)
Tcl_PrintDouble(interp, value, buffer);
#if defined(ELECTROSTATICS) && defined(DIPOLES)
-
Tcl_AppendResult(interp, "{ coulomb+magdipoles ", buffer, (char *)NULL);
-
-#else
-
-#ifndef DIPOLES
+#elif defined(ELECTROSTATICS)
Tcl_AppendResult(interp, "{ coulomb ", buffer, (char *)NULL);
-#endif
-
-#ifndef ELECTROSTATICS
+#elif defined(DIPOLES)
Tcl_AppendResult(interp, "{ magdipoles ", buffer, (char *)NULL);
#endif
-#endif
-
/* if it is split up, then print the split up parts */
+#ifdef ELECTROSTATICS
if (total_energy.n_coulomb > 1) {
for (i = 0; i < total_energy.n_coulomb; i++) {
Tcl_PrintDouble(interp, total_energy.coulomb[i], buffer);
Tcl_AppendResult(interp, " ", buffer, (char *)NULL);
}
- }
+ }
+#endif
+
+#ifdef DIPOLES
if (total_energy.n_dipolar > 1) {
for (i = 0; i < total_energy.n_dipolar; i++) {
Tcl_PrintDouble(interp, total_energy.dipolar[i], buffer);
Tcl_AppendResult(interp, " ", buffer, (char *)NULL);
}
}
+#endif
Tcl_AppendResult(interp, " }", (char *)NULL);
}
#endif
@@ -385,7 +378,7 @@ int tclcommand_analyze_parse_and_print_energy(Tcl_Interp *interp, int argc, char
for (i = 0; i < total_energy.n_coulomb; i++)
value += total_energy.coulomb[i];
#else
- Tcl_AppendResult(interp, "ELECTROSTATICS not compiled (see config.h)\n", (char *)NULL);
+ Tcl_AppendResult(interp, "ELECTROSTATICS not compiled (see myconfig.h)\n", (char *)NULL);
#endif
}
else if( ARG0_IS_S("magnetic")) {
@@ -394,7 +387,7 @@ int tclcommand_analyze_parse_and_print_energy(Tcl_Interp *interp, int argc, char
for (i = 0; i < total_energy.n_dipolar; i++)
value += total_energy.dipolar[i];
#else
- Tcl_AppendResult(interp, "DIPOLES not compiled (see config.h)\n", (char *)NULL);
+ Tcl_AppendResult(interp, "DIPOLES not compiled (see myconfig.h)\n", (char *)NULL);
#endif
}
View
@@ -1435,9 +1435,11 @@ double p3m_perform_aliasing_sums_energy(int n[3])
#define P3M_TUNE_MAX_CUTS 50
-/** get the minimal error for this combination of parameters. In fact, the real space error is tuned such that it
- contributes half of the total error, and then the Fourier space error is calculated. Returns the error and the
- optimal alpha, or 0 if this combination does not work at all */
+/** get the minimal error for this combination of parameters. In fact,
+ the real space error is tuned such that it contributes half of the
+ total error, and then the Fourier space error is
+ calculated. Returns the error and the optimal alpha, or 0 if this
+ combination does not work at all */
static double p3m_get_accuracy(int mesh[3], int cao, double r_cut_iL, double *_alpha_L, double *_rs_err, double *_ks_err)
{
double rs_err, ks_err;
View
@@ -34,9 +34,10 @@
/*@{*/
typedef struct {
- /** Status flag for observable calculation.
- For 'analyze energy': 0 re-initialize observable struct, else every thing is fine, calculation can start.
- For 'analyze pressure' and 'analyze p_inst': 0 or !(1+v_comp) re-initialize, else all OK. */
+ /** Status flag for observable calculation. For 'analyze energy': 0
+ re-initialize observable struct, else everything is fine,
+ calculation can start. For 'analyze pressure' and 'analyze
+ p_inst': 0 or !(1+v_comp) re-initialize, else all OK. */
int init_status;
/** Array for observables on each node. */

0 comments on commit 7723700

Please sign in to comment.