diff --git a/.cproject b/.cproject
new file mode 100644
index 00000000000..6133cfedb98
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ make
+ -k -j12
+ check
+ false
+ true
+ true
+
+
+ make
+ -k -j12
+ check processors="4"
+ false
+ true
+ true
+
+
+ make
+ -k -j12
+ clean
+ false
+ true
+ true
+
+
+ make
+ -k -j12
+ distcheck
+ false
+ true
+ true
+
+
+ make
+ -k -j12
+ distclean
+ false
+ true
+ false
+
+
+ make
+ -k -j12
+ doc
+ false
+ true
+ true
+
+
+ make
+ -k -j12
+ all
+ false
+ true
+ true
+
+
+ make
+ -k
+ all
+ false
+ false
+ true
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 3cb0dae5cbc..b83a7281b30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ tools/es_mpiexec
src/libEspresso.a
Espresso
Espresso.install
+build.eclipse
# Espresso output
*.end
diff --git a/.project b/.project
new file mode 100644
index 00000000000..67e6cff74df
--- /dev/null
+++ b/.project
@@ -0,0 +1,55 @@
+
+
+ ESPResSo
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+ org.eclipse.ui.externaltools.ExternalToolBuilder
+ full,incremental,
+
+
+ LaunchConfigHandle
+ <project>/.externalToolBuilders/net.sourceforge.texlipse.builder.TexlipseBuilder.launch
+
+
+
+
+ org.python.pydev.PyDevBuilder
+
+
+
+
+
+ net.sourceforge.texlipse.builder.TexlipseNature
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ org.python.pydev.pythonNature
+
+
+
+ 1401874441371
+
+ 30
+
+ org.eclipse.ui.ide.multiFilter
+ 1.0-projectRelativePath-matches-false-false-build.eclipse/espresso-*
+
+
+
+
diff --git a/.settings/org.eclipse.cdt.codan.core.prefs b/.settings/org.eclipse.cdt.codan.core.prefs
new file mode 100644
index 00000000000..77386c23cbe
--- /dev/null
+++ b/.settings/org.eclipse.cdt.codan.core.prefs
@@ -0,0 +1,67 @@
+eclipse.preferences.version=1
+org.eclipse.cdt.codan.checkers.errnoreturn=Warning
+org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
+org.eclipse.cdt.codan.checkers.errreturnvalue=Error
+org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.checkers.noreturn=Error
+org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false}
+org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
+org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true}
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false}
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false}
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")}
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
diff --git a/.settings/org.eclipse.cdt.ui.prefs b/.settings/org.eclipse.cdt.ui.prefs
new file mode 100644
index 00000000000..4ee12a4ba78
--- /dev/null
+++ b/.settings/org.eclipse.cdt.ui.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+formatter_settings_version=1
diff --git a/.settings/org.eclipse.core.runtime.prefs b/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..11bfbcd5d3a
--- /dev/null
+++ b/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,3 @@
+content-types/enabled=true
+content-types/org.eclipse.cdt.core.cxxSource/file-extensions=cu
+eclipse.preferences.version=1
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000000..223535f9492
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,36 @@
+language: cpp
+
+before_install:
+ - sudo apt-get update
+ - sudo apt-get install tcl-dev #cython python-numpy
+ - if [ "$with_mpi" != false ]; then sudo apt-get install libopenmpi-dev openmpi-bin; fi
+ - if [ "$with_fftw" != false ]; then sudo apt-get install libfftw3-dev; fi
+
+env:
+ - myconfig=default
+ - myconfig=maxset
+ - myconfig=molcut
+ - myconfig=rest1
+ - myconfig=rest2
+ - make_check=false myconfig=nocheck-maxset
+ - with_fftw=false with_mpi=false myconfig=maxset
+
+compiler:
+ - gcc
+
+matrix:
+ include:
+ - compiler: clang
+ env: with-mpi=false myconfig=default
+ - compiler: clang
+ env: with-mpi=false myconfig=maxset
+ - compiler: clang
+ env: with-mpi=false myconfig=molcut
+ - compiler: clang
+ env: with-mpi=false myconfig=rest1
+ - compiler: clang
+ env: with-mpi=false myconfig=rest2
+ - compiler: clang
+ env: with-mpi=false make_check=false myconfig=nocheck-maxset
+
+script: ./maintainer/travis/build.sh
diff --git a/AUTHORS b/AUTHORS
index a53315a6b7c..27a9eff8cb1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,6 +12,7 @@ Core developers
---------------
Axel Arnold
Olaf Lenz (maintainer)
+Florian Weik
Stefan Kesselheim
Bernward Mann (deceased 2006)
@@ -26,44 +27,61 @@ Alexander Schlaich
Arjit Maitra
Ben Reynwar (formerly: Reynolds)
Christoph Schneider
+David Schwörer
Dmitro Galperin
Dmytro Antypov
Dominic Röhm
+Elena Minina
Florian Fahrenberger (formerly: Rühle)
-Florian Weik
Florian Häußermann
Francesca Lugli
Frank Mühlbach
Georg Rempfer
Gizem Inci
Gregoria Illya
-Igor Pasichny
+Hamid Zaheri
+Henri Menke
+Igor Pasichnyk
Ira Cooke
+Ivan Cimrak
+Iveta Jancigova
Joan Josep Cerdà
Jon Halverson
+Joost de Graaf
+Josh Berryman
Kai Grass
Kai Kratzer
+Kai Szuttor
Karen Johnston
Konrad Breitsprecher
+Lukas Fischer
Marcello Sega
+Markus Gusenbauer
Matej Praprotnik
Mehmet Sayar
Mehmet Süzen
+Michael Kuron
Mingyang Hu
Muhammad Anwar
Nils Binz
-Owen Hickey
+Owen A. Hickey-Moriarty
+Patrick Diggins
+Pedro Ojeda
Pedro Sanchez
Peter Kosovan
+Pierre de Buyl
Rudolf Weeber
Sandeep Tyagi
Sathish K. Sukumaran
Sela Samin
Shervin Raafatnia
Simon Poblete
+Stephan Gekle
+Stefan Medina
Thomas Spura
Timo Schürg
Tobias Richter
+Tobias Steinle
Tristan Bereau
Ulf Schiller
Vagelis Harmandaris
@@ -75,3 +93,4 @@ Special thanks
--------------
Special thanks to Henrik Skov Midtiby for providing a GPL version of
todonotes.sty.
+
diff --git a/INSTALL b/INSTALL
index 16345a68700..36fe7af876f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -43,7 +43,7 @@ without any warranty.
LICENSE
-------
-Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/Makefile.am b/Makefile.am
index 0e49a19b2ad..b169b0bf629 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
@@ -16,7 +16,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
-SUBDIRS = config src . scripts tools testsuite doc
+DIST_SUBDIRS = config src . scripts tools testsuite doc
+SUBDIRS = config src .
+if TCL
+SUBDIRS += scripts
+endif
+SUBDIRS += tools testsuite doc
ACLOCAL_AMFLAGS = -I config
AUTOMAKE_OPTIONS = gnu subdir-objects dist-xz
@@ -25,21 +30,36 @@ AUTOMAKE_OPTIONS = gnu subdir-objects dist-xz
# by any other means
EXTRA_DIST = bootstrap.sh samples packages $(extra)
+CLEANFILES =
+
+if TCL
all-local: Espresso
-CLEANFILES = Espresso
+CLEANFILES += Espresso
if !DEVEL_SRC
Espresso: FORCE
- test -e Espresso || $(LN_S) src/Espresso .
+ test -L Espresso || $(LN_S) src/tcl/Espresso .
else
Espresso: version.txt
- test -e Espresso || $(LN_S) src/Espresso .
+ test -L Espresso || $(LN_S) src/tcl/Espresso .
+endif
+endif
+
+if PYTHON_INTERFACE
+all-local: espresso-python pypresso
+espresso-python: FORCE
+ test -L espressomd || $(LN_S) src/python/espressomd espressomd
+pypresso: FORCE
+ test -L pypresso || $(LN_S) src/python/pypresso pypresso
+
+CLEANFILES += pypresso espresso
endif
# Sample myconfig generation
-myconfig-sample.hpp:
+myconfig-sample.hpp:
./config.status myconfig-sample.hpp
-CLEANFILES += myconfig-sample.hpp
+DISTCLEANFILES = myconfig-sample.hpp
+
# config.status deps in configure.ac
# Handle version
@@ -79,7 +99,6 @@ else
endif
doc doxygen: FORCE
- cd src; $(MAKE) --print-directory $@
cd doc; $(MAKE) --print-directory $@
FORCE:
diff --git a/NEWS b/NEWS
index 210d930d9f4..35c5d052029 100644
--- a/NEWS
+++ b/NEWS
@@ -2,40 +2,133 @@
= ESPRESSO NEWS =
=================
+ESPResSo 3.4
+============
+
+New user-visible features
+-------------------------
+
+* New quartic bonded interaction
+* New bonded coulomb interaction
+* Lees Edwards boundaries for sheer stuff
+
+Known bugs
+----------
+
+User-visible changes
+--------------------
+
+Changes visible for developers
+------------------------------
+
+
ESPResSo 3.3
============
New user-visible features
-------------------------
+* SHANCHEN: a bicomponent lattice Boltzmann fluid, with support for rigid
+ boundaries and coupling to particle dynamics.
+
+* ELECTROKINETICS: An algorithm to treat species of ions on a mean-field
+ level. Implementation takes advantage of a GPU.
+
+* MMM1D_GPU: The mmm1d electrostatics algorithm is now available as GPU version.
+
* Support of P3M on GPU.
+* Provide the preliminary Python interface. Configure with
+ --with-python-interface.
+
* Allow the p3m to dump the mesh in x, y, and z (before it only dumped
-the mesh in x). This allows for the dumping of the p3m in blockfile
-format in the case of non-cubic boxes. It will also now be possible to
-tune the settings of a non-cubic mesh.
+ the mesh in x). This allows for the dumping of the p3m in blockfile
+ format in the case of non-cubic boxes. It will also now be possible
+ to tune the settings of a non-cubic mesh.
* Stomatocyte lb-boundary and constraint implemented.
* MEMD electrostatics can now handle spatially varying dielectrc
constants.
-* New command time_integration to get the runtime of the integration loop.
+* Pore constraint / lbboundary can have a two outer radii now to create nozzles.
+
+* Slitpore constraint and dielectric for IL based supercaps implemented.
+
+* New command time_integration to get the runtime of the integration
+ loop.
+
+* New harmonic well that runs on the GPU.
+
+Known bugs
+----------
+
+* The implementation of dielectric contrasts in conjunction with ELC
+ seems to have an error. Please do not use it if you do not know
+ exactly what you are doing until we have fixe the problem.
User-visible changes
--------------------
-* Generic LJ can now turned into an soft potential.
+* Added new arguments "recalc_forces" and "reuse_forces" to the
+ command "integrate". These arguments can be used to enforce or
+ suppress the recalculation of the forces at the beginning of the
+ call to "integrate". This is important for doing checkpoints, where
+ the forces have to be stored and reloaded.
+
+* Removed command "invalidate_system".
+
+* 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.
+
+* The configure option "--with-myconfig" has been removed. Instead,
+ the configure variable "MYCONFIG" can be set to give the name of a
+ myconfig file.
+
+* Generic LJ can now be turned into a soft potential.
* Renamed torque to torque_{lab,body}, improved torque handling in
blockfiles. Clearer distinction between the reference frames for
torque and angular momentum.
+* Lattice-Boltzmann now has a additional 3-point coupling scheme.
+
+* The noise type in thermalized Lattice-Boltzmann is now selectable via Tcl.
+
+* Interaction with a wall can be restricted to the outside.
+
+* Removed compiler switch GRANDCANONICAL.
+
+* Removed outdated ADRESS code.
+
+* external_potential tabulated to include arbitrary potentials applied to all
+ particles.
+
+* thermostat inter_dpd ignore_fixed_particles 1 allows the user to swith on DPD
+ with fixed particles.
+
+* New Observable concept that includes running averages and other observables
+ with history
+
+
Changes visible for developers
------------------------------
+* Feature GHOSTS_HAVE_BONDS allows for ghost particles to also store the bonds.
+
* The code has been switched to using a C++ compiler.
+* Introduced object-oriented interfaces for forces/constraints/external fields:
+ SystemInterface and Actor.
+
+* Improved Lattice structure
+
+* Generic TclAppend function
+
ESPResSo 3.2
============
@@ -150,7 +243,6 @@ New user-visible features
* Added new feature LANGEVIN_PER_PARTICLE that allows to set the
Langevin parameters temperature and gamma per particle.
-
* Added new constraint and LB boundary condition "rhomboid".
* Lattice-Boltzmann:
@@ -403,7 +495,7 @@ Changes visible for developers
For older changes to ESPResSo, see ./old/RELEASE_NOTES.
========================================================================
-Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/README b/README
index ab45508b28c..a6b10fe715b 100644
--- a/README
+++ b/README
@@ -181,7 +181,7 @@ testsuite/thermostat.data
testsuite/thermostat_rot.data
testsuite/uwerr.data
-"Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+"Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
diff --git a/Readme.md b/Readme.md
new file mode 100644
index 00000000000..9a9f7b05397
--- /dev/null
+++ b/Readme.md
@@ -0,0 +1,212 @@
+# ESPResSo
+
+This is the Molecular Dynamics software ESPResSo ("Extensible
+Simulation Package for the Research on Soft Matter Systems").
+
+ESPResSo is a highly versatile software package for performing and
+analyzing scientific Molecular Dynamics many-particle simulations of
+"coarse-grained" bead-spring models as they are used in soft-matter
+research in physics, chemistry and molecular biology. It can be used
+to simulate systems as for example polymers, liquid crystals,
+colloids, ferrofluids and biological systems such as DNA and lipid
+membranes.
+
+In "coarse-grained" models, a whole group of atoms or molecules are
+treated as a single bead. Although many details are coarse-grained
+away in these models, they can often predict qualitative properties,
+such as for example the scaling behavior of a system, and can give
+insight into theoretical models. Due to the drastic reduction of
+degrees of freedom, coarse-graining allows to investigate systems
+which would be out of reach of the commonly used atom-based
+simulations, due to the large time- and length scales of the studied
+processes.
+
+ESPResSo is capable of doing classical Molecular dynamics simulations
+of many types of systems in different statistical ensembles (NVE, NVT,
+NPT) and non-equilibrium situations, using standard potentials such as
+the Lennard-Jones or Morse potential. It contains many advanced
+simulation algorithms, which take into account hydrodynamic (lattice
+Boltzmann) and electrostatic interactions (P3M, ELC, MMMxD). Rigid
+bodies can be modelled by virtual site interactions, and it can
+integrate rotationally non-invariant particles.
+
+ESPResSo is free, open-source software (GPL). It is parallelized and
+can be employed on desktop machines, convenience clusters as well as
+on supercomputers with hundreds of CPUs. The parallel code is
+controlled via the scripting language Tcl, which gives the software
+its great flexibility and allows for many unconventional simulation
+protocols, as are often required when studying coarse-grained models.
+
+ESPResSo is used in scientific working groups all over the world both
+as a production platform as well as a research platform for developing
+new algorithms and methods and designing new models for coarse-grained
+simulations. It is mainly developed at the Institute for
+Computational Physics of the University of Stuttgart, but has
+contributors from all over the world.
+
+
+## Documentation
+
+You can find documentation on how to compile, use and develop ESPResSo
+on the homepage at [http://espressomd.org](http://espressomd.org).
+
+ESPResSo is intended to be used by people that have proper knowledge
+of simulation techniques and know how to use them. We do not take
+responsibility if you use ESPResSo to create and publish bogus
+results. You have been warned!
+
+## PLEASE CITE US!
+
+If you use ESPResSo and obtain scientific results that you publish, we
+would ask you to acknowledge the usage of ESPResSo by referencing
+
+ Hans-Jörg Limbach, Axel Arnold, Bernward A. Mann and Christian
+ Holm.
+ "ESPResSo - An Extensible Simulation Package for Research on
+ Soft Matter Systems".
+ Comput. Phys. Commun. 174(9) (704-727), 2006.
+
+For a BibTeX record, please refer to the key "espresso" in
+doc/ug/citations.bib.
+
+A number of algorithms in ESPResSo are fairly advanced and unique to
+ESPResSo. The authors of these contributions kindly ask you to cite the
+relevant publications, as indicated in the ESPResSo User's Guide
+(see http://espressomd.org or doc/ug/ug.pdf). For your convenience, the
+BibTeX records are compiled in doc/ug/citations.bib.
+
+## Licence
+
+The following files are licensed and copyrighted as indicated below:
+
+```
+doc/dg/figs/bond_angle.fig
+doc/dg/figs/datastorage.gif
+doc/dg/figs/dihedral_angle.fig
+doc/dg/figs/directions.fig
+doc/dg/figs/elc_errordist.gif
+doc/dg/figs/ghost_cells.fig
+doc/dg/figs/ghost_communication.fig
+doc/dg/figs/linked_cells.fig
+doc/dg/figs/logo.png
+doc/dg/figs/move_to_p_buf.fig
+doc/dg/figs/particles.fig
+doc/ug/figures/diamond.png
+doc/ug/figures/dihedral-angle.fig
+doc/ug/figures/dihedral-angle.pdf
+doc/ug/figures/fullerene.png
+doc/ug/figures/hbond.fig
+doc/ug/figures/hbond.pdf
+doc/ug/figures/logo.png
+doc/ug/figures/maggs-charge-assignment.pdf
+doc/ug/figures/maggs-initial-scheme.pdf
+doc/ug/figures/maggs-rotation.pdf
+doc/ug/figures/nacl-rdf.pdf
+doc/ug/figures/salt.png
+doc/tutorials/tut2/figures/data/neutral-rho.data
+doc/tutorials/tut2/figures/data/nonneutral-rho.data
+doc/tutorials/tut2/figures/data/rdf_from_melt_00.data
+doc/tutorials/tut2/figures/data/rdf_from_melt_10.data
+doc/tutorials/tut2/figures/data/rdf_from_melt_11.data
+doc/tutorials/tut2/figures/data/rdf_lj_00.data
+doc/tutorials/tut2/figures/nacl-rdf.pdf
+doc/tutorials/tut2/figures/nacl.plot
+doc/tutorials/tut2/figures/neutral-rho.pdf
+doc/tutorials/tut2/figures/nonneutral-rho.pdf
+doc/tutorials/tut2/figures/salt.png
+packages/mbtools/doc/colloid_model.jpg
+packages/mbtools/doc/cylinder_membrane.jpg
+packages/mbtools/doc/flat_membrane.jpg
+packages/mbtools/doc/protein_model.jpg
+packages/mbtools/doc/sphere_membrane.jpg
+packages/mbtools/doc/torus_membrane.jpg
+packages/mbtools/doc/wrapped_colloid_densitymap.jpg
+packages/mbtools/examples/forcetables/9_095_11.tab
+packages/mbtools/examples/forcetables/n9_c140_22.tab
+packages/mbtools/examples/forcetables/n9_c160_22.tab
+packages/mbtools/examples/forcetables/sr_e10_c25.tab
+samples/adress/bond_tetra.tab
+samples/adress/cg_ic_tetra.tab
+samples/adress/cg_tetra.tab
+samples/adress/thermo_force.tab
+samples/maggs_correct_rdf.dat
+samples/object-in-fluid/object-in-fluidUG/figures/arealocal.eps
+samples/object-in-fluid/object-in-fluidUG/figures/bending.eps
+samples/object-in-fluid/object-in-fluidUG/figures/bloodCell.eps
+samples/object-in-fluid/object-in-fluidUG/figures/stretching.eps
+samples/object-in-fluid/object-in-fluidUG/figures/volume.eps
+testsuite/analysis_system.data.00.gz
+testsuite/analysis_system.data.01.gz
+testsuite/analysis_system.data.02.gz
+testsuite/analysis_system.data.03.gz
+testsuite/analysis_system.data.04.gz
+testsuite/analysis_system.data.05.gz
+testsuite/analysis_system.data.06.gz
+testsuite/analysis_system.data.07.gz
+testsuite/analysis_system.data.08.gz
+testsuite/analysis_system.data.09.gz
+testsuite/analysis_system.data.10.gz
+testsuite/analysis_system.data.chk
+testsuite/angle_cosine.data
+testsuite/angle_cossquare.data
+testsuite/angle_harmonic.data
+testsuite/comfixed_system.data
+testsuite/comforce_system.data
+testsuite/constraints_system.data
+testsuite/dh_system.data
+testsuite/el2d_system.data
+testsuite/el2d_system_die.data
+testsuite/gb_system.data
+testsuite/lb_system.data
+testsuite/lj-cos_system.data
+testsuite/lj_system.data
+testsuite/maggs_correct_rdf.data
+testsuite/mass_system.data
+testsuite/mdlc_expected_energy.data
+testsuite/mdlc_expected_force_torque.data
+testsuite/mdlc_system.data
+testsuite/mmm1d_system.data
+testsuite/npt_lj_system.data
+testsuite/object_in_fluid_system-final.data
+testsuite/object_in_fluid_system-init.data
+testsuite/object_in_fluid_system-nodes.data
+testsuite/object_in_fluid_system-triangles.data
+testsuite/p3m_magnetostatics2_expected.data
+testsuite/p3m_magnetostatics2_system.data
+testsuite/p3m_magnetostatics.data
+testsuite/p3m_system.data
+testsuite/p3m_wall_system.data
+testsuite/pe_micelle.data
+testsuite/tabulated_system.data
+testsuite/thermostat.data
+testsuite/thermostat_rot.data
+testsuite/uwerr.data
+```
+
+> "Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
+> Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
+> Max-Planck-Institute for Polymer Research, Theory Group
+>
+> This file is part of ESPResSo.
+>
+> ESPResSo is free software: you can redistribute it and/or modify it
+> under the terms of the GNU General Public License as published by the
+> Free Software Foundation, either version 3 of the License, or (at your
+> option) any later version.
+>
+> ESPResSo is distributed in the hope that it will be useful, but
+> WITHOUT ANY WARRANTY; without even the implied warranty of
+> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+> General Public License for more details.
+>
+> You should have received a copy of the GNU General Public License
+> along with this program. If not, see ."
+
+This file is licensed as follows:
+
+> Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
+>
+> Copying and distribution of this file, with or without modification,
+> are permitted in any medium without royalty provided the copyright
+> notice and this notice are preserved. This file is offered as-is,
+>without any warranty.
diff --git a/config/Espresso.m4 b/config/Espresso.m4
index 50847711207..5aaeeb4b9ae 100644
--- a/config/Espresso.m4
+++ b/config/Espresso.m4
@@ -1,5 +1,5 @@
dnl -*- mode: autoconf -*-
-dnl Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+dnl Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
dnl Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
dnl Max-Planck-Institute for Polymer Research, Theory Group
dnl
@@ -56,7 +56,7 @@ AC_DEFUN([ES_ADDPATH_CHECK_HEADER],[
])],[es_adp_found=yes],[])
if test .$es_adp_found = .no; then
- for path in $4 /sw/include /usr/include /usr/local/include /opt/include; do
+ for path in $4 /sw/include /opt/local/include /usr/include /usr/local/include /opt/include; do
CPPFLAGS="$es_save_CPPFLAGS -I$path"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <$1>
diff --git a/config/Makefile.am b/config/Makefile.am
index 89a9d83c45d..f32e4604c60 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
@@ -16,8 +16,5 @@
# along with this program. If not, see .
#
EXTRA_DIST = \
- gen_featureconfig.py \
- gen_doxyconfig.py \
gen_sampleconfig.py \
- featuredefs.py \
genversion.sh
diff --git a/config/ax_count_cpus.m4 b/config/ax_count_cpus.m4
index d4f3d290f4f..2bcbdf84cf0 100644
--- a/config/ax_count_cpus.m4
+++ b/config/ax_count_cpus.m4
@@ -15,6 +15,7 @@
#
# LICENSE
#
+# Copyright (C) 2014 The ESPResSo project
# Copyright (c) 2012 Brian Aker
# Copyright (c) 2008 Michael Paul Bailey
# Copyright (c) 2008 Christophe Tournayre
diff --git a/config/ax_cxx_var_prettyfunc.m4 b/config/ax_cxx_var_prettyfunc.m4
new file mode 100644
index 00000000000..9afc52594dc
--- /dev/null
+++ b/config/ax_cxx_var_prettyfunc.m4
@@ -0,0 +1,92 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_cxx_var_prettyfunc.html
+# ===========================================================================
+#
+# SYNPOSIS
+#
+# AX_CXX_VAR_PRETTYFUNC
+#
+# DESCRIPTION
+#
+# This function tries to determine the best C++ macro/identifier
+# that contains the current function name. Depending on the
+# compiler, this may be __PRETTY_FUNCTION__ (GCC), __FUNCSIG__
+# (MSVC), __func__ (C++ standard), __FUNCTION__ (fallback).
+#
+# The function will define HAVE_PRETTYFUNC if a macro exists,
+# and define __PRETTYFUNC__ to the best possible macro. When
+# HAVE_PRETTYFUNC is not defined, __PRETTYFUNC__ will contain the
+# constant string "<>".
+#
+# LICENSE
+#
+# Copyright (c) 2014 Olaf Lenz
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 1
+
+AC_DEFUN([AX_CXX_VAR_PRETTYFUNC],
+[
+# try to find best __FUNCTION__ variant
+
+AC_CACHE_CHECK([whether $CXX can get a pretty function name], ac_cv_cxx_var_prettyfunc,
+ ac_cv_cxx_var_prettyfunc=no
+
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[const char *s = __PRETTY_FUNCTION__])],
+ [ ac_cv_cxx_var_prettyfunc=__PRETTY_FUNCTION__ ])
+
+ AS_IF([test "x$ac_cv_cxx_var_prettyfunc" = "xno"], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[const char *s = __FUNCSIG__])],
+ [ ac_cv_cxx_var_prettyfunc=__FUNCSIG__ ])
+ ])
+
+ AS_IF([test "x$ac_cv_cxx_var_prettyfunc" = "xno"], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[const char *s = __func__])],
+ [ ac_cv_cxx_var_prettyfunc=__func__ ])
+ ])
+
+ AS_IF([test "x$ac_cv_cxx_var_prettyfunc" = "xno"], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(,[const char *s = __FUNCTION__])],
+ [ ac_cv_cxx_var_prettyfunc=__FUNCTION__ ])
+ ])
+)
+
+
+AS_IF([test "x$ac_cv_cxx_var_prettyfunc" != "xno"], [
+ AC_DEFINE(HAVE_PRETTYFUNC,, [Whether __PRETTY_FUNCTION__ has a useful value.])
+ AC_DEFINE_UNQUOTED(__PRETTYFUNC__,$ac_cv_cxx_var_prettyfunc,
+ [contains the function wherein the macro is called])
+],[
+ AC_DEFINE(__PRETTYFUNC__,"<>")
+])
+
+])dnl
diff --git a/config/ax_prog_cc_mpi.m4 b/config/ax_prog_cc_mpi.m4
deleted file mode 100644
index a1c22a1bd8f..00000000000
--- a/config/ax_prog_cc_mpi.m4
+++ /dev/null
@@ -1,141 +0,0 @@
-dnl -*- mode: autoconf -*-
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_mpi.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_CC_MPI([MPI-WANTED-TEST[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
-#
-# DESCRIPTION
-#
-# This macro tries to find out how to compile C programs that use MPI
-# (Message Passing Interface), a standard API for parallel process
-# communication (see http://www-unix.mcs.anl.gov/mpi/).
-# The macro has to be used instead of the standard macro AC_PROG_CC
-# and will replace the standard variable CC with the found compiler.
-#
-# MPI-WANTED-TEST is used to test whether MPI is actually wanted by
-# the user. If the test fails, the macro will not try to find MPI
-# and call AC_MPI_CC instead. If the test is omitted, the macro will
-# try to found MPI and fail if it is not found.
-#
-# When MPI is found, ACTION-IF-FOUND will be executed, otherwise
-# ACTION-IF-NOT-FOUND is executed. If ACTION-IF-FOUND is not set,
-# the macro will define HAVE_MPI.
-#
-# EXAMPLE
-#
-# # If --with-mpi=auto is used, try to find MPI, but use standard C
-# compiler if it is not found.
-# # If --with-mpi=yes is used, try to find MPI and fail if it isn't
-# # found.
-# # If --with-mpi=no is used, use a standard C compiler instead.
-# AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
-# [compile with MPI (parallelization) support. If none is found,
-# MPI is not used. Default: auto])
-# ],,[with_mpi=auto])
-#
-# AX_PROG_CC_MPI([test x"$with_mpi" != xno],[use_mpi=yes],[
-# use_mpi=no
-# if test x"$with_mpi" = xyes; then
-# AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.])
-# else
-# AC_MSG_WARN([No MPI compiler found, won't use MPI.])
-# fi
-# ])
-#
-# LICENSE
-#
-# Copyright (C) 2012,2013 The ESPResSo project
-# Copyright (c) 2010,2011 Olaf Lenz
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see .
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 1
-
-AC_DEFUN([AX_PROG_CC_MPI], [
-AC_PREREQ(2.50) dnl for AC_LANG_CASE
-
-# Check for compiler
-# Needs to be split off into an extra macro to ensure right expansion
-# order.
-AC_REQUIRE([_AX_PROG_CC_MPI],[_AX_PROG_CC_MPI([$1])])
-
-AS_IF([test x"$_ax_prog_mpicc_mpi_wanted" = xno],
- [ ax_prog_mpicc_mpi_found=no ],
- [
- # test whether MPI_Init is available in a library
- AC_SEARCH_LIBS(MPI_Init, [mpi mpich],
- [ ax_prog_mpicc_mpi_found=yes ],
- [ ax_prog_mpicc_mpi_found=no ])
-
- # Check for header
- AS_IF([test x"$ax_only_mpi_found" = xyes], [
- AC_MSG_CHECKING([for mpi.h])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ])],
- [ AC_MSG_RESULT(yes)],
- [ AC_MSG_RESULT(no)
- ax_prog_mpicc_mpi_found=no
- ])
- ])
-])
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-AS_IF([test x"$ax_prog_mpicc_mpi_found" = xyes], [
- ifelse([$2],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$2])
- :
-],[
- $3
- :
-])
-
-])dnl AX_PROG_CC_MPI
-
-dnl _AX_PROG_CC_MPI is an internal macro required by AX_PROG_CC_MPI.
-dnl To ensure the right expansion order, the main function AX_PROG_CC_MPI
-dnl has to be split into two parts.
-AC_DEFUN([_AX_PROG_CC_MPI], [
- AC_ARG_VAR(MPICC,[MPI C compiler command])
- ifelse([$1],,[_ax_prog_mpicc_mpi_wanted=yes],[
- AC_MSG_CHECKING([whether to compile using MPI])
- if $1; then
- _ax_prog_mpicc_mpi_wanted=yes
- else
- _ax_prog_mpicc_mpi_wanted=no
- fi
- AC_MSG_RESULT($_ax_prog_mpicc_mpi_wanted)
- ])
- if test x"$_ax_prog_mpicc_mpi_wanted" = xyes; then
- if test -z "$CC" && test -n "$MPICC"; then
- CC="$MPICC"
- else
- AC_CHECK_TOOLS([CC], [mpicc hcc mpxlc_r mpxlc mpcc cmpicc])
- fi
- fi
- AC_PROG_CC
-])dnl _AX_PROG_CC_MPI
diff --git a/config/ax_prog_cxx_mpi.m4 b/config/ax_prog_cxx_mpi.m4
index a0053abf43f..28c982bef04 100644
--- a/config/ax_prog_cxx_mpi.m4
+++ b/config/ax_prog_cxx_mpi.m4
@@ -44,6 +44,7 @@
#
# LICENSE
#
+# Copyright (C) 2014 The ESPResSo project
# Copyright (c) 2010,2011 Olaf Lenz
#
# This program is free software: you can redistribute it and/or modify it
@@ -72,7 +73,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 1
+#serial 2
AC_DEFUN([AX_PROG_CXX_MPI], [
AC_PREREQ(2.50)
@@ -87,24 +88,22 @@ AS_IF([test x"$_ax_prog_cxx_mpi_mpi_wanted" = xno],
[
AC_LANG_PUSH([C++])
- # test whether MPI::Init is available
+ # test whether MPI_Init() is available
# We do not use AC_SEARCH_LIBS here, as it caches its outcome and
# thus disallows corresponding calls in the other AX_PROG_*_MPI
# macros.
for lib in NONE mpi mpich; do
save_LIBS=$LIBS
if test x"$lib" = xNONE; then
- AC_MSG_CHECKING([for function MPI::Init])
+ AC_MSG_CHECKING([for function MPI_Init])
else
- AC_MSG_CHECKING([for function MPI::Init in -l$lib])
+ AC_MSG_CHECKING([for function MPI_Init in -l$lib])
LIBS="-l$lib $LIBS"
fi
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
-namespace MPI {
-char Init();
-};
-using MPI::Init;],[MPI::Init;])],
+extern "C" { void MPI_Init(); }
+],[MPI_Init();])],
[ _ax_prog_cxx_mpi_mpi_found=yes ],
[ _ax_prog_cxx_mpi_mpi_found=no ])
AC_MSG_RESULT($_ax_prog_cxx_mpi_mpi_found)
diff --git a/config/ax_python_devel.m4 b/config/ax_python_devel.m4
new file mode 100644
index 00000000000..1dae176e890
--- /dev/null
+++ b/config/ax_python_devel.m4
@@ -0,0 +1,337 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_DEVEL([version])
+#
+# DESCRIPTION
+#
+# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
+# in your configure.ac.
+#
+# This macro checks for Python and tries to get the include path to
+# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS)
+# output variables. It also exports $(PYTHON_EXTRA_LIBS) and
+# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
+#
+# You can search for some particular version of Python by passing a
+# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
+# note that you *have* to pass also an operator along with the version to
+# match, and pay special attention to the single quotes surrounding the
+# version number. Don't use "PYTHON_VERSION" for this: that environment
+# variable is declared as precious and thus reserved for the end-user.
+#
+# This macro should work for all versions of Python >= 2.1.0. As an end
+# user, you can disable the check for the python version by setting the
+# PYTHON_NOVERSIONCHECK environment variable to something else than the
+# empty string.
+#
+# If you need to use this macro for an older Python version, please
+# contact the authors. We're always open for feedback.
+#
+# LICENSE
+#
+# Copyright (C) 2014 The ESPResSo project
+# Copyright (c) 2009 Sebastian Huber
+# Copyright (c) 2009 Alan W. Irwin
+# Copyright (c) 2009 Rafael Laboissiere
+# Copyright (c) 2009 Andrew Collier
+# Copyright (c) 2009 Matteo Settenvini
+# Copyright (c) 2009 Horst Knorr
+# Copyright (c) 2013 Daniel Mullner
+# Copyright (c) 2013 Axel Arnold
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 17
+
+AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
+AC_DEFUN([AX_PYTHON_DEVEL],[
+ #
+ # Allow the use of a (user set) custom python version
+ #
+ AC_ARG_VAR([PYTHON_VERSION],[The installed Python
+ version to use, for example '2.3'. This string
+ will be appended to the Python interpreter
+ canonical name.])
+
+ AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
+ if test -z "$PYTHON"; then
+ AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # if the macro parameter ``version'' is set, honour it
+ # otherwise, we need at least 2.1.0 for this to work
+ #
+ if test -n "$1"; then
+ version='2.1.0'
+ else
+ version='$1'
+ fi
+ AC_MSG_CHECKING([for a version of Python $1])
+ ac_supports_python_ver=`$PYTHON -c "import sys; \
+ ver = sys.version.split ()[[0]]; \
+ print (ver $1)"`
+ if test "$ac_supports_python_ver" = "True"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([this package requires Python $1.
+If you have it installed, but it isn't the default Python
+interpreter in your system path, please pass the PYTHON_VERSION
+variable to configure. See ``configure --help'' for reference.
+])
+ PYTHON_VERSION=""
+ fi
+
+ # get the flags to compile against python
+ #########################################
+
+ # first try python-config, following the python manual
+ _AC_PYTHON_DEVEL_FROM_PYTHONCONFIG
+ AS_IF([test "$PYTHONCONFIG" != "no"], [
+ _AC_CHECK_PYTHON_DEVEL_CONSISTENCY
+ ],)
+
+ # try again using distutils, if that failed
+ AS_IF([test "$pythonexists" != "yes"], [
+ _AC_PYTHON_CHECK_DISTUTILS
+ _AC_PYTHON_DEVEL_FROM_DISTUTILS
+ _AC_CHECK_PYTHON_DEVEL_CONSISTENCY
+
+ if test ! "x$pythonexists" = "xyes"; then
+ AC_MSG_FAILURE([
+ Could not link test program to Python neither using distutils nor
+ python-config. Maybe the main Python library has been
+ installed in some non-standard library path. If so, pass it to configure,
+ via the LDFLAGS environment variable.
+ Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
+ ============================================================================
+ ERROR!
+ You probably have to install the development version of the Python package
+ for your distribution. The exact name of this package varies among them.
+ ============================================================================
+ ])
+ fi
+ ])
+
+ AC_SUBST([PYTHON_SITE_PKG])
+ AC_SUBST([PYTHON_CPPFLAGS])
+ AC_SUBST([PYTHON_LDFLAGS])
+ AC_SUBST(PYTHON_EXTRA_LDFLAGS)
+ AC_SUBST(PYTHON_EXTRA_LIBS)
+
+ #
+ # all done!
+ #
+])
+
+AC_DEFUN([_AC_CHECK_PYTHON_DEVEL_CONSISTENCY],[
+ # check to see if everything compiles alright
+ #
+ AC_MSG_CHECKING([consistency of all components of python development environment])
+ # save current global flags
+ ac_save_LIBS="$LIBS"
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS"
+ CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
+ AC_LANG_PUSH([C])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include ]],
+ [[Py_Initialize();]])
+ ],[pythonexists=yes],[pythonexists=no])
+ AC_LANG_POP([C])
+ # turn back to default flags
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+ AC_MSG_RESULT([$pythonexists])
+])
+
+AC_DEFUN([_AC_PYTHON_DEVEL_FROM_PYTHONCONFIG],[
+
+ AC_PATH_PROG([PYTHONCONFIG],[python[$PYTHON_VERSION]-config],no)
+
+ if test "$PYTHONCONFIG" != no; then
+ # no splitting of LDFLAGS with python-config
+ PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
+ PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
+ PYTHON_EXTRA_LDFLAGS=
+ PYTHON_EXTRA_LIBS=`$PYTHONCONFIG --libs`
+ fi
+])
+
+AC_DEFUN([_AC_PYTHON_CHECK_DISTUTILS],[
+ #
+ # Check if you have distutils, else fail
+ #
+ AC_MSG_CHECKING([for the distutils Python package])
+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
+ if test -z "$ac_distutils_result"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot import Python module "distutils".
+Please check your Python installation. The error was:
+$ac_distutils_result])
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # Check for site packages
+ #
+ AC_MSG_CHECKING([for Python site-packages path])
+ if test -z "$PYTHON_SITE_PKG"; then
+ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_lib(0,0));"`
+ fi
+ AC_MSG_RESULT([$PYTHON_SITE_PKG])
+])
+
+AC_DEFUN([_AC_PYTHON_DEVEL_FROM_DISTUTILS],[
+ #
+ # Check for Python include path
+ #
+ AC_MSG_CHECKING([for Python include path])
+ if test -z "$PYTHON_CPPFLAGS"; then
+ python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc ());"`
+ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
+ if test -n "${python_path}"; then
+ if test "${plat_python_path}" != "${python_path}"; then
+ python_path="-I$python_path -I$plat_python_path"
+ else
+ python_path="-I$python_path"
+ fi
+ fi
+ PYTHON_CPPFLAGS=$python_path
+ fi
+ AC_MSG_RESULT([$PYTHON_CPPFLAGS])
+
+ #
+ # Check for Python library path
+ #
+ AC_MSG_CHECKING([for Python library path])
+ if test -z "$PYTHON_LDFLAGS"; then
+ # (makes two attempts to ensure we've got a version number
+ # from the interpreter)
+ ac_python_version=`cat</dev/null
+ if test $? -eq 0;
+ then
+ AC_MSG_RESULT(yes)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ else
+ AC_MSG_RESULT(no)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ #
+ if test -n "$2"
+ then
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+ fi
+])
diff --git a/testsuite/configs/check_myconfig_complete.py b/config/check_myconfig_complete.py
similarity index 74%
rename from testsuite/configs/check_myconfig_complete.py
rename to config/check_myconfig_complete.py
index 8779323790c..248afecb15a 100644
--- a/testsuite/configs/check_myconfig_complete.py
+++ b/config/check_myconfig_complete.py
@@ -1,4 +1,5 @@
-# Copyright (C) 2012 Olaf Lenz
+# Copyright (C) 2014 The ESPResSo project
+# Copyright (C) 2012,2013 Olaf Lenz
#
# This file is part of ESPResSo.
#
@@ -17,16 +18,17 @@
#
# Check whether all features used in the code are defined
#
+from __future__ import print_function
import sys, os, re, fileinput
-sys.path.append(os.path.join(sys.path[0], '..', '..', 'config'))
+sys.path.append(os.path.join(sys.path[0], '..', 'src'))
import featuredefs
if len(sys.argv) < 3:
- print "Usage: %s DEFFILE [FILE...]" % sys.argv[0]
+ print("Usage: %s DEFFILE [FILE...]" % sys.argv[0])
exit(2)
-print "Checking for completeness of features in test configurations..."
+print("Checking for completeness of features in test configurations...")
fdefs = featuredefs.defs(sys.argv[1])
@@ -42,8 +44,8 @@
unused = unused.difference(fdefs.notestfeatures)
if len(unused) > 0:
for feature in unused:
- print "check_myconfig_complete: %s is not used" % feature
+ print("check_myconfig_complete: %s is not used" % feature)
else:
- print "check_myconfig_complete: All features are used!"
+ print("check_myconfig_complete: All features are used!")
diff --git a/config/compile b/config/compile
index 106fd91e0ca..2fdcd9e5883 100755
--- a/config/compile
+++ b/config/compile
@@ -3,7 +3,7 @@
scriptversion=2005-05-14.22
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
diff --git a/config/config.guess b/config/config.guess
index b79252d6b10..de8e6dd2c4a 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,12 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+timestamp='2012-02-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -20,17 +22,19 @@ timestamp='2013-06-10'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to and include a ChangeLog
+# entry.
#
-# Originally written by Per Bothner.
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +54,9 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,26 +138,15 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
+case "${UNAME_MACHINE}" in
+ i?86)
+ test -z "$VENDOR" && VENDOR=pc
+ ;;
+ *)
+ test -z "$VENDOR" && VENDOR=unknown
+ ;;
esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
# Note: order is significant - the case branches are not exclusive.
@@ -215,25 +210,21 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
@@ -301,13 +292,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
+ echo m68k-${VENDOR}-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo ${UNAME_MACHINE}-${VENDOR}-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo ${UNAME_MACHINE}-${VENDOR}-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -321,8 +312,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-${VENDOR}-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
@@ -430,7 +421,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
+ echo m68k-${VENDOR}-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
@@ -741,9 +732,9 @@ EOF
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -803,26 +794,23 @@ EOF
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
@@ -842,10 +830,10 @@ EOF
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
+ echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
exit ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
+ echo ia64-${VENDOR}-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
@@ -864,31 +852,31 @@ EOF
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
+ echo x86_64-${VENDOR}-cygwin
exit ;;
p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
+ echo powerpcle-${VENDOR}-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -901,54 +889,59 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -967,63 +960,54 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-${VENDOR}-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-${VENDOR}-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
+ PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
+ *) echo hppa-${VENDOR}-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-${VENDOR}-linux-gnu
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpc-${VENDOR}-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1045,16 +1029,16 @@ EOF
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo ${UNAME_MACHINE}-${VENDOR}-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo ${UNAME_MACHINE}-${VENDOR}-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ echo i386-${VENODR}-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1074,7 +1058,7 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
@@ -1113,7 +1097,7 @@ EOF
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1150,19 +1134,19 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
@@ -1212,7 +1196,7 @@ EOF
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-${VENDOR}-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1227,9 +1211,6 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1256,21 +1237,19 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1287,7 +1266,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
+ NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1311,13 +1290,13 @@ EOF
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo ${UNAME_MACHINE}-${VENDOR}-plan9
exit ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
+ echo pdp10-${VENDOR}-tops10
exit ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
+ echo pdp10-${VENDOR}-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
@@ -1326,16 +1305,16 @@ EOF
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
+ echo pdp10-${VENDOR}-tops20
exit ;;
*:ITS:*:*)
- echo pdp10-unknown-its
+ echo pdp10-${VENDOR}-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1357,10 +1336,13 @@ EOF
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
+ echo ${UNAME_MACHINE}-${VENDOR}-esx
exit ;;
esac
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
eval $set_cc_for_build
cat >$dummy.c <.
@@ -20,12 +26,11 @@ timestamp='2013-04-24'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
+# the same distribution terms that you use for the rest of that program.
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to . Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -68,7 +73,9 @@ Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -116,7 +123,7 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
@@ -149,7 +156,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
@@ -252,10 +259,8 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
@@ -268,7 +273,7 @@ case $basic_machine in
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -286,17 +291,16 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
+ | nios | nios2 \
| ns16k | ns32k \
| open8 \
- | or1k | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -366,7 +370,7 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
@@ -385,8 +389,7 @@ case $basic_machine in
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -404,13 +407,12 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -786,13 +788,9 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze*)
+ microblaze)
basic_machine=microblaze-xilinx
;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -1021,11 +1019,7 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
+ rdos)
basic_machine=i386-pc
os=-rdos
;;
@@ -1352,21 +1346,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
+ | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1498,6 +1492,9 @@ case $os in
-aros*)
os=-aros
;;
+ -kaos*)
+ os=-kaos
+ ;;
-zvmoe)
os=-zvmoe
;;
@@ -1546,9 +1543,6 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
- hexagon-*)
- os=-elf
- ;;
tic54x-*)
os=-coff
;;
@@ -1589,9 +1583,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
diff --git a/config/cuda.m4 b/config/cuda.m4
new file mode 100644
index 00000000000..01873500cc0
--- /dev/null
+++ b/config/cuda.m4
@@ -0,0 +1,103 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright (C) 2013,2014 The ESPResSo project
+dnl
+dnl This file is part of ESPResSo.
+dnl
+dnl ESPResSo is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl ESPResSo is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see .
+dnl
+dnl CUDA support for libtool
+dnl
+AC_DEFUN([AC_PROG_CUDA],
+ [LT_LANG(CUDA)])
+
+AC_DEFUN([LT_PROG_CUDA],
+ [AC_ARG_VAR(NVCC,[NVIDIA CUDA compiler command])
+ AC_ARG_VAR(NVCCFLAGS,[special compiler flags for the NVIDIA CUDA compiler])
+
+ AC_PATH_PROG(NVCC, nvcc, no, [$PATH:$cuda_path/bin])
+
+ # MAC nvcc stays 32 bit, even if the rest is 64 bit
+ case $target in
+ x86_64-apple-darwin*)
+ NVCCFLAGS="$NVCCFLAGS -m64";;
+ esac
+])
+
+# _LT_LANG_CUDA_CONFIG([TAG])
+# --------------------------
+# Analogue to _LT_LANG_GCJ_CONFIG for CUDA
+AC_DEFUN([_LT_LANG_CUDA_CONFIG],
+ [AC_REQUIRE([LT_PROG_CUDA])
+ AC_LANG_PUSH(C++)
+
+ # CUDA file extensions
+ ac_ext=cu
+ objext=o
+ _LT_TAGVAR(objext, $1)=$objext
+
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="static __device__ __constant__ int var;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="#include
+ int main() { cudaGetDevice(0); }"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+
+ # nvcc interface is not gcc-like (but can steer gcc)
+ GCC=no
+ CC=$NVCC
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_TAGVAR(LD, $1)="$LD"
+ _LT_CC_BASENAME([$compiler])
+
+ # CUDA did not exist at the time GCC didn't implicitly link libc in.
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+ _LT_TAGVAR(reload_flag, $1)=$reload_flag
+ _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ # building shared with nvcc not there in libtool
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Xcompiler -static'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi
+
+ AC_LANG_POP
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+])
diff --git a/config/depcomp b/config/depcomp
index 4ebd5b3a2f2..08ffb634daa 100755
--- a/config/depcomp
+++ b/config/depcomp
@@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2012-03-27.16; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 2014 The ESPResSo project
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,9 +28,9 @@ scriptversion=2013-05-30.07; # UTC
case $1 in
'')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -56,65 +57,11 @@ EOF
;;
esac
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
# A tabulation character.
tab=' '
# A newline character.
nl='
'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
@@ -128,9 +75,6 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
@@ -142,32 +86,32 @@ if test "$depmode" = hp; then
fi
if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
fi
if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
fi
case "$depmode" in
@@ -190,7 +134,8 @@ gcc3)
done
"$@"
stat=$?
- if test $stat -ne 0; then
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile"
exit $stat
fi
@@ -198,17 +143,13 @@ gcc3)
;;
gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say). Also, it might not be
-## supported by the other compilers which use the 'gcc' depmode.
+## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
@@ -216,14 +157,15 @@ gcc)
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
- if test $stat -ne 0; then
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- # The second -e expression handles DOS-style file names with drive
- # letters.
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
@@ -232,15 +174,15 @@ gcc)
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
+ tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -258,7 +200,8 @@ sgi)
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
- if test $stat -ne 0; then
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile"
exit $stat
fi
@@ -266,6 +209,7 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
+
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
@@ -273,15 +217,19 @@ sgi)
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
- | tr "$nl" ' ' >> "$depfile"
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
+
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
else
- make_dummy_depfile
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
@@ -299,8 +247,9 @@ aix)
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
- set_dir_from "$object"
- set_base_from "$object"
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
@@ -313,7 +262,9 @@ aix)
"$@" -M
fi
stat=$?
- if test $stat -ne 0; then
+
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
@@ -322,113 +273,65 @@ aix)
do
test -f "$tmpdepfile" && break
done
- aix_post_process_depfile
- ;;
-
-tcc)
- # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
- # FIXME: That version still under development at the moment of writing.
- # Make that this statement remains true also for stable, released
- # versions.
- # It will wrap lines (doesn't matter whether long or short) with a
- # trailing '\', as in:
- #
- # foo.o : \
- # foo.c \
- # foo.h \
- #
- # It will put a trailing '\' even on the last line, and will use leading
- # spaces rather than leading tabs (at least since its commit 0394caf7
- # "Emit spaces for -MD").
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
fi
- rm -f "$depfile"
- # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
- # We have to change lines of the first kind to '$object: \'.
- sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
- # And for each line of the second kind, we have to emit a 'dep.h:'
- # dummy dependency, to avoid the deleted-header problem.
- sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file. A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
- # Portland's C compiler understands '-MD'.
- # Will always output deps to 'file.d' where file is the root name of the
- # source file under compilation, even if file resides in a subdirectory.
- # The object file name does not affect the name of the '.d' file.
- # pgcc 10.2 will output
+icc)
+ # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+ # However on
+ # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\' :
+ # and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
- set_dir_from "$object"
- # Use the source, not the object, to determine the base name, since
- # that's sadly what pgcc will do too.
- set_base_from "$source"
- tmpdepfile=$base.d
-
- # For projects that build the same source file twice into different object
- # files, the pgcc approach of using the *source* file root name can cause
- # problems in parallel builds. Use a locking strategy to avoid stomping on
- # the same $tmpdepfile.
- lockdir=$base.d-lock
- trap "
- echo '$0: caught signal, cleaning up...' >&2
- rmdir '$lockdir'
- exit 1
- " 1 2 13 15
- numtries=100
- i=$numtries
- while test $i -gt 0; do
- # mkdir is a portable test-and-set.
- if mkdir "$lockdir" 2>/dev/null; then
- # This process acquired the lock.
- "$@" -MD
- stat=$?
- # Release the lock.
- rmdir "$lockdir"
- break
- else
- # If the lock is being held by a different process, wait
- # until the winning process is done or we timeout.
- while test -d "$lockdir" && test $i -gt 0; do
- sleep 1
- i=`expr $i - 1`
- done
- fi
- i=`expr $i - 1`
- done
- trap - 1 2 13 15
- if test $i -le 0; then
- echo "$0: failed to acquire lock after $numtries attempts" >&2
- echo "$0: check lockdir '$lockdir'" >&2
- exit 1
- fi
-
- if test $stat -ne 0; then
+ # tcc 0.9.26 (FIXME still under development at the moment of writing)
+ # will emit a similar output, but also prepend the continuation lines
+ # with horizontal tabulation characters.
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Each line is of the form 'foo.o: dependent.h',
+ # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
- | sed -e 's/$/ :/' >> "$depfile"
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
+ < "$tmpdepfile" > "$depfile"
+ sed '
+ s/[ '"$tab"'][ '"$tab"']*/ /g
+ s/^ *//
+ s/ *\\*$//
+ s/^[^:]*: *//
+ /^$/d
+ /:$/d
+ s/$/ :/
+ ' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -439,8 +342,9 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
- set_dir_from "$object"
- set_base_from "$object"
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
@@ -451,7 +355,8 @@ hp2)
"$@" +Maked
fi
stat=$?
- if test $stat -ne 0; then
+ if test $stat -eq 0; then :
+ else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
@@ -461,61 +366,76 @@ hp2)
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
else
- make_dummy_depfile
+ echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- set_dir_from "$object"
- set_base_from "$object"
-
- if test "$libtool" = yes; then
- # Libtool generates 2 separate objects for the 2 libraries. These
- # two compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir$base.o.d # libtool 1.5
- tmpdepfile2=$dir.libs/$base.o.d # Likewise.
- tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- # Same post-processing that is required for AIX mode.
- aix_post_process_depfile
- ;;
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
msvc7)
if test "$libtool" = yes; then
@@ -526,7 +446,8 @@ msvc7)
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
- if test $stat -ne 0; then
+ if test "$stat" = 0; then :
+ else
rm -f "$tmpdepfile"
exit $stat
fi
@@ -552,7 +473,6 @@ $ {
G
p
}' >> "$depfile"
- echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
@@ -604,14 +524,13 @@ dashmstdout)
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
- sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this sed invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -664,12 +583,10 @@ makedepend)
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process the last invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed '1,2d' "$tmpdepfile" \
- | tr ' ' "$nl" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
@@ -705,10 +622,10 @@ cpp)
esac
done
- "$@" -E \
- | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- | sed '$ s: \\$::' > "$tmpdepfile"
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@@ -740,15 +657,15 @@ msvisualcpp)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
+ set fnord "$@"
+ shift
+ shift
+ ;;
*)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
esac
done
"$@" -E 2>/dev/null |
diff --git a/config/gen_doxyconfig.py b/config/gen_doxyconfig.py
deleted file mode 100644
index eb80f7d1bcc..00000000000
--- a/config/gen_doxyconfig.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (C) 2013 The ESPResSo project
-# Copyright (C) 2012 Olaf Lenz
-#
-# This file is part of ESPResSo.
-#
-# ESPResSo is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# ESPResSo is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# This script generates the file doxyconfigure.h (used by doxygen)
-#
-import sys, featuredefs, time
-
-if len(sys.argv) != 3:
- print >> sys.stderr, "Usage: %s DEFFILE HFILE" % sys.argv[0]
- exit(2)
-
-deffilename, hfilename = sys.argv[1:3]
-
-print "Reading definitions from " + deffilename + "..."
-defs = featuredefs.defs(deffilename)
-print "Done."
-
-print "Writing " + hfilename + "..."
-hfile = file(hfilename, 'w');
-
-hfile.write("""/*
-WARNING: This file was autogenerated by
-
- %s on %s
-
- Do not modify it or your changes will be overwritten!
- Modify features.def instead.
-
- This file is needed so that doxygen will generate documentation for
- all functions of all features.
-*/
-#ifndef _DOXYCONFIG_H
-#define _DOXYCONFIG_H
-
-""" % (sys.argv[0], time.asctime()))
-
-for feature in defs.features:
- hfile.write('#define ' + feature + '\n')
-
-hfile.write("""
-#endif /* of _DOXYCONFIG_H */""")
-hfile.close()
-print "Done."
-
diff --git a/config/gen_sampleconfig.py b/config/gen_sampleconfig.py
index 41fecccfe03..2951537dac6 100644
--- a/config/gen_sampleconfig.py
+++ b/config/gen_sampleconfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 The ESPResSo project
+# Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
@@ -19,10 +19,16 @@
# This script appends the sample list of features to the file
# myconfig-sample.h.
#
-import sys, featuredefs, time, string, fileinput
+from __future__ import print_function
+import time, string, fileinput
+import inspect, sys, os
+# find featuredefs.py
+moduledir = os.path.dirname(inspect.getfile(inspect.currentframe()))
+sys.path.append(os.path.join(moduledir, '..', 'src'))
+import featuredefs
if len(sys.argv) != 2:
- print >> sys.stderr, "Usage: %s DEFFILE" % sys.argv[0]
+ print("Usage: {} DEFFILE".format(sys.argv[0]), file=sys.stderr)
exit(2)
deffilename = sys.argv[1]
@@ -39,17 +45,17 @@
# Handle empty and comment lines
if len(line) == 0:
- print
+ print()
continue
elif line.startswith('#'):
continue
elif line.startswith('//') or line.startswith('/*'):
- print line
+ print(line)
continue
# Tokenify line
feature = line.split(None, 1)[0]
if feature in defs.features and feature not in featuresdone:
- print '//#define %s' % feature
+ print('//#define %s' % feature)
featuresdone.add(feature)
diff --git a/config/genversion.sh b/config/genversion.sh
index 100afd8ad42..2c2c546216a 100755
--- a/config/genversion.sh
+++ b/config/genversion.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2013 The ESPResSo project
+# Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2011,2012 Olaf Lenz
#
# This program is free software: you can redistribute it and/or modify
@@ -47,11 +47,11 @@ fi
VERSIONFILE=version.txt
# try to use git describe --dirty
-if VERSION=`git describe --dirty --match=?\.?\.? 2> /dev/null`; then
+if VERSION=`git describe --dirty --match=?\.* 2> /dev/null`; then
test -z "$DIST" && VERSION=$VERSION-git
# try to use git without --dirty
-elif VERSION=`git describe --match=?\.?\.? 2> /dev/null`-maybedirty; then
+elif VERSION=`git describe --match=?\.* 2> /dev/null`-maybedirty; then
test -z "$DIST" && VERSION=$VERSION-git
# otherwise use the versionfile
diff --git a/config/header.txt b/config/header.txt
index e326a2747b5..d13469910f9 100644
--- a/config/header.txt
+++ b/config/header.txt
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+ Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
diff --git a/config/missing b/config/missing
index cdea514931f..690a25e377b 100755
--- a/config/missing
+++ b/config/missing
@@ -1,10 +1,11 @@
#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
+# Common stub for a few missing GNU programs while installing.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2012-01-06.18; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard , 1996.
+# Copyright (C) 2014 The ESPResSo project
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,33 +30,61 @@ if test $# -eq 0; then
exit 1
fi
-case $1 in
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
+# In the cases where this matters, 'missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
+ aclocal touch file 'aclocal.m4'
+ autoconf touch file 'configure'
+ autoheader touch file 'config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all 'Makefile.in' files
+ bison create 'y.tab.[ch]', if possible, from existing .[ch]
+ flex create 'lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create 'lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create 'y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
@@ -70,141 +99,228 @@ Send bug reports to ."
;;
-*)
- echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "$0: Unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running '$TOOL --version' or '$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'acinclude.m4' or '${configure_ac}'. You might want
+ to install the Automake and Perl packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified '${configure_ac}'. You might want to install the
+ Autoconf and GNU m4 packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
+ autoheader*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'acconfig.h' or '${configure_ac}'. You might want
+ to install the Autoconf and GNU m4 packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
- -e '2,$s/^/ /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
+
+ automake*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+ You might want to install the Automake and Perl packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: '$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get '$1' as part of Autoconf from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: '$1' $msg. You should only need it if
+ you modified a '.y' file. You may need the Bison package
+ in order for those modifications to take effect. You can get
+ Bison from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a '.l' file. You may need the Flex package
+ in order for those modifications to take effect. You can get
+ Flex from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ Help2man package in order for those modifications to take
+ effect. You can get Help2man from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a '.texi' or '.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy 'make' (AIX,
+ DU, IRIX). You might want to install the Texinfo package or
+ the GNU make package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: '$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the 'README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing '$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/configure.ac b/configure.ac
index 4f9ac9036c8..143fb166a21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2006,2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
# Copyright (C) 2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
@@ -25,7 +25,7 @@ AC_INIT([ESPResSo],[ESPRESSO_VERSION],[espressomd-users@nongnu.org])
AC_PREREQ([2.59])
-AC_CONFIG_SRCDIR([src/initialize.cpp])
+AC_CONFIG_SRCDIR([src/features.def])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_PREFIX_DEFAULT($HOME/Espresso)
@@ -33,11 +33,12 @@ AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# Initialize automake
-AM_INIT_AUTOMAKE([1.11 gnu subdir-objects dist-xz])
+# tar-ustar is needed for filenames longer than 99 chars
+AM_INIT_AUTOMAKE([1.11 gnu tar-ustar subdir-objects dist-xz])
AM_MAINTAINER_MODE
# silent rules, backwards compatiblity
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Are we in an unpacked dist or in the git repo?
AC_MSG_CHECKING([whether we are using development sources])
@@ -116,18 +117,22 @@ AC_SUBST(ESPRESSO_MPIEXEC)
##################################
#### COMPILER CHARACTERISTICS ####
##################################
+# try to find best __FUNCTION__ variant
+AX_CXX_VAR_PRETTYFUNC()
+
+# set the optimization flags
# never overwrite users CXXFLAGS
if test "${CXXFLAGS+set}" != set; then
- # test for -O5
- AC_MSG_CHECKING([whether the compiler accepts -O5])
+ # test for -O3
+ AC_MSG_CHECKING([whether the compiler accepts -O3])
saved_CXXFLAGS=$CXXFLAGS
- CXXFLAGS="-O5 $CXXFLAGS"
+ CXXFLAGS="-O3 $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[
AC_MSG_RESULT(yes);try_add_flag_res=yes
],[
AC_MSG_RESULT(no); CXXFLAGS=$saved_CXXFLAGS; try_add_flag_res=no
])
-
+
##################################
# test for -Wall
AC_MSG_CHECKING([whether the compiler accepts -Wall])
@@ -150,15 +155,15 @@ cat < /dev/null 2>&1; then
- PYTHON="$PYTHON -B"
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
-fi
cat <.dylib is
- in one of the library paths set by LDFLAGS, or that you set the appropriate
- apple gcc -framework option in CPPFLAGS and LDFLAGS.]) ;;
- *) AC_MSG_FAILURE([
-********************************************************************************
-* Could not link against the (static) Tcl library (libtcl*.a). *
-* Please add the library path to LDFLAGS (e.g. configure LDFLAGS=-L/usr/lib)! *
-********************************************************************************
-]) ;;
- esac
-fi
-
-case $target_os in
- *linux*) # path used by *buntu
- extrapaths=/usr/include/$version ;;
-esac
-
-if test .$use_tcl != .none; then
- ES_ADDPATH_CHECK_HEADER(tcl.h, [],
- [AC_MSG_FAILURE([
-********************************************************************************
-* Could not find the Tcl header files (tcl.h). *
-* Please add the include path to CPPFLAGS *
-* (e.g. configure CPPFLAGS=-I/usr/include)! *
-********************************************************************************
-])], $extrapaths)
-fi
-
-if test .$use_tcl = .; then
- use_tcl=none
-fi
-
-AM_CONDITIONAL(TCL, [test .$use_tcl != .none])
-
-##################################
-# check for tk
-AC_ARG_WITH(tk,
- AS_HELP_STRING([--with-tk=VERSION],[whether to use Tk, and which version to use]),
- [], [with_tk=no])
-dnl with_tk=no don't use Tk
-dnl with_tk=yes try to find a working Tk version, bail out if none is found
-dnl otherwise use the specified version
-if test .$with_tk != .no; then
- # test for X11
- AC_PATH_XTRA
- saved_CPPFLAGS=$CPPFLAGS
- saved_LDFLAGS=$LDFLAGS
- saved_LIBS=$LIBS
- CPPFLAGS="$CPPFLAGS $X_CXXFLAGS"
- LDFLAGS="$LDFLAGS $X_LIBS"
- LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
- AC_LINK_IFELSE([AC_LANG_CALL([],[XOpenDisplay])],[x11_works=yes],[x11_works=no])
- if test $x11_works = no; then
- AC_MSG_WARN([could not link against X11, hoping Tk works without])
- CPPFLAGS=$saved_CPPFLAGS
- LDFLAGS=$saved_LDFLAGS
- LIBS=$saved_LIBS
- fi
- # now test whether Tk can be found
- if test .$with_tk = .yes; then
- for version in $TK_VERSION tk8.5 tk8.4 tk8.3 tk8.2 tk; do
- ES_ADDPATH_CHECK_LIB($version, Tk_Init, [use_tk=$version], [])
- if test .$use_tk != .; then break; fi
- done
- else
- ES_ADDPATH_CHECK_LIB($with_tk, Tk_Init, [use_tk=$with_tk], [])
- fi
- if test .$use_tk = .; then
- case $target_os in
- *darwin*) AC_MSG_ERROR(
-[If you have Tk installed, make sure that either libtcl.dylib is
- in one of the library paths set by LDFLAGS, or that you set the appropriate
- apple gcc -framework option in CPPFLAGS and LDFLAGS.]) ;;
- *) AC_MSG_FAILURE([Tk library $with_tk not found]) ;;
- esac
- fi
- if test .$use_tk = .tk; then
- if test .$use_tcl != .tcl; then
- AC_MSG_WARN([You are using a generic Tk version, but a defined Tcl version. This may cause problems.
-Try --with-tcl=tcl to also use a generic Tcl version, which may fit better.])
- fi
- fi
- case $target_os in
- *linux*) # path used by *buntu
- extrapaths="/usr/include/$version /usr/include/$use_tcl" ;;
- (*) ;;
- esac
- ES_ADDPATH_CHECK_HEADER(tk.h, [],
- [AC_MSG_ERROR([Tk headers not found. Please add the include path to CPPFLAGS (e.g. configure CPPFLAGS=-I/usr/include/tcl8.4).])
- ]
- ,$extrapaths)
- AC_DEFINE_UNQUOTED(TK,$use_tk,[Whether to use Tk])
-else
- use_tk=none
-fi
-
##################################
# check for FFTW
# with_fftw=no don't use FFTW
@@ -363,9 +225,9 @@ AC_ARG_WITH([fftw],
AC_MSG_RESULT($with_fftw)
AS_IF([test x$with_fftw = xno], [fftw_found=no],
- [ AC_SEARCH_LIBS(fftw_plan_many_dft, [fftw3], [fftw_found=yes], [fftw_found=no])
+ [ ES_ADDPATH_CHECK_LIB(fftw3, fftw_plan_many_dft, [fftw_found=yes], [fftw_found=no],)
AS_IF([test x$fftw_found = xyes],
- [AC_CHECK_HEADER([fftw3.h],, [fftw_found=no])])
+ [ES_ADDPATH_CHECK_HEADER([fftw3.h],, [fftw_found=no],)])
])
AS_IF([test x$fftw_found = xno],[
@@ -382,14 +244,14 @@ AS_IF([test x$fftw_found = xyes],[
##################################
# check for CUDA
AC_MSG_CHECKING([whether to use CUDA])
-
AC_ARG_WITH([cuda],
AS_HELP_STRING([--with-cuda@<:@=DIR@:>@], [specify
where CUDA is installed. The cuda compiler can also be
specified by setting the NVCC environment variable. The CUDA
library and header can be manually specified by using
CPPFLAGS, LDFLAGS and LIBS. [guess]]), ,
- with_cuda=guess) AC_MSG_RESULT($with_cuda)
+ with_cuda=guess)
+AC_MSG_RESULT($with_cuda)
AS_IF([test x$with_cuda = xguess || test x$with_cuda = xyes],[
cuda_path=/usr/local/cuda
@@ -402,16 +264,13 @@ cuda_ok=no
AS_IF([test x$with_cuda != xno],[
cuda_ok=yes
+
+ # save current libs in case CUDA is not enabled at the end
save_LIBS=$LIBS
save_LDFLAGS=$LDFLAGS
- save_CXX=$CXX
- save_CXXFLAGS=$CXXFLAGS
# NVCC
- AC_ARG_VAR(NVCC,[NVIDIA CUDA compiler command])
- AC_ARG_VAR(NVCCFLAGS,[special compiler flags for the NVIDIA CUDA compiler])
-
- AC_PATH_PROG(NVCC, nvcc, no, [$PATH:$cuda_path/bin])
+ AC_PROG_CUDA
AS_IF([test x$NVCC = xno],[
AS_IF([test x$with_cuda = xyes],[
@@ -421,14 +280,8 @@ AS_IF([test x$with_cuda != xno],[
])
])
- # MAC nvcc stays 32 bit, even if the rest is 64 bit
- case $target in
- x86_64-apple-darwin*)
- NVCCFLAGS="$NVCCFLAGS -m64";;
- esac
-
# since we link with mpic++, we need to find the cuda libraries manually
- ES_ADDPATH_CHECK_LIB(cudart, cudaGetDevice, [LIBS="$LIBS -lcudart"], [
+ ES_ADDPATH_CHECK_LIB(cudart, cudaGetDevice, [], [
cuda_ok=no
AS_IF([test x$with_cuda = xyes],[
@@ -438,7 +291,7 @@ AS_IF([test x$with_cuda != xno],[
])
], [$cuda_path/lib $cuda_path/lib64])
- ES_ADDPATH_CHECK_LIB(cufft, cufftPlan3d, [LIBS="$LIBS -lcufft"], [
+ ES_ADDPATH_CHECK_LIB(cufft, cufftPlan3d, [], [
cuda_ok=no
AS_IF([test x$with_cuda = xyes],[
@@ -451,20 +304,25 @@ AS_IF([test x$with_cuda != xno],[
# NVCC compile check
AC_MSG_CHECKING([whether CUDA compiles])
- # if no other compute capability is defined by the user, we require at least 1.1
+ # if no other compute capability is defined by the user, we default to 2.0
case "$NVCCFLAGS" in
*-arch=*) ;;
- *) NVCCFLAGS="$NVCCFLAGS --ptxas-options=-v -gencode arch=compute_11,code=compute_11 -gencode arch=compute_20,code=compute_20"
+ *) NVCCFLAGS="$NVCCFLAGS --ptxas-options=-v -gencode arch=compute_20,code=compute_20"
esac
# use nvcc
# autoconf currently doesn't allow to define new languages like cuda, this is a workaround
- save_CXX=$CXX
- save_CXXFLAGS=$CXXFLAGS
-
+ save_noncuda_CXX=$CXX
+ save_noncuda_CXXFLAGS=$CXXFLAGS
+ save_noncuda_LDFLAGS=$LDFLAGS
+ save_noncuda_LIBS=$LIBS
+
CXX=$NVCC
CXXFLAGS="$NVCCFLAGS -x cu"
+ # libtool linking options likely break NVCC linking, sort out all but simple -L options
+ AS_IF([test -n "$LDFLAGS"],[ LDFLAGS="-Xlinker `echo $LDFLAGS | sed -e ['s|-[^L][^ ]*||g' -e 's|[ ][ ]*|,|g']`" ])
+ AS_IF([test -n "$LIBS" ],[ LIBS="-Xlinker `echo $LIBS | sed ['s|[ ][ ]*|,|g']`"])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ],[cudaGetDevice(0);])], [
AC_MSG_RESULT(yes)
@@ -481,26 +339,44 @@ AS_IF([test x$with_cuda != xno],[
# NVCC compile check
AC_MSG_CHECKING([whether CUDA runs])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ],[int no; cudaGetDeviceCount(&no);])], [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ],[
+ int no;
+ cudaGetDeviceCount(&no);
+ if (no == 0) return 1;
+ ])], [
AC_MSG_RESULT(yes)
],[
- cuda_ok=no
AC_MSG_RESULT(no)
AS_IF([test x$with_cuda = xyes],[
- AC_MSG_FAILURE([cannot run CUDA code. Look at config.log for more details.])
+ cuda_running=no
+ AC_MSG_WARN([cannot run CUDA code. Look at config.log for more details. Still compiling since explicitely requested.])
],[
+ cuda_ok=no
AC_MSG_WARN([cannot run CUDA code. Some features will not be available!])
])
],[
AC_MSG_RESULT([unknown (cross-compiling)])
])
-
- CXX=$save_CXX
- CXXFLAGS=$save_CXXFLAGS
+
+ CXX=$save_noncuda_CXX
+ CXXFLAGS=$save_noncuda_CXXFLAGS
+ LDFLAGS=$save_noncuda_LDFLAGS
+ LIBS=$save_noncuda_LIBS
AS_IF([test x$cuda_ok == xyes], [
+ # NVCC doesn't work with llvm's libc++ so we need to also
+ # compile the rest with libstdc++, if nvcc-compiled code is
+ # used
+ AC_MSG_CHECKING([whether the compiler accepts -stdlib=libstdc++])
+ saved_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="-stdlib=libstdc++ $CXXFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[ AC_MSG_RESULT(yes) ],[
+ AC_MSG_RESULT(no); CXXFLAGS=$saved_CXXFLAGS
+ ])
+
AC_DEFINE(CUDA,[],[Whether CUDA is available])
],[
+ # reset standard compiler options
LIBS=$save_LIBS
LDFLAGS=$save_LDFLAGS
])
@@ -508,6 +384,197 @@ AS_IF([test x$with_cuda != xno],[
AM_CONDITIONAL(CUDA, [test x$cuda_ok == xyes])
+cat < /dev/null 2>&1; then
+ PYTHON="$PYTHON -B"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+AC_MSG_CHECKING([whether the python interface is wanted])
+AC_ARG_WITH([python-interface], AS_HELP_STRING([--with-python-interface],
+ [specify whether or not to use python [guess]]),
+ [], [with_python_interface=guess])
+AC_MSG_RESULT($with_python_interface)
+dnl with_python_interface=yes try to find a working PYTHON devel version,
+dnl bail out if none is found
+dnl with_python_interface=guess try to find a working PYTHON devel version,
+dnl with_python_interface=no do not use python interface
+
+AS_IF([test .$with_python_interface != .no], [
+ AX_PYTHON_DEVEL([>= '2.5'])
+
+ AC_ARG_VAR(CYTHON,[Specify the cython tool to use])
+ AC_PATH_PROG(CYTHON,cython,no)
+ AS_IF([test .$CYTHON = .no],
+ [build_python_interface=no],
+ [build_python_interface=yes])
+
+ AX_PYTHON_MODULE(numpy, required)
+ AC_MSG_CHECKING([for numpy include path])
+ NUMPY_INCLUDE="`$PYTHON -c 'import numpy; import sys; sys.stdout.write(numpy.get_include())'`" #`
+ PYTHON_CPPFLAGS="$PYTHON_CPPFLAGS -I$NUMPY_INCLUDE"
+ AC_MSG_RESULT([$NUMPY_INCLUDE])
+
+ AS_IF([test .$with_python_interface = .yes && test .$build_python_interface = .no],
+ [AC_MSG_FAILURE([Cannot build python interface!])])
+ AC_DEFINE(PYTHON_DEV,[],[Whether Python is available])
+])
+AM_CONDITIONAL(PYTHON_INTERFACE, [test .$build_python_interface = .yes])
+# export libtool objdir, so that we can link the .so files to the dir itself
+AC_SUBST(objdir)
+
+cat <.dylib is
+ in one of the library paths set by LDFLAGS, or that you set the appropriate
+ apple gcc -framework option in CPPFLAGS and LDFLAGS.]) ;;
+ *) AC_MSG_FAILURE([
+********************************************************************************
+* Could not link against the (static) Tcl library (libtcl*.a). *
+* Please add the library path to LDFLAGS (e.g. configure LDFLAGS=-L/usr/lib)! *
+********************************************************************************
+]) ;;
+ esac
+fi
+
+case $target_os in
+ *darwin*) extrapaths=/Library/Frameworks/Tcl.framework/Headers ;;
+ *linux*) # path used by *buntu
+ extrapaths=/usr/include/$version ;;
+esac
+
+if test .$use_tcl != .none; then
+ ES_ADDPATH_CHECK_HEADER(tcl.h, [],
+ [AC_MSG_FAILURE([
+********************************************************************************
+* Could not find the Tcl header files (tcl.h). *
+* Please add the include path to CPPFLAGS *
+* (e.g. configure CPPFLAGS=-I/usr/include)! *
+********************************************************************************
+])], $extrapaths)
+fi
+
+if test .$use_tcl = .; then
+ use_tcl=none
+fi
+
+AM_CONDITIONAL(TCL, [test .$use_tcl != .none])
+
+##################################
+# check for tk
+
+AC_MSG_CHECKING([whether to use Tk])
+AC_ARG_WITH(tk,
+ AS_HELP_STRING([--with-tk=VERSION],[whether to use Tk, and which version to use]),
+ [], [with_tk=no])
+AC_MSG_RESULT($with_tcl)
+
+dnl with_tk=no don't use Tk
+dnl with_tk=yes try to find a working Tk version, bail out if none is found
+dnl otherwise use the specified version
+if test .$with_tk != .no; then
+ # test for X11
+ AC_PATH_XTRA
+ saved_CPPFLAGS=$CPPFLAGS
+ saved_LDFLAGS=$LDFLAGS
+ saved_LIBS=$LIBS
+ CPPFLAGS="$CPPFLAGS $X_CXXFLAGS"
+ LDFLAGS="$LDFLAGS $X_LIBS"
+ LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[XOpenDisplay])],[x11_works=yes],[x11_works=no])
+ if test $x11_works = no; then
+ AC_MSG_WARN([could not link against X11, hoping Tk works without])
+ CPPFLAGS=$saved_CPPFLAGS
+ LDFLAGS=$saved_LDFLAGS
+ LIBS=$saved_LIBS
+ fi
+ # now test whether Tk can be found
+ if test .$with_tk = .yes; then
+ for version in $TK_VERSION tk8.5 tk8.4 tk8.3 tk8.2 tk; do
+ ES_ADDPATH_CHECK_LIB($version, Tk_Init, [use_tk=$version], [])
+ if test .$use_tk != .; then break; fi
+ done
+ else
+ ES_ADDPATH_CHECK_LIB($with_tk, Tk_Init, [use_tk=$with_tk], [])
+ fi
+ if test .$use_tk = .; then
+ case $target_os in
+ *darwin*) AC_MSG_ERROR(
+[If you have Tk installed, make sure that either libtcl.dylib is
+ in one of the library paths set by LDFLAGS, or that you set the appropriate
+ apple gcc -framework option in CPPFLAGS and LDFLAGS.]) ;;
+ *) AC_MSG_FAILURE([Tk library $with_tk not found]) ;;
+ esac
+ fi
+ if test .$use_tk = .tk; then
+ if test .$use_tcl != .tcl; then
+ AC_MSG_WARN([You are using a generic Tk version, but a defined Tcl version. This may cause problems.
+Try --with-tcl=tcl to also use a generic Tcl version, which may fit better.])
+ fi
+ fi
+ case $target_os in
+ *darwin*) extrapaths=/Library/Frameworks/Tk.framework/Headers ;;
+ *linux*) # path used by *buntu
+ extrapaths="/usr/include/$version /usr/include/$use_tcl" ;;
+ (*) ;;
+ esac
+ ES_ADDPATH_CHECK_HEADER(tk.h, [],
+ [AC_MSG_ERROR([Tk headers not found. Please add the include path to CPPFLAGS (e.g. configure CPPFLAGS=-I/usr/include/tcl8.4).])
+ ]
+ ,$extrapaths)
+ AC_DEFINE_UNQUOTED(TK,$use_tk,[Whether to use Tk])
+else
+ use_tk=none
+fi
+
cat <@])
+AC_MSG_CHECKING([whether the variable MYCONFIG is set])
+AS_IF([test "x$MYCONFIG" != "x"], [
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([whether file $MYCONFIG exists])
+ if ! test -f $MYCONFIG; then
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([MYCONFIG file $MYCONFIG does not exist!])
+ fi
+],[
+ AC_MSG_RESULT(no)
+ MYCONFIG="myconfig.hpp"
+])
+AM_CONDITIONAL(MYCONFIG, [test x$MYCONFIG != xmyconfig.hpp])
##################################
# Number of CPUs
@@ -567,10 +641,12 @@ AC_CONFIG_FILES([
config/Makefile
config/myconfig-sample-header.hpp
src/Makefile
+ src/core/Makefile
+ src/tcl/Makefile
+ src/python/espressomd/Makefile
tools/Makefile
scripts/Makefile
testsuite/Makefile
- testsuite/configs/Makefile
doc/Makefile
doc/logo/Makefile
doc/ug/Makefile
@@ -579,12 +655,15 @@ AC_CONFIG_FILES([
doc/tutorials/Makefile
doc/tutorials/01-lennard_jones/Makefile
doc/tutorials/02-charged_system/Makefile
+ doc/tutorials/03-object_in_fluid/Makefile
doc/latexit.sh
])
AC_CONFIG_FILES([testsuite/runtest.sh],
[chmod 755 testsuite/runtest.sh])
AC_CONFIG_FILES([tools/es_mpiexec],
[chmod 755 tools/es_mpiexec])
+AC_CONFIG_FILES([src/python/pypresso],
+ [chmod 755 src/python/pypresso])
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/src/features.def $(top_srcdir)/config/gen_sampleconfig.py'])
AC_CONFIG_COMMANDS([myconfig-sample.hpp],
@@ -602,59 +681,86 @@ cat <
%%
%% This program is free software: you can redistribute it and/or modify
diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile
index a826c755949..b9353ee76b0 100644
--- a/doc/doxygen/Doxyfile
+++ b/doc/doxygen/Doxyfile
@@ -1,4 +1,6 @@
-# Doxyfile 1.7.3
+# Doxyfile 1.8.2
+
+@INCLUDE = $(BUILDDIR)/doxy-features
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -22,8 +24,9 @@
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
PROJECT_NAME = $(PACKAGE)
@@ -33,10 +36,9 @@ PROJECT_NAME = $(PACKAGE)
PROJECT_NUMBER =
-# Using the PROJECT_BRIEF tag one can provide an optional one line
-# description for a project that appears at the top of each page and
-# should give viewer a quick idea about the purpose of the
-# project. Keep the description short.
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "Extensible Simulation Package for Soft Matter Research"
@@ -126,7 +128,9 @@ FULL_PATH_NAMES = NO
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# path to strip. Note that you specify absolute paths here, but also
+# relative paths, which will be relative from the directory where doxygen is
+# started.
STRIP_FROM_PATH =
@@ -167,7 +171,7 @@ QT_AUTOBRIEF = NO
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
-MULTILINE_CPP_IS_BRIEF = NO
+MULTILINE_CPP_IS_BRIEF = YES
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
@@ -195,6 +199,13 @@ TAB_SIZE = 8
ALIASES =
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
@@ -222,16 +233,33 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING = cu=C
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension,
+# and language is one of the parsers supported by doxygen: IDL, Java,
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
+# C++. For instance to make doxygen treat .inc files as Fortran files (default
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the
+# files are not read by doxygen.
+
+EXTENSION_MAPPING = cu=C++
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented classes,
+# or namespaces to their corresponding documentation. Such a link can be
+# prevented in individual cases by by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
@@ -253,12 +281,7 @@ CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO.
IDL_PROPERTY_SUPPORT = YES
@@ -277,6 +300,22 @@ DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
@@ -299,10 +338,21 @@ TYPEDEF_HIDES_STRUCT = NO
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
+# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 0
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -319,6 +369,11 @@ EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE = NO
+
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
@@ -453,12 +508,11 @@ SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will
-# reject a match between the prototype and the implementation of a
-# member function even if there is only one candidate or it is obvious
-# which candidate to choose by doing a simple string match. By
-# disabling STRICT_PROTO_MATCHING doxygen will still accept a match
-# between prototype and implementation in such cases.
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
STRICT_PROTO_MATCHING = NO
@@ -507,12 +561,6 @@ MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = YES
-
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
@@ -538,13 +586,23 @@ FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
+# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -606,8 +664,7 @@ WARN_LOGFILE =
# with spaces.
INPUT = $(SRCDIR)/src \
- $(SRCDIR)/doc/doxygen \
- background_errors.dox
+ $(SRCDIR)/doc/doxygen
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -627,7 +684,9 @@ INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \
*.c \
- *.cu \
+ *.hpp \
+ *.cpp \
+ *.cu \
*.dox
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
@@ -636,13 +695,15 @@ FILE_PATTERNS = *.h \
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
+# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
-EXCLUDE = acconfig.h
+EXCLUDE = acconfig.hpp
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
@@ -654,7 +715,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
-EXCLUDE_PATTERNS = src/myconfig-final.h
+EXCLUDE_PATTERNS = src/myconfig-final.hpp
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -744,7 +805,7 @@ INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
STRIP_CODE_COMMENTS = NO
@@ -790,7 +851,7 @@ VERBATIM_HEADERS = YES
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
-ALPHABETICAL_INDEX = NO
+ALPHABETICAL_INDEX = YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
@@ -828,7 +889,14 @@ HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
@@ -840,15 +908,34 @@ HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
+# fine-tune the look of the HTML output. If left blank doxygen will
+# generate a default style sheet. Note that it is recommended to use
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
+# tag will in the future become obsolete.
HTML_STYLESHEET =
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
+# user-defined cascading style sheet that is included after the standard
+# style sheets created by doxygen. Using this option one can overrule
+# certain style aspects. This is preferred over using HTML_STYLESHEET
+# since it does not replace the standard style sheet and is therefor more
+# robust against future updates. Doxygen will copy the style sheet file to
+# the output directory.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the stylesheet and background images
+# Doxygen will adjust the colors in the style sheet and background images
# according to this color. Hue is specified as an angle on a colorwheel,
# see http://en.wikipedia.org/wiki/Hue for more information.
# For instance the value 0 represents red, 60 is yellow, 120 is green,
@@ -878,19 +965,22 @@ HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
-HTML_DYNAMIC_SECTIONS = NO
+HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
@@ -919,9 +1009,9 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
+# identify the documentation publisher. This should be a reverse domain-name
+# style string, e.g. com.mycompany.MyDocSet.documentation.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
@@ -1043,18 +1133,14 @@ GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [0,1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-# Note that a value of 0 will completely suppress the enum values from appearing in the overview section.
-
-ENUM_VALUES_PER_LINE = 4
-
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
@@ -1062,13 +1148,17 @@ ENUM_VALUES_PER_LINE = 4
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
-GENERATE_TREEVIEW = NO
+GENERATE_TREEVIEW = YES
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
-USE_INLINE_TREES = NO
+ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
@@ -1101,23 +1191,28 @@ FORMULA_TRANSPARENT = YES
# (see http://www.mathjax.org) which uses client side Javascript for the
# rendering instead of using prerendered bitmaps. Use this if you do not
# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you also need to install MathJax separately and
+# output. When enabled you may also need to install MathJax separately and
# configure the path to it using the MATHJAX_RELPATH option.
USE_MATHJAX = NO
-# When MathJax is enabled you need to specify the location relative to
-# the HTML output directory using the MATHJAX_RELPATH option. The
-# destination directory should contain the MathJax.js script. For
-# instance, if the mathjax directory is located at the same level as
-# the HTML output directory, then MATHJAX_RELPATH should be
-# ../mathjax. The default value points to the mathjax.org site, so you
-# can quickly see the result without installing MathJax, but it is
-# strongly recommended to install a local copy of MathJax before
-# deployment.
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
# for the HTML output. The underlying search engine uses javascript
# and DHTML and should work on any modern browser. Note that when using
@@ -1191,6 +1286,13 @@ EXTRA_PACKAGES =
LATEX_HEADER =
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
@@ -1224,6 +1326,12 @@ LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1255,7 +1363,7 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# Load style sheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
@@ -1400,7 +1508,7 @@ MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
@@ -1415,7 +1523,7 @@ INCLUDE_PATH = $(INCLUDEDIR)
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
-INCLUDE_FILE_PATTERNS = myconfig-sample.h
+INCLUDE_FILE_PATTERNS = *.h *.hpp
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
@@ -1425,14 +1533,17 @@ INCLUDE_FILE_PATTERNS = myconfig-sample.h
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED = DOXYGEN_RUN FFTW CUDA TK
+# PREDEFINED = \
+# DOXYGEN_RUN \
+# FFTW \
+# CUDA \
+# TK
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES
-# then this tag can be used to specify a list of macro names that
-# should be expanded. The macro definition that is found in the
-# sources will be used. Use the PREDEFINED tag if you want to use a
-# different macro definition that overrules the definition found in
-# the source code.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
@@ -1447,22 +1558,18 @@ SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
#
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
TAGFILES =
@@ -1530,13 +1637,12 @@ HAVE_DOT = $(HAVE_DOT)
DOT_NUM_THREADS = 0
-# By default doxygen will write a font called Helvetica to the output
-# directory and reference it in all dot files that doxygen generates.
-# When you want a differently looking font you can specify the font name
-# using DOT_FONTNAME. You need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
DOT_FONTNAME = Helvetica
@@ -1545,17 +1651,16 @@ DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
@@ -1577,6 +1682,15 @@ GROUP_GRAPHS = YES
UML_LOOK = NO
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS = 10
+
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
@@ -1617,7 +1731,7 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
@@ -1625,10 +1739,21 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, svg, gif or svg.
-# If left blank png will be used.
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = svg
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
-DOT_IMAGE_FORMAT = png
+INTERACTIVE_SVG = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -1655,7 +1780,7 @@ MSCFILE_DIRS =
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-DOT_GRAPH_MAX_NODES = 50
+DOT_GRAPH_MAX_NODES = 100
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
@@ -1673,7 +1798,7 @@ MAX_DOT_GRAPH_DEPTH = 0
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
-DOT_TRANSPARENT = NO
+DOT_TRANSPARENT = YES
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 6920ad0182d..095faf2dbed 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
@@ -17,52 +17,66 @@
# along with this program. If not, see .
#
EXTRA_DIST = \
- background_errors.sh background_errors.awk \
+ gen_doxyconfig.py \
Doxyfile \
- figs/bond_angle.fig \
- figs/bond_angle.gif \
- figs/datastorage.gif \
- figs/dihedral_angle.fig \
- figs/dihedral_angle.gif \
- figs/dihedral_angle.pdf \
- figs/directions.fig \
- figs/directions.gif \
- figs/elc_errordist.gif \
- figs/ghost_cells.fig \
- figs/ghost_cells.gif \
- figs/ghost_communication.fig \
- figs/ghost_communication.gif \
- figs/linked_cells.fig \
- figs/linked_cells.gif \
- figs/logo.png \
- figs/move_to_p_buf.fig \
- figs/move_to_p_buf.gif \
- figs/particles.fig \
- figs/particles.gif
+ figs/bond_angle.fig \
+ figs/bond_angle.gif \
+ figs/datastorage.gif \
+ figs/dihedral_angle.fig \
+ figs/dihedral_angle.gif \
+ figs/dihedral_angle.pdf \
+ figs/directions.fig \
+ figs/directions.gif \
+ figs/elc_errordist.gif \
+ figs/ghost_cells.fig \
+ figs/ghost_cells.gif \
+ figs/ghost_communication.fig \
+ figs/ghost_communication.gif \
+ figs/linked_cells.fig \
+ figs/linked_cells.gif \
+ figs/logo.png \
+ figs/move_to_p_buf.fig \
+ figs/move_to_p_buf.gif \
+ figs/particles.fig \
+ figs/particles.gif
.PHONY: doc doxygen
doc: doxygen
-doxygen:
if HAVE_DOXYGEN
- SRCDIR=$(srcdir) AWK=$(AWK)\
- $(SHELL) $(srcdir)/background_errors.sh $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
+if HAVE_PYTHON
+doxy-features:
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_doxyconfig.py \
+ $(top_srcdir)/src/features.def doxy-features
+
+doxygen-html: doxy-features
+ $(AM_V_GEN)\
ESPRESSO_VERSION=`cd $(top_srcdir); sh config/genversion.sh` \
PACKAGE="ESPResSo $$ESPRESSO_VERSION" \
- SRCDIR=$(top_srcdir) INCLUDEDIR=$(top_builddir) \
- HAVE_DOT=$(HAVE_DOT) DOT_PATH=$(DOT_PATH) \
+ SRCDIR="$(abs_top_srcdir)" \
+ BUILDDIR="$(builddir)" \
+ HAVE_DOT="$(HAVE_DOT)" DOT_PATH="$(DOT_PATH)" \
$(DOXYGEN) $(srcdir)/Doxyfile
@echo "***************************************************************************"
@echo "* The code documentation is now accessible at"
@echo "* file://`pwd`/html/index.html"
@echo "***************************************************************************"
+
+doxygen: doxygen-html
+
else
+doxygen:
+ @echo "Python was not found in your PATH."
+ @echo "Can't build the code documentation without python."
+ @echo "Install python and rerun configure."
+endif
+else
+doxygen:
@echo "doxygen was not found in your PATH."
- @echo "Can't build the code documentation without doxygen."
+ @echo "Can't build the code documentation without doxygen and python."
@echo "Install doxygen and rerun configure."
endif
-MOSTLYCLEANFILES = background_errors.doxygen background_errors.sorted background_errors.unsorted
clean-local:
-rm -rf html
diff --git a/doc/doxygen/background_errors.awk b/doc/doxygen/background_errors.awk
deleted file mode 100644
index 2f99a8e771a..00000000000
--- a/doc/doxygen/background_errors.awk
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (C) 2012,2013 The ESPResSo project
-# Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Axel Arnold
-#
-# This file is part of ESPResSo.
-#
-# ESPResSo is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# ESPResSo is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# Parse the ERROR_SPRINTF lines
-/\ *ERROR_SPRINTF.*/ {
- # skip define of ERROR_SPRINTF
- if($0 == "#define ERROR_SPRINTF sprintf")
- nextfile;
- out = "";
- count = split($0,s,/\{/);
- c = 2;
- while(c <= count){
- out = out s[c];
- c = c+1;
- }
- errcode = substr(out,match(out,/[0-9]{3}/),3);
- if(para_match($0) != 0){
- getline;
- c = match($0,/[a-zA-Z0-9]/);
- out = out substr($0,c,length-c+1);
- out = substr(out,1,length(out)-2);
- } else {
- out = substr(out,1,length(out)-2);
- }
- filename = FILENAME;
- gsub(/.*\//,"",filename);
- print "
";
-}
-
-# Parse all other lines for the function name
-/.*/ {
- if(FNR == 1){
- i = 0;
- j = 0;
- cflag = 0;
- }
- nocomments();
- i = i + split(" " $0 " ",tmp,/\{/);
- i = i - split(" " $0 " ",tmp,/\}/);
- if(i == 1 && j == 0) {
- if(match($0,/[a-zA-Z0-9_]+\(.*\).*\{/) == 0)
- $0 = buf $0;
- if(match($0,/[a-zA-Z0-9_]+\(.*\).*\{/) == 0)
- $0 = buf1 $0;
- x = match($0,/\(/);
- $0 = substr($0,1,x-1);
- x = split($0,s);
- fname = s[x];
- if(match(fname,/\*/) == 1)
- fname = substr(fname,2,length(fname)-1);
- }
- buf1= buf;
- buf = $0;
- j = i;
-}
-
-# ignore comment lines
-function nocomments(){
- tmp0 = "";
- spos = match($0,/\/\*/)
- eposold = 0
- epos = match($0,/\*\//)
- while(spos > 0 || epos > 0){
- if((spos < epos && spos > 0) || epos == 0){
- if(cflag == 0){
- tmp0 = tmp0 substr($0,eposold+1,spos-eposold-1)
- cflag = 1
- }
- sub(/\/\*/,"XX",$0)
- spos = match($0,/\/\*/)
- }
- else{
- if(cflag == 1){
- cflag = 0
- eposold = epos+1
- }
- sub(/\*\//,"YY",$0)
- epos = match($0,/\*\//)
- }
- }
- if(cflag == 0)
- tmp0 = tmp0 substr($0,eposold+1,length-eposold)
- $0 = tmp0
-}
-
-function para_match(s){
- return (split(s,a,"(") - split(s,b,")"));
-}
diff --git a/doc/doxygen/gen_doxyconfig.py b/doc/doxygen/gen_doxyconfig.py
new file mode 100644
index 00000000000..eec761206bc
--- /dev/null
+++ b/doc/doxygen/gen_doxyconfig.py
@@ -0,0 +1,59 @@
+# Copyright (C) 2013,2014 The ESPResSo project
+# Copyright (C) 2012 Olaf Lenz
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# This script generates the file doxy-features
+#
+from __future__ import print_function
+import inspect, sys, os
+# find featuredefs.py
+moduledir = os.path.dirname(inspect.getfile(inspect.currentframe()))
+sys.path.append(os.path.join(moduledir, '..', '..', 'src'))
+import featuredefs
+import time
+
+if len(sys.argv) != 3:
+ print("Usage: {} DEFFILE DOXYCONFIG".format(sys.argv[0]), file=sys.stderr)
+ exit(2)
+
+deffilename, configfilename = sys.argv[1:3]
+
+print("Reading definitions from {}...".format(deffilename))
+defs = featuredefs.defs(deffilename)
+print("Done.")
+
+print("Writing {}...".format(configfilename))
+configfile = file(configfilename, 'w');
+
+configfile.write("""# WARNING: This file was autogenerated by
+#
+# {}
+# on {}
+# Do not modify it or your changes will be overwritten!
+# Modify features.def instead.
+#
+# This file is needed so that doxygen will generate documentation for
+# all functions of all features.
+PREDEFINED = \\
+""".format(sys.argv[0], time.asctime()))
+
+for feature in sorted(defs.features):
+ configfile.write(" {} \\\n".format(feature))
+
+configfile.close()
+print("Done.")
+
diff --git a/doc/doxygen/main.dox b/doc/doxygen/main.dox
index ef7ace73195..489f52f869d 100644
--- a/doc/doxygen/main.dox
+++ b/doc/doxygen/main.dox
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+ Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
@@ -46,9 +46,9 @@ homepage. The DG explains
The script is interpreted on one node, the master node, whereas the
other nodes wait for the master node to issue specific actions,
i. e. a client-server model is utilized. More details can be found in
-\ref communication.h "communication.h". During the actual integration,
+\ref communication.hpp "communication.hpp". During the actual integration,
however, the communication is done synchronously. For more details
-see \ref integrate.c "integrate.c".
+see \ref integrate.cpp "integrate.cpp".
\section Copyright and License of the Code Documentation
Copyright (C) 2010,2011,2012 The ESPResSo project
diff --git a/doc/latexit.sh.in b/doc/latexit.sh.in
index 88573fb4d1f..5def13f9b7b 100644
--- a/doc/latexit.sh.in
+++ b/doc/latexit.sh.in
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2010,2011,2012 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/doc/logo/Makefile.am b/doc/logo/Makefile.am
index 94d3d9befa0..541187fd9b5 100644
--- a/doc/logo/Makefile.am
+++ b/doc/logo/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2011 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/doc/logo/cup.vmd b/doc/logo/cup.vmd
index a032e56660c..94fba744975 100644
--- a/doc/logo/cup.vmd
+++ b/doc/logo/cup.vmd
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
diff --git a/doc/logo/cup_espresso.tcl b/doc/logo/cup_espresso.tcl
index e7279921b29..835479b3647 100755
--- a/doc/logo/cup_espresso.tcl
+++ b/doc/logo/cup_espresso.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/logo/generate_animation.sh b/doc/logo/generate_animation.sh
index 6543e860276..1a78d2b5da3 100755
--- a/doc/logo/generate_animation.sh
+++ b/doc/logo/generate_animation.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2012,2013 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/doc/logo/generate_pixmaps.sh b/doc/logo/generate_pixmaps.sh
index b44d0982782..76053a21883 100755
--- a/doc/logo/generate_pixmaps.sh
+++ b/doc/logo/generate_pixmaps.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2012,2013 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/doc/misc/description.txt b/doc/misc/description.txt
index 8eab071257d..88097ed0857 100644
--- a/doc/misc/description.txt
+++ b/doc/misc/description.txt
@@ -1,4 +1,4 @@
-Copyright (C) 2012,2013 The ESPResSo project
+Copyright (C) 2012,2013,2014 The ESPResSo project
This file is part of ESPResSo.
diff --git a/doc/misc/python.tex b/doc/misc/python.tex
index e8507872ca2..0ee70bf7ca9 100644
--- a/doc/misc/python.tex
+++ b/doc/misc/python.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2011,2012,2013 The ESPResSo project
+% Copyright (C) 2011,2012,2013,2014 The ESPResSo project
%
% This file is part of ESPResSo.
%
diff --git a/doc/tutorials/01-lennard_jones/01-lennard_jones.tex b/doc/tutorials/01-lennard_jones/01-lennard_jones.tex
index 748262bc7c2..e319f55a270 100644
--- a/doc/tutorials/01-lennard_jones/01-lennard_jones.tex
+++ b/doc/tutorials/01-lennard_jones/01-lennard_jones.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -394,7 +394,8 @@ \subsection{Comparisons and looping}
{\small\vspace{0,2cm}
\begin{lstlisting}[numbers=none]
-set i 0 foreach j $x {\
+set i 0
+foreach j $x {\
puts "$j is item number $i in list x"; incr i}
\end{lstlisting}\vspace{0,2cm}
}
@@ -418,7 +419,7 @@ \subsection{Comparisons and looping}
llength $x ; # get the size of list x (number of elements)
lappend x 5 ; # add a new member end of list
puts "x is {$x}" ; # print list again
-set $x [linsert $x 3 3a] ; # insert an element "3a" at index 3
+set x [linsert $x 3 3a] ; # insert an element "3a" at index 3
puts "x is {$x}" ; # print list again
\end{lstlisting}
}\vspace{0,2cm}
diff --git a/doc/tutorials/01-lennard_jones/Makefile.am b/doc/tutorials/01-lennard_jones/Makefile.am
index 99c88887612..5da07156598 100644
--- a/doc/tutorials/01-lennard_jones/Makefile.am
+++ b/doc/tutorials/01-lennard_jones/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
diff --git a/doc/tutorials/01-lennard_jones/scripts/blockfile_read.tcl b/doc/tutorials/01-lennard_jones/scripts/blockfile_read.tcl
index 75f77131f42..542762219b9 100755
--- a/doc/tutorials/01-lennard_jones/scripts/blockfile_read.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/blockfile_read.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/scripts/lj_functions.tcl b/doc/tutorials/01-lennard_jones/scripts/lj_functions.tcl
index 04ce09e1b06..1b8c56f8c43 100755
--- a/doc/tutorials/01-lennard_jones/scripts/lj_functions.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/lj_functions.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/scripts/lj_tutorial.tcl b/doc/tutorials/01-lennard_jones/scripts/lj_tutorial.tcl
index f62a86ede72..38233fd2bcf 100755
--- a/doc/tutorials/01-lennard_jones/scripts/lj_tutorial.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/lj_tutorial.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/scripts/msd.tcl b/doc/tutorials/01-lennard_jones/scripts/msd.tcl
index 94b5589e101..50d609fe16b 100755
--- a/doc/tutorials/01-lennard_jones/scripts/msd.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/msd.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/scripts/rdf.tcl b/doc/tutorials/01-lennard_jones/scripts/rdf.tcl
index 3772c1a4fec..32fa80149d5 100755
--- a/doc/tutorials/01-lennard_jones/scripts/rdf.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/rdf.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/scripts/vacf.tcl b/doc/tutorials/01-lennard_jones/scripts/vacf.tcl
index 2b03f49a80e..d892790b729 100755
--- a/doc/tutorials/01-lennard_jones/scripts/vacf.tcl
+++ b/doc/tutorials/01-lennard_jones/scripts/vacf.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/blockfile_read.tcl b/doc/tutorials/01-lennard_jones/solutions/blockfile_read.tcl
index 75f77131f42..542762219b9 100755
--- a/doc/tutorials/01-lennard_jones/solutions/blockfile_read.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/blockfile_read.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/lj_functions.tcl b/doc/tutorials/01-lennard_jones/solutions/lj_functions.tcl
index 04ce09e1b06..1b8c56f8c43 100755
--- a/doc/tutorials/01-lennard_jones/solutions/lj_functions.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/lj_functions.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/lj_tutorial.tcl b/doc/tutorials/01-lennard_jones/solutions/lj_tutorial.tcl
index 5502419e06c..b5d70306fb5 100755
--- a/doc/tutorials/01-lennard_jones/solutions/lj_tutorial.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/lj_tutorial.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/msd.tcl b/doc/tutorials/01-lennard_jones/solutions/msd.tcl
index 623940a8ea3..410d37dbb39 100755
--- a/doc/tutorials/01-lennard_jones/solutions/msd.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/msd.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/rdf.tcl b/doc/tutorials/01-lennard_jones/solutions/rdf.tcl
index 3772c1a4fec..32fa80149d5 100755
--- a/doc/tutorials/01-lennard_jones/solutions/rdf.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/rdf.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/vacf.tcl b/doc/tutorials/01-lennard_jones/solutions/vacf.tcl
index 3e2d76e44dc..0efe3255976 100755
--- a/doc/tutorials/01-lennard_jones/solutions/vacf.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/vacf.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/01-lennard_jones/solutions/vacf_vec.tcl b/doc/tutorials/01-lennard_jones/solutions/vacf_vec.tcl
index d0d9cfed647..8a617a2945d 100755
--- a/doc/tutorials/01-lennard_jones/solutions/vacf_vec.tcl
+++ b/doc/tutorials/01-lennard_jones/solutions/vacf_vec.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/02-charged_system/02-charged_system.tex b/doc/tutorials/02-charged_system/02-charged_system.tex
index 13b9c4b90a2..c80e08f7e10 100644
--- a/doc/tutorials/02-charged_system/02-charged_system.tex
+++ b/doc/tutorials/02-charged_system/02-charged_system.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -395,6 +395,50 @@ \section{Analysis}
was one of the main reasons why we decided to use a script language
for controlling the simulation core.
+\section{Using the MEMD algorithm}
+
+\es{} provides a variety of different electrostatics solvers. So far,
+we have been introduced to P$^3$M, but in this section we will try
+something new. A fairly recent addition to the family of electrostatics
+solvers is the "Maxwell Equations Molecular Dynamics" (MEMD) algorithm.
+To use it, two parameters have to be set: A mesh size, and a method
+parameter called \verb|f_mass|, which can be estimated following the
+formula in the \es{} user guide. In this example, a good estimate for
+the mesh size is 12, but this can be varied, affecting speed and
+accuracy of the algorithm.
+
+The MEMD algorithm relies on a very precise spatial distribution of
+the particles across processors, and will therefore currently not work
+with Verlet lists. Since those are switched on by default, they will
+have to be turned off manually.
+
+\begin{tclcode}
+ cellsystem domain_decomposition -no_verlet_list
+\end{tclcode}
+
+
+Other than that, you will have to replace the setup of the P$^3$M
+interaction with an according MEMD call.
+
+\begin{tclcode}
+ set memd_mesh 12
+ set f_mass [expr 100.0*pow( ([setmd time_step]*$memd_mesh/$box_l),2.0)]
+ inter coulomb 10.0 memd $f_mass $memd_mesh
+\end{tclcode}
+
+
+Be sure to comment out the P$^3$M part of your script, otherwise
+you will have both algorithms running at the same time, resulting
+in twice the electrostatic force. In the example script included
+within the \es{} code, there is already an \verb|if|-construct
+provided and you can switch between the methods at the very top
+of the script.
+
+You can copy the results from your completed tasks so far to a different
+filename (e.g.~\verb|rdf_p3m.data|) for comparison. Then, just
+run the simulation and analysis again, and compare the speed and
+resulting radial distribution function of the two methods.
+
\section{Partially periodic boundary conditions}
\begin{figure}[t]
diff --git a/doc/tutorials/02-charged_system/Makefile.am b/doc/tutorials/02-charged_system/Makefile.am
index 960de222d11..98de59ded40 100644
--- a/doc/tutorials/02-charged_system/Makefile.am
+++ b/doc/tutorials/02-charged_system/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
diff --git a/doc/tutorials/02-charged_system/figures/nacl.plot b/doc/tutorials/02-charged_system/figures/nacl.plot
index 8d1e901618f..d981858ba54 100644
--- a/doc/tutorials/02-charged_system/figures/nacl.plot
+++ b/doc/tutorials/02-charged_system/figures/nacl.plot
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
diff --git a/doc/tutorials/02-charged_system/scripts/analyze.tcl b/doc/tutorials/02-charged_system/scripts/analyze.tcl
index 8f034c13838..aac67c85487 100644
--- a/doc/tutorials/02-charged_system/scripts/analyze.tcl
+++ b/doc/tutorials/02-charged_system/scripts/analyze.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/tutorials/02-charged_system/scripts/analyze_rho.tcl b/doc/tutorials/02-charged_system/scripts/analyze_rho.tcl
index 1c1bfb6eaee..4bb3afe5684 100644
--- a/doc/tutorials/02-charged_system/scripts/analyze_rho.tcl
+++ b/doc/tutorials/02-charged_system/scripts/analyze_rho.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/tutorials/02-charged_system/scripts/replay.tcl b/doc/tutorials/02-charged_system/scripts/replay.tcl
index e5d15c72786..8e6fbc65e31 100644
--- a/doc/tutorials/02-charged_system/scripts/replay.tcl
+++ b/doc/tutorials/02-charged_system/scripts/replay.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/tutorials/02-charged_system/scripts/sim.tcl b/doc/tutorials/02-charged_system/scripts/sim.tcl
index b5a74b536c7..ed35bfd3185 100644
--- a/doc/tutorials/02-charged_system/scripts/sim.tcl
+++ b/doc/tutorials/02-charged_system/scripts/sim.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
@@ -17,13 +17,22 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-#
-set n_part 200; set density 0.7
+#
+
+# Set system parameters
+set n_part 200
+set density 0.7
set box_l [expr pow($n_part/$density,1./3.)]
+# Select electrostatics method
+set method "p3m"
+#set method "memd"
+
+# Setup system geometry in Espresso
setmd box_l $box_l $box_l $box_l
setmd periodic 1 1 1
+# Place particles
set q 1; set type 0
for {set i 0} { $i < $n_part } {incr i} {
set posx [expr $box_l*[t_random]]
@@ -33,16 +42,42 @@ for {set i 0} { $i < $n_part } {incr i} {
part $i pos $posx $posy $posz q $q type $type
}
+# Simulation parameters
setmd time_step 0.01; setmd skin 0.3
+# Thermostat
set temp 1; set gamma 1
thermostat langevin $temp $gamma
+
+# Lennard-Jones interactions
set sig 1.0; set cut [expr 1.12246*$sig]
set eps 1.0; set shift [expr 0.25*$eps]
inter 0 0 lennard-jones $eps $sig $cut $shift 0
inter 1 0 lennard-jones $eps $sig $cut $shift 0
inter 1 1 lennard-jones $eps $sig $cut $shift 0
-puts [inter coulomb 10.0 p3m tunev2 accuracy 1e-3 mesh 32]
+
+
+# Check if electrostatics method is clear...
+if { ![ info exists method ] } {
+ puts "Please select an electrostatics method in the script."
+ exit
+}
+
+# Distinguish between different methods
+if { $method == "p3m" } {
+ puts [inter coulomb 10.0 p3m tunev2 accuracy 1e-3 mesh 32]
+} elseif { $method == "memd" } {
+ # MEMD need no Verlet lists!
+ cellsystem domain_decomposition -no_verlet_list
+ set memd_mesh 12
+ set f_mass [expr 100.0*pow( ([setmd time_step]*$memd_mesh/$box_l) , 2.0 ) ]
+ puts "memd parameters: mesh=$memd_mesh, f_mass=$f_mass"
+ puts [inter coulomb 10.0 memd $f_mass $memd_mesh]
+} else {
+ puts "Electrostatics method must be one of 'memd' or 'p3m'."
+ exit
+}
+
set p3m_params [inter coulomb]
foreach f $p3m_params { eval inter $f }
diff --git a/doc/tutorials/02-charged_system/scripts/sim_charged_walls.tcl b/doc/tutorials/02-charged_system/scripts/sim_charged_walls.tcl
index bc2671f630a..ee6d0003adf 100644
--- a/doc/tutorials/02-charged_system/scripts/sim_charged_walls.tcl
+++ b/doc/tutorials/02-charged_system/scripts/sim_charged_walls.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/tutorials/02-charged_system/scripts/sim_walls.tcl b/doc/tutorials/02-charged_system/scripts/sim_walls.tcl
index 13f9dc6a7ab..afa9336a25e 100644
--- a/doc/tutorials/02-charged_system/scripts/sim_walls.tcl
+++ b/doc/tutorials/02-charged_system/scripts/sim_walls.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/doc/tutorials/03-object_in_fluid/03-object_in_fluid.tex b/doc/tutorials/03-object_in_fluid/03-object_in_fluid.tex
new file mode 100755
index 00000000000..bb2bb1d3ad0
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/03-object_in_fluid.tex
@@ -0,0 +1,338 @@
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
+% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
+% Max-Planck-Institute for Polymer Research, Theory Group
+%
+% This file is part of ESPResSo.
+%
+% ESPResSo is free software: you can redistribute it and/or modify it
+% under the terms of the GNU General Public License as published by the
+% Free Software Foundation, either version 3 of the License, or (at your
+% option) any later version.
+%
+% ESPResSo is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see .
+%
+\documentclass[
+a4paper, % paper size
+11pt, % font size
+twoside, % two sided
+footsepline, % add a line to separate the footer
+headsepline, % add a line to separate the header
+headexclude, % header does not belong to the text
+footexclude, % footer does not belong to the text
+pagesize, % set the pagesize in a DVI document
+]{scrartcl}
+
+\include{common}
+\usepackage[export]{adjustbox}
+
+\begin{document}
+\esptitlehead
+\title{Tutorial: Object in fluid
+\ifdefined\esversion
+\thanks{For \es \esversion}
+\fi
+}
+
+\maketitle
+\tableofcontents
+
+\section{Introduction}
+
+This tutorial introduces some of the features of \es\ module Object in fluid (OIF). Even though \es\ was not primarily intended to work with closed objects, it appears very suitable when one wants to model closed objects with elastic properties, especially if they are immersed in a moving fluid. Here we offer a step by step Tcl tutorial that will show you how to use this module. The resulting code can be run using \verb|Espresso | from the \es source directory. It produces .vtk files that can then be visualized using Paraview.\\
+
+The OIF module was developed for simulations of red blood cells flowing through microfluidic devices and therefore the elasticity features were designed with this application in mind. However, they are completely tunable and can be modified easily to allow the user model any elastic object moving in fluid flow.
+
+\begin{figure}[htbp]
+ \hfill
+ \begin{minipage}[t]{.32\textwidth}
+
+ \includegraphics[width=4.3cm,right]{figures/1.png}
+
+ \end{minipage}
+ \hfill
+ \begin{minipage}[t]{.32\textwidth}
+ \begin{center}
+ \includegraphics[width=4.2cm]{figures/2.png}
+ \end{center}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[t]{.32\textwidth}
+
+ \includegraphics[width=4.2cm,left]{figures/3.png}
+
+ \end{minipage}
+ \hfill
+\end{figure}
+
+\section{Basic set up}
+
+In order to be able to work with elastic objects, one needs to configure \es with the following options in myconfig.hpp:\\
+\#define LB (or \#define LB\_GPU)\\
+\#define LB\_BOUNDARIES (or \#define LB\_BOUNDARIES\_GPU)\\
+\#define EXTERNAL\_FORCES\\
+\#define MASS\\
+\#define CONSTRAINTS\\
+\#define BOND\_ANGLE\\
+\#define VOLUME\_FORCE\\
+\#define AREA\_FORCE\_GLOBAL\\
+
+To create an elastic object, we also need a triangulation of the surface of this object. Sample sphere and red blood cell are provided in the directory scripts/input. User can create her own in gmsh, salome or any other meshing software. The required format is as follows:\\
+
+The file \verb|some_nodes.dat| should contain triplets of floats (one triplet per line), where each triplet represents the x, y and z coordinates of one node of the surface triangulation. No additional information should be written in this file, so this means that the number of lines equals the number of surface nodes. The coordinates of the nodes should be specified in such a way that the approximate center of mass of the object corresponds to the origin (0,0,0). This is for convenience when placing the objects at desired locations later.\\
+
+The file \verb|some_triangles.dat| should also contain triplets of numbers, this time integers. These refer to the IDs of the nodes in the \verb|some_nodes.dat| file and specify which three nodes form a triangle together. Please, note that the nodes' IDs start at 0, i.e. the node written in the first line of \verb|some_nodes.dat| has ID 0, the node in the second line, has ID 1, etc.\\
+
+We can start our script by specifying these files:\\
+\begin{tclcode}
+ set fileNodes "input/cell_nodes.dat"
+ set fileTriangles "input/cell_triangles.dat"
+\end{tclcode}
+\vspace{0 mm}
+
+And continue with setting up some molecular dynamics parameters of the simulation engine:\\
+\begin{tclcode}
+ setmd time_step 0.1
+ setmd skin 0.4
+ thermostat off
+\end{tclcode}
+\vspace{0 mm}
+
+The skin depth \verb|skin| is a parameter for the link--cell system, which tunes its performance, but will not be discussed here in detail. The one important thing a user needs to know about it is that it has to be strictly less than half the grid size.\\
+
+Next we need to specify the simulation box:\\
+\begin{tclcode}
+ set boxX 50
+ set boxY 22
+ set boxZ 20
+ setmd box_l $boxX $boxY $boxZ
+\end{tclcode}
+\vspace{0 mm}
+
+and define the walls and boundaries. For clarity, these have been placed in a separate file \verb|boundaries.tcl|, which we'll go over in the next subsection. The source code of this boundaries script is included using the command\\
+\begin{tclcode}
+ source boundaries.tcl
+\end{tclcode}
+\vspace{0 mm}
+
+but note, that the boundaries could have been specified directly at this point.\\
+
+Now comes the initialization of OIF module using\\
+\begin{tclcode}
+ oif_init
+\end{tclcode}
+\vspace{0 mm}
+
+This command creates all the global variables and lists needed for templates and objects that will come afterwards. Elastic objects cannot be created directly. Each one has to correspond to a template that has been created first. The advantage of this approach is clear when creating many objects of the same type that only differ by e.g. position or rotation, because in such case it significantly speeds up the creation of objects that are just copies of the same template. The following command creates a template\\
+\begin{tclcode}
+ oif_create_template template-id 0 nodes-file $fileNodes \
+ triangles-file $fileTriangles stretch 3.0 3.0 3.0 \
+ ks 0.05 kb 0.01 kal 0.01 kag 0.01 kv 10.0
+\end{tclcode}
+\vspace{0 mm}
+
+Each template has to have a unique ID specified using keyword \verb|template-id|. The IDs should start at 0 and increase consecutively. Another two mandatory arguments are \verb|nodes-file| and \verb|triangles-file| that specify data files with desired triangulation. All other arguments are optional: \verb|stretch| defines stretching in x, y, z direction and \verb|ks, kb, kal, kag, kv| specify the elastic properties of the object (stretching, bending, local area conservation, global area conservation, volume conservation respectively). The keywords can come in any order.\\
+
+Once we have the template, we can start creating objects:\\
+\begin{tclcode}
+ oif_add_object object-id 0 template-id 0 origin 5 15 5 \
+ rotate 0 0 [expr $pi/2] part-type 0 mass 1
+ oif_add_object object-id 1 template-id 0 origin 5 5 15 \
+ rotate 0 0 0 part-type 1 mass 1
+\end{tclcode}
+\vspace{0 mm}
+
+Each object has to have a unique ID specified using keyword \verb|object-id|. The IDs should start at 0 and increase consecutively. Another three mandatory arguments are \verb|template-id|, \verb|origin| and \verb|part-type|. \verb|template-id| specifies which template will be used for this object. \verb|origin| gives placement of object's center in the simulation box. And \verb|part-type| assigns the particle type to all nodes of the given object. It is generally a good idea to specify a different \verb|part-type| for different objects since it can be then used to set up interactions among objects. The optional arguments are \verb|rotate| and \verb|mass|. Rotate takes three arguments - angles in radians - that determine how much the object is rotated around the x, y, z axes. (Note: if you want to use the variable \verb|$pi|, you need to specify it beforehand, i.e. \verb|set pi 3.14159265359|). The optional keyword \verb|mass| takes one value and this mass will be assigned to each surface node of the object.\\
+
+The interactions among objects are specified using\\
+\begin{tclcode}
+ inter 0 1 soft-sphere 0.005 2.0 0.3 0.0
+\end{tclcode}
+\vspace{0 mm}
+
+where after \verb|inter| come the particle types of the two objects and \verb|soft-sphere| with four parameters stands for the "bouncy" interactions between the objects, once they come sufficiently close. (There are also other interaction types available in \es.) Similar interaction is defined with the boundaries:\\
+\begin{tclcode}
+ inter 0 10 soft-sphere 0.0001 1.2 0.1 0.0
+ inter 1 10 soft-sphere 0.0001 1.2 0.1 0.0
+\end{tclcode}
+\vspace{0 mm}
+
+Here 10 (the second number after keyword \verb|inter|) is the the type of all boundaries and obstacles.
+
+Finally, we specify the fluid, either by\\
+\begin{tclcode}
+ lbfluid grid 1 dens 1.0 visc 1.5 tau 0.1 friction 0.5
+\end{tclcode}
+\vspace{0 mm}
+
+or\\
+ \begin{tclcode}
+ lbfluid gpu grid 1 dens 1.0 visc 1.5 tau 0.1 friction 0.5
+\end{tclcode}
+\vspace{0 mm}
+
+depending on the available computational resources. (The GPU computation can be two orders of magnitude faster than the CPU.)\\
+
+\subsection*{Specification of boundaries}
+As was previously mentioned, all the boundaries and obstacles are conveniently grouped in separate file \verb|boundaries.tcl|. This file contains two output procedures - one writes a rhomboid, another a cylinder into a .vtk file for later visualization. Below these procedures, one can specify the geometry of the channel. Here we only go over rhomboids and cylinders, but note that other boundary types are available in \es.\\
+
+The rhomboid is a 3D structure specified by one corner and three vectors originating from this corner. It can be a box and in that case the three vectors give the length, width and height. However, there is no requirement that the vectors are perpendicular (to each other or to the walls). It is a standard \es command.\\
+
+Cylinder is specified by its center, radius, normal vector, and length. The length is the distance from center to either base, therefore it is only half the total "height". Note: the included \verb|boundaries.tcl| script can only output cylinder with (0,0,1) normal. \\
+
+\begin{figure}[htbp]
+ \hfill
+ \begin{minipage}[t]{.22\textwidth}
+ \includegraphics[width=2.3cm,right]{figures/cylinder.png}
+ %\caption{Cylinder dimensions}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[t]{.45\textwidth}
+ \begin{center}
+ \includegraphics[width=5.2cm]{figures/rhomboid.png}
+ %\caption{Rhomboid dimensions}
+ \end{center}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[t]{.3\textwidth}
+ \includegraphics[width=4cm,left]{figures/channel.png}
+ %\caption{Channel geometry}
+ \end{minipage}
+ \hfill
+\end{figure}
+
+Each wall and obstacle has to be specified separately as a fluid boundary and as a particle constraint. The former enters the simulation as a boundary condition for the fluid, the latter serves for particle-boundary interactions. Sample cylinder and rhomboid can then be defined as follows:\\
+ \begin{tclcode}
+# obstacle cylinder1
+set cX 16; set cY 17; set cZ 10;
+set nX 0; set nY 0; set nZ 1;
+set L 9
+set r 3
+set cylFile "output/cylinder1.vtk"
+set n 20
+output_vtk_cylinder $cX $cY $cZ $nX $nY $nZ $r $L $n $cylFile
+constraint cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r \
+length $L direction 1 type 10
+lbboundary cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r \
+length $L direction 1
+ \end{tclcode}
+\vspace{0 mm}
+
+ \begin{tclcode}
+# obstacle rhomboid1
+set corX 25; set corY 1; set corZ 1;
+set aX 5; set aY 0; set aZ 0;
+set bX 0; set bY 20; set bZ 0;
+set cX 0; set cY 0; set cZ 10;
+set rhomFile "output/rhomboid1.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ \
+$cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ \
+c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ \
+c $cX $cY $cZ direction 1
+ \end{tclcode}
+ \vspace{0 mm}
+
+Note that the cylinder also has an input parameter \verb|n|. This specifies number of rectangular faces on the side. The \verb|direction 1| determines that the fluid is on the "outside".\\
+
+To create a rectangular channel, there are two possibilities. Either the walls are specified as the \verb|lbboundary wall| and \verb|constraint wall| with normal and distance from origin. Alternatively, the channel can be built using four flat rhomboids as can be seen in the picture above.\\
+
+Another way how to work with boundaries, is to set them up using \verb|lbboundary| and \verb|constraint|, make sure each boundary has a different type (the object-boundary interactions have to be modified accordingly) and then following command can be used for output of all of them at once:\\
+ \begin{tclcode}
+lbfluid print vtk boundary "boundary.vtk"
+ \end{tclcode}
+ \vspace{0 mm}
+
+The differences in visualization in these two approaches are discussed later in this tutorial.
+
+\section{Running the simulation}
+One last thing needed before we can proceed to the main part of the simulation code, is to get the fluid moving. This can be done by setting the velocity of the individual \verb|lbnodes| on one side of the channel and letting the flow develop, but this is not a very convenient setup because it has to be done at every integration step and the tcl-C communication slows down the computation. The alternative is to set up a wall/rhomboid with velocity. This does not mean that the physical boundary is moving, but rather that it transfers specified momentum onto the fluid. This can be done using the command\\
+\begin{tclcode}
+lbboundary rhomboid velocity 0.01 0 0 corner 0 1 1 a 1 1 1 \
+b 0 [expr $boxY-1] 1 c 0 1 [expr $boxZ-1] direction 1
+ \end{tclcode}
+ \vspace{0 mm}
+
+Now we can integrate the system:\\
+\begin{tclcode}
+set steps 200
+set counter 0
+while { $counter<150} {
+ set cycle [expr $counter*$steps]
+ puts "cycle $cycle"
+ integrate $steps
+ incr counter
+}
+ \end{tclcode}
+ \vspace{0 mm}
+
+The script will print out a cycle number every 200 MD steps.
+
+\section{Writing out data}
+
+We have already discussed how to output the walls and obstacles for later visualization, but we also need output for fluid and objects. The fluid output is done using the standard \es command\\
+\begin{tclcode}
+ lbfluid print vtk velocity "output/fluid$cycle.vtk"
+ \end{tclcode}
+ \vspace{0 mm}
+
+ and for object output we have\\
+ \begin{tclcode}
+ oif_object_output object-id 0 vtk-pos "output/output_file.vtk"
+ \end{tclcode}
+ \vspace{0 mm}
+
+This will save the positions of all surface nodes into the .vtk output file. The modified integration loop now looks like this:\\
+\begin{tclcode}
+while { $counter<150} {
+ set cycle [expr $counter*$steps]
+ puts "cycle $cycle"
+ lbfluid print vtk velocity "output/fluid$cycle.vtk"
+ oif_object_output object-id 0 vtk-pos "output/cell0_$cycle.vtk"
+ oif_object_output object-id 1 vtk-pos "output/cell1_$cycle.vtk"
+ integrate $steps
+ incr counter
+}
+ \end{tclcode}
+ \vspace{0 mm}
+
+ where each object has its own output file and a new file is written every \verb|$steps| steps.
+
+\section{Visualization}
+For visualization we suggest the free software Paraview. All .vtk files (boundaries, fluid, objects at all time steps) can be loaded at the same time. The loading is a two step process, because only after pressing the Apply button, are the files actually imported. Using the eye icon to the left of file names, one can turn on and off the individual objects and/or boundaries. It is also possible to do this when one imports all the boundaries from a single .vtk file (created using command \verb|lbfluid print vtk| \verb|boundary| \verb|"boundary.vtk"|), however only when each boundary had been assigned a unique type number and is then selected in the bottom left menu by this number.\\
+
+Fluid can be visualized using Filters/Alphabetical/Glyph (or other options from this menu. Please, refer to the Paraview user's guide for more details).\\
+
+Note, that Paraview does not automatically reload the data if they have been changed in the input folder, but a useful thing to know is that the created filters can be "recycled". Once you delete the old data, load the new data and right-click on the existing filters, you can re-attach them to the new data.\\
+
+It is a good idea to output and visualize the boundaries and objects just prior to running the actual simulation, to make sure that the geometry is correct and no objects intersect with any boundaries. This would cause "particle out of range" error and crash the simulation.\\
+
+\section{Other available OIF commands}
+
+The OIF commands that we have covered so far are\\
+ \begin{tclcode}
+oif_init
+oif_create_template
+oif_add_object
+oif_object_output
+ \end{tclcode}
+ \vspace{0 mm}
+
+Here we want to describe the rest of the currently available OIF commands and note that there are more still being added. We would be pleased to hear from you about any suggestions on further functionality.\\
+
+\verb|oif_info| prints out information about all global variables, currently available templates and added objects.\\
+
+\verb|oif_mesh_analyze| takes two mandatory arguments: \verb|nodes-file nodes.dat| and \verb|triangles-file triangles.dat|. Their required format is discussed at the beginning of this document, in Basic set up section. The three optional arguments: \verb|orientation|, \verb|repair| and \verb|flip| determine what will be done with the mesh. \verb|orientation| checks whether all triangles of the surface mesh are properly oriented, \verb|repair| corrects the orientation of those that are not and \verb|flip| flips the orientation of all triangles in the triangulation.\\
+
+\verb|oif_object_analyze| has only one mandatory argument, \verb|object-id 0|, and the optional arguments specify what function will be performed. \verb|origin| outputs the location of the center of the object, \verb|pos-bounds b-name| computes the six extremal coordinates of the object. More precisely, runs through the all mesh points and remembers the minimal and maximal x-coordinate, y-coordinate and z-coordinate. If \verb|b-name| is the name of one of these: \verb|z-min, z-max, x-min, x-max, y-min, y-max| then the procedure returns one number according to the value of \verb|b-name|. If b-name is \verb|all|, then the procedure returns a list of six numbers, namely Xmin, Xmax, Ymin, Ymax, Zmin, Zmax. \verb|volume| outputs the volume of the object, \verb|surface-area| outputs the surface of the object and \verb|velocity| outputs the average velocity of the object by calculating the average velocity of object's mesh points.\\
+
+\verb|oif_object_set| also has only one mandatory argument \verb|object-id 0|. The optional arguments are: \verb|force valX valY valZ|, which sets the force vector (valX,valY,valZ) to all mesh nodes of the object. Setting is done using \es command \verb|part $i set| \verb|ext_force $valX $valY $valZ|. Note, that this command sets the external force in each integration step. So if you want to use the external force only in one iteration, you need to set zero external force in the following integration step. \verb|origin posX posY posZ| moves the object in such a way that the origin has coordinates posX posY posZ. \verb|mesh-nodes "mesh-nodes.dat"| deforms the object in such a way that its origin stays unchanged, however the relative positions of the mesh points are taken from file mesh-nodes.dat. (The file mesh-nodes.dat should contain the coordinates of the mesh points with the origin's location at (0,0,0).) The command also checks whether number of lines in the mesh-nodes.dat file is the same as the corresponding value from oif\_nparticles. \verb|kill-motion| stops all the particles in the object (analogue to the \verb|kill_motion| command in \es).\\
+
+More information can be found in the OIF documentation and on our website www.cell-in-fluid.weebly.com.
+\end{document}
diff --git a/doc/tutorials/03-object_in_fluid/Makefile.am b/doc/tutorials/03-object_in_fluid/Makefile.am
new file mode 100644
index 00000000000..5aedea67f09
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/Makefile.am
@@ -0,0 +1,60 @@
+# Copyright (C) 2014 Olaf Lenz
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+BASENAME=03-object_in_fluid
+EXTRA_DIST=$(BASENAME).pdf \
+ scripts/boundaries.tcl \
+ scripts/simulation.tcl \
+ scripts/input/cell_nodes.dat \
+ scripts/input/cell_triangles.dat \
+ scripts/input/sphere_nodes.dat \
+ scripts/input/sphere_triangles.dat
+
+if DEVEL_SRC
+tutorial_TEXFILES=$(BASENAME).tex
+
+tutorial_FIGURES = \
+ figures/1.png \
+ figures/2.png \
+ figures/3.png \
+ figures/channel.png \
+ figures/cylinder.png \
+ figures/rhomboid.png
+
+tutorial_FILES = \
+ $(tutorial_TEXFILES) \
+ $(tutorial_FIGURES)
+
+.PHONY: doc $(BASENAME).pdf
+
+doc: tutorials
+tutorials: $(BASENAME).pdf
+$(BASENAME).pdf: $(tutorial_FILES) ../common/common.tex
+if HAVE_LATEX
+ sh ../../latexit.sh $(srcdir):$(srcdir)/../common $(BASENAME)
+else
+ @echo "No complete LaTeX-installation was not found in your PATH."
+ @echo "Can't build the tutorial without pdflatex, makeindex and bibtex."
+ @echo "Install these and rerun configure."
+endif
+
+CLEANFILES = $(BASENAME).pdf
+MOSTLYCLEANFILES = \
+ *.aux *.aux.bak\
+ $(BASENAME).idx $(BASENAME).idx.bak $(BASENAME).ilg $(BASENAME).ind \
+ $(BASENAME).log $(BASENAME).out $(BASENAME).toc \
+ $(BASENAME).blg $(BASENAME).bbl
+endif
diff --git a/doc/tutorials/03-object_in_fluid/figures/1.png b/doc/tutorials/03-object_in_fluid/figures/1.png
new file mode 100755
index 00000000000..6ad71a0d069
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/1.png differ
diff --git a/doc/tutorials/03-object_in_fluid/figures/2.png b/doc/tutorials/03-object_in_fluid/figures/2.png
new file mode 100755
index 00000000000..edf1298cc41
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/2.png differ
diff --git a/doc/tutorials/03-object_in_fluid/figures/3.png b/doc/tutorials/03-object_in_fluid/figures/3.png
new file mode 100755
index 00000000000..cf445ca4d62
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/3.png differ
diff --git a/doc/tutorials/03-object_in_fluid/figures/channel.png b/doc/tutorials/03-object_in_fluid/figures/channel.png
new file mode 100755
index 00000000000..c20cf824a4d
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/channel.png differ
diff --git a/doc/tutorials/03-object_in_fluid/figures/cylinder.png b/doc/tutorials/03-object_in_fluid/figures/cylinder.png
new file mode 100755
index 00000000000..4c228f904af
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/cylinder.png differ
diff --git a/doc/tutorials/03-object_in_fluid/figures/rhomboid.png b/doc/tutorials/03-object_in_fluid/figures/rhomboid.png
new file mode 100755
index 00000000000..99bbc768f73
Binary files /dev/null and b/doc/tutorials/03-object_in_fluid/figures/rhomboid.png differ
diff --git a/doc/tutorials/03-object_in_fluid/scripts/boundaries.tcl b/doc/tutorials/03-object_in_fluid/scripts/boundaries.tcl
new file mode 100644
index 00000000000..5d50bec0144
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/boundaries.tcl
@@ -0,0 +1,244 @@
+# Copyright (C) 2014 The ESPResSo project
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+proc output_vtk_rhomboid { args } {
+
+ # expected parameters:
+ # corX, corY, corZ - corner
+ # aX, aY, aZ - length vector
+ # bX, bY, bZ - width vector
+ # cX, cY, cZ - height vector
+ # rhomFile - file to write into
+
+ set corX [lindex $args 0]
+ set corY [lindex $args 1]
+ set corZ [lindex $args 2]
+ set aX [lindex $args 3]
+ set aY [lindex $args 4]
+ set aZ [lindex $args 5]
+ set bX [lindex $args 6]
+ set bY [lindex $args 7]
+ set bZ [lindex $args 8]
+ set cX [lindex $args 9]
+ set cY [lindex $args 10]
+ set cZ [lindex $args 11]
+ set rhomFile [lindex $args 12]
+
+ # write output
+ set f [open $rhomFile "w"]
+
+ puts $f "# vtk DataFile Version 3.0"
+ puts $f "Data"
+ puts $f "ASCII"
+ puts $f "DATASET POLYDATA"
+ puts $f "POINTS 8 float"
+
+ puts $f "$corX $corY $corZ"
+ puts $f "[expr $corX + $aX] [expr $corY + $aY] [expr $corZ + $aZ]"
+ puts $f "[expr $corX + $aX + $bX] [expr $corY + $aY + $bY] [expr $corZ + $aZ + $bZ]"
+ puts $f "[expr $corX + $bX] [expr $corY + $bY] [expr $corZ + $bZ]"
+
+ puts $f "[expr $corX + $cX] [expr $corY + $cY] [expr $corZ + $cZ]"
+ puts $f "[expr $corX + $aX + $cX] [expr $corY + $aY + $cY] [expr $corZ + $aZ + $cZ]"
+ puts $f "[expr $corX + $aX + $bX + $cX] [expr $corY + $aY + $bY + $cY] [expr $corZ + $aZ + $bZ + $cZ]"
+ puts $f "[expr $corX + $bX + $cX] [expr $corY + $bY + $cY] [expr $corZ + $bZ + $cZ]"
+
+ puts $f "POLYGONS 6 30"
+ puts $f "4 0 1 2 3"
+ puts $f "4 4 5 6 7"
+ puts $f "4 0 1 5 4"
+ puts $f "4 2 3 7 6"
+ puts $f "4 0 4 7 3"
+ puts $f "4 1 2 6 5"
+
+ close $f
+}
+
+#---------------------------------------------------------------------------------------------------------------
+proc output_vtk_cylinder { args } {
+
+ # expected parameters:
+ # cX, cY, cZ - center
+ # nX, nY, nZ - normal vector, for now only [0,0,1]
+ # L - half cylinder length
+ # r - radius
+ # n - number of faces on the circumference (the higher the number, the smoother the cylinder)
+ # cylFile - file to write into
+
+ set cX [lindex $args 0]
+ set cY [lindex $args 1]
+ set cZ [lindex $args 2]
+ set nX [lindex $args 3]
+ set nY [lindex $args 4]
+ set nZ [lindex $args 5]
+ set r [lindex $args 6]
+ set L [lindex $args 7]
+ set n [lindex $args 8]
+ set cylFile [lindex $args 9]
+
+ # write output
+ set f [open $cylFile "w"]
+
+ set check_normal 1
+ if { $nX != 0.0 } { set check_normal 0 }
+ if { $nY != 0.0 } { set check_normal 0 }
+ if { $nZ == 0.0 } { set check_normal 0 }
+ if { $check_normal == 0 } {
+ puts "This type of cylinder is not supported yet."
+ } else {
+ if { $nZ != 1.0 } { set nZ 1.0 }
+
+ # set points on the circumference
+ set pi 3.14159265359
+ set alpha [expr 2*$pi/$n]
+ set points [expr 2*$n]
+
+ # get center P1 of bottom circle
+ set p1X [expr $cX-$L*$nX]
+ set p1Y [expr $cY-$L*$nY]
+ set p1Z [expr $cZ-$L*$nZ]
+
+ puts $f "# vtk DataFile Version 3.0"
+ puts $f "Data"
+ puts $f "ASCII"
+ puts $f "DATASET POLYDATA"
+ puts $f "POINTS $points float"
+
+ for {set i 0} {$i < $n} {incr i} {
+ puts $f "[expr $p1X+$r*cos($i*$alpha)] [expr $p1Y+$r*sin($i*$alpha)] $p1Z"
+ }
+
+ for {set i 0} {$i < $n} {incr i} {
+ puts $f "[expr $p1X+$r*cos($i*$alpha)] [expr $p1Y+$r*sin($i*$alpha)] [expr $p1Z+2*$L*$nZ]"
+ }
+
+ puts $f "POLYGONS [expr $n+2] [expr 5*$n+($n+1)*2]"
+
+ # writing the bottom "circle"
+ puts -nonewline $f "$n "
+ for {set i 0} {$i < [expr $n-1]} {incr i} {
+ puts -nonewline $f "$i "
+ }
+ puts $f "[expr $n-1]"
+
+ # writing the top "circle"
+ puts -nonewline $f "$n "
+ for {set i 0} {$i < [expr $n-1]} {incr i} {
+ puts -nonewline $f "[expr $i+$n] "
+ }
+ puts $f "[expr 2*$n-1]"
+
+ # writing the side rectangles
+ for {set i 0} {$i < [expr $n-1]} {incr i} {
+ puts $f "4 $i [expr $i+1] [expr $i+$n+1] [expr $i+$n]"
+ }
+ puts $f "4 [expr $n-1] 0 $n [expr 2*$n-1]"
+
+ close $f
+ }
+}
+
+#-----------------------------------------------------------------------------------------------------
+# define your own walls and boundaries here
+#
+# remember that
+# output_vtk_* writes boundary for visualisation later
+# constraint sets up boundary for objects
+# and lbboundary sets up boundary for fluid
+
+# wall - bottom
+set corX 0; set corY 0; set corZ 0;
+set aX $boxX; set aY 0; set aZ 0;
+set bX 0; set bY $boxY; set bZ 0;
+set cX 0; set cY 0; set cZ 1;
+set rhomFile "output/wallbottom.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+# wall - top
+set corX 0; set corY 0; set corZ [expr $boxZ - 1];
+set aX $boxX; set aY 0; set aZ 0;
+set bX 0; set bY $boxY; set bZ 0;
+set cX 0; set cY 0; set cZ 1;
+set rhomFile "output/walltop.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+# wall - front side
+set corX 0; set corY 0; set corZ 1;
+set aX $boxX; set aY 0; set aZ 0;
+set bX 0; set bY 1; set bZ 0;
+set cX 0; set cY 0; set cZ [expr $boxZ - 2];
+set rhomFile "output/wallfront.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+# wall - back side
+set corX 0; set corY [expr $boxY - 1]; set corZ 1;
+set aX $boxX; set aY 0; set aZ 0;
+set bX 0; set bY 1; set bZ 0;
+set cX 0; set cY 0; set cZ [expr $boxZ - 2];
+set rhomFile "output/wallback.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+
+# obstacle rhomboid1
+set corX 10; set corY 1; set corZ 1;
+set aX 8; set aY 0; set aZ 0;
+set bX 0; set bY 4; set bZ 0;
+set cX 0; set cY 0; set cZ 18;
+set rhomFile "output/rhomboid1.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+# obstacle cylinder1
+set cX 16; set cY 17; set cZ 10;
+set nX 0; set nY 0; set nZ 1;
+set L 9
+set r 3
+set cylFile "output/cylinder1.vtk"
+set n 20
+output_vtk_cylinder $cX $cY $cZ $nX $nY $nZ $r $L $n $cylFile
+constraint cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r length $L direction 1 type 10
+lbboundary cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r length $L direction 1
+
+# obstacle rhomboid2
+set corX 25; set corY 1; set corZ 1;
+set aX 5; set aY 0; set aZ 0;
+set bX 0; set bY 20; set bZ 0;
+set cX 0; set cY 0; set cZ 10;
+set rhomFile "output/rhomboid2.vtk"
+output_vtk_rhomboid $corX $corY $corZ $aX $aY $aZ $bX $bY $bZ $cX $cY $cZ $rhomFile
+constraint rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1 type 10
+lbboundary rhomboid corner $corX $corY $corZ a $aX $aY $aZ b $bX $bY $bZ c $cX $cY $cZ direction 1
+
+# obstacle cylinder2
+set cX 37; set cY 10; set cZ 10;
+set nX 0; set nY 0; set nZ 1;
+set L 9
+set r 3
+set cylFile "output/cylinder2.vtk"
+set n 20
+output_vtk_cylinder $cX $cY $cZ $nX $nY $nZ $r $L $n $cylFile
+constraint cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r length $L direction 1 type 10
+lbboundary cylinder center $cX $cY $cZ axis $nX $nY $nZ radius $r length $L direction 1
diff --git a/doc/tutorials/03-object_in_fluid/scripts/input/cell_nodes.dat b/doc/tutorials/03-object_in_fluid/scripts/input/cell_nodes.dat
new file mode 100644
index 00000000000..9bf051cb7c1
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/input/cell_nodes.dat
@@ -0,0 +1,400 @@
+ 1.00000 0.00000 0.00017
+ 0.99262 0.00000 0.12129
+ 0.99266 0.00000 -0.12096
+ 0.95106 0.16995 0.00000
+ 0.95106 -0.16995 0.00000
+ 0.94356 0.16995 0.11920
+ 0.94356 -0.16995 0.11920
+ 0.94356 0.16995 -0.11920
+ 0.94356 -0.16995 -0.11920
+ 0.97063 0.00000 0.24059
+ 0.97070 0.00000 -0.24028
+ 0.92118 0.16995 0.23652
+ 0.92118 -0.16995 0.23652
+ 0.92118 0.16995 -0.23652
+ 0.92118 -0.16995 -0.23652
+ 0.80902 0.30474 0.00018
+ 0.80902 -0.30474 0.00018
+ 0.93437 0.00000 0.35630
+ 0.93448 0.00000 -0.35601
+ 0.79991 0.30474 -0.12108
+ 0.79991 -0.30474 -0.12108
+ 0.79985 0.30474 0.12142
+ 0.79985 -0.30474 0.12142
+ 0.88427 0.16995 0.35011
+ 0.88427 -0.16995 0.35011
+ 0.88427 0.16995 -0.35011
+ 0.88427 -0.16995 -0.35011
+ 0.77274 0.30474 -0.23954
+ 0.77274 -0.30474 -0.23954
+ 0.77264 0.30474 0.23986
+ 0.77264 -0.30474 0.23986
+ 0.88440 0.00000 0.46674
+ 0.88453 0.00000 -0.46648
+ 0.58778 0.30944 0.00072
+ 0.58778 -0.30944 0.00072
+ 0.83342 0.16995 0.45817
+ 0.83342 -0.16995 0.45817
+ 0.83342 0.16995 -0.45817
+ 0.83342 -0.16995 -0.45817
+ 0.72816 0.30474 -0.35255
+ 0.72816 -0.30474 -0.35255
+ 0.72802 0.30474 0.35284
+ 0.72802 -0.30474 0.35284
+ 0.57475 0.30944 -0.12310
+ 0.57475 -0.30944 -0.12310
+ 0.57447 0.30944 0.12442
+ 0.57447 -0.30944 0.12442
+ 0.82145 0.00000 0.57028
+ 0.82161 0.00000 -0.57005
+ 0.53601 0.30944 -0.24121
+ 0.53601 -0.30944 -0.24121
+ 0.53549 0.30944 0.24236
+ 0.53549 -0.30944 0.24236
+ 0.44556 0.25003 -0.09326
+ 0.44556 -0.25003 -0.09326
+ 0.58856 0.30747 -0.34170
+ 0.58856 -0.30747 -0.34170
+ 0.58844 0.30747 0.34193
+ 0.58844 -0.30747 0.34193
+ 0.44090 0.24824 0.09592
+ 0.44090 -0.24824 0.09592
+ 0.76942 0.16995 0.55902
+ 0.76942 -0.16995 0.55902
+ 0.76942 0.16995 -0.55902
+ 0.76942 -0.16995 -0.55902
+ 0.66720 0.30474 -0.45755
+ 0.66720 -0.30474 -0.45755
+ 0.66703 0.30474 0.45780
+ 0.66703 -0.30474 0.45780
+ 0.47343 0.30944 -0.34837
+ 0.47343 -0.30944 -0.34837
+ 0.47273 0.30944 0.34931
+ 0.47273 -0.30944 0.34931
+ 0.74647 0.00000 0.66542
+ 0.74665 0.00000 -0.66521
+ 0.30902 0.18452 0.00000
+ 0.30902 -0.18452 0.00000
+ 0.36597 0.24798 -0.26295
+ 0.36597 -0.24798 -0.26295
+ 0.36563 0.24797 0.26339
+ 0.36563 -0.24797 0.26339
+ 0.69329 0.16995 0.65104
+ 0.69329 -0.16995 0.65104
+ 0.69329 0.16995 -0.65104
+ 0.69329 -0.16995 -0.65104
+ 0.28549 0.18452 0.11826
+ 0.28549 -0.18452 0.11826
+ 0.28549 0.18452 -0.11826
+ 0.28549 -0.18452 -0.11826
+ 0.59125 0.30474 -0.55221
+ 0.59125 -0.30474 -0.55221
+ 0.59105 0.30474 0.55242
+ 0.59105 -0.30474 0.55242
+ 0.38990 0.30944 -0.43986
+ 0.38990 -0.30944 -0.43986
+ 0.38908 0.30944 0.44058
+ 0.38908 -0.30944 0.44058
+ 0.66058 0.00000 0.75076
+ 0.66077 0.00000 -0.75059
+ 0.21851 0.18452 0.21851
+ 0.21851 -0.18452 0.21851
+ 0.21851 0.18452 -0.21851
+ 0.21851 -0.18452 -0.21851
+ 0.16751 0.14801 -0.02766
+ 0.16751 -0.14801 -0.02766
+ 0.60623 0.16995 0.73280
+ 0.60623 -0.16995 0.73280
+ 0.60623 0.16995 -0.73280
+ 0.60623 -0.16995 -0.73280
+ 0.50184 0.30474 0.63456
+ 0.50184 -0.30474 0.63456
+ 0.50205 0.30474 -0.63439
+ 0.50205 -0.30474 -0.63439
+ 0.13233 0.15270 0.13307
+ 0.13233 -0.15270 0.13307
+ 0.23292 0.24653 -0.38200
+ 0.23292 -0.24653 -0.38200
+ 0.23255 0.24653 0.38222
+ 0.23255 -0.24653 0.38222
+ 0.10127 0.15129 -0.15154
+ 0.10127 -0.15129 -0.15154
+ 0.28923 0.30944 -0.51170
+ 0.28923 -0.30944 -0.51170
+ 0.28837 0.30944 0.51219
+ 0.28837 -0.30944 0.51219
+ 0.56503 0.00000 0.82507
+ 0.56524 0.00000 -0.82493
+ 0.11826 0.18452 0.28549
+ 0.11826 -0.18452 0.28549
+ 0.11826 0.18452 -0.28549
+ 0.11826 -0.18452 -0.28549
+ 0.50960 0.16995 0.80300
+ 0.50960 -0.16995 0.80300
+ 0.50960 0.16995 -0.80300
+ 0.50960 -0.16995 -0.80300
+ 0.40140 0.30474 0.70242
+ 0.40140 -0.30474 0.70242
+ 0.40162 0.30474 -0.70229
+ 0.40162 -0.30474 -0.70229
+ 0.00000 0.10350 0.00000
+ 0.00000 -0.10350 0.00000
+ 0.46125 0.00000 0.88727
+ 0.46146 0.00000 -0.88716
+ 0.08622 0.24233 -0.42945
+ 0.08622 -0.24233 -0.42945
+ 0.08583 0.24233 0.42954
+ 0.08583 -0.24233 0.42954
+ 0.17598 0.30944 -0.56082
+ 0.17598 -0.30944 -0.56082
+ 0.17512 0.30944 0.56109
+ 0.17512 -0.30944 0.56109
+ 0.40494 0.16995 0.86054
+ 0.40494 -0.16995 0.86054
+ 0.40494 0.16995 -0.86054
+ 0.40494 -0.16995 -0.86054
+ 0.00000 0.18452 0.30902
+ 0.00000 -0.18452 0.30902
+ 0.00000 0.18452 -0.30902
+ 0.00000 -0.18452 -0.30902
+ 0.29201 0.30474 0.75448
+ 0.29201 -0.30474 0.75448
+ 0.29224 0.30474 -0.75439
+ 0.29224 -0.30474 -0.75439
+ -0.07038 0.14689 0.14977
+ -0.07038 -0.14689 0.14977
+ -0.07504 0.14811 -0.15272
+ -0.07504 -0.14811 -0.15272
+ -0.10802 0.13182 0.00000
+ -0.10802 -0.13182 0.00000
+ 0.35077 0.00000 0.93646
+ 0.35097 0.00000 -0.93638
+ 0.05519 0.30944 -0.58519
+ 0.05519 -0.30944 -0.58519
+ 0.05439 0.30944 0.58526
+ 0.05439 -0.30944 0.58526
+ 0.29389 0.16995 0.90451
+ 0.29389 -0.16995 0.90451
+ 0.29389 0.16995 -0.90451
+ 0.29389 -0.16995 -0.90451
+ -0.11826 0.18452 0.28549
+ -0.11826 -0.18452 0.28549
+ -0.11826 0.18452 -0.28549
+ -0.11826 -0.18452 -0.28549
+ 0.17615 0.30474 0.78961
+ 0.17615 -0.30474 0.78961
+ 0.17637 0.30474 -0.78956
+ 0.17637 -0.30474 -0.78956
+ -0.06741 0.24653 -0.44229
+ -0.06741 -0.24653 -0.44229
+ -0.06771 0.24654 0.44226
+ -0.06771 -0.24654 0.44226
+ -0.17500 0.15518 -0.09072
+ -0.17500 -0.15518 -0.09072
+ -0.17509 -0.15521 0.09077
+ -0.17509 0.15521 0.09077
+ -0.20942 0.15841 0.00000
+ -0.20942 -0.15841 0.00000
+ 0.23519 0.00000 0.97195
+ 0.23540 0.00000 -0.97190
+ -0.00342 -0.30746 0.68107
+ -0.00342 0.30746 0.68107
+ -0.00326 -0.30746 -0.68105
+ -0.00326 0.30746 -0.68105
+ -0.21851 0.18452 0.21851
+ -0.21851 -0.18452 0.21851
+ -0.21851 0.18452 -0.21851
+ -0.21851 -0.18452 -0.21851
+ 0.17821 0.16995 0.93421
+ 0.17821 -0.16995 0.93421
+ -0.06779 0.30944 -0.58386
+ -0.06779 -0.30944 -0.58386
+ 0.17821 0.16995 -0.93421
+ 0.17821 -0.16995 -0.93421
+ -0.06849 0.30944 0.58378
+ -0.06849 -0.30944 0.58378
+ 0.05641 0.30474 0.80705
+ 0.05641 -0.30474 0.80705
+ 0.05661 0.30474 -0.80703
+ 0.05661 -0.30474 -0.80703
+ -0.28549 0.18452 0.11826
+ -0.28549 -0.18452 0.11826
+ -0.28549 0.18452 -0.11826
+ -0.28549 -0.18452 -0.11826
+ -0.23507 0.24797 -0.38444
+ -0.23507 -0.24797 -0.38444
+ -0.23530 0.24798 0.38433
+ -0.23530 -0.24798 0.38433
+ -0.30902 0.18452 0.00000
+ -0.30902 -0.18452 0.00000
+ 0.11623 0.00000 0.99322
+ 0.11643 0.00000 -0.99320
+ 0.05972 0.16995 0.94918
+ 0.05972 -0.16995 0.94918
+ 0.05972 0.16995 -0.94918
+ 0.05972 -0.16995 -0.94918
+ -0.18757 0.30944 -0.55705
+ -0.18757 -0.30944 -0.55705
+ -0.18814 0.30944 0.55686
+ -0.18814 -0.30944 0.55686
+ -0.06452 0.30474 0.80644
+ -0.06452 -0.30474 0.80644
+ -0.06433 0.30474 -0.80645
+ -0.06433 -0.30474 -0.80645
+ -0.00437 0.00000 0.99999
+ -0.00419 0.00000 -0.99999
+ -0.40262 0.22646 0.00000
+ -0.40262 -0.22646 0.00000
+ -0.37335 0.25105 -0.26441
+ -0.37355 0.25103 0.26404
+ -0.37355 -0.25103 0.26404
+ -0.37330 -0.25232 -0.26933
+ -0.29896 0.30944 -0.50608
+ -0.29896 -0.30944 -0.50608
+ -0.29939 0.30944 0.50582
+ -0.29939 -0.30944 0.50582
+ -0.05972 0.16995 0.94918
+ -0.05972 -0.16995 0.94918
+ -0.05972 0.16995 -0.94918
+ -0.05972 -0.16995 -0.94918
+ -0.18394 0.30474 0.78783
+ -0.18394 -0.30474 0.78783
+ -0.18377 0.30474 -0.78787
+ -0.18377 -0.30474 -0.78787
+ -0.44692 0.25385 -0.12373
+ -0.44696 0.25386 0.12363
+ -0.44696 -0.25386 0.12363
+ -0.44695 -0.25396 -0.12457
+ -0.39718 0.30944 -0.43329
+ -0.39718 -0.30944 -0.43329
+ -0.39747 0.30944 0.43303
+ -0.39747 -0.30944 0.43303
+ -0.12487 0.00000 0.99217
+ -0.12470 0.00000 -0.99220
+ -0.17821 0.16995 0.93421
+ -0.17821 -0.16995 0.93421
+ -0.17821 0.16995 -0.93421
+ -0.17821 -0.16995 -0.93421
+ -0.49535 0.26802 0.00000
+ -0.49535 -0.26802 0.00000
+ -0.29918 0.30474 0.75166
+ -0.29918 -0.30474 0.75166
+ -0.29904 0.30474 -0.75172
+ -0.29904 -0.30474 -0.75172
+ -0.47807 0.30944 -0.34197
+ -0.47807 -0.30944 -0.34197
+ -0.47823 0.30944 0.34174
+ -0.47823 -0.30944 0.34174
+ -0.24349 0.00000 0.96990
+ -0.24334 0.00000 -0.96994
+ -0.53832 0.30944 0.23600
+ -0.53832 -0.30944 0.23600
+ -0.53826 0.30944 -0.23616
+ -0.53826 -0.30944 -0.23616
+ -0.29389 0.16995 0.90451
+ -0.29389 -0.16995 0.90451
+ -0.29389 0.16995 -0.90451
+ -0.29389 -0.16995 -0.90451
+ -0.40769 0.30474 0.69878
+ -0.40769 -0.30474 0.69878
+ -0.40758 0.30474 -0.69885
+ -0.40758 -0.30474 -0.69885
+ -0.57532 0.30944 0.12043
+ -0.57532 -0.30944 0.12043
+ -0.57530 0.30944 -0.12049
+ -0.57530 -0.30944 -0.12049
+ -0.58779 0.30944 0.00000
+ -0.58779 -0.30944 0.00000
+ -0.35851 0.00000 0.93352
+ -0.35838 0.00000 -0.93358
+ -0.59131 0.30744 0.33913
+ -0.59131 -0.30744 0.33913
+ -0.59127 0.30744 -0.33917
+ -0.59127 -0.30744 -0.33917
+ -0.40494 0.16995 0.86054
+ -0.40494 -0.16995 0.86054
+ -0.40494 0.16995 -0.86054
+ -0.40494 -0.16995 -0.86054
+ -0.50706 0.30474 0.63039
+ -0.50706 -0.30474 0.63039
+ -0.50698 0.30474 -0.63046
+ -0.50698 -0.30474 -0.63046
+ -0.46828 0.00000 0.88358
+ -0.46816 0.00000 -0.88364
+ -0.59511 0.30474 0.54805
+ -0.59511 -0.30474 0.54805
+ -0.59505 0.30474 -0.54811
+ -0.59505 -0.30474 -0.54811
+ -0.50960 0.16995 0.80300
+ -0.50960 -0.16995 0.80300
+ -0.50960 0.16995 -0.80300
+ -0.50960 -0.16995 -0.80300
+ -0.69840 0.30709 0.00000
+ -0.69840 -0.30709 0.00000
+ -0.66990 0.30474 0.45359
+ -0.66990 -0.30474 0.45359
+ -0.66986 0.30474 -0.45365
+ -0.66986 -0.30474 -0.45365
+ -0.57118 0.00000 0.82082
+ -0.57109 0.00000 -0.82089
+ -0.60623 0.16995 0.73280
+ -0.60623 -0.16995 0.73280
+ -0.60623 0.16995 -0.73280
+ -0.60623 -0.16995 -0.73280
+ -0.72979 0.30474 0.34916
+ -0.72979 -0.30474 0.34916
+ -0.72977 0.30474 -0.34920
+ -0.72977 -0.30474 -0.34920
+ -0.77350 0.30474 0.23707
+ -0.77350 -0.30474 0.23707
+ -0.77349 0.30474 -0.23710
+ -0.77349 -0.30474 -0.23710
+ -0.69329 0.16995 0.65104
+ -0.69329 -0.16995 0.65104
+ -0.69329 0.16995 -0.65104
+ -0.69329 -0.16995 -0.65104
+ -0.66575 0.00000 0.74617
+ -0.66568 0.00000 -0.74624
+ -0.80010 0.30474 0.11981
+ -0.80010 -0.30474 0.11981
+ -0.80009 0.30474 -0.11982
+ -0.80009 -0.30474 -0.11982
+ -0.80902 0.30474 0.00000
+ -0.80902 -0.30474 0.00000
+ -0.76942 0.16995 0.55902
+ -0.76942 -0.16995 0.55902
+ -0.76942 0.16995 -0.55902
+ -0.76942 -0.16995 -0.55902
+ -0.75062 0.00000 0.66073
+ -0.75057 0.00000 -0.66080
+ -0.88004 0.23735 0.00000
+ -0.88004 -0.23735 0.00000
+ -0.83342 0.16995 0.45817
+ -0.83342 -0.16995 0.45817
+ -0.83342 0.16995 -0.45817
+ -0.83342 -0.16995 -0.45817
+ -0.82457 0.00000 0.56576
+ -0.82453 0.00000 -0.56581
+ -0.88427 0.16995 0.35011
+ -0.88427 -0.16995 0.35011
+ -0.88427 0.16995 -0.35011
+ -0.88427 -0.16995 -0.35011
+ -0.88655 0.00000 0.46263
+ -0.88652 0.00000 -0.46268
+ -0.92118 0.16995 0.23652
+ -0.92118 -0.16995 0.23652
+ -0.92118 0.16995 -0.23652
+ -0.92118 -0.16995 -0.23652
+ -0.94356 0.16995 0.11920
+ -0.94356 -0.16995 0.11920
+ -0.94356 0.16995 -0.11920
+ -0.94356 -0.16995 -0.11920
+ -0.95106 0.16995 0.00000
+ -0.95106 -0.16995 0.00000
+ -0.93567 0.00000 0.35287
+ -0.93566 0.00000 -0.35291
+ -0.97125 0.00000 0.23806
+ -0.97125 0.00000 -0.23808
+ -0.99279 0.00000 0.11986
+ -0.99279 0.00000 -0.11987
+ -1.00000 0.00000 0.00000
diff --git a/doc/tutorials/03-object_in_fluid/scripts/input/cell_triangles.dat b/doc/tutorials/03-object_in_fluid/scripts/input/cell_triangles.dat
new file mode 100644
index 00000000000..2a521f6367e
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/input/cell_triangles.dat
@@ -0,0 +1,796 @@
+ 175 151 169
+ 295 315 308
+ 313 293 307
+ 153 177 170
+ 35 23 31
+ 373 379 382
+ 377 371 381
+ 25 37 32
+ 383 377 393
+ 13 25 18
+ 23 11 17
+ 379 385 394
+ 327 313 321
+ 133 153 142
+ 151 131 141
+ 315 329 322
+ 365 373 376
+ 61 35 47
+ 371 363 375
+ 37 63 48
+ 339 327 337
+ 107 133 126
+ 131 105 125
+ 329 341 338
+ 81 61 73
+ 353 365 368
+ 363 351 367
+ 63 83 74
+ 351 339 355
+ 105 81 97
+ 83 107 98
+ 341 353 356
+ 207 175 197
+ 275 295 288
+ 293 273 287
+ 177 211 198
+ 255 231 243
+ 233 257 244
+ 391 387 397
+ 3 7 2
+ 5 3 1
+ 389 391 398
+ 387 383 395
+ 7 13 10
+ 11 5 9
+ 385 389 396
+ 231 207 229
+ 257 275 272
+ 273 255 271
+ 211 233 230
+ 397 399 391
+ 399 398 391
+ 395 397 387
+ 398 396 389
+ 393 395 383
+ 396 394 385
+ 381 393 377
+ 394 382 379
+ 375 381 371
+ 382 376 373
+ 367 375 363
+ 376 368 365
+ 355 367 351
+ 368 356 353
+ 337 355 339
+ 356 338 341
+ 321 337 327
+ 338 322 329
+ 307 321 313
+ 322 308 315
+ 287 307 293
+ 308 288 295
+ 271 287 273
+ 288 272 275
+ 243 271 255
+ 272 244 257
+ 229 243 231
+ 244 230 233
+ 197 229 207
+ 230 198 211
+ 169 197 175
+ 198 170 177
+ 141 169 151
+ 170 142 153
+ 125 141 131
+ 142 126 133
+ 97 125 105
+ 126 98 107
+ 73 97 81
+ 98 74 83
+ 47 73 61
+ 74 48 63
+ 31 47 35
+ 48 32 37
+ 17 31 23
+ 32 18 25
+ 9 17 11
+ 18 10 13
+ 1 9 5
+ 10 2 7
+ 0 1 3
+ 2 0 3
+ 391 369 387
+ 369 361 357
+ 315 295 281
+ 151 175 159
+ 177 153 161
+ 293 313 279
+ 379 373 345
+ 23 35 41
+ 37 25 39
+ 371 377 343
+ 25 13 27
+ 377 383 347
+ 385 379 349
+ 11 23 29
+ 153 133 137
+ 313 327 297
+ 329 315 299
+ 131 151 135
+ 373 365 335
+ 35 61 67
+ 63 37 65
+ 363 371 333
+ 133 107 111
+ 327 339 317
+ 341 329 319
+ 105 131 109
+ 365 353 325
+ 61 81 91
+ 83 63 89
+ 351 363 323
+ 353 341 325
+ 107 83 89
+ 81 105 91
+ 339 351 323
+ 295 275 261
+ 175 207 183
+ 211 177 185
+ 273 293 259
+ 257 233 217
+ 231 255 215
+ 7 3 15
+ 391 389 369
+ 3 5 15
+ 13 7 19
+ 383 387 357
+ 389 385 359
+ 5 11 21
+ 275 257 241
+ 207 231 215
+ 233 211 217
+ 255 273 239
+ 359 361 369
+ 357 347 383
+ 349 359 385
+ 347 343 377
+ 345 349 379
+ 343 333 371
+ 335 345 373
+ 333 323 363
+ 325 335 365
+ 323 317 339
+ 319 325 341
+ 317 297 327
+ 299 319 329
+ 297 279 313
+ 281 299 315
+ 279 259 293
+ 261 281 295
+ 259 239 273
+ 241 261 275
+ 239 215 255
+ 217 241 257
+ 215 183 207
+ 185 217 211
+ 183 159 175
+ 161 185 177
+ 159 135 151
+ 137 161 153
+ 135 109 131
+ 111 137 133
+ 109 91 105
+ 89 111 107
+ 91 67 61
+ 65 89 63
+ 67 41 35
+ 39 65 37
+ 41 29 23
+ 27 39 25
+ 29 21 11
+ 19 27 13
+ 21 15 5
+ 15 19 7
+ 387 369 357
+ 369 389 359
+ 361 331 357
+ 331 305 301
+ 331 361 359
+ 347 357 301
+ 359 349 303
+ 343 347 289
+ 349 345 291
+ 333 343 309
+ 345 335 311
+ 323 333 285
+ 335 325 283
+ 317 323 269
+ 325 319 267
+ 297 317 253
+ 319 299 251
+ 259 279 237
+ 281 261 235
+ 239 259 213
+ 261 241 209
+ 215 239 200
+ 241 217 202
+ 183 215 173
+ 217 185 171
+ 159 183 149
+ 185 161 147
+ 303 305 331
+ 135 159 123
+ 161 137 121
+ 109 135 123
+ 137 111 121
+ 91 109 95
+ 111 89 93
+ 67 91 71
+ 301 289 347
+ 89 65 69
+ 41 67 57
+ 65 39 55
+ 291 303 349
+ 29 41 51
+ 39 27 49
+ 21 29 45
+ 27 19 43
+ 15 21 33
+ 19 15 33
+ 289 285 309
+ 309 285 333
+ 289 309 343
+ 283 291 311
+ 283 311 335
+ 311 291 345
+ 285 269 323
+ 267 283 325
+ 269 253 317
+ 251 267 319
+ 253 237 297
+ 235 251 281
+ 281 251 299
+ 237 213 259
+ 209 235 261
+ 213 173 200
+ 200 173 215
+ 213 200 239
+ 171 209 202
+ 171 202 217
+ 202 209 241
+ 173 149 183
+ 147 171 185
+ 149 123 159
+ 121 147 161
+ 297 237 279
+ 123 95 109
+ 93 121 111
+ 95 71 91
+ 69 93 89
+ 71 51 57
+ 57 51 41
+ 71 57 67
+ 49 69 55
+ 49 55 39
+ 55 69 65
+ 51 45 29
+ 43 49 27
+ 45 33 21
+ 33 43 19
+ 357 331 301
+ 331 359 303
+ 305 277 301
+ 277 305 303
+ 277 245 264
+ 245 277 263
+ 245 227 219
+ 264 245 219
+ 277 264 301
+ 245 263 221
+ 263 277 303
+ 203 179 225
+ 99 85 79
+ 101 129 115
+ 205 221 247
+ 219 203 248
+ 127 99 117
+ 87 101 77
+ 181 205 223
+ 155 127 145
+ 75 87 53
+ 157 181 187
+ 179 155 189
+ 85 75 59
+ 129 157 143
+ 221 227 245
+ 289 301 264
+ 303 291 263
+ 285 289 248
+ 291 283 247
+ 269 285 248
+ 283 267 247
+ 253 269 225
+ 267 251 223
+ 237 253 225
+ 251 235 223
+ 213 237 189
+ 235 209 187
+ 173 213 189
+ 209 171 187
+ 149 173 145
+ 171 147 143
+ 123 149 117
+ 147 121 115
+ 95 123 117
+ 121 93 115
+ 71 95 79
+ 93 69 77
+ 51 71 79
+ 69 49 77
+ 45 51 59
+ 49 43 53
+ 33 45 59
+ 43 33 53
+ 225 179 189
+ 115 129 143
+ 79 85 59
+ 247 221 263
+ 181 223 187
+ 87 77 53
+ 127 117 145
+ 219 248 264
+ 205 247 223
+ 99 79 117
+ 101 115 77
+ 203 225 248
+ 155 145 189
+ 157 187 143
+ 59 75 53
+ 247 263 291
+ 264 248 289
+ 59 53 33
+ 189 145 173
+ 143 187 171
+ 117 79 95
+ 223 247 267
+ 77 115 93
+ 248 225 269
+ 225 189 237
+ 115 143 147
+ 79 59 51
+ 187 223 235
+ 145 117 149
+ 53 77 49
+ 227 195 219
+ 195 167 194
+ 167 195 191
+ 167 139 163
+ 139 167 165
+ 221 205 191
+ 129 101 119
+ 85 99 113
+ 179 203 163
+ 205 181 165
+ 101 87 119
+ 99 127 113
+ 203 219 194
+ 181 157 165
+ 87 75 103
+ 227 221 195
+ 157 129 119
+ 75 85 113
+ 155 179 163
+ 194 167 163
+ 194 163 203
+ 195 194 219
+ 167 191 165
+ 165 191 205
+ 191 195 221
+ 139 165 119
+ 163 139 113
+ 127 155 113
+ 87 103 119
+ 155 163 113
+ 103 75 113
+ 119 103 139
+ 103 113 139
+ 119 165 157
+ 176 169 152
+ 296 308 316
+ 314 307 294
+ 154 170 178
+ 36 31 24
+ 374 382 380
+ 378 381 372
+ 26 32 38
+ 384 393 378
+ 14 18 26
+ 24 17 12
+ 380 394 386
+ 328 321 314
+ 134 142 154
+ 152 141 132
+ 316 322 330
+ 366 376 374
+ 62 47 36
+ 372 375 364
+ 38 48 64
+ 340 337 328
+ 108 126 134
+ 132 125 106
+ 330 338 342
+ 82 73 62
+ 354 368 366
+ 364 367 352
+ 64 74 84
+ 352 355 340
+ 106 97 82
+ 84 98 108
+ 342 356 354
+ 208 197 176
+ 276 288 296
+ 294 287 274
+ 178 198 212
+ 256 243 232
+ 234 244 258
+ 392 397 388
+ 4 2 8
+ 6 1 4
+ 390 398 392
+ 388 395 384
+ 8 10 14
+ 12 9 6
+ 386 396 390
+ 232 229 208
+ 258 272 276
+ 274 271 256
+ 212 230 234
+ 397 392 399
+ 399 392 398
+ 395 388 397
+ 398 390 396
+ 393 384 395
+ 396 386 394
+ 381 378 393
+ 394 380 382
+ 375 372 381
+ 382 374 376
+ 367 364 375
+ 376 366 368
+ 355 352 367
+ 368 354 356
+ 337 340 355
+ 356 342 338
+ 321 328 337
+ 338 330 322
+ 307 314 321
+ 322 316 308
+ 287 294 307
+ 308 296 288
+ 271 274 287
+ 288 276 272
+ 243 256 271
+ 272 258 244
+ 229 232 243
+ 244 234 230
+ 197 208 229
+ 230 212 198
+ 169 176 197
+ 198 178 170
+ 141 152 169
+ 170 154 142
+ 125 132 141
+ 142 134 126
+ 97 106 125
+ 126 108 98
+ 73 82 97
+ 98 84 74
+ 47 62 73
+ 74 64 48
+ 31 36 47
+ 48 38 32
+ 17 24 31
+ 32 26 18
+ 9 12 17
+ 18 14 10
+ 1 6 9
+ 10 8 2
+ 0 4 1
+ 2 4 0
+ 392 388 370
+ 370 358 362
+ 362 360 370
+ 316 282 296
+ 152 160 176
+ 178 162 154
+ 294 280 314
+ 380 346 374
+ 24 42 36
+ 38 40 26
+ 372 344 378
+ 26 28 14
+ 378 348 384
+ 386 350 380
+ 12 30 24
+ 154 138 134
+ 314 298 328
+ 330 300 316
+ 132 136 152
+ 374 336 366
+ 36 68 62
+ 64 66 38
+ 364 334 372
+ 134 112 108
+ 328 318 340
+ 342 320 330
+ 106 110 132
+ 366 326 354
+ 62 92 82
+ 84 90 64
+ 352 324 364
+ 354 326 342
+ 108 90 84
+ 82 92 106
+ 340 324 352
+ 296 262 276
+ 176 184 208
+ 212 186 178
+ 274 260 294
+ 258 218 234
+ 232 216 256
+ 8 16 4
+ 392 370 390
+ 4 16 6
+ 14 20 8
+ 384 358 388
+ 390 360 386
+ 6 22 12
+ 276 242 258
+ 208 216 232
+ 234 218 212
+ 256 240 274
+ 358 384 348
+ 350 386 360
+ 348 378 344
+ 346 380 350
+ 344 372 334
+ 336 374 346
+ 334 364 324
+ 326 366 336
+ 324 340 318
+ 320 342 326
+ 318 328 298
+ 300 330 320
+ 298 314 280
+ 282 316 300
+ 280 294 260
+ 262 296 282
+ 260 274 240
+ 242 276 262
+ 240 256 216
+ 218 258 242
+ 216 208 184
+ 186 212 218
+ 184 176 160
+ 162 178 186
+ 160 152 136
+ 138 154 162
+ 136 132 110
+ 112 134 138
+ 110 106 92
+ 90 108 112
+ 92 62 68
+ 66 64 90
+ 68 36 42
+ 40 38 66
+ 42 24 30
+ 28 26 40
+ 30 12 22
+ 20 14 28
+ 22 6 16
+ 16 8 20
+ 388 358 370
+ 370 360 390
+ 362 358 332
+ 332 302 306
+ 332 360 362
+ 348 302 358
+ 360 304 350
+ 344 290 348
+ 350 292 346
+ 334 310 344
+ 346 312 336
+ 324 286 334
+ 336 284 326
+ 318 270 324
+ 326 268 320
+ 298 254 318
+ 320 252 300
+ 260 238 280
+ 282 236 262
+ 240 214 260
+ 262 210 242
+ 216 199 240
+ 242 201 218
+ 184 174 216
+ 218 172 186
+ 160 150 184
+ 186 148 162
+ 304 332 306
+ 136 124 160
+ 162 122 138
+ 110 124 136
+ 138 122 112
+ 92 96 110
+ 112 94 90
+ 68 72 92
+ 302 348 290
+ 90 70 66
+ 42 58 68
+ 66 56 40
+ 292 350 304
+ 30 52 42
+ 40 50 28
+ 22 46 30
+ 28 44 20
+ 16 34 22
+ 20 34 16
+ 290 310 286
+ 310 334 286
+ 290 344 310
+ 284 312 292
+ 284 336 312
+ 312 346 292
+ 286 324 270
+ 268 326 284
+ 270 318 254
+ 252 320 268
+ 254 298 238
+ 236 282 252
+ 282 300 252
+ 238 260 214
+ 210 262 236
+ 214 199 174
+ 199 216 174
+ 214 240 199
+ 172 201 210
+ 172 218 201
+ 201 242 210
+ 174 184 150
+ 148 186 172
+ 150 160 124
+ 122 162 148
+ 298 280 238
+ 124 110 96
+ 94 112 122
+ 96 92 72
+ 70 90 94
+ 72 58 52
+ 58 42 52
+ 72 68 58
+ 50 56 70
+ 50 40 56
+ 56 66 70
+ 52 30 46
+ 44 28 50
+ 46 22 34
+ 34 20 44
+ 358 302 332
+ 332 304 360
+ 306 302 278
+ 278 304 306
+ 278 265 246
+ 246 220 228
+ 228 222 246
+ 265 220 246
+ 278 302 265
+ 204 226 180
+ 100 80 86
+ 102 116 130
+ 206 250 222
+ 220 249 204
+ 128 118 100
+ 88 78 102
+ 182 224 206
+ 156 146 128
+ 76 54 88
+ 158 188 182
+ 180 190 156
+ 86 60 76
+ 130 144 158
+ 290 265 302
+ 304 266 292
+ 286 249 290
+ 292 250 284
+ 270 249 286
+ 284 250 268
+ 254 226 270
+ 268 224 252
+ 238 226 254
+ 252 224 236
+ 214 190 238
+ 236 188 210
+ 174 190 214
+ 210 188 172
+ 150 146 174
+ 172 144 148
+ 124 118 150
+ 148 116 122
+ 96 118 124
+ 122 116 94
+ 72 80 96
+ 94 78 70
+ 52 80 72
+ 70 78 50
+ 46 60 52
+ 50 54 44
+ 34 60 46
+ 44 54 34
+ 226 190 180
+ 116 144 130
+ 80 60 86
+ 250 266 222
+ 250 292 266
+ 182 188 224
+ 88 54 78
+ 128 146 118
+ 220 265 249
+ 206 224 250
+ 100 118 80
+ 102 78 116
+ 204 249 226
+ 156 190 146
+ 158 144 188
+ 60 54 76
+ 304 278 266
+ 278 246 266
+ 246 222 266
+ 265 290 249
+ 60 34 54
+ 190 174 146
+ 144 172 188
+ 118 96 80
+ 224 268 250
+ 78 94 116
+ 249 270 226
+ 226 238 190
+ 116 148 144
+ 80 52 60
+ 188 236 224
+ 146 150 118
+ 54 50 78
+ 228 220 196
+ 196 193 168
+ 168 192 196
+ 168 164 140
+ 140 166 168
+ 222 192 206
+ 130 120 102
+ 86 114 100
+ 180 164 204
+ 206 166 182
+ 102 120 88
+ 100 114 128
+ 204 193 220
+ 182 166 158
+ 88 104 76
+ 228 196 222
+ 158 120 130
+ 76 114 86
+ 156 164 180
+ 193 164 168
+ 193 204 164
+ 196 220 193
+ 168 166 192
+ 166 206 192
+ 192 222 196
+ 140 120 166
+ 164 114 140
+ 128 114 156
+ 88 120 104
+ 156 114 164
+ 104 114 76
+ 120 140 104
+ 104 140 114
+ 120 158 166
diff --git a/doc/tutorials/03-object_in_fluid/scripts/input/sphere_nodes.dat b/doc/tutorials/03-object_in_fluid/scripts/input/sphere_nodes.dat
new file mode 100644
index 00000000000..5d307c282f6
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/input/sphere_nodes.dat
@@ -0,0 +1,393 @@
+4.000000e+00 0.000000e+00 0.000000e+00
+0.000000e+00 4.000000e+00 0.000000e+00
+0.000000e+00 0.000000e+00 4.000000e+00
+-4.000000e+00 2.449213e-16 0.000000e+00
+-4.898425e-16 -4.000000e+00 0.000000e+00
+0.000000e+00 0.000000e+00 -4.000000e+00
+7.809111e-01 0.000000e+00 3.923031e+00
+1.531079e+00 0.000000e+00 3.695376e+00
+2.222436e+00 0.000000e+00 3.325775e+00
+2.828427e+00 0.000000e+00 2.828427e+00
+3.325775e+00 0.000000e+00 2.222437e+00
+3.695375e+00 0.000000e+00 1.531079e+00
+3.923031e+00 0.000000e+00 7.809112e-01
+3.923031e+00 7.809111e-01 0.000000e+00
+3.695376e+00 1.531079e+00 0.000000e+00
+3.325775e+00 2.222436e+00 0.000000e+00
+2.828427e+00 2.828427e+00 0.000000e+00
+2.222437e+00 3.325775e+00 0.000000e+00
+1.531079e+00 3.695375e+00 0.000000e+00
+7.809112e-01 3.923031e+00 0.000000e+00
+0.000000e+00 3.923031e+00 7.809111e-01
+0.000000e+00 3.695376e+00 1.531079e+00
+0.000000e+00 3.325775e+00 2.222436e+00
+0.000000e+00 2.828427e+00 2.828427e+00
+0.000000e+00 2.222437e+00 3.325775e+00
+0.000000e+00 1.531079e+00 3.695375e+00
+0.000000e+00 7.809112e-01 3.923031e+00
+-7.809111e-01 3.923031e+00 0.000000e+00
+-1.531079e+00 3.695376e+00 0.000000e+00
+-2.222436e+00 3.325775e+00 0.000000e+00
+-2.828427e+00 2.828427e+00 0.000000e+00
+-3.325775e+00 2.222437e+00 0.000000e+00
+-3.695375e+00 1.531079e+00 0.000000e+00
+-3.923031e+00 7.809112e-01 0.000000e+00
+-3.923031e+00 2.402085e-16 7.809111e-01
+-3.695376e+00 2.262690e-16 1.531079e+00
+-3.325775e+00 2.036382e-16 2.222436e+00
+-2.828427e+00 1.731855e-16 2.828427e+00
+-2.222437e+00 1.360805e-16 3.325775e+00
+-1.531079e+00 9.374846e-17 3.695375e+00
+-7.809112e-01 4.781544e-17 3.923031e+00
+-3.923031e+00 -7.809111e-01 0.000000e+00
+-3.695376e+00 -1.531079e+00 0.000000e+00
+-3.325775e+00 -2.222436e+00 0.000000e+00
+-2.828427e+00 -2.828427e+00 0.000000e+00
+-2.222437e+00 -3.325775e+00 0.000000e+00
+-1.531079e+00 -3.695375e+00 0.000000e+00
+-7.809112e-01 -3.923031e+00 0.000000e+00
+-4.804169e-16 -3.923031e+00 7.809111e-01
+-4.525380e-16 -3.695376e+00 1.531079e+00
+-4.072765e-16 -3.325775e+00 2.222436e+00
+-3.463710e-16 -2.828427e+00 2.828427e+00
+-2.721610e-16 -2.222437e+00 3.325775e+00
+-1.874969e-16 -1.531079e+00 3.695375e+00
+-9.563088e-17 -7.809112e-01 3.923031e+00
+7.809111e-01 -3.923031e+00 0.000000e+00
+1.531079e+00 -3.695376e+00 0.000000e+00
+2.222436e+00 -3.325775e+00 0.000000e+00
+2.828427e+00 -2.828427e+00 0.000000e+00
+3.325775e+00 -2.222437e+00 0.000000e+00
+3.695375e+00 -1.531079e+00 0.000000e+00
+3.923031e+00 -7.809112e-01 0.000000e+00
+7.809111e-01 0.000000e+00 -3.923031e+00
+1.531079e+00 0.000000e+00 -3.695376e+00
+2.222436e+00 0.000000e+00 -3.325775e+00
+2.828427e+00 0.000000e+00 -2.828427e+00
+3.325775e+00 0.000000e+00 -2.222437e+00
+3.695375e+00 0.000000e+00 -1.531079e+00
+3.923031e+00 0.000000e+00 -7.809112e-01
+0.000000e+00 3.923031e+00 -7.809111e-01
+0.000000e+00 3.695376e+00 -1.531079e+00
+0.000000e+00 3.325775e+00 -2.222436e+00
+0.000000e+00 2.828427e+00 -2.828427e+00
+0.000000e+00 2.222437e+00 -3.325775e+00
+0.000000e+00 1.531079e+00 -3.695375e+00
+0.000000e+00 7.809112e-01 -3.923031e+00
+-3.923031e+00 2.402085e-16 -7.809111e-01
+-3.695376e+00 2.262690e-16 -1.531079e+00
+-3.325775e+00 2.036382e-16 -2.222436e+00
+-2.828427e+00 1.731855e-16 -2.828427e+00
+-2.222437e+00 1.360805e-16 -3.325775e+00
+-1.531079e+00 9.374846e-17 -3.695375e+00
+-7.809112e-01 4.781544e-17 -3.923031e+00
+-4.804169e-16 -3.923031e+00 -7.809111e-01
+-4.525380e-16 -3.695376e+00 -1.531079e+00
+-4.072765e-16 -3.325775e+00 -2.222436e+00
+-3.463710e-16 -2.828427e+00 -2.828427e+00
+-2.721610e-16 -2.222437e+00 -3.325775e+00
+-1.874969e-16 -1.531079e+00 -3.695375e+00
+-9.563088e-17 -7.809112e-01 -3.923031e+00
+1.894854e+00 2.438120e+00 2.542621e+00
+1.704344e+00 1.876629e+00 3.094139e+00
+1.266904e+00 1.589526e+00 3.445037e+00
+3.772757e+00 1.137329e+00 6.714737e-01
+1.104442e+00 3.772531e+00 7.322286e-01
+2.343466e+00 1.619107e+00 2.808317e+00
+2.278902e+00 7.554233e-01 3.197192e+00
+1.213682e+00 2.982021e+00 2.373729e+00
+3.109551e+00 2.451983e+00 5.198051e-01
+2.445957e+00 2.597821e+00 1.807927e+00
+1.718495e+00 2.983532e+00 2.035984e+00
+1.851154e+00 3.462550e+00 7.558510e-01
+6.071574e-01 1.955790e+00 3.430865e+00
+5.621668e-01 3.779217e+00 1.165981e+00
+3.759272e+00 6.327164e-01 1.199336e+00
+6.513418e-01 1.198689e+00 3.756737e+00
+1.400636e+00 7.484204e-01 3.669645e+00
+1.118821e+00 2.416356e+00 2.984902e+00
+2.870560e+00 8.977746e-01 2.636720e+00
+4.909150e-01 3.505724e+00 1.848146e+00
+1.291576e+00 3.442122e+00 1.575918e+00
+5.732813e-01 3.002874e+00 2.571644e+00
+1.889620e+00 1.382830e+00 3.242777e+00
+3.919135e+00 5.346171e-01 5.117257e-01
+3.482453e+00 1.830013e+00 7.103406e-01
+3.378556e+00 6.859136e-01 2.022787e+00
+2.927272e+00 1.954846e+00 1.899603e+00
+3.421874e+00 1.441956e+00 1.487081e+00
+4.703272e-01 2.516754e+00 3.064392e+00
+2.957761e+00 1.493075e+00 2.241056e+00
+2.021612e+00 3.158533e+00 1.391136e+00
+3.122297e+00 4.373653e-01 2.449965e+00
+3.061355e+00 2.274672e+00 1.205686e+00
+2.568992e+00 2.947271e+00 8.419584e-01
+4.935165e-01 3.920371e+00 5.403548e-01
+2.552751e+00 2.053710e+00 2.294481e+00
+1.902304e+00 3.891480e-01 3.487965e+00
+5.713833e-01 5.496422e-01 3.910774e+00
+-2.803402e+00 2.207545e+00 1.807417e+00
+-2.099985e+00 1.565474e+00 3.023115e+00
+-1.363141e+00 2.103006e+00 3.117372e+00
+-3.500096e+00 1.337346e+00 1.400095e+00
+-1.541026e+00 3.067214e+00 2.053559e+00
+-6.262644e-01 1.092081e+00 3.792816e+00
+-3.774834e+00 1.131828e+00 6.687780e-01
+-1.889804e+00 3.242206e+00 1.383919e+00
+-1.336915e+00 1.398428e+00 3.500926e+00
+-1.899860e+00 2.402970e+00 2.572125e+00
+-1.257690e+00 2.721341e+00 2.647749e+00
+-2.532174e+00 7.649893e-01 2.998291e+00
+-2.346521e+00 2.642036e+00 1.874213e+00
+-1.216509e+00 3.458547e+00 1.599542e+00
+-2.536861e+00 1.982283e+00 2.373675e+00
+-3.423768e+00 1.915117e+00 7.742512e-01
+-7.838044e-01 3.148339e+00 2.337332e+00
+-1.142079e+00 6.886843e-01 3.768595e+00
+-3.778175e+00 5.766649e-01 1.163430e+00
+-3.376469e+00 7.792642e-01 1.995428e+00
+-6.861429e-01 3.769627e+00 1.140025e+00
+-3.158925e+00 1.948181e+00 1.491543e+00
+-7.090569e-01 2.517315e+00 3.023185e+00
+-1.265744e+00 3.712649e+00 7.788963e-01
+-2.954341e+00 2.610697e+00 6.537937e-01
+-5.518353e-01 3.525513e+00 1.794971e+00
+-2.896120e+00 2.423958e+00 1.317808e+00
+-3.089989e+00 1.597968e+00 1.974395e+00
+-2.521811e+00 3.054240e+00 5.127586e-01
+-2.488667e+00 2.934563e+00 1.093003e+00
+-5.493375e-01 3.914162e+00 5.424736e-01
+-3.920832e+00 5.026320e-01 5.276556e-01
+-5.112628e-01 5.070701e-01 3.922109e+00
+-2.791110e+00 1.249421e+00 2.578193e+00
+-7.062452e-01 1.829761e+00 3.483330e+00
+-2.987207e+00 5.721610e-01 2.590055e+00
+-2.035189e+00 3.374565e+00 6.664262e-01
+-1.852423e+00 7.604300e-01 3.460953e+00
+-2.207545e+00 -2.803402e+00 1.807417e+00
+-1.565474e+00 -2.099985e+00 3.023115e+00
+-2.103006e+00 -1.363141e+00 3.117372e+00
+-1.337346e+00 -3.500096e+00 1.400095e+00
+-3.067214e+00 -1.541026e+00 2.053559e+00
+-1.092081e+00 -6.262644e-01 3.792816e+00
+-1.131828e+00 -3.774834e+00 6.687780e-01
+-3.242206e+00 -1.889804e+00 1.383919e+00
+-1.398428e+00 -1.336915e+00 3.500926e+00
+-2.402970e+00 -1.899860e+00 2.572125e+00
+-2.721341e+00 -1.257690e+00 2.647749e+00
+-7.649893e-01 -2.532174e+00 2.998291e+00
+-2.642036e+00 -2.346521e+00 1.874213e+00
+-3.458547e+00 -1.216509e+00 1.599542e+00
+-1.982283e+00 -2.536861e+00 2.373675e+00
+-1.915117e+00 -3.423768e+00 7.742512e-01
+-3.148339e+00 -7.838044e-01 2.337332e+00
+-6.886843e-01 -1.142079e+00 3.768595e+00
+-5.766649e-01 -3.778175e+00 1.163430e+00
+-7.792642e-01 -3.376469e+00 1.995428e+00
+-3.769627e+00 -6.861429e-01 1.140025e+00
+-1.948181e+00 -3.158925e+00 1.491543e+00
+-2.517315e+00 -7.090569e-01 3.023185e+00
+-3.712649e+00 -1.265744e+00 7.788963e-01
+-2.610697e+00 -2.954341e+00 6.537937e-01
+-3.525513e+00 -5.518353e-01 1.794971e+00
+-2.423958e+00 -2.896120e+00 1.317808e+00
+-1.597968e+00 -3.089989e+00 1.974395e+00
+-3.054240e+00 -2.521811e+00 5.127586e-01
+-2.934563e+00 -2.488667e+00 1.093003e+00
+-3.914162e+00 -5.493375e-01 5.424736e-01
+-5.026320e-01 -3.920832e+00 5.276556e-01
+-5.070701e-01 -5.112628e-01 3.922109e+00
+-1.249421e+00 -2.791110e+00 2.578193e+00
+-1.829761e+00 -7.062452e-01 3.483330e+00
+-5.721610e-01 -2.987207e+00 2.590055e+00
+-3.374565e+00 -2.035189e+00 6.664262e-01
+-7.604300e-01 -1.852423e+00 3.460953e+00
+1.795535e+00 -2.920995e+00 2.059895e+00
+2.059999e+00 -1.481755e+00 3.091943e+00
+3.279759e+00 -1.335256e+00 1.859787e+00
+3.536872e+00 -1.480828e+00 1.138916e+00
+1.521236e+00 -1.912615e+00 3.166518e+00
+1.130687e+00 -3.233759e+00 2.064652e+00
+3.782088e+00 -1.156482e+00 5.625638e-01
+6.592869e-01 -1.039867e+00 3.802726e+00
+1.128112e+00 -3.779322e+00 6.464092e-01
+2.742903e+00 -1.444477e+00 2.527605e+00
+2.115196e+00 -2.227741e+00 2.561583e+00
+1.400128e+00 -1.255191e+00 3.530337e+00
+1.331660e+00 -2.649562e+00 2.684126e+00
+1.908751e+00 -3.431406e+00 7.543102e-01
+6.341436e-01 -3.028220e+00 2.529020e+00
+7.883196e-01 -2.430908e+00 3.075553e+00
+3.473460e+00 -1.877956e+00 6.111823e-01
+3.732273e+00 -7.410055e-01 1.228485e+00
+1.942094e+00 -8.253110e-01 3.397307e+00
+3.477505e+00 -5.303094e-01 1.891615e+00
+7.661470e-01 -1.760618e+00 3.507463e+00
+1.371126e+00 -3.471119e+00 1.439100e+00
+6.035457e-01 -3.784885e+00 1.129707e+00
+6.255508e-01 -3.487150e+00 1.848246e+00
+3.022251e+00 -2.546547e+00 5.847712e-01
+2.579939e+00 -2.853689e+00 1.095189e+00
+2.511531e+00 -3.066367e+00 4.870977e-01
+2.059163e+00 -3.094702e+00 1.477136e+00
+2.641355e+00 -8.302566e-01 2.885769e+00
+5.071048e-01 -3.921603e+00 5.160746e-01
+3.917757e+00 -5.402530e-01 5.189075e-01
+2.424698e+00 -2.604973e+00 1.826138e+00
+2.781142e+00 -2.023617e+00 2.041532e+00
+3.084175e+00 -2.168104e+00 1.336558e+00
+3.104700e+00 -7.118799e-01 2.415350e+00
+5.293112e-01 -4.606326e-01 3.924763e+00
+1.329724e+00 -5.296436e-01 3.728749e+00
+1.735562e+00 3.048014e+00 -1.922915e+00
+1.305414e+00 3.469395e+00 -1.502979e+00
+1.798713e+00 1.155291e+00 -3.380708e+00
+1.233134e+00 5.758579e-01 -3.756085e+00
+3.779509e+00 1.079701e+00 -7.334144e-01
+2.406790e+00 2.780186e+00 -1.574106e+00
+1.983735e+00 3.263740e+00 -1.187875e+00
+3.452674e+00 1.856573e+00 -7.896939e-01
+5.421156e-01 2.494953e+00 -3.071813e+00
+2.517589e+00 1.346143e+00 -2.801508e+00
+2.392386e+00 6.545226e-01 -3.133620e+00
+1.473417e+00 2.764007e+00 -2.487680e+00
+3.522618e+00 1.312920e+00 -1.366227e+00
+9.344768e-01 3.257081e+00 -2.125461e+00
+3.761524e+00 5.772544e-01 -1.215900e+00
+9.699098e-01 1.266094e+00 -3.668140e+00
+3.093864e+00 1.471639e+00 -2.064350e+00
+3.079085e+00 2.483935e+00 -5.527143e-01
+6.325733e-01 3.780067e+00 -1.132326e+00
+1.253388e+00 3.731593e+00 -6.969211e-01
+1.862575e+00 4.792319e-01 -3.499484e+00
+3.448914e+00 7.166009e-01 -1.890294e+00
+1.487472e+00 1.793177e+00 -3.251342e+00
+2.556994e+00 2.985280e+00 -7.294241e-01
+7.313388e-01 1.936548e+00 -3.420318e+00
+2.995461e+00 7.912778e-01 -2.528066e+00
+7.389885e-01 2.873244e+00 -2.679871e+00
+2.990056e+00 2.389490e+00 -1.161915e+00
+1.230124e+00 2.360920e+00 -2.985448e+00
+1.818633e+00 2.225888e+00 -2.781545e+00
+3.919423e+00 4.914396e-01 -5.506946e-01
+5.942955e-01 3.549865e+00 -1.734348e+00
+3.219477e+00 1.866263e+00 -1.466593e+00
+1.959795e+00 3.438905e+00 -5.353617e-01
+2.415444e+00 1.954043e+00 -2.519345e+00
+2.033127e+00 1.717196e+00 -2.986229e+00
+2.737902e+00 2.219829e+00 -1.890679e+00
+5.377519e-01 3.917268e+00 -5.260557e-01
+2.135028e+00 2.539836e+00 -2.233767e+00
+5.116662e-01 7.108174e-01 -3.895340e+00
+-2.803402e+00 2.207545e+00 -1.807417e+00
+-2.099985e+00 1.565474e+00 -3.023115e+00
+-1.363141e+00 2.103006e+00 -3.117372e+00
+-3.500096e+00 1.337346e+00 -1.400095e+00
+-1.541026e+00 3.067214e+00 -2.053559e+00
+-6.262644e-01 1.092081e+00 -3.792816e+00
+-3.774834e+00 1.131828e+00 -6.687780e-01
+-1.889804e+00 3.242206e+00 -1.383919e+00
+-1.336915e+00 1.398428e+00 -3.500926e+00
+-1.899860e+00 2.402970e+00 -2.572125e+00
+-1.257690e+00 2.721341e+00 -2.647749e+00
+-2.532174e+00 7.649893e-01 -2.998291e+00
+-2.346521e+00 2.642036e+00 -1.874213e+00
+-1.216509e+00 3.458547e+00 -1.599542e+00
+-2.536861e+00 1.982283e+00 -2.373675e+00
+-3.423768e+00 1.915117e+00 -7.742512e-01
+-7.838044e-01 3.148339e+00 -2.337332e+00
+-1.142079e+00 6.886843e-01 -3.768595e+00
+-3.778175e+00 5.766649e-01 -1.163430e+00
+-3.376469e+00 7.792642e-01 -1.995428e+00
+-6.861429e-01 3.769627e+00 -1.140025e+00
+-3.158925e+00 1.948181e+00 -1.491543e+00
+-7.090569e-01 2.517315e+00 -3.023185e+00
+-1.265744e+00 3.712649e+00 -7.788963e-01
+-2.954341e+00 2.610697e+00 -6.537937e-01
+-5.518353e-01 3.525513e+00 -1.794971e+00
+-2.896120e+00 2.423958e+00 -1.317808e+00
+-3.089989e+00 1.597968e+00 -1.974395e+00
+-2.521811e+00 3.054240e+00 -5.127586e-01
+-2.488667e+00 2.934563e+00 -1.093003e+00
+-5.493375e-01 3.914162e+00 -5.424736e-01
+-3.920832e+00 5.026320e-01 -5.276556e-01
+-5.112628e-01 5.070701e-01 -3.922109e+00
+-2.791110e+00 1.249421e+00 -2.578193e+00
+-7.062452e-01 1.829761e+00 -3.483330e+00
+-2.987207e+00 5.721610e-01 -2.590055e+00
+-2.035189e+00 3.374565e+00 -6.664262e-01
+-1.852423e+00 7.604300e-01 -3.460953e+00
+-1.570453e+00 -2.100102e+00 -3.020453e+00
+-2.099664e+00 -1.363321e+00 -3.119542e+00
+-1.338350e+00 -3.500008e+00 -1.399354e+00
+-3.067878e+00 -1.552183e+00 -2.044149e+00
+-1.092077e+00 -6.263561e-01 -3.792804e+00
+-1.131943e+00 -3.774808e+00 -6.687200e-01
+-3.730096e+00 -1.168653e+00 -8.480656e-01
+-3.291597e+00 -1.785079e+00 -1.406405e+00
+-1.398130e+00 -1.336659e+00 -3.501142e+00
+-2.403074e+00 -1.901667e+00 -2.570692e+00
+-2.709438e+00 -1.245706e+00 -2.665558e+00
+-7.687068e-01 -2.532073e+00 -2.997502e+00
+-2.657537e+00 -2.319311e+00 -1.886069e+00
+-3.435465e+00 -1.065821e+00 -1.749721e+00
+-1.972411e+00 -2.605948e+00 -2.305941e+00
+-1.829031e+00 -3.467277e+00 -7.901029e-01
+-3.094484e+00 -7.485042e-01 -2.418425e+00
+-6.889896e-01 -1.142044e+00 -3.768556e+00
+-5.767202e-01 -3.778173e+00 -1.163412e+00
+-7.810603e-01 -3.376683e+00 -1.994416e+00
+-2.137047e+00 -3.014331e+00 -1.531891e+00
+-2.495662e+00 -7.009861e-01 -3.042765e+00
+-3.392898e+00 -1.995080e+00 -6.974808e-01
+-1.527532e+00 -3.111629e+00 -1.995927e+00
+-3.005806e+00 -2.567486e+00 -5.769942e-01
+-2.877050e+00 -2.501969e+00 -1.209109e+00
+-5.026668e-01 -3.920830e+00 -5.276404e-01
+-5.070718e-01 -5.112746e-01 -3.922107e+00
+-1.825157e+00 -7.048900e-01 -3.485991e+00
+-1.260338e+00 -2.789080e+00 -2.575073e+00
+-5.751112e-01 -2.987235e+00 -2.589450e+00
+-2.533967e+00 -3.009639e+00 -7.071854e-01
+-7.619421e-01 -1.852408e+00 -3.460657e+00
+-3.757472e+00 -5.376977e-01 -1.243318e+00
+-3.503600e+00 -4.794512e-01 -1.854765e+00
+-3.915144e+00 -5.010026e-01 -5.789481e-01
+2.038209e+00 -2.693023e+00 -2.142660e+00
+2.060668e+00 -1.481789e+00 -3.091481e+00
+3.305494e+00 -1.329959e+00 -1.817608e+00
+3.538110e+00 -1.476612e+00 -1.140532e+00
+1.521236e+00 -1.912615e+00 -3.166518e+00
+1.342350e+00 -3.156562e+00 -2.057340e+00
+3.782097e+00 -1.156474e+00 -5.625042e-01
+6.593780e-01 -1.039973e+00 -3.802684e+00
+1.106854e+00 -3.781071e+00 -6.764234e-01
+2.740095e+00 -1.537685e+00 -2.475260e+00
+2.090785e+00 -2.119853e+00 -2.670674e+00
+1.433143e+00 -1.240783e+00 -3.522198e+00
+1.336528e+00 -2.650154e+00 -2.681121e+00
+1.900919e+00 -3.435687e+00 -7.546614e-01
+6.380061e-01 -3.029047e+00 -2.527172e+00
+7.898274e-01 -2.431194e+00 -3.074968e+00
+3.474443e+00 -1.875816e+00 -6.123156e-01
+5.701324e-01 -3.785781e+00 -1.141215e+00
+3.732323e+00 -7.409966e-01 -1.228342e+00
+2.123914e+00 -6.977133e-01 -3.313686e+00
+3.482950e+00 -5.297323e-01 -1.881704e+00
+1.283908e+00 -3.537658e+00 -1.354816e+00
+7.663934e-01 -1.760657e+00 -3.507394e+00
+6.040160e-01 -3.479031e+00 -1.869635e+00
+3.022950e+00 -2.545619e+00 -5.852553e-01
+2.573444e+00 -2.877956e+00 -1.046010e+00
+2.509183e+00 -3.068500e+00 -4.855800e-01
+1.954280e+00 -3.136923e+00 -1.529606e+00
+2.644809e+00 -8.515097e-01 -2.876707e+00
+2.592202e+00 -2.533079e+00 -1.692289e+00
+4.960999e-01 -3.921830e+00 -5.245320e-01
+3.917761e+00 -5.402503e-01 -5.188667e-01
+2.923650e+00 -1.957738e+00 -1.902190e+00
+3.126751e+00 -2.140957e+00 -1.280024e+00
+2.506927e+00 -2.213752e+00 -2.194033e+00
+3.113086e+00 -7.318979e-01 -2.399109e+00
+5.293383e-01 -4.606590e-01 -3.924758e+00
+1.362841e+00 -5.096747e-01 -3.719130e+00
diff --git a/doc/tutorials/03-object_in_fluid/scripts/input/sphere_triangles.dat b/doc/tutorials/03-object_in_fluid/scripts/input/sphere_triangles.dat
new file mode 100644
index 00000000000..a9321d1aa77
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/input/sphere_triangles.dat
@@ -0,0 +1,782 @@
+93 14 13
+95 91 90
+9 8 96
+101 94 18
+105 26 25
+12 11 104
+99 90 100
+19 18 94
+25 24 102
+25 102 105
+105 102 92
+101 18 17
+16 15 98
+90 97 100
+92 106 105
+22 21 109
+109 21 103
+111 23 22
+112 106 92
+113 0 12
+113 93 13
+13 0 113
+14 93 114
+107 111 97
+113 12 104
+93 113 104
+111 22 109
+91 95 112
+112 92 91
+112 95 96
+15 14 114
+114 98 15
+108 9 96
+96 95 108
+110 94 101
+103 94 110
+110 100 97
+103 110 109
+90 91 107
+107 97 90
+102 107 92
+107 91 92
+103 21 20
+109 110 97
+111 109 97
+118 24 23
+118 111 107
+23 111 118
+119 108 95
+110 101 120
+120 100 110
+102 24 118
+102 118 107
+108 119 115
+11 10 115
+115 104 11
+104 115 117
+121 10 9
+121 108 115
+115 10 121
+9 108 121
+16 98 123
+124 1 19
+20 1 124
+19 94 124
+114 122 98
+103 20 124
+103 124 94
+99 122 116
+17 16 123
+123 101 17
+99 100 120
+95 90 125
+99 116 125
+125 90 99
+8 7 126
+126 7 106
+126 96 8
+119 95 125
+119 125 116
+123 120 101
+99 120 123
+123 98 122
+99 123 122
+119 116 117
+117 116 122
+119 117 115
+93 104 117
+114 93 117
+114 117 122
+6 2 127
+127 2 26
+105 106 127
+127 26 105
+106 7 6
+6 127 106
+112 96 126
+112 126 106
+133 25 26
+33 32 134
+137 130 129
+138 137 132
+130 137 138
+132 137 140
+140 135 132
+132 135 141
+142 137 129
+143 134 32
+131 134 143
+145 40 39
+145 136 133
+35 34 146
+147 36 35
+148 20 21
+142 128 140
+137 142 140
+147 35 146
+146 134 131
+144 22 23
+144 138 132
+141 144 132
+143 32 31
+149 131 143
+139 38 37
+136 129 130
+131 147 146
+138 144 150
+150 144 23
+31 30 152
+152 143 31
+153 141 148
+148 21 153
+144 141 153
+128 142 155
+155 149 128
+156 30 29
+158 1 20
+27 1 158
+159 3 33
+34 3 159
+26 2 160
+40 145 160
+160 2 40
+162 24 25
+25 133 162
+152 30 156
+133 26 160
+133 160 145
+150 23 24
+153 21 22
+144 153 22
+149 155 131
+128 149 154
+154 140 128
+140 154 157
+159 146 34
+134 146 159
+159 33 134
+158 20 148
+143 152 154
+154 149 143
+161 142 129
+129 139 161
+161 155 142
+135 140 157
+141 135 151
+141 151 148
+148 151 158
+163 139 37
+163 147 161
+161 139 163
+164 157 156
+156 29 164
+164 29 28
+151 164 28
+164 151 135
+157 164 135
+157 154 152
+157 152 156
+36 163 37
+147 163 36
+162 136 130
+133 136 162
+131 155 147
+147 155 161
+165 129 136
+139 129 165
+150 24 162
+130 138 150
+130 150 162
+165 145 39
+165 39 38
+136 145 165
+38 139 165
+151 28 27
+158 151 27
+171 39 40
+47 46 172
+175 168 167
+176 175 170
+168 175 176
+170 175 178
+178 173 170
+170 173 179
+180 175 167
+181 172 46
+169 172 181
+183 54 53
+183 174 171
+49 48 184
+185 50 49
+186 34 35
+180 166 178
+175 180 178
+185 49 184
+184 172 169
+182 36 37
+182 176 170
+179 182 170
+181 46 45
+187 169 181
+177 52 51
+174 167 168
+169 185 184
+176 182 188
+188 182 37
+45 44 190
+190 181 45
+191 179 186
+186 35 191
+182 179 191
+166 180 193
+193 187 166
+194 44 43
+196 3 34
+41 3 196
+197 4 47
+48 4 197
+40 2 198
+54 183 198
+198 2 54
+200 38 39
+39 171 200
+190 44 194
+171 40 198
+171 198 183
+188 37 38
+191 35 36
+182 191 36
+187 193 169
+166 187 192
+192 178 166
+178 192 195
+197 184 48
+172 184 197
+197 47 172
+196 34 186
+181 190 192
+192 187 181
+199 180 167
+167 177 199
+199 193 180
+173 178 195
+179 173 189
+179 189 186
+186 189 196
+201 177 51
+201 185 199
+199 177 201
+202 195 194
+194 43 202
+202 43 42
+189 202 42
+202 189 173
+195 202 173
+195 192 190
+195 190 194
+50 201 51
+185 201 50
+200 174 168
+171 174 200
+169 193 185
+185 193 199
+203 167 174
+177 167 203
+188 38 200
+168 176 188
+168 188 200
+203 183 53
+203 53 52
+174 183 203
+52 177 203
+189 42 41
+196 189 41
+61 60 210
+205 213 214
+214 208 205
+216 214 204
+208 214 216
+218 50 51
+220 210 60
+207 210 220
+11 12 221
+224 215 208
+211 215 224
+226 48 49
+226 225 212
+49 50 227
+209 225 227
+227 50 218
+209 227 218
+225 209 204
+226 49 227
+226 227 225
+211 53 54
+225 217 212
+224 52 53
+53 211 224
+219 224 208
+52 224 219
+223 10 11
+223 11 221
+220 60 59
+51 52 219
+218 51 219
+208 216 219
+216 204 209
+218 216 209
+216 218 219
+215 205 208
+205 215 222
+217 57 56
+212 56 55
+212 217 56
+207 206 221
+221 210 207
+223 221 206
+58 57 230
+230 57 217
+230 228 58
+231 225 204
+231 229 217
+217 225 231
+213 205 232
+232 205 222
+233 4 48
+55 4 233
+48 226 233
+12 0 234
+234 0 61
+59 58 228
+212 55 233
+212 233 226
+230 217 229
+228 230 229
+234 221 12
+210 221 234
+234 61 210
+59 228 220
+204 214 235
+214 213 236
+236 235 214
+237 207 220
+206 207 237
+231 204 235
+231 235 229
+237 228 229
+237 220 228
+237 229 235
+238 9 10
+232 9 238
+238 10 223
+213 206 236
+206 237 236
+236 237 235
+238 206 213
+213 232 238
+223 206 238
+8 9 232
+8 232 222
+54 2 239
+239 211 54
+239 2 6
+240 6 7
+239 6 240
+239 240 211
+215 211 240
+240 222 215
+7 8 222
+7 222 240
+13 14 245
+62 63 244
+241 246 247
+247 242 241
+251 64 65
+245 248 253
+245 253 255
+258 248 15
+259 69 70
+261 244 63
+243 244 261
+255 67 68
+251 250 243
+262 66 67
+262 67 255
+262 255 253
+261 63 64
+64 251 261
+261 251 243
+258 15 16
+260 242 247
+252 241 254
+241 242 254
+72 73 249
+15 248 14
+14 248 245
+256 244 243
+242 260 259
+256 243 263
+258 16 264
+256 263 265
+251 65 266
+266 250 251
+267 71 72
+254 71 267
+271 0 13
+68 0 271
+13 245 271
+70 71 272
+272 71 254
+266 65 66
+262 266 66
+255 68 271
+255 271 245
+269 249 265
+263 269 265
+247 246 264
+258 264 268
+268 264 246
+268 248 258
+73 74 265
+265 249 73
+265 74 256
+254 242 272
+272 242 259
+259 70 272
+264 16 17
+267 72 249
+267 249 269
+267 252 254
+267 269 252
+257 250 266
+262 253 257
+257 266 262
+273 253 248
+257 253 273
+248 268 273
+274 18 260
+260 247 274
+17 18 274
+264 17 274
+264 274 247
+18 19 260
+270 252 269
+269 263 270
+275 250 257
+243 250 276
+270 263 276
+276 263 243
+277 268 246
+277 275 257
+19 1 278
+69 259 278
+278 1 69
+241 252 279
+279 252 270
+276 250 275
+270 276 275
+277 257 273
+268 277 273
+260 19 278
+260 278 259
+246 241 279
+277 246 279
+270 275 279
+275 277 279
+280 5 62
+75 5 280
+74 75 280
+244 256 280
+280 62 244
+74 280 256
+75 74 286
+287 32 33
+282 283 290
+285 290 291
+291 290 283
+293 290 285
+285 288 293
+294 288 285
+282 290 295
+32 287 296
+296 287 284
+81 82 298
+286 289 298
+299 76 77
+77 78 300
+70 69 301
+293 281 295
+293 295 290
+299 77 300
+284 287 299
+72 71 297
+285 291 297
+285 297 294
+31 32 296
+296 284 302
+79 80 292
+283 282 289
+299 300 284
+303 297 291
+72 297 303
+305 30 31
+31 296 305
+301 294 306
+306 70 301
+306 294 297
+308 295 281
+281 302 308
+29 30 309
+311 1 27
+69 1 311
+33 3 312
+312 3 76
+313 5 75
+313 298 82
+82 5 313
+74 73 315
+315 286 74
+309 30 305
+313 75 286
+298 313 286
+73 72 303
+71 70 306
+71 306 297
+284 308 302
+307 302 281
+281 293 307
+310 307 293
+76 299 312
+312 299 287
+287 33 312
+301 69 311
+307 305 296
+296 302 307
+282 295 314
+314 292 282
+295 308 314
+310 293 288
+304 288 294
+301 304 294
+311 304 301
+79 292 316
+314 300 316
+316 292 314
+309 310 317
+317 29 309
+28 29 317
+28 317 304
+288 304 317
+288 317 310
+305 307 310
+309 305 310
+79 316 78
+78 316 300
+283 289 315
+315 289 286
+300 308 284
+314 308 300
+289 282 318
+318 282 292
+315 73 303
+303 291 283
+315 303 283
+81 298 318
+80 81 318
+318 298 289
+318 292 80
+27 28 304
+27 304 311
+41 42 325
+82 81 323
+324 46 47
+319 320 328
+322 328 329
+329 328 320
+331 328 322
+322 326 331
+332 326 322
+325 326 332
+319 328 333
+46 324 334
+334 324 321
+88 89 336
+323 327 336
+337 83 84
+84 85 338
+331 333 328
+337 84 338
+321 324 337
+79 78 335
+322 329 335
+322 335 332
+45 46 334
+334 321 339
+86 87 330
+320 319 327
+337 338 321
+340 335 329
+79 335 340
+341 325 42
+326 325 341
+43 44 343
+47 4 345
+345 4 83
+346 5 82
+346 336 89
+89 5 346
+81 80 347
+347 323 81
+346 82 323
+336 346 323
+80 79 340
+321 342 339
+341 42 43
+83 337 345
+345 337 324
+324 47 345
+343 341 43
+319 333 348
+348 330 319
+333 342 348
+86 330 349
+348 338 349
+349 330 348
+344 331 326
+326 341 344
+341 343 344
+86 349 85
+85 349 338
+320 327 347
+347 327 323
+338 342 321
+348 342 338
+334 339 350
+350 339 344
+327 319 351
+351 319 330
+347 80 340
+340 329 320
+347 340 320
+331 339 333
+339 331 344
+342 333 339
+350 44 45
+45 334 350
+343 44 350
+344 343 350
+88 336 351
+87 88 351
+351 336 327
+351 330 87
+325 332 352
+352 77 76
+353 335 78
+353 352 332
+332 335 353
+354 3 41
+76 3 354
+353 78 77
+352 353 77
+354 352 76
+325 352 354
+354 41 325
+55 56 363
+361 60 61
+365 364 356
+356 359 365
+355 365 367
+367 365 359
+86 85 369
+60 361 371
+371 361 358
+373 68 67
+376 372 363
+359 366 377
+377 366 362
+378 85 84
+84 372 378
+372 84 83
+369 85 378
+369 378 360
+376 360 378
+376 378 372
+89 88 362
+363 368 376
+88 87 377
+377 362 88
+359 377 370
+370 377 87
+56 57 368
+56 368 363
+67 66 375
+373 67 375
+59 60 371
+370 87 86
+370 86 369
+370 367 359
+360 355 367
+360 367 369
+370 369 367
+359 356 366
+374 366 356
+373 357 358
+358 361 373
+357 373 375
+381 57 58
+368 57 381
+58 379 381
+368 380 382
+382 376 368
+383 356 364
+374 356 383
+385 4 55
+83 4 385
+55 363 385
+61 0 386
+386 0 68
+379 58 59
+382 355 360
+376 382 360
+372 83 385
+372 385 363
+380 368 381
+380 381 379
+384 355 382
+380 384 382
+68 373 386
+386 373 361
+361 61 386
+387 357 364
+371 379 59
+371 358 388
+389 364 365
+387 364 389
+388 358 357
+387 388 357
+355 384 389
+389 365 355
+389 384 387
+380 379 388
+379 371 388
+384 380 388
+384 388 387
+66 65 390
+390 65 383
+375 66 390
+364 357 390
+390 383 364
+390 357 375
+391 5 89
+89 362 391
+62 5 391
+63 62 392
+392 62 391
+362 392 391
+392 362 366
+366 374 392
+383 65 64
+374 383 64
+374 64 63
+392 374 63
diff --git a/doc/tutorials/03-object_in_fluid/scripts/simulation.tcl b/doc/tutorials/03-object_in_fluid/scripts/simulation.tcl
new file mode 100644
index 00000000000..e5629511f5b
--- /dev/null
+++ b/doc/tutorials/03-object_in_fluid/scripts/simulation.tcl
@@ -0,0 +1,75 @@
+# Copyright (C) 2014 The ESPResSo project
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+file delete -force "output"
+file mkdir output
+
+# what input files to read
+set fileNodes "input/cell_nodes.dat"
+set fileTriangles "input/cell_triangles.dat"
+
+# integrator settings for the simulation
+setmd time_step 0.1
+setmd skin 0.4
+thermostat off
+
+# rectangular channel box geometry
+set boxX 50
+set boxY 22
+set boxZ 20
+setmd box_l $boxX $boxY $boxZ
+
+source boundaries.tcl
+
+# initialization of the object-in-fluid mechanisms
+oif_init
+
+# creating templates
+oif_create_template template-id 0 nodes-file $fileNodes triangles-file $fileTriangles stretch 3.0 3.0 3.0 ks 0.07 kb 0.01 kal 0.01 kag 0.01 kv 10.0
+
+set pi 3.14159265359
+
+# adding cells
+oif_add_object object-id 0 template-id 0 origin 5 15 5 rotate 0 0 [expr $pi/2] part-type 0 mass 1
+oif_add_object object-id 1 template-id 0 origin 5 5 15 rotate 0 0 0 part-type 1 mass 1
+
+# cell-cell interactions
+inter 0 1 soft-sphere 0.005 2.0 0.3 0.0
+
+# cell-wall interactions
+inter 0 10 soft-sphere 0.0001 1.2 0.1 0.0
+
+# set up fluid
+lbfluid grid 1 dens 1.0 visc 1.5 tau 0.1 friction 0.5
+
+# setting the constant velocity
+# of the fluid on the left side of the md_box
+lbboundary rhomboid velocity 0.005 0 0 corner 0 1 1 a 1 1 1 b 0 [expr $boxY-1] 1 c 0 1 [expr $boxZ-1] direction 1
+
+# main iteration loop
+set steps 200
+set counter 0
+while { $counter<200} {
+
+ set cycle [expr $counter*$steps]
+ puts "cycle $cycle"
+ lbfluid print vtk velocity "output/fluid$cycle.vtk"
+ oif_object_output object-id 0 vtk-pos "output/cell0_$cycle.vtk"
+ oif_object_output object-id 1 vtk-pos "output/cell1_$cycle.vtk"
+ integrate $steps
+ incr counter
+}
diff --git a/doc/tutorials/Makefile.am b/doc/tutorials/Makefile.am
index c89bb02e2b5..64dffb735d3 100644
--- a/doc/tutorials/Makefile.am
+++ b/doc/tutorials/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-SUBDIRS=01-lennard_jones 02-charged_system
+SUBDIRS=01-lennard_jones 02-charged_system 03-object_in_fluid
if DEVEL_SRC
diff --git a/doc/tutorials/common/common.tex b/doc/tutorials/common/common.tex
index f0b00435fd6..160bfd304b6 100644
--- a/doc/tutorials/common/common.tex
+++ b/doc/tutorials/common/common.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/Makefile.am b/doc/ug/Makefile.am
index 110b21a81ce..c17d489f382 100644
--- a/doc/ug/Makefile.am
+++ b/doc/ug/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
#
# This file is part of ESPResSo.
diff --git a/doc/ug/analysis-core.tex b/doc/ug/analysis-core.tex
index b1c771014dd..532e0d20e49 100644
--- a/doc/ug/analysis-core.tex
+++ b/doc/ug/analysis-core.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2012,2013 The ESPResSo project
+% Copyright (C) 2012,2013,2014 The ESPResSo project
%
% This file is part of ESPResSo.
%
@@ -54,8 +54,11 @@ \section{Observables}
\subsection{Introduction}
The first step of the core analysis is to tell \es to create an observable.
An observable in the sense of the core analysis can be considered as
-a rule how to compute a certain set of numbers from a given state of the system.
-It does not refer to the numbers itself.
+a rule how to compute a certain set of numbers from a given state of the system
+or a role how to collect data from other observables. Any observable
+is represented as a single array of double values. Any more complex
+shape (tensor, complex number, \ldots) must be compatible to this
+prerequisite. Every observable however documents the storage order.
Creating an observable means just allocating the corresponding memory, assigning a function
to compute the observable value and reserving an \var{id} which will be used to refer
@@ -66,7 +69,10 @@ \subsection{Introduction}
The observable value is computed from the current state of the system
at the moment when it is needed, \ie when requested explicitly by the
user calling the \verb!observable print! function or when requested
-automatically by some other analysis function.
+automatically by some other analysis function. Updating is an orthogonal
+concept: Observables that collect data over time (e.g. the average observable)
+need to be updated regularly, even though their current value is not
+of interest.
Not all observables are implemented in parallel. When performing a parallel
computation, too frequent updates to observables which are not implemented
@@ -90,6 +96,8 @@ \subsubsection{Available observables}
They are generic to all observables and are described after the list of observables.
\todo{Missing descriptions of parameters of several observables}
+Here are the observables, that only depend on the current state of the simulation
+system:
\begin{itemize}
\item \lit{particle_positions} \var{particle\_specifications}\\
Positions of the particles, in the format
@@ -100,6 +108,13 @@ \subsubsection{Available observables}
$v^x_1,\ v^y_1,\ v^z_1,\ v^x_2,\ v^y_2,\ v^z_2,\
\dots\ v^x_n,\ v^y_n,\ v^z_n$.
The particles are ordered ascending according to their ids.
+ \item \lit{particle_body_velocities} \var{particle\_specifications}\\
+ Velocities of the particles in the body frame, in the format\\
+ $v^x_1,\ v^y_1,\ v^z_1,\ v^x_2,\ v^y_2,\ v^z_2,\
+ \dots\ v^x_n,\ v^y_n,\ v^z_n$.
+ The particles are ordered ascending according to their ids. This
+ command only produces a meaningful result when \texttt{ROTATIONS}
+ is compiled in.
\item \lit{particle_forces} \var{particle\_specifications}\\
Forces on the particles, in the format\\
$f^x_1,\ f^y_1,\ f^z_1,\ f^x_2,\ f^y_2,\ f^z_2,\
@@ -111,6 +126,12 @@ \subsubsection{Available observables}
\dots\ \omega^x_n,\ \omega^y_n,\ \omega^z_n$.
The particles are ordered ascending according to their ids and the
angular velocity/momentum is specified in the laboratory frame.
+ \item \lit{particle_body_angular_momentum} \var{particle\_specifications}\\
+ Angular momenta (omega) of the particles, in the format\\
+ $\omega^x_1,\ \omega^y_1,\ \omega^z_1,\ \omega^x_2,\ \omega^y_2,\ \omega^z_2,\
+ \dots\ \omega^x_n,\ \omega^y_n,\ \omega^z_n$.
+ The particles are ordered ascending according to their ids and the
+ angular velocity/momentum is specified in the body (co-rotating) frame.
\item \lit{com_position} \var{particle\_specifications} \opt{blocked \var{size}}\\
Position of the centre of mass.
If \lit{blocked \var{size}} is specified,
@@ -190,13 +211,25 @@ \subsubsection{Available observables}
\item \lit{lb_radial_velocity_profile} \\
Compute the Lattice-Boltzmann velocity profile in cylindrical coordinates.
For profile specifications, see section~\ref{sec:DensProfSpec}.
+ \end{itemize}
+The tclcommand observable is a helpful tool, that allows to make the
+analysis framework much more versatile, by allowing
+the evaluation of arbitrary tcl commands.
+ \begin{itemize}
\item \lit{tclcommand \var{dimQ} \var{command}} \\
An arbitrary Tcl function that returns a list of floating point numbers of fixed size
\var{dimQ} can be specified. Although its execution might be slow, it allows
to prototype new observables without a lot of trouble.
Many existing analysis commands can be made to cooperate with the core analysis that way.
\end{itemize}
+The following commands allow to collect data automatically over time
+once their autoupdate feature is enabled.
+ \begin{itemize}
+ \item \lit{average \var{ref}} \\
+ The running average of the reference observable with id \var{ref}.
+ It can be resetted by \lit{observable \var{no} reset}
+ \end{itemize}
\subsection{Printing an observable}
\begin{essyntax}
observable \var{id} print \opt{formatted}
@@ -373,7 +406,10 @@ \subsection{Creating a correlation}
corresponding components of the observables, \ie $C_i = (A_i-B_i)^2$.
Example: when $A$ is \lit{particle_positions}, it produces the mean square displacement
(for each component separately).
+ \item \lit{tensor_product} \\
+ Tensor product of $A$ and $B$, \ie $C_{i \cdot l_B + j} = A_i B_j$, with $l_B$ the length of $B$.
\item \lit{complex_conjugate_product}
+ \todo{Complex conjugate product must be defined.}
\item \lit{fcs_acf} \var{w_x}\var{w_y} \var{w_z} \\
Fluorescence Correlation Spectroscopy (FCS) autocorrelation function, \ie
\begin{equation}
diff --git a/doc/ug/analysis.tex b/doc/ug/analysis.tex
index 13ecc3d14a4..b4b8da05867 100644
--- a/doc/ug/analysis.tex
+++ b/doc/ug/analysis.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -209,7 +209,13 @@ \subsection{Vkappa}
analyze Vkappa \opt{\alt{ reset \asep read \asep set \var{V_{\kappa, 1}} \var{V_{\kappa, 2}} \var{avk} } }
\end{essyntax}
-\todo{Document the usage and what it is!}
+Calculates the compressibility $V \times \kappa_T$ through the Volume fluctuations
+$V \times \kappa_T = \beta \left(\langle V^2\rangle - \langle V \rangle^2\right)$ \cite{kolb99a}.
+Given no arguments this function calculates and returns the current value of the
+running average for the volume fluctuations.
+The argument \keyword{reset} clears the currently stored values. With \keyword{read}
+the cumulative mean volume, cumulative mean squared volume and how many samples were
+used can be retrieved. Likewise the option \keyword{set} enables you to set those.
\subsection{Radial distribution function}
\label{analyze:rdf}
@@ -389,7 +395,10 @@ \subsection{Finding holes}
\analyzeindex{finding holes}
\begin{essyntax}
- analyze holes \var{typeid_\mathrm{probe}} \var{mesh\_size}
+ analyze holes \var{typeid_\mathrm{probe}} \var{mesh\_size}
+ \begin{features}
+ \required{LENNARD_JONES}
+ \end{features}
\end{essyntax}
Function for the calculation of the unoccupied volume (often also
called free volume) in a system. Details can be found in
@@ -427,8 +436,27 @@ \subsection{Finding holes}
numbers give the position of a mesh point in the linear representation
of the 3D grid (coordinates are in the order x, y, z). Attention: the
algorithm assumes a cubic box. Surface results have not been tested.
-Requires the feature LENNARD_JONES. \todo{I think there is still a
- bug in there (Hanjo)}.
+\todo{I think there is still a bug in there (Hanjo)}.
+
+
+\subsection{Temperature of the LB fluid}
+\label{analyze:lbtemp}
+\analyzeindex{fluid temperature}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{analyze fluid temp}
+ \begin{features}
+ \required[1]{LB}
+ \required[2]{LB_GPU}
+ \required[3]{ELECTROKINETICS}
+ \end{features}
+\end{essyntax}
+
+This command returns the temperature of the lattice-Boltzmann (LB)
+fluid, see Chapter~\ref{sec:lb}, by averaging over the fluid nodes. In
+case \feature{LB_BOUNDARIES} or \feature{LB_BOUNDARIES_GPU} are
+compiled in and boundaries are defined, only the available fluid
+volume is taken into account.
\subsection{Energies}
\label{analyze:energy}
@@ -453,7 +481,6 @@ \subsection{Energies}
\{ energy \var{value} \} \{ kinetic \var{value} \} \{ interaction \var{value} \} \dots
\end{code}
-
\subsection{Pressure}
\label{analyze:pressure}
\analyzeindex{pressure}
@@ -462,7 +489,7 @@ \subsection{Pressure}
\variant{1} analyze pressure
\variant{2} analyze pressure total
\variant{3} analyze pressure \alt{totals \asep ideal \asep coulomb
- \asep \\tot_nonbonded_inter \asep tot_nonbonded_intra}
+ \asep \\tot_nonbonded_inter \asep tot_nonbonded_intra \asep vs_relative}
\variant{4} analyze pressure bonded \var{bondid}
\variant{5} analyze pressure nonbonded \var{typeid1} \var{typeid2}
\variant{6} analyze pressure nonbonded_intra \opt{\var{typeid}}
@@ -505,7 +532,8 @@ \subsection{Pressure}
Anything outside that is currently not implemented.
Four-body dihedral potentials are not included.
In case of rigid body rotation, virial contribution from torques is not included.
-Constraints of any kind are not currently accounted for in the pressure calculations.
+The pressure contribution for rigid bodies constructed by means of the VIRTUAL\_SITES\_RELATIVE mechanism is included. On the other hand, the pressure contribution for rigid bonds is not included.
+All other constraints of any kind are not currently accounted for in the pressure calculations.
The pressure is no longer correct, e.g., when particles are confined to a plane.
The command is implemented in parallel.
@@ -626,18 +654,6 @@ \section{Analyzing groups of particles (molecules)}
\analyzeindex{topologies}
\label{analyze:set}
-The following set of functions is designed to facilitate analysis of molecules. Molecules are expected to be a group of particles
-comprising a contiguous range of particle IDs. Each molecule
-is a set of consecutively numbered particles and all molecules
-are supposed to consist of the same number of particles.
-Some functions in this group require that the particles constituting
-a molecule are connected into linear chains (particle $n$ is connected
-to $n+1$ and so on) while others are applicable to molecules
-of whatever topology.
-
-The \lit{analyze set} command defines the structure of the current
-system to be used with some of the analysis functions.
-
\begin{essyntax}
\variant{1} analyze set chains \opt{\var{chain\_start} \var{n\_chains}
\var{chain\_length}}
@@ -646,13 +662,26 @@ \section{Analyzing groups of particles (molecules)}
%\variant{4} analyze set trapmol \var{mol\_id} \var{xpos} \var{ypos} \var{zpos} \var{isrelative} \var{spring\_constant} \var{drag\_constant} coords \var{trapped\_coord\_x} \var{trapped\_coord\_y} \var{trapped\_coord\_z} noforce\_coords \var{noforce\_coord\_x} \var{noforce\_coord\_y} \var{noforce\_coord\_z}
\end{essyntax}
+The above set of functions is designed to facilitate analysis of
+molecules. Molecules are expected to be a group of particles
+comprising a contiguous range of particle IDs. Each molecule is a set
+of consecutively numbered particles and all molecules are supposed to
+consist of the same number of particles. Some functions in this group
+require that the particles constituting a molecule are connected into
+linear chains (particle $n$ is connected to $n+1$ and so on) while
+others are applicable to molecules of whatever topology.
+
+The \lit{analyze set} command defines the structure of the current
+system to be used with some of the analysis functions.
+
Variant \variant{1} defines a set of \var{n\_chains} chains of equal
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} - 1$).
-Variant \variant{2} synchronizes topology and particle data, assigning \var{mol\_id} values to particles.
+Variant \variant{2} synchronizes topology and particle data, assigning
+\var{mol\_id} values to particles.
Variant \variant{3} will return the chains currently stored.
diff --git a/doc/ug/aux.tex b/doc/ug/aux.tex
index be54b447813..031a2a4193c 100644
--- a/doc/ug/aux.tex
+++ b/doc/ug/aux.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -445,15 +445,9 @@ \subsection{\texttt{t\_random}}
\end{code}
with \var{status-list} being the tcl-list mentioned above without any
braces. Be careful! A complete recovery of the current state of the
-simulation is only possible if you make sure to include a call to The
-invalidate\_system command after you saved the checkpoint
-(tcl\_checkpoint\_set will do this automatically for you), because the
-integration algorithm re-uses the old forces calculated in the
-previous time-step; if something has changed in the system (or if it
-has just been read from a file) the forces are re-derived (including
-application of the thermostat and its random numbers) leading to
-slightly different results compared to the uninterrupted run (see The
-invalidate\_system command for details)!
+simulation is only possible if you make sure to include a call to the
+\texttt{sort_particles} command after you saved the blockfile to make
+sure random numbers are applied in the same order.
\end{itemize}
The C implementation is t\_random
@@ -498,16 +492,9 @@ \subsection{\texttt{The bit\_random command}}
bit\_random stat
\end{code}
with being the tcl-list mentioned above without any
-braces. Be careful! A complete recovery of the current state of the
-simulation is only possible if you make sure to include a call to The
-invalidate\_system command after you saved the checkpoint
-(tcl\_checkpoint\_set will do this automatically for you), because the
-integration algorithm re-uses the old forces calculated in the
-previous time-step; if something has changed in the system (or if it
-has just been read from a file) the forces are re-derived (including
-application of the thermostat and its random numbers) leading to
-slightly different results compared to the uninterrupted run (see The
-invalidate\_system command for details)!
+braces. Be careful! See \ref{ssec:trandom} for more information
+on how to recover of the current state, include the sequence the random
+numbers are applied.
\item Note further that the bit-wise display of integers, as it is
used by this random number generator, is platform dependent. As long
as you stay on the same architecture this doesn't matter at all;
diff --git a/doc/ug/check_consistency.sh b/doc/ug/check_consistency.sh
index 6f1366fd4ae..954c991d4df 100644
--- a/doc/ug/check_consistency.sh
+++ b/doc/ug/check_consistency.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# check documentation of configuration switches
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010 Axel Arnold
#
# This file is part of ESPResSo.
diff --git a/doc/ug/citations.bib b/doc/ug/citations.bib
index 6ca5e18ee10..3b52a5a81ee 100644
--- a/doc/ug/citations.bib
+++ b/doc/ug/citations.bib
@@ -27,16 +27,6 @@ @INCOLLECTION{espresso2
}
-@ARTICLE{adress,
- author = {C.~Junghans and S.~Poblete},
- title = {A reference implementation of the adaptive resolution scheme in {ESPResSo}},
- journal = {Comp. Phys. Comm.},
- year = {2010},
- volume = {181},
- pages = {1449--1454},
- number = {8}
-}
-
@ARTICLE{elc,
author = {Axel Arnold and Jason {de Joannis} and Christian Holm},
title = {{Electrostatics in Periodic Slab Geometries I+II}},
@@ -109,3 +99,19 @@ @ARTICLE{cimrak
volume = {64},
pages = {278--288}
}
+
+@ARTICLE{sega13c,
+ title = {Mesoscale structures at complex fluid–fluid interfaces: a novel lattice Boltzmann/molecular dynamics coupling},
+ author = {M. Sega and M. Sbragaglia and S. S. Kantorovich and A. O. Ivanov},
+ journal = {Soft Matter},
+ year = {2013, in press},
+ doi = {10.1039/C3SM51556G}
+}
+@article{shan93a,
+ author={ X. Shan and H. Chen },
+ title = {Lattice Boltzmann model for simulating flows with multiple phases and components},
+ journal={ Phys. Rev. E},
+ volume={47},
+ pages={1815},
+ year={1993}
+}
diff --git a/doc/ug/contributing.tex b/doc/ug/contributing.tex
index 18bc663c674..9b68b4ba6a3 100644
--- a/doc/ug/contributing.tex
+++ b/doc/ug/contributing.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/electrokinetics.tex b/doc/ug/electrokinetics.tex
new file mode 100644
index 00000000000..e05b80c1715
--- /dev/null
+++ b/doc/ug/electrokinetics.tex
@@ -0,0 +1,504 @@
+% Copyright (C) 2013,2014 The ESPResSo project
+%
+% This file is part of ESPResSo.
+%
+% ESPResSo is free software: you can redistribute it and/or modify it
+% under the terms of the GNU General Public License as published by the
+% Free Software Foundation, either version 3 of the License, or (at your
+% option) any later version.
+%
+% ESPResSo is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see .
+%
+\newcommand{\lb}{l_\mathrm{B}}
+\newcommand{\kT}{k_\mathrm{B}T}
+
+\chapter{\label{sec:electrokinetics}Electrokinetics}
+\newescommand{electrokinetics}
+
+The electrokinetics setup in \es{} allows for the description of
+electro-hydrodynamic systems on the level of ion density distributions
+coupled to a Lattice-Boltzmann (LB) fluid. The ion density
+distributions may also interact with explicit charged particles, which
+are interpolated on the LB grid. In the following paragraph we
+briefly explain the electrokinetic model implemented in \es, before
+we come to the description of the interface.
+
+If you are interested in using the electrokinetic implementation in
+\es for scientific purposes, please contact G.~Rempfer before you
+start your project.
+
+\section{Electrokinetic Equations}
+
+In the electrokinetics code we solve the following system of coupled continuity,
+diffusion-advection, Poisson, and Navier-Stokes equations:
+\begin{eqnarray}
+\label{eq:ek-model-continuity} \frac{\partial n_k}{\partial t} & = & -\, \nabla \cdot \vec{j}_k \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\label{eq:ek-model-fluxes} \vec{j}_{k} & = & -D_k \nabla n_k - \nu_k \, q_k n_k\, \nabla \Phi + n_k \vec{v}_{\mathrm{fl}} \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\label{eq:ek-model-poisson} \Delta \Phi & = & -4 \pi \, \lb \, \kT \sum_k q_k n_k \vphantom{\left(\frac{\partial}{\partial}\right)}; \\
+\nonumber \left(\frac{\partial \vec{v}_{\mathrm{fl}}}{\partial t} + \vec{v}_{\mathrm{fl}} \cdot \vec{\nabla} \vec{v}_{\mathrm{fl}} \right) \rho_\mathrm{fl} & = & -\kT \, \nabla \rho_\mathrm{fl} - q_k n_k \nabla \Phi \\
+\label{eq:ek-model-velocity} & & +\, \eta \vec{\Delta} \vec{v}_{\mathrm{fl}} + (\eta / 3 + \eta_{\text{\,b}}) \nabla (\nabla \cdot \vec{v}_{\mathrm{fl}}) \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\label{eq:ek-model-continuity-fl} \frac{\partial \rho_\mathrm{fl}}{\partial t} & = & -\,\nabla\cdot\left( \rho_\mathrm{fl} \vec{v}_{\mathrm{fl}} \right) \vphantom{\left(\frac{\partial}{\partial}\right)} ,
+\end{eqnarray}
+which define relations between the following observables
+\begin{description}[itemsep=0cm,labelindent=1.5em,leftmargin=4.5em,style=nextline]
+ \item[$n_k$] the number density of the particles of species $k$,
+ \item[$\vec{j}_k$] the number density flux of the particles of species $k$,
+ \item[$\Phi$] the electrostatic potential,
+ \item[$\rho_{\mathrm{fl}}$] the mass density of the fluid,
+ \item[$\vec{v}_{\mathrm{fl}}$] the advective velocity of the fluid,
+\end{description}
+and input parameters
+\begin{description}[itemsep=0cm,labelindent=1.5em,leftmargin=4.5em,style=nextline]
+ \item[$D_k$] the diffusion constant of species $k$,
+ \item[$\nu_k$] the mobility of species $k$,
+ \item[$q_k$] the charge of a single particle of species $k$,
+ \item[$\lb$] the Bjerrum length,
+ \item[$\kT$] the thermal energy given by the product of Boltzmann's constant
+ $k_\text{B}$\\and the temperature $T$,
+ \item[$\eta$] the dynamic viscosity of the fluid,
+ \item[$\eta_{\text{\,b}}$] the bulk viscosity of the fluid.
+\end{description}
+The temperature $T$, and diffusion constants $D_k$ and mobilities $\nu_k$ of
+individual species are linked through the Einstein-Smoluchowski relation $D_k /
+\nu_k = \kT$. The system of equations described in
+Eqs.~\eqref{eq:ek-model-continuity}-\eqref{eq:ek-model-continuity-fl}, combining
+diffusion-advection, electrostatics, and hydrodynamics is conventionally
+referred to as the \textit{Electrokinetic Equations}.
+
+\todo{Complete in broad strokes the applicability of the
+ electrokinetics model. Also mention the difference in temperatures
+ between EK and LB species.}
+
+The electrokinetic equations have the following properties:
+\begin{itemize}
+\item On the coarse time and length scale of the model, the dynamics
+ of the particle species can be described in terms of smooth density
+ distributions and potentials as opposed to the microscale where
+ highly localized densities cause singularities in the potential.
+
+ In most situations, this restricts the application of the model to
+ species of monovalent ions, since ions of higher valency typically
+ show strong condensation and correlation effects -- the localization
+ of individual ions in local potential minima and the subsequent
+ correlated motion with the charges causing this minima.
+
+\item Only the entropy of an ideal gas and electrostatic interactions
+ are accounted for. In particular, there is no excluded volume.
+
+ This restricts the application of the model to monovalent ions and
+ moderate charge densities. At higher valencies or densities,
+ overcharging and layering effects can occur, which lead to
+ non-monotonic charge densities and potentials, that can not be
+ covered by a mean-field model such as Poisson-Boltzmann or this one.
+
+ Even in salt free systems containing only counter ions, the
+ counter-ion densities close to highly charged objects can be
+ overestimated when neglecting excluded volume effects. Decades of
+ the application of Poisson-Boltzmann theory to systems of
+ electrolytic solutions, however, show that those conditions are
+ fulfilled for monovalent salt ions (such as sodium chloride or
+ potassium chloride) at experimentally realizable concentrations.
+
+\item Electrodynamic and magnetic effects play no role. Electrolytic
+ solutions fulfill those conditions as long as they don't contain
+ magnetic particles.
+
+\item The diffusion coefficient is a scalar, which means there can not
+ be any cross-diffusion. Additionally, the diffusive behavior has
+ been deduced using a formalism relying on the notion of a local
+ equilibrium. The resulting diffusion equation, however, is known to
+ be valid also far from equilibrium.
+
+\item The temperature is constant throughout the system.
+
+\item The density fluxes instantaneously relax to their local
+ equilibrium values. Obviously one can not extract information about
+ processes on length and time scales not covered by the model, such
+ as dielectric spectra at frequencies, high enough that they
+ correspond to times faster than the diffusive time scales of the
+ charged species.
+\end{itemize}
+
+\section{Setup}
+
+\subsection{\label{ssec:ek-init}Initialization}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \opt{agrid \var{agrid}}
+ \opt{lb_density \var{lb\_density}}
+ \opt{visc \var{viscosity}}
+ \opt{bulk_visc \var{bulk\_viscosity}}
+ \opt{friction \var{gamma} }
+ \opt{gamma_odd \var{gamma\_odd}}
+ \opt{gamma_even \var{gamma\_even}}
+ \opt{T \var{T}}
+ \opt{bjerrum_length \var{bjerrum\_length}}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{electrokinetics} command initializes the LB fluid with a given
+set of parameters, and it is very similar to the \es{} Lattice-Boltzmann
+\lit{lbfluid} command in set-up. We therefore refer the reader to
+Chapter~\ref{sec:lb} for details on the implementation of LB in \es{} and
+describe only the major differences here.
+
+The first major difference with the LB implementation is that the
+electrokinetics set-up is a Graphics Processing Unit (GPU) only implementation.
+There is no Central Processing Unit (CPU) version, and at this time there are no
+plans to make a CPU version available in the future. To use the electrokinetics
+features it is therefore imperative that your computer contains a CUDA capable
+GPU which is sufficiently modern.
+
+To set up a proper LB fluid using the \lit{electrokinetics} command one has to
+specify at least the following options: \var{agrid}, \var{lb\_density}, \var{visc},
+\var{friction}, \var{T}, and \var{bjerrum\_length}. The other options can be used to
+modify the behavior of the LB fluid. Note that the \lit{electrokinetics} command
+does not allow the user to set the time step parameter \lit{tau} as is the case for
+the \lit{lbfluid} command, this parameter is instead taken directly from the input
+of the \lit{setmd} \texttt{t\_step} command. The LB \emph{mass density} is set
+independently from the electrokinetic \emph{number densities}, since the LB fluid
+serves only as a medium through which hydrodynamic interactions are propagated,
+as will be explained further in the next paragraph. If no \var{lb\_density} is
+specified, then our algorithm assumes \var{lb\_density} = 1.0. The two `new'
+parameters are \var{T} the temperature at which the diffusive species are simulated
+and \var{bjerrum\_length} the Bjerrum length associated with the electrostatic
+properties of the medium. See the above description of the electrokinetic
+equations for an explanation of the introduction of a temperature, which does
+not come in directly via a thermostat that produces thermal fluctuations.
+
+\subsection{\label{ssec:ek-diff-species}Diffusive Species}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \var{species\_number}
+ \opt{density \var{density}}
+ \opt{D \var{D}}
+ \opt{valency \var{valency}}
+ \opt{ext_force \var{f_x} \var{f_y} \var{f_z}}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{electrokinetics} command followed by an integer \var{species\_number}
+(in the range 0 to 10) and several options can be used to initialize the
+diffusive species. Here the options specify: the number density
+\var{density}, the diffusion coefficient \var{D}, the valency of the particles
+of that species \var{valency}, and an optional external (electric) force which
+is applied to the diffusive species. As mentioned before, the LB density is
+completely decoupled from the electrokinetic densities. This has the advantage
+that greater freedom can be achieved in matching the internal parameters to an
+experimental system. Moreover, it is possible to choose parameters for which
+the LB is more stable. The LB fluid must already be (partially) set up using the
+\lit{electrokinetics} \var{agrid} ... command, before the diffusive species can
+be initialized. The variables \var{density}, \var{D}, and \var{valency} must be
+set to properly initialize the diffusive species; the \var{ext\_force} is
+optional.
+
+\subsection{\label{ssec:ek-boundaries}Boundaries}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \require{2}{boundary}
+ \opt{charge_density \var{charge\_density}}
+ \opt{shape \var{shape\_args}}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{boundary} command allows one to set up (internal or external) boundaries
+for the electrokinetics algorithm in much the same way as the \lit{lbboundary}
+command is used for the LB fluid. The major difference with the LB command is
+given by the option \var{charge\_density}, with which a boundary can be endowed
+with a volume charge density. To create a surface charge density, a combination
+of two oppositely charged boundaries, one inside the other, can be used.
+However, care should be taken to maintain the surface charge density when the
+value of \var{agrid} is changed. Currently, the following \var{shape}s are
+available: wall, sphere, cylinder, rhomboid, pore, and stomatocyte. We refer to
+the documentation of the \lit{lbboundary} command (Chapter~\ref{sec:lb}) for
+information on the options \var{shape\_args} associated to these shapes. In
+order to properly set up the boundaries, the \var{charge\_density} and relevant
+\var{shape\_args} must be specified.
+
+\section{\label{ssec:ek-output}Output}
+
+\subsection{\label{ssec:ek-output-fields}Fields}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ print
+ \require{1 or 2}{\var{property}}
+ \opt{vtk}
+ filename [\var{filename}]
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The print parameter of the \lit{electrokinetics} command enables simple
+visualization of simulation data. A property of the fluid field can be exported
+into a file with name \var{filename} in one go. Currently, supported values of
+the parameter \var{property} are: \var{density}, \var{velocity},
+\var{potential}, and \var{boundary}, which give the LB fluid density, the LB
+fluid velocity, the electrostatic potential, and the location and type of the
+boundaries, respectively. The boundaries can only be printed when the
+\texttt{EK_BOUNDARIES} is compiled in. The additional option \lit{vtk} can be
+used to directly export in the vtk format. The vtk format is readable
+by visualization software such as paraview\footnote{http://www.paraview.org/}
+and mayavi2\footnote{http://code.enthought.com/projects/mayavi/}. If the
+\opt{vtk} option is not specified, a gnuplot readable data will be exported.
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \var{species\_number}
+ print
+ \var{property}
+ \opt{vtk}
+ filename [\var{filename}]
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+This print statement is similar to the above command. It enables the export of
+diffusive species properties, namely: \var{density} and \var{flux}, which
+specify the number density and flux of species \var{species\_number},
+respectively.
+
+\subsection{\label{ssec:ek-local-quantities}Local Quantities}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ node \var{x} \var{y} \var{z}
+ velocity
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{node} option of the \lit{electrokinetics} command allows one to output
+the value of a quantity on a single LB node. The node is addressed using three
+integer values which run from 0 to \var{dim\_x}/\var{agrid},
+\var{dim\_y}/\var{agrid}, and \var{dim\_z}/\var{agrid}, respectively. Thus far,
+only the velocity of the LB fluid can be printed in the standard electrokinetics
+implementation. For other quantities the \lit{lbnode} command may be used.
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \var{species\_number}
+ node \var{x} \var{y} \var{z}
+ density
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+This command can be used to output the number density of the
+\var{species\_number}-th diffusive species on a single LB node.
+
+\section{Catalytic Reaction}
+
+\subsection{Concept}
+
+The electrokinetics solver implemented in \es{} can be used to
+simulate a system, for which in addition to the electrokinetic
+equations, there is a (local) catalytic reaction which converts one
+species into another.
+
+If you are interested in using this implementation in \es{} for
+scientific purposes, please contact J.~de~Graaf before you start your
+project.
+
+Currently, a linear reaction is implemented which converts one species into two others, in
+order to model the catalytic decomposition of hydrogen peroxide in the presence
+of a platinum catalyst: $2 \mathrm{H}_{2}\mathrm{O}_{2} \rightarrow
+2 \mathrm{H}_{2}\mathrm{O} + \mathrm{O}_{2}$. The decomposition of
+$\mathrm{H}_{2}\mathrm{O}_{2}$ is in reality more complicated than the linear
+reaction introduced here, since it is assumed to proceed via several intermediate complexed-states,
+but our model can be thought of as modeling the rate-limiting step.
+If we assume that there are three non-ionic species with number densities
+$n_{k}$, where $n_{0} = [ \mathrm{H}_{2}\mathrm{O}_{2} ]$,
+$n_{1} = [ \mathrm{H}_{2}\mathrm{O} ]$, and $n_{2} = [ \mathrm{O}_{2} ]$,
+then we can write the (electro)kinetic equations for this system as
+
+\begin{eqnarray}
+\label{eq:ek-reaction-continuity} \frac{\partial n_k}{\partial t} & = & -\, \nabla \cdot \vec{j}_k +\, f_{k} c n_{k} \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\label{eq:ek-reaction-fluxes} \vec{j}_{k} & = & -D_k \nabla n_k + n_k \vec{v}_{\mathrm{fl}} \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\nonumber \left(\frac{\partial \vec{v}_{\mathrm{fl}}}{\partial t} + \vec{v}_{\mathrm{fl}} \cdot \vec{\nabla} \vec{v}_{\mathrm{fl}} \right) \rho_\mathrm{fl} & = & -\kT \, \sum_{k} \nabla n_k \\
+\label{eq:ek-reaction-velocity} & & +\, \eta \vec{\Delta} \vec{v}_{\mathrm{fl}} + (\eta / 3 + \eta_{\text{\,b}}) \nabla (\nabla \cdot \vec{v}_{\mathrm{fl}}) \vphantom{\left(\frac{\partial}{\partial}\right)} ; \\
+\label{eq:ek-reaction-continuity-fl} \frac{\partial \rho_\mathrm{fl}}{\partial t} & = & -\,\nabla\cdot\left( \rho_\mathrm{fl} \vec{v}_{\mathrm{fl}} \right) \vphantom{\left(\frac{\partial}{\partial}\right)} ,
+\end{eqnarray}
+which define relations between the following observables
+\begin{description}[itemsep=0cm,labelindent=1.5em,leftmargin=4.5em,style=nextline]
+ \item[$n_k$] the number density of the particles of species $k$,
+ \item[$\vec{j}_k$] the number density flux of the particles of species $k$,
+ \item[$\rho_{\mathrm{fl}}$] the mass density of the fluid,
+ \item[$\vec{v}_{\mathrm{fl}}$] the advective velocity of the fluid,
+\end{description}
+and input parameters
+\begin{description}[itemsep=0cm,labelindent=1.5em,leftmargin=4.5em,style=nextline]
+ \item[$D_k$] the diffusion constant of species $k$,
+ \item[$\kT$] the thermal energy given by the product of Boltzmann's constant
+ $k_\text{B}$\\and the temperature $T$,
+ \item[$\eta$] the dynamic viscosity of the fluid,
+ \item[$\eta_{\text{\,b}}$] the bulk viscosity of the fluid,
+ \item[$f_{k}$] the reaction constant $f_{0} \equiv -1$, $f_{1} = 1$ and $f_{2} = 0.5$ for the above reaction,
+ \item[$c$] the reaction rate.
+\end{description}
+In this set of equations we have fully decoupled the number densities and the
+fluid mass density. N.B. We have set the initial fluid mass density is not necessarily
+equal to the sum of the initial species number densities. This means that
+some care needs to be taken in the interpretation of the results obtained using
+this feature. In particular, the solution of the Navier-Stokes equation exclusively
+models the momentum transport through the (multicomponent) fluid, while the diffusive
+properties of the individual chemical species are handled by Eqs.~\eqref{eq:ek-reaction-continuity}
+and~\eqref{eq:ek-reaction-fluxes}.
+
+It is important to note that to ensure mass conservation the reaction must satisfy:
+\begin{equation}
+\label{eq:ek-mass-balance} \sum_{k} f_{k} m_{k} = 0 ,
+\end{equation}
+where $m_{k}$ is the molecular mass of a reactive species. Unfortunately, the current
+electrokinetic implementation does not conserve mass flux locally. That is to say, the
+LB fluid is compressible and the sum of the fluxes of the three species is not equal to
+zero in the frame co-moving with the advective fluid velocity. It is therefore debatable
+whether it is necessary to impose Eq.~\eqref{eq:ek-mass-balance}, since the EK algorithm
+itself does not conserve mass density. However, we strived to be as accurate as
+possible and in future versions of the EK algorithm the lack of incompressiblity will
+be addressed.
+
+The reaction is specified by the second term on the right-hand side of
+Eq.~\eqref{eq:ek-reaction-continuity}. It is important to note that this term
+can be set locally, as opposed to the other terms in the equation system
+Eqs.~\eqref{eq:ek-reaction-continuity}-\eqref{eq:ek-reaction-continuity-fl}, in
+our implementation, as will become clear in the following. This has the
+advantage that catalytic surfaces may be modeled.
+
+\subsection{\label{ssec:ek-reac-init}Initialization and Geometry Definition}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \require{3}{reaction}
+ \opt{reactant_index \var{reactant\_index}}
+ \opt{product0_index \var{product0\_index}}
+ \opt{product1_index \var{product1\_index}}
+ \opt{reactant_resrv_density \var{reactant\_resrv\_density}}
+ \opt{product0_resrv_density \var{product0\_resrv\_density}}
+ \opt{product1_resrv_density \var{product1\_resrv\_density}}
+ \opt{reaction_rate \var{reaction\_rate}}
+ \opt{mass_reactant \var{mass\_reactant}}
+ \opt{mass_product0 \var{mass\_product0}}
+ \opt{mass_product1 \var{mass\_product1}}
+ \opt{reaction_fraction_pr_0 \var{reaction\_fraction\_pr\_0}}
+ \opt{reaction_fraction_pr_1 \var{reaction\_fraction\_pr\_1}}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{electrokinetics reaction} command is used to set up the catalytic
+reaction between three previously defined the diffusive species, of which the i
+identifiers are given by \var{reactant\_index}, \var{product0\_index}, and
+\var{product1\_index}, respectively. In the 1:2 reaction, these fulfill the role
+of the reactant and the two products, as indicated by the naming convention. For
+each species a reservoir (number) density must be set, given by the variables
+\var{reactant\_resrv\_density}, \var{product0\_resrv\_density}, and
+\var{product1\_resrv\_density}, respectively. These reservoir densities
+correspond to the initial number densities associated with the reactive species.
+The reservoir densities, in tandem with reservoir nodes, see below, can be used
+to keep the reaction from depleting all the reactant in the simulation box. The
+\var{reaction\_rate} variable specifies the speed at which the reaction proceeds.
+The three masses (typically given in the atomic weight equivalent) are used to
+determine the total mass flux provided by the reaction, as described above, and
+are also used to check whether the reaction ratios that are given satisfy the
+chemical requirement of mass conservation. Finally, the parameters
+\var{reaction\_fraction\_pr\_0} and \var{reaction\_fraction\_pr\_1} specify
+what fractions of the product are generated when a given quantity of reactant is
+catalytically converted. To use a chemical reaction, all options for the
+\lit{electrokinetics reaction} command must be specified.
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \require{3}{reaction}
+ \require{3}{region}
+ \opt{reaction_type \var{reaction\_type}}
+ \opt{shape \var{shape\_args}}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{region} option of the \lit{electrokinetics reaction} command allows one
+to set up regions in which the reaction takes place with the help of the
+constraints that are available to set up boundaries. The integer value
+\var{reaction\_type} can be used to select the reaction: 0 no reaction takes
+place for this region, 1 the catalytic reaction takes place in this region, and
+2 the region functions as a reservoir, wherein the species densities are reset
+to their initial (or reservoir) concentrations. The rest of the command follows
+the same format of the \lit{electrokinetics boundary} command. Currently, the
+following \var{shape}s are available: box, wall, sphere, cylinder, rhomboid,
+pore, and stomatocyte. The box shape is a \lit{region} specific command, which
+can be used to set the entire simulation box to a specific reaction value. To
+use the \lit{electrokinetics reaction region} command, one must first set up
+a reaction, as described above. To successfully specify a region all the
+relevant arguments that go with the shape constraints must be provided.
+
+\subsubsection{\label{sssec:ek-pdb-parse}Parsing PDB Files}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ \require{2}{pdb-parse}
+ \var{pdb\_filename}
+ \var{itp\_filename}
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The \lit{electrokinetics pdb-parse} feature allows the user to parse simple PDB files, a file format introduced by the protein database to encode molecular structures. Together with a topology file (here \var{itp\_filename}) the structure gets interpolated to the \lit{electrokinetics} grid. For the input you will need to prepare a PDB file with a \lit{gromacs} force field to generate the topology file. Normally the PDB file extension is \lit{.pdb}, the topology file extension is \lit{.itp}. Obviously the PDB file is placed instead of \var{pdb\_filename} and the topology file instead of \var{itp\_filename}. \todo{At the moment this fails badly, if you try to parse incorrectly formatted files. This will be fixed in the future.}
+
+\subsection{\label{ssec:ek-reac-output}Reaction-Specific Output}
+
+\begin{essyntax}
+ \require{1 or 2 or 3}{electrokinetics}
+ print
+ \require{3}{\var{property}}
+ \opt{vtk}
+ \var{filename} [\var{filename}]
+ \begin{features}
+ \required[1]{ELECTROKINETICS}
+ \required[2]{EK_BOUNDARIES}
+ \required[3]{EK_REACTIONS}
+ \end{features}
+\end{essyntax}
+The print parameter of the \lit{electrokinetics} command can be used in
+combination with the \texttt{EK\_REACTION} feature to give advanced output
+options. Currently, supported values of the parameter \var{property} are:
+\var{pressure} and \var{reaction\_tags}, which give the
+location and type of the reactive regions and the ideal-gas pressure coming from
+the diffusive species, respectively. To use this command a reaction must be set up.
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "ug"
+%%% End:
diff --git a/doc/ug/examples.tex b/doc/ug/examples.tex
index a199e0e23db..50fab1b3573 100644
--- a/doc/ug/examples.tex
+++ b/doc/ug/examples.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/features.tex b/doc/ug/features.tex
index bcff31f201c..591298ad929 100644
--- a/doc/ug/features.tex
+++ b/doc/ug/features.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/figures/slitpore.pdf b/doc/ug/figures/slitpore.pdf
new file mode 100644
index 00000000000..874d751fa71
Binary files /dev/null and b/doc/ug/figures/slitpore.pdf differ
diff --git a/doc/ug/firststeps.tex b/doc/ug/firststeps.tex
index ad4bdefa8ec..bfc6c259b42 100644
--- a/doc/ug/firststeps.tex
+++ b/doc/ug/firststeps.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/fsi.tex b/doc/ug/fsi.tex
index 8701da02dbd..8dd34e0b74d 100644
--- a/doc/ug/fsi.tex
+++ b/doc/ug/fsi.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
%
% This file is part of ESPResSo.
%
diff --git a/doc/ug/installation.tex b/doc/ug/installation.tex
index ff4b382042b..78b2c437ba7 100644
--- a/doc/ug/installation.tex
+++ b/doc/ug/installation.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -32,8 +32,7 @@ \chapter{Getting, compiling and running \es}
contributing to the software can instead obtain the current
development code via the version control system software
\textsf{git}\footnote{\url{http://git.org}} from \es's project page at
-the Savannah GNU server
-\footnote{\url{https://savannah.nongnu.org/projects/espressomd/}}.
+Github \footnote{\url{https://github.com/espressomd/espresso}}.
This code might be not as well tested and documented as the release
code; it is recommended to use this code only if you have already
gained some experience in using \es.
@@ -56,9 +55,6 @@ \section{Running \texttt{configure}}
\label{sec:configure}
\index{configure}
-\todo[inline]{Description of basic options: \keyword{CPPFLAGS},
- \keyword{CFLAGS}, \keyword{LDFLAGS}}
-
The first step of building \es is to run the shell script
\codebox{configure} which is to be found in the top level source
directory. The script collects all the information required by the
@@ -76,7 +72,7 @@ \section{Running \texttt{configure}}
If you are using the development source code from the \textsf{git}
repository, before you can call \codebox{configure}, it is necessary
to have the GNU autotools (\textsf{autoconf} and \textsf{automake})
-installed. Then you can call the script \codebox{bootstrap.sh} from
+installed. Then you can call the script \codebox{bootstrap.sh} from
the top level source directory, which will generate the
\codebox{configure} script.
@@ -87,13 +83,15 @@ \subsection{Source and build directories}
Usually, when a program is compiled, the resulting binary files are
put into the same directory as the sources of the program. In \es's
build system, the \emph{source directory} that contains all the source
-files is completely separated from the \emph{build directory}, where
-the files created by the build process are put. The location of the
-build directory is the current working directory at the time when
+files can be completely separated from the \emph{build directory},
+where the files created by the build process are put. The location of
+the build directory is the current working directory at the time when
\codebox{configure} is called. In this way, you can build several
variants of \es, each variant having different activated features, and
for as many platforms as you want. All further commands concerning
compiling and running \es have to be called from the build directory.
+None of the files in the source directory is ever modified when by the
+build process.
\paragraph{Example}
When the source directory is \codebox{\$srcdir} (\ie the files where
@@ -107,22 +105,19 @@ \subsection{Source and build directories}
Espresso
\end{code}
-\subsection{Options}
+\subsection{Options and Variables}
\label{ssec:configureoptions}
\index{configure options} The behaviour of \codebox{configure} can be
-controlled by the means of command line options. In the following
-only those command line options that are specific to \es will be
-explained. For a complete list of options and explanations thereof,
-call
+controlled by the means of command line options and variables. In the
+following, only important command line options and variables \es will
+be explained. For a complete list of options, variables and
+explanations thereof, call
\begin{code}
configure --help
\end{code}
\begin{description}
-\item[\texttt{--with-myconfig=MYCONFIG\_HEADER}] This option sets the
- name of the local configuration header (see \vref{sec:myconfig}). It
- defaults to ``\texttt{myconfig.h}''.
\item[\texttt{--with-mpi=\alt{\lit{yes} \asep \lit{no} \asep
\lit{guess}}}/ \texttt{--without-mpi}] By default,
\codebox{configure} will automatically determine whether an MPI
@@ -155,11 +150,26 @@ \subsection{Options}
be used to define compiler flags for the NVIDIA CUDA-compiler
\texttt{nvcc}. For example, \texttt{NVCCFLAGS = "{}-gencode
arch=compute_20,code=sm_20"{}} will compile code only for Fermi
- cards. Default is to compile for compute models 1.1 and 2.0,
- i.e. everything with a G90 chip or newer. Note that we require at
- least compute model 1.1.
+ cards. Default is to compile for compute model 2.0,
+ i.e. everything with a Fermi chip or newer. Note that we require at
+ least compute model 1.1, that is G90. However, to use G90 (e.\,g.~Tesla
+ C1060), you need to manually specificy compute model 1.1.
+\item[\texttt{LDFLAGS=\textit{linker-flags}}] This variable can be
+ used to change the flags that the linker will get when linking the
+ \es binaries. This variable can be used to modify the path where
+ the compiler finds library files when they are installed in
+ non-standard places, \eg \codebox{LDFLAGS="-L/home/juser/lib"}.
+\item[\texttt{CPPFLAGS=\textit{preprocessor-flags}}] This variable can
+ be used to change the flags that the preprocessor will see. This
+ variable can be used to modify the path wherer the compiler finds
+ include files when they are installed in non-standard places, \eg
+ \codebox{CPPFLAGS="-I/home/juser/include"}.
+\item[\texttt{CXXFLAGS=\textit{C++-compiler flags}}] This variable can
+ be used to modify the compilation flags, \eg to change the
+ optimization level for debugging (\codebox{CXXFLAGS="-g -O0"}).
\end{description}
+
\section{\texttt{make}: Compiling, testing and installing \es}
\label{sec:make}
@@ -198,9 +208,9 @@ \section{\texttt{make}: Compiling, testing and installing \es}
The variable \texttt{extra} can be used to specify additional
files and directories that are to be included in the archive
file. \\
- \textbf{Example:} \verb!make dist extra="myconfig.h internal"!\\
+ \textbf{Example:} \verb!make dist extra="myconfig.hpp internal"!\\
will create the archive file and include the file
- \texttt{myconfig.h} and the directory \texttt{internal} with all
+ \texttt{myconfig.hpp} and the directory \texttt{internal} with all
files and subdirectories.
\item[\texttt{install}] Install \es. The variables \texttt{prefix} and
\texttt{exec-prefix} can be used to specify the installation
@@ -261,10 +271,10 @@ \section{Running \es}
instead of ``-n'' or ``mpirun'' instead of ``mpiexec''.
-\section{\texttt{myconfig.h}: Activating and deactivating features}
+\section{\texttt{myconfig.hpp}: Activating and deactivating features}
\label{sec:myconfig}
-\index{features} \index{myconfig.h} \index{configuration header} \es
+\index{features} \index{myconfig.hpp} \index{configuration header} \es
has a large number of features that can be compiled into the binary.
However, it is not recommended to actually compile in all possible
features, as this will slow down \es significantly. Instead, compile
@@ -273,24 +283,25 @@ \section{\texttt{myconfig.h}: Activating and deactivating features}
for a single one, e.g. \feature{LENNARD_JONES}. For the developers,
it is also possible to turn on or off a number of debugging messages.
The features and debug messages can be controlled via a configuration
-header file that contains C-preprocessor declarations. Appendix
-\vref{chap:features} lists and describes all available features. When
-no configuration header is provided by the user, a default header,
-found in src/myconfig-default.h, will be used that turns on the
-default features. The file \texttt{myconfig-sample.h} in the source
-directory contains a list of all possible features that can be copied
-into your own configuration file.
+header file that contains C-preprocessor declarations. Appendix
+\vref{chap:features} lists and describes all available features. The
+file \texttt{myconfig-sample.hpp} that configure will generate in the
+build directory contains a list of all possible features that can be
+copied into your own configuration file. When no configuration header
+is provided by the user, a default header, found in
+\texttt{src/core/myconfig-default.hpp}, will be used that turns on the
+default features.
When you distinguish between the build and the source directory, the
configuration header can be put in either of these. Note, however,
that when a configuration header is found in both directories, the one
in the build directory will be used.
-By default, the configuration header is called \texttt{myconfig.h}.
+By default, the configuration header is called \texttt{myconfig.hpp}.
The name of the configuration header can be changed either when the
-\texttt{configure}-script is called with the option
-\mbox{\texttt{--with-myconfig}} (see section \vref{sec:configure}), or
-when \texttt{make} is called with the setting
+\texttt{configure}-script is called via the variable
+\mbox{\texttt{MYCONFIG}} (see section \vref{sec:configure}), or when
+\texttt{make} is called with the setting
\mbox{\texttt{myconfig=}\textit{myconfig\_header}} (see section
\vref{sec:make}).
@@ -301,13 +312,13 @@ \section{\texttt{myconfig.h}: Activating and deactivating features}
\texttt{\$builddir2} that contain different configuration headers:
\begin{itemize}
-\item \texttt{\$builddir1/myconfig.h}:
+\item \texttt{\$builddir1/myconfig.hpp}:
\begin{code}
#define ELECTROSTATICS
#define LENNARD-JONES
\end{code}
-\item \texttt{\$builddir2/myconfig.h}:
+\item \texttt{\$builddir2/myconfig.hpp}:
\begin{code}
#define LJCOS
\end{code}
diff --git a/doc/ug/inter.tex b/doc/ug/inter.tex
index 273d9420aea..3dcaf607320 100644
--- a/doc/ug/inter.tex
+++ b/doc/ug/inter.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -188,6 +188,38 @@ \subsection{Lennard-Jones interaction}
$\var{r_\mathrm{cut}}=2^\frac{1}{6}\var{\sigma}$. The WCA potential is
purely repulsive, and is often used to mimick hard sphere repulsion.
+
+When coupling particles to a Shan-Chen fluid, if the \lit{affinity} interaction is set, the Lennard-Jones potential is multiplied by the function
+
+\begin{equation}
+ \label{eq:lj-affinity}
+ A(r) = \Biggl\{
+ \begin{array}{ll}
+ \frac{(1-\alpha_1)}{2} [1+\tanh(2\phi)] + \frac{(1-\alpha_2)}{2} [1+\tanh(-2\phi)]
+ & \mathrm{, if~} \var{r} > \var{r_\mathrm{cut}}+2^{\frac{1}{6}}\sigma\\
+ 1
+ & \mathrm{, otherwise~} \\
+ \end{array},
+\end{equation}
+where $\alpha_i$ is the affinity to the $i$-th fluid component (see
+\ref{sec:affinity}), and the order parameter $\phi$ is calculated
+from the fluid component local density as $\phi=\frac{\rho_1 -
+\rho_2}{\rho_1+\rho_2}$. For example, if the affinities are chosen
+so that the first component is a good solvent ($\alpha_1=1$) and
+the second one is a bad solvent ($\alpha_2=0$), then, if the two
+particles are both in a region rich in the first component, then
+$\phi\simeq1$, and $A(r)\simeq0$ for
+$r>\var{r_\mathrm{cut}}+2^{\frac{1}{6}}\sigma$. Therefore, the
+interaction potential will be very close to the WCA one. Conversely,
+if both particles are in a region rich in the second component,
+then $\phi\simeq-1$, and $A(r)\simeq 1$, so that the potential
+will be very close to the full LJ one. If the cutoff has been set
+large enough, the particle will experience the attractive part of
+the potential, mimiking the effective attraction induced by the bad
+solvent.
+
+
+
\subsection{Generic Lennard-Jones interaction}
\index{Generic Lennard-Jones interaction|mainindex}
\index{interactions!Generic Lennard-Jones|mainindex}
@@ -667,6 +699,35 @@ \subsection{Gay-Berne interaction}
being $\var{k_1} = 3$, $\var{k_2} = 5$, $\var{\mu} = 2$ and $\var{\nu}
= 1$.
+\subsection{Affinity interaction}
+\label{sec:affinity}
+
+\index{Affinity interaction|mainindex}
+\index{interactions!Affinity|mainindex}
+\begin{essyntax}
+ inter \var{type1}
+ \var{type2}
+ affinity
+ \var{\alpha_1} \var{\alpha_2}
+ \begin{features}
+ \required{SHANCHEN}
+ \end{features}
+\end{essyntax}
+
+Instead of defining a new interaction, this command acts as a
+modifier for existing interactions, so that the conditions of
+good/bad solvent associated to the two components of a Shan-Chen
+fluid. The two types must match those of the interaction that one
+wants to modify, and the two affinity values \var{\alpha_1} and
+\var{\alpha_2} are values between 0 and 1. A value of 1 (of 0)
+indicates that the component acts as a good (bad) solvent. The
+specific functional form depends on the interaction type and is
+listed in the interaction section. So far, only the standard
+Lennard-Jones interaction is modified by the \lit{affinity}
+interaction.
+
+
+
\section{Bonded interactions}
\label{sec:inter-bonded}
\index{bonded interactions|mainindex}
@@ -746,6 +807,43 @@ \subsection{Harmonic bond}
\var{r_\mathrm{cut}}, the bond will be reported as broken, and a
background error will be raised.
+\subsection{Quartic bond}
+\index{quartic bond|mainindex}
+\index{interactions!quartic|mainindex}
+
+\begin{essyntax}
+ inter \var{bondid}
+ quartic \var{K_0} \var{K_1} \var{R} \opt{\var{r_\mathrm{cut}}}
+\end{essyntax}
+This creates a bond type with identificator \var{bondid} with a
+quartic potential. The potential is minimal at particle distance $r=R$.
+It is given by
+\begin{equation}
+ V(r) = \frac{1}{2} K_0 \left( r - R \right)^2 + \frac{1}{4} K_1 \left( r - R \right)^4
+\end{equation}
+The fourth, optional, parameter \var{r_\mathrm{cut}} defines a cutoff
+radius. Whenever a quartic bond gets longer than
+\var{r_\mathrm{cut}}, the bond will be reported as broken, and a
+background error will be raised.
+
+\subsection{Bonded coulomb}
+\index{bonded coulomb bond|mainindex}
+\index{interactions!bonded_coulomb|mainindex}
+
+\begin{essyntax}
+ inter \var{bondid}
+ bonded_coulomb \var{\alpha}
+\end{essyntax}
+This creates a bond type with identificator \var{bondid} with a
+coulomb pair potential.
+It is given by
+\begin{equation}
+ V(r) = \frac{\alpha q_1 q_2}{r},
+\end{equation}
+where \var{q_1} and \var{q_2} are the charges of the bound particles.
+There is no cutoff, the bejerrum length of other coulomb interactions
+is not taken into account.
+
\subsection{Subtracted Lennard-Jones bond}
\index{subtracted Lennard-Jones bond|mainindex}
\index{interactions!subtracted Lennard-Jones|mainindex}
@@ -1368,6 +1466,61 @@ \subsubsection{Additional P3M parameters}
\end{description}
+\subsection{Coulomb Ewald GPU}
+\label{sec:coulombewald}
+\index{EwaldGPU method|mainindex}
+\index{interactions!EwaldGPU|mainindex}
+
+\begin{essyntax}
+ inter coulomb \var{l_B} ewaldgpu
+ \var{r_\mathrm{cut}} \alt{\var{K_\mathrm{cut}} \asep \{\var{K_\mathrm{cut,x}} \var{K_\mathrm{cut,y}} \var{K_\mathrm{cut,x}}\}} \var{alpha}
+ \begin{features}
+ \required{ELECTROSTATICS}
+ \end{features}
+\end{essyntax}
+
+This command activates the Ewald method to compute the electrostatic
+interactions between charged particles. The far field is computed by the GPU with single precision and the near field by the CPU with double precision. It only works for the case of cubic boxes.
+\begin{description}
+\item[\var{l_B}] Bjerrum length as positive floating point number
+\item[\var{r_\mathrm{cut}}] Real space cutoff as positive floating point number
+\item[\var{K_\mathrm{cut}}] Reciprocal space cutoff as single positive integer
+\item[\var{K_\mathrm{cut,xyz}}] Reciprocal space cutoff in x, y and z direction (relevant for noncubic boxes)
+\item[\var{alpha}] Ewald parameter as positive floating point number
+\end{description}
+
+\subsubsection{Tuning Ewald GPU}
+\label{ssec:tuneewaldgpu}
+\begin{essyntax}
+ inter coulomb \var{l_B} ewaldgpu tune
+ accuracy \var{accuracy} precision \var{precision}
+ K_max \var{K_\mathrm{max}}
+ \begin{features}
+ \required{ELECTROSTATICS}
+ \end{features}
+\end{essyntax}
+
+The tuning algorithm first computes the optimal \var{r_\mathrm{cut}} and \var{alpha} for every \var{K_\mathrm{cut}} between one and \var{K_\mathrm{max}} as described in \cite{kolafa92}. Then the performance for all those (\var{K_\mathrm{cut}}, \var{r_\mathrm{cut}}, \var{alpha})-triplets will be measured via a short test simulation and the fastest will be chosen.
+
+\begin{description}
+\item[\var{accuracy}] Maximal allowed root mean square error regarding the forces
+\item[\var{precision}] Determines how precise alpha will be computed
+\item[\var{K_\mathrm{max}}] Maximal reciprocal space cutoff \var{K_\mathrm{cut}} to be tested in the tuning algorithm
+\end{description}
+
+\subsubsection{Tuning Alpha Ewald GPU}
+\label{ssec:tunealphaewaldgpu}
+\begin{essyntax}
+ inter coulomb \var{l_B} ewaldgpu tunealpha
+ \var{r_\mathrm{cut}} \alt{\var{K_\mathrm{cut}} \asep \{\var{K_\mathrm{cut,x}} \var{K_\mathrm{cut,y}} \var{K_\mathrm{cut,x}}\}} \var{precision}
+ \begin{features}
+ \required{ELECTROSTATICS}
+ \end{features}
+\end{essyntax}
+
+If \var{K_\mathrm{cut}} and \var{r_\mathrm{cut}} are given by the user, then \keyword{tunealpha} computes the optimal \var{alpha} with the chosen \var{precision} as described in \cite{kolafa92}. But in general \keyword{tune} should be chosen for tuning.
+
+
\subsection{Debye-H\"uckel potential}
\index{Debye-H\"uckel potential|mainindex}
\index{interactions!Debye-H\"uckel|mainindex}
@@ -1392,7 +1545,6 @@ \subsection{Debye-H\"uckel potential}
For $\kappa = 0$, this corresponds to the plain coulomb potential.
-
\subsection{MMM2D}
\index{MMM2D method|mainindex}
\index{interactions!MMM2D|mainindex}
@@ -1408,6 +1560,7 @@ \subsection{MMM2D}
\opt{\var{fixed\_far\_cutoff}}
\opt{dielectric \var{\epsilon_t} \var{\epsilon_m} \var{\epsilon_b}}
\opt{dielectric-contrasts \var{\Delta_t} \var{\Delta_b}}
+ \opt{capacitor \var{U}}
\begin{features}
\required{ELECTROSTATICS}
\end{features}
@@ -1435,6 +1588,28 @@ \subsection{MMM2D}
this form allows to choose $\Delta_{t/b}=-1$, corresponding to
metallic boundary conditions.
+Using \keyword{capacitor} \var{U} allows to maintain a constant
+electric potential difference \var{U} between the xy-plane at $z=0$
+and $z=L$, where $L$ denotes the box length in $z$-direction.
+This is done by countering the total dipol moment of
+the system with the electric field $E_{induced}$ and superposing
+a homogeneous electric field $E_{applied} = \frac{U}{L}$
+to retain \var{U}. This mimics the induction of surface charges
+$\pm\sigma = E_{induced} \cdot \epsilon_0$ for planar electrodes at $z=0$
+and $z=L$ in a capacitor connected to a battery with voltage \var{U}.
+Using \var{capacitor} 0 is equivalent to $\Delta_{t/b}=-1$.
+
+\begin{essyntax}
+ efield_caps \alt{total \asep induced \asep applied}
+ \begin{features}
+ \required{ELECTROSTATICS}
+ \end{features}
+\end{essyntax}
+
+The electric fields added by \var{capacitor} \var{U} can be obtained
+by calling the above command, where \var{induced} returns $E_{induced}$,
+\var{applied} returns $E_{applied}$ and \var{total} their sum.
+
\subsection{MMM1D}
\index{MMM1D method|mainindex}
\index{interactions!MMM1D|mainindex}
@@ -1446,7 +1621,7 @@ \subsection{MMM1D}
\begin{essyntax}
\variant{1}
inter coulomb \var{l_B} mmm1d \var{switch\_radius}
- \opt{\var{bessel\_cutoff}} \var{maximal\_pairwise\_error}
+ \var{maximal\_pairwise\_error}
\variant{2}
inter coulomb \var{l_B} mmm1d tune \var{maximal\_pairwise\_error}
@@ -1458,14 +1633,39 @@ \subsection{MMM1D}
nsquared cell system (see section \vref{sec:cell-systems}). The first
form sets parameters manually. The switch radius determines at which
xy-distance the force calculation switches from the near to the far
-formula. If the Bessel cutoff is not explicitly given, it is
-determined from the maximal pairwise error, otherwise this error only
-counts for the near formula. The second, tuning form just takes the
+formula. The Bessel cutoff does not need to be specified as it is
+automatically determined from the particle distances and maximal
+pairwise error. The second tuning form just takes the
maximal pairwise error and tries out a lot of switching radii to find
out the fastest one. If this takes too long, you can change the value
of the setmd variable \keyword{timings}, which controls the number of
-test force calculations. For details on the MMM family of algorithms,
-refer to appendix \vref{chap:mmm}.
+test force calculations.
+
+\begin{essyntax}
+ \variant{1}
+ inter coulomb \var{l_B} mmm1dgpu \var{switch\_radius}
+ \opt{\var{bessel\_cutoff}} \var{maximal\_pairwise\_error}
+
+ \variant{2}
+ inter coulomb \var{l_B} mmm1dgpu tune \var{maximal\_pairwise\_error}
+ \begin{features}
+ \required{CUDA}
+ \required{ELECTROSTATICS}
+ \required{MMM1D_GPU}
+ \end{features}
+\end{essyntax}
+MMM1D is also available in a GPU implementation. Unlike its CPU
+counterpart, it does not need the nsquared cell system. The first
+form sets parameters manually. The switch radius determines at which
+xy-distance the force calculation switches from the near to the far
+formula. If the Bessel cutoff is not explicitly given, it is
+determined from the maximal pairwise error, otherwise this error only
+counts for the near formula. The second tuning form just takes the
+maximal pairwise error and tries out a lot of switching radii to find
+out the fastest one.
+
+For details on the MMM family of algorithms, refer to appendix
+\vref{chap:mmm}.
\subsection{Maxwell Equation Molecular Dynamics (MEMD)}
\index{Maggs method|mainindex}
@@ -1621,6 +1821,7 @@ \subsection{Electrostatic Layer Correction (ELC)}
\opt{noneutralization}
\opt{dielectric \var{\epsilon_t} \var{\epsilon_m} \var{\epsilon_b}}
\opt{dielectric-contrasts \var{\Delta_t} \var{\Delta_b}}
+ \opt{capacitor \var{U}}
\begin{features}
\required{ELECTROSTATICS}
\end{features}
@@ -1662,7 +1863,11 @@ \subsection{Electrostatic Layer Correction (ELC)}
disable the neutralization.
The dielectric contrast features work exactly the same as for MMM2D,
-see the documentation above.
+see the documentation above. Same accounts for \keyword{capacitor}
+\var{U}, but the constant potential is maintained between the xy-plane
+at $z=0$ and $z=L-gap\_size$. The command \var{efield\_caps} to read
+out the electric fields added by \var{capacitor} \var{U} also applies
+for the capacitor-feature of ELC.
Make sure that you read the papers on ELC (\cite{elc,icelc})
before using it.
@@ -1727,12 +1932,21 @@ \subsubsection{Quick setup of dielectric interfaces}
\variant{2} dielectric wall normal \var{nx} \var{ny} \var{nz} dist \var{d} res \var{res}
\variant{3} dielectric cylinder center \var{cx} \var{cy} \var{cz} axis \var{ax} \var{ay} \var{az} radius \var{r} direction \var{d}
\variant{4} dielectric pore center \var{cx} \var{cy} \var{cz} axis \var{ax} \var{ay} \var{az} radius \var{r} length \var {l} smoothing\_radius \var{rs} res \var{res}
+ \variant{5} dielectric slitpore pore_mouth \var{z} \
+ channel_width \var{c} \
+ pore_width \var{w} \
+ pore_length \var{l} \
+ upper_smoothing_radius \var{us} \
+ lower_smoothing_radius \var{ls}
+
\end{essyntax}
The command \keyword{dielectric} allows to conveniently create
dielectric interfaces similar to the constraint and the lbboundary
command. Currently the creation of spherical, cylindrical and planar
-geometries as well as a pore geometry is supported. It is implemented
+geometries as well as a pore and slitpore geometry is supported.
+Please check the documentation of the corresponding constraint for the detailed geometry.
+It is implemented
in Tcl and places particles in the right positions and adds the
correct values to the global Tcl variables \var{icc\_areas}
\var{icc\_normals} \var{icc\_sigmas} \var{icc\_epsilons} and increases
@@ -1943,18 +2157,18 @@ \subsection{Tunable-slip boundary interaction}\label{sec:tunableSlip}
In recent years, experiments have indicated that the no-slip boundary
condition is indeed usually not valid on the micrometer
-scale. Instead, it has to be replaced by the {\em {partial-slip
- boundary condition}}
+scale. Instead, it has to be replaced by the \emph{partial-slip
+ boundary condition}
\begin{displaymath}
-\delta_B \: \: \partial_{{\bf n}} v_{\parallel}|_{{\bf r}_B} =
-v_{\parallel}|_{{\bf r}_B},
+\delta_B \; \; \partial_\mathbf{n} v_{\parallel} \rVert_{\mathbf{r}_B} =
+v_{\parallel} \rVert_{\mathbf{r}_B},
\end{displaymath}
where $v_{\parallel}$ denotes the tangential component of the velocity
-and $\partial_{{\bf n}} v_{\parallel}$ its spatial derivative normal
-to the surface, both evaluated at the position ${\bf r}_B$ of the
-so-called {\em hydrodynamic boundary}. This boundary condition is
+and $\partial_\mathbf{n} v_{\parallel}$ its spatial derivative normal
+to the surface, both evaluated at the position $\mathbf{r}_B$ of the
+so-called \emph{hydrodynamic boundary}. This boundary condition is
characterized by two effective parameters, namely (i) the slip length
-$\delta_B$ and (ii) the hydrodynamic boundary ${\bf r}_B$.
+$\delta_B$ and (ii) the hydrodynamic boundary $\mathbf{r}_B$.
Within the approach of the tunable-slip boundary interactions it is
possible to tune the slip length systematically from full-slip to
@@ -1994,9 +2208,9 @@ \subsection{DPD interaction}\label{sec:DPDinter}
This is a special interaction that is to be used in conjunction with
the Dissipative Particle Dynamics algorithm \ref{sec:DPD} when the
-\texttt{INTER_DPD} implementation is used. The parameters correspond
-to the parameters of the DPD thermostat \vref{sec:DPDinter}, but
-can be set individually for the different interactions.
+\feature{INTER_DPD} implementation is used. The parameters correspond
+to the parameters of the DPD thermostat \vref{sec:DPDinter}, but can
+be set individually for the different interactions.
\subsection{Fixing the center of mass}
\begin{essyntax}
@@ -2011,14 +2225,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}
@@ -2048,7 +2270,7 @@ \subsection{Capping the force during warmup}
\label{sec:forcecap}
\begin{essyntax}
- \variant{1} inter forcecap \alt{\var{F_\mathrm{max}} \asep individual}
+ inter forcecap \alt{\var{F_\mathrm{max}} \asep individual}
\end{essyntax}
Non-bonded interactions are often used to model the hard core
diff --git a/doc/ug/internal.tex b/doc/ug/internal.tex
index 572d05ee33d..b836c215540 100644
--- a/doc/ug/internal.tex
+++ b/doc/ug/internal.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
diff --git a/doc/ug/introduction.tex b/doc/ug/introduction.tex
index 1d818f24293..6537793c7b0 100644
--- a/doc/ug/introduction.tex
+++ b/doc/ug/introduction.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -111,31 +111,81 @@ \section{Guiding principles}
\section{Available simulation methods}
-\begin{itemize}
-\item Ensembles:
- \begin{itemize}
- \item NVE
- \item NVT
- \item NpT
- \end{itemize}
-\item Algorithms for charged systems:
- \begin{itemize}
- \item P3M for fully periodic systems
- \item ELC and MMM-family of algorithms for charged systems with
- non-periodic boundary conditions
- \item MEMD (Maggs algorithm)
- \end{itemize}
-\item Hydrodynamics:
- \begin{itemize}
- \item DPD (as a thermostat)
- \item Lattice-Boltzmann
- \end{itemize}
-\item Non-equilibrium MD to simulate shear flow
-\item Parallel tempering
-\item Metadynamics
-\item Rigid bodies via virtual sites
-\item AdResS
-\end{itemize}
+\es provides a number of useful methods. The following table shows the
+various methods as well as their status. The table distinguishes
+between the state of the development of a certain feature and the
+state of its use. We distinguish between five levels:
+\begin{description}
+\item[Core] means that the method is part of the core of \es, and that
+ it is extensively developed and used by many people.
+\item[Good] means that the method is developed and used by independent
+ people from different groups.
+\item[Group] means that the method is developed and used in one group.
+\item[Single] means that the method is developed and used by one
+ person only.
+\item[None] means that the method is developed and used by nobody.
+\end{description}
+If you believe that the status of a certain method is wrong, please
+report so to the developers.
+
+\newpage
+\definecolor{supportgrey}{rgb}{0.9,0.9,0.9}
+\rowcolors{1}{supportgrey}{}
+\begin{longtable}{|l|l|l|}
+ \hline
+ \textbf{Feature} & \textbf{Development Status} & \textbf{Usage Status}\\\hline%
+ \multicolumn{3}{|c|}{\textbf{Integrators, Thermostats, Barostats}} \\
+ Velocity-Verlet Integrator & Core & Core \\
+ Langevin Thermostat & Core & Core \\
+ GHMC Thermostat & Single & Single \\
+ DPD Thermostat & None & Good \\
+ Isotropic NPT & None & Single \\
+ NEMD & None & Group \\
+ Quarternion Integrator & None & Good \\
+ \multicolumn{3}{|c|}{\textbf{Interactions}} \\
+ Short-range Interactions & Core & Core \\
+ Directional Lennard-Jones & Single & Single \\
+ Gay-Berne Interaction & None & Single \\
+ Constraints & Core & Core \\
+ Relative Virtual Sites & Good & Good \\
+ Center-of-mass Virtual Sites & None & Good \\
+ RATTLE Rigid Bonds & None & Group \\
+ \multicolumn{3}{|c|}{\textbf{Coulomb Interaction}} \\
+ P3M & Core & Core \\
+ P3M on GPU & Single & Single \\
+ Dipolar P3M & Group & Good \\
+ Ewald on GPU & Single & Single \\
+ MMM1D & Single & Good \\
+ MMM2D & Single & Good \\
+ MMM1D on GPU & Single & Single \\
+ ELC & Good & Good \\
+ MEMD & Single & Group \\
+ ICC* & Group & Group \\
+ \multicolumn{3}{|c|}{\textbf{Hydrodynamic Interaction}} \\
+ Lattice-Boltzmann & Core & Core \\
+ Lattice-Boltzmann on GPU & Group & Core \\
+ DPD & None & Good \\
+ Shan-Chen Multicomponent Fluid & Group & Group \\
+ Tunable Slip Boundary & Single & Single \\
+ \multicolumn{3}{|c|}{\textbf{Analysis}} \\
+ uwerr & None & Good \\
+ \multicolumn{3}{|c|}{\textbf{Input/Output}} \\
+ Blockfiles & Core & Core \\
+ VTF output & Core & Core \\
+ VTK output & Group & Group \\
+ PDB output & Good & Good \\
+ Online visulation with VMD & Good & Good \\
+ \multicolumn{3}{|c|}{\textbf{Miscellaneous}} \\
+ Grand canonical feature & Single & Single \\
+ Metadynamics & Single & Single \\
+ Parallel Tempering & Single & Single \\
+ Electrokinetics & Group & Group \\
+ Object-in-fluid & Group & Group \\
+ Collision Detection & Group & Group \\
+ Catalytic Reactions & Single & Single \\
+ mbtools package & Group & Group \\
+ \hline
+\end{longtable}
\section{Basic program structure}
\label{sec:structure}
@@ -297,8 +347,8 @@ \section{Syntax description}
type.
\item \texttt{\alt{\var{alt1} \asep \var{alt2}}} specifies, that one
of the alternatives \var{alt1} or \var{alt2} can be used.
-\item \texttt{\opt{\var{argument}}} specifies, that the augment
- \var{argument} is optional, \ie{} it can be omitted.
+\item \texttt{\opt{\var{argument}}} specifies, that the argument
+ \var{argument} is optional, \ie it can be omitted.
\item When an optional argument or a whole command is marked by a
superscript label (\fmark{1}), this denotes that the argument can
only be used, when the corresponding feature (see appendix
diff --git a/doc/ug/io.tex b/doc/ug/io.tex
index eff89f85272..64442671eb5 100644
--- a/doc/ug/io.tex
+++ b/doc/ug/io.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -29,27 +29,28 @@ \section{No generic checkpointing!}
this state to or read it from a file. This would be most useful to be
able to restart a simulation from a specific point in time.
-Unfortunately, a simple command \texttt{checkpoint} could not work,
-out of two reasons. The main reason is that \es has no way to
-determine what information constitutes the actual state of the
-simulation. On the one hand, \es scripts sometimes use Tcl-variables
-that contain essential information about a simulation, \eg the stored
-values of an observable that was computed in previous time steps,
-counters, etc. These would have to be contained in a checkpoint.
-However, not all Tcl-variables are of interest. For example, Tcl has a
-number of automatically set variables that contain information about
-the hostname, the machine type, etc. These variables should most
-probably \emph{not} be included the simulation state. \es has no way
-to distinguish between these variables. On the other hand, the \es
-core has a number of internal variables, \eg the particle coordinates.
-While most of these are probably good candidates for being included
-into a checkpoint, this is not necessarily so. For example, when you
-have particles in your system that have fixed coordinates, should
-these be stored in a checkpoint, or not? If the system contains
-mostly fixed particles and only very few moving particles, this would
-increase the memory size of a checkpoint needlessly. And what about
-the interactions in the system, or the bonds? Should these be stored
-in a checkpoint, or are they generated by the script?
+Unfortunately, it is impossible to provide a simple command (\eg
+\texttt{checkpoint}), out of two reasons. The main reason is that \es
+has no way to determine what information constitutes the actual state
+of the simulation. On the one hand, \es scripts sometimes use
+Tcl-variables that contain essential information about a simulation,
+\eg the stored values of an observable that was computed in previous
+time steps, counters, etc. These would have to be contained in a
+checkpoint. However, not all Tcl-variables are of interest. For
+example, Tcl has a number of automatically set variables that contain
+information about the hostname, the machine type, etc. These variables
+should most probably \emph{not} be included the simulation state. \es
+has no way to distinguish between these variables. On the other hand,
+the \es core has a number of internal variables, \eg the particle
+coordinates. While most of these are probably good candidates for
+being included into a checkpoint, this is not necessarily so. For
+example, when you have particles in your system that have fixed
+coordinates, should these be stored in a checkpoint, or not? If the
+system contains mostly fixed particles and only very few moving
+particles, this would increase the memory size of a checkpoint
+needlessly. And what about the interactions in the system, or the
+bonds? Should these be stored in a checkpoint, or are they generated
+by the script?
Another problem with a generic checkpoint would be the control flow of
the script. In principle, the checkpoint would have to store where in
@@ -59,7 +60,29 @@ \section{No generic checkpointing!}
Instead, in \es, the user has to specify what information needs to be
saved to a file to be able to restore the simulation state. The
-\texttt{blockfile} command helps you to do that.
+\texttt{blockfile} and \texttt{writemd} commands help you to do that.
+\texttt{blockfile} writes text files. When floating point numbers are
+stored in such files (\eg the particle positions), there is only a
+limited precision. Therefore, it is not possible to bitwise reproduce
+a simulation state using this function. When you need bitwise
+reproducibility, you will have to use the command \lit{writemd}, which
+stores positions, forces and velocities in binary format. Note that
+there is no command to write other MD parameters like time step or
+interactions in binary format. You should restore these using exactly
+the same Tcl command that you used to create them.
+
+Finally, there is one more complication: random forces are computed
+in the order the particles are stored in memory. This order usually
+differs after reading a blockfile back, since the particles are
+stored in consecutive identity order. In memory, they are usually
+not in a specific order. Therefore, you need to use \texttt{sort_particles}
+after writing a blockfile that you want to use for checkpointing, so
+that the particles are resorted to the same consecutive order. Note
+that this does not change physics, just the order the random numbers
+are applied.
+
+When using an LB fluid, you need to also write out the fluid nodes,
+see the \texttt{lbfluid} command for further details.
\section{\texttt{blockfile}: Using the structured file format}
\label{sec:structured-file-format}
@@ -142,13 +165,18 @@ \subsection{Writing particles, bonds and interactions}
\variant{3} blockfile \var{channel} write interactions
\end{essyntax}
-\todo{How is a Tcl-range specified?} Variant \variant{1} writes
+Variant \variant{1} writes
particle information in a standardized format to \var{channel}.
\var{what} can be any list of parameters that can be specified in
\codebox{part \var{part_id} print}, except for \lit{bonds}. Note that
\lit{id} and \lit{pos} will automatically be added if missing.
-\var{range} is a Tcl list of ranges which particles to write. The
-keyword \keyword{all} denotes all known particles.
+\var{range} is a Tcl list of ranges which particles to write. A range
+is defined as \textit{start}-\textit{stop}, where \textit{start} and
+\textit{stop} are particle identities. \textit{stop} can also be the
+string ``end'', denoting the highest used particle identity. Thus
+\texttt{"{} 0-5 10-end"{}} are all particles with the exception of
+particles 6-9. The keyword \keyword{all} denotes all known particles,
+\ie{} is eqivalent to \texttt{"0-end"{}}).
Variant \variant{2} writes the bond information in a standardized
format to \var{channel}. The involved particles and bond types must
@@ -225,10 +253,10 @@ \subsection{Reading blocks}
\begin{essyntax}
\variant{1} blockfile \var{channel} read start
\variant{2} blockfile \var{channel} read toend
- \variant{3} blockfile \var{channel} read \alt{particles \asep
+ \variant{3} blockfile \var{channel} read auto
+ \variant{4} blockfile \var{channel} read \alt{particles \asep
interactions \asep bonds \asep variable \asep seed \asep random
\asep bitrandom \asep configs}
- \variant{4} blockfile \var{channel} read auto
\end{essyntax}
Variants \variant{1} and \variant{2} are the low-level block-reading
@@ -236,11 +264,8 @@ \subsection{Reading blocks}
returns the block title, while variant \variant{2} reads the block
data and returns it.
-\todo{Needs to be rewritten!}
-Variants \variant{3} and \variant{4} read whole blocks. Variant
-\variant{3} reads the beginning of one block, checks wether it
-contains data of the given type and reads it. Variant \variant{4}
-reads in one block and does the following:
+Variants \variant{3} and \variant{4} read whole blocks.
+Variant \variant{3} reads in one block and does the following:
\begin{enumerate}
\item if a procedure \keyword{blockfile_read_auto_\var{tag}} exists,
this procedure takes over (\var{tag} is the first expression in the
@@ -257,7 +282,7 @@ \subsection{Reading blocks}
\item if the file is at the end, it returns \lit{eof}
\end{enumerate}
-Variant \variant{3} checks for a block with tag \var{block} and then
+Variant \variant{4} checks for a block with tag \var{block} and then
again executes the corresponding \lit{blockfile_read_auto_\var{tag}},
if it exists.
@@ -310,6 +335,31 @@ \subsection{Reading blocks}
This is basically all you need to restore the information in the
blockfile, overwriting the current settings in \es.
+\section{Writing and reading binary files}
+\index{binary I/O}
+
+Binary files are written using the command
+\begin{essyntax}
+ writemd \var{channel} \opt{posx|posy|posz|vx|vy|vz|fx|fy|fz}\dots
+\end{essyntax}
+This will write out particle data to the Tcl channel \var{channel} for
+all particles in binary format. Apart from the mandatory particle id,
+only limited information can be stored. The coordinates (\keyword{posx},
+\keyword{posy} and \keyword{posz}), velocities (\keyword{vx}, \keyword{vy} and
+\keyword{vz}) and forces (\keyword{fx}, \keyword{fy} and \keyword{fz}). Other
+information should be stored in a blockfile or reconstructed
+differently. Note that since both \texttt{blockfile} and
+\texttt{writemd} are using a Tcl channel, it is actually possible to
+mix them, so that you can write a single checkpoint file. However, the
+\texttt{blockfile read auto} mechanism cannot handle the binary
+section, thus you need to read this section manually. Reading of
+binary particle data happens through
+\begin{essyntax}
+ readmd \var{channel}
+\end{essyntax}
+For the exact format of the written binary sequence, see
+\texttt{src/tcl/binary_file_tcl.cpp}.
+
\section{Writing VTF files}
\label{sec:vtf}
%\quickrefheading{Handling of VTF files}
@@ -372,7 +422,6 @@ \subsection{\texttt{writevsf}: Writing the topology}
\opt{\alt{short \asep verbose}}
\opt{radius \alt{\var{radii} \asep auto}}
\opt{typedesc \var{typedesc}}
- \opt{ignore_charges}
\end{essyntax}
Writes a structure block describing the system's structure to the
channel given by \var{channelId}. \var{channelId} must be an
@@ -405,12 +454,6 @@ \subsection{\texttt{writevsf}: Writing the topology}
is an atom name and \textit{type} is the type id.
\minisec{Example}
\verb!writevsf $file typedesc {0 "name colloid" 1 "name pe"}!
-\item[\opt{ignore_charges}]
- this is a temporary workaround for a bug in the VTF reader of VMD,
- which cannot handle multiple atom sections for the same
- atom. However, charges are written out per-atom, so that VMD forgets
- about atom types and radii. If you don't need the charges, you can
- switch them off by this flat, making the other settings work again.
\end{arguments}
\subsection{\texttt{writevcf}: Writing the coordinates}
@@ -681,7 +724,7 @@ \subsection{Automatically setting up a VMD connection}
parameters and boolean values for \opt{start} and \opt{constraints}, as
described above.
-\section{Errorhandling}
+\section{Error handling}
Errors in the parameters are detected as early as possible, and
hopefully self-explanatory error messages returned without any changes
to the data in the internal data of \es. This include errors such as
diff --git a/doc/ug/latexmk b/doc/ug/latexmk
index fabbe331156..97b765e8582 100755
--- a/doc/ug/latexmk
+++ b/doc/ug/latexmk
@@ -5,7 +5,7 @@ if 0;
#!/opt/local/bin/perl -w
#!/usr/local/bin/perl -w
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright John Collins 1998-2004
# (username collins at node phys.psu.edu)
# (and thanks to David Coppit (username david at node coppit.org)
diff --git a/doc/ug/lb.tex b/doc/ug/lb.tex
index bed01ba055b..4136580b040 100644
--- a/doc/ug/lb.tex
+++ b/doc/ug/lb.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
%
% This file is part of ESPResSo.
%
@@ -53,6 +53,7 @@ \section{Setting up a LB fluid}
\require{1 or 2 or 3}{\opt{bulk_visc \var{bulk\_viscosity}}}
\require{1 or 2 or 3}{\opt{ext_force \var{f_x} \var{f_y} \var{f_z}}}
\require{1 or 2 or 3}{\opt{friction \var{gamma} } }
+ \require{2}{\opt{couple \var{2pt/3pt} } }
\require{1 or 2 or 3}{\opt{gamma_odd \var{gamma\_odd}}}
\require{1 or 2 or 3}{\opt{gamma_even \var{gamma\_even}}}
\require{3}{\opt{mobility} \var{mobilities} }
@@ -111,7 +112,7 @@ \section{Setting up a LB fluid}
If the feature \lit{SHANCHEN} is activated, the Lattice Boltzmann
code (so far GPU version only) is extended to a two-component
-Shan-Chen method. The \lit{lbfluid} command requires in this case
+Shan-Chen (SC) method. The \lit{lbfluid} command requires in this case
to supply two values, for the respective fluid components, to each
of the options \lit{dens}, \lit{visc}, \lit{bulk_visc}, \lit{friction},
\lit{gamma_odd} and \lit{gamma_even}, when they are used, otherwise
@@ -137,7 +138,12 @@ \section{Setting up a LB fluid}
The first two save commands save all of the LB fluid nodes' populations to \var{filename} in ascii or binary format respectively.
The two load commands load the populations from \var{filename}. This is useful for restarting a simulation either on the same
machine or a different machine. Some care should be taken when using the binary format as the format of doubles can depend
-on both the computer being used as well as the compiler. This is currently only implemented for the cpu version of LB.
+on both the computer being used as well as the compiler. One thing that one needs to be aware of is that loading the checkpoint also requires the used to reuse the old forces. This is necessary
+since the coupling force between the paricles and the fluid has already been applied to the fluid. Failing to reuse the old forces breaks momentum conservation, which is in general a problem. It is
+particularly problematic for bulk simulations as the system as a whole acquires a drift of the center of mass, causing errors in the calculation of velocities and diffusion coefficients.
+The correct way to restart
+an LB simulation is to first load in the particles with the correct forces, and use ``integrate {\it steps} reuse_forces'' upon the first
+call to integrate. This causes the old forces to be reused and thus conserves momentum.
\section{LB as a thermostat}
\begin{essyntax}
@@ -155,6 +161,8 @@ \section{LB as a thermostat}
\vec{F} = -\gamma \left(\vec{v}-\vec{u}\right) + \vec{F}_R.
\end{equation*}
The momentum acquired by the particles is then transferred back to the fluid using a linear interpolation scheme, to preserve total momentum.
+In the GPU implementation the force can alternatively be interpolated using a three point scheme which couples the particles to the nearest 27 LB nodes.
+This can be called using ``lbfluid \lit{couple} 3pt'' and is described in D\"{u}nweg and Ladd by equation 301\cite{duenweg08a}. Note that the three point coupling scheme is incompatible with the Shan Chen Lattice Boltmann.
The frictional force tends to decrease the relative velocity
between the fluid and the particle whereas the random forces are chosen
so large that the average kinetic energy per particle corresponds to
@@ -171,15 +179,23 @@ \section{LB as a thermostat}
Section~\ref{sec:units}.
\section{The Shan Chen bicomponent fluid\label{sec:shanchen}}
-The Lattice Boltzmann variant of Shan and Chan\cite{...} is widely
+\begin{citebox}
+ Please cite~\citewbibkey{sega13c} if you use the Shan Chen implementation described below.
+\end{citebox}
+
+
+The Lattice Boltzmann variant of Shan and Chan\cite{shan93a} is widely
used as it is simple and yet very effective in reproducing the most
important traits of multicomponent or multiphase fluids. The version
-of the Shan-Chen method implemented in \es is an extension of the
-single-component, multi-relaxation times Lattice Boltzmann with
-fluctuations applied to all modes, that is already present in \es.
+of the Shan-Chen method implemented in \es is an extension to
+bi-component fluids of the multi-relaxation-times Lattice Boltzmann
+with fluctuations applied to all modes, that is already present in
+\es. It features, in addition, coupling with particles\cite{sega13c}
+and component-dependent particle interactions (see sections
+\ref{sec:scmd-coupling} and\ref{sec:scmd-affinity}).
+
The Shan-Chen fluid is set up using the \lit{lbfluid} command,
-supplying two Besides the usual transport coefficients (shear and
-bulk viscosity, and relaxation constants for the ghost modes) it
+supplying two values (one per component) to the \lit{dens} option. Optionally, two values can be set for each of the usual transport coefficients (shear and bulk viscosity), and for the ghost modes. It
is possible to set a relaxation time also for the momentum modes,
since they are not conserved quantities in the Shan-Chen method,
by using the option \lit{mobility}. The mobility transport coefficient
@@ -189,7 +205,30 @@ \section{The Shan Chen bicomponent fluid\label{sec:shanchen}}
fluctuations are switched on, a random noise is added, in addition,
also to the momentum modes. Differently from the other modes, a
correlated noise is added to the momentum ones, in order to preserve
-the \emph{total} momentum. The coupling between the fluid components
+the \emph{total} momentum.
+
+
+The fluctuating hydrodynamic equations that are simulated using the
+Shan-Chen approach are
+\begin{equation}\label{eq:shanchen-NS}
+\rho \left(\frac{\partial }{\partial t} {\vec {u}} + ({\vec {u}}\cdot {\vec {\nabla}}) {\vec {u}} \right)=-{\vec {\nabla}} p+{\vec {\nabla}} \cdot ({\vec {\Pi}}+\hat{{\vec {\sigma}}})+\sum_{\zeta} {\vec {g}}_{\zeta},
+\end{equation}
+\begin{equation}\label{eq:shanchen-cont}
+\frac{\partial }{\partial t} \rho_{\zeta}+{\vec {\nabla}} \cdot (\rho_{\zeta} {\vec {u}}) = {\vec {\nabla}} \cdot ({\vec {D}}_{\zeta}+\hat{{\vec {\xi}}}_{\zeta}),
+\end{equation}
+\begin{equation}\label{eq:shanchen-globalcont}
+\partial_t \rho+{\vec {\nabla}} \cdot (\rho {\vec {u}}) = 0,
+\end{equation}
+where the index $\zeta=1,2$ specifies the component, $\vec{u}$ is
+the fluid (baricentric) velocity, $\rho=\sum_\zeta\rho_\zeta$ is
+the total density, and $p=\sum_{\zeta} p_{\zeta}=\sum_{\zeta} c_s^2
+\rho_{\zeta}$ is the internal pressure of the mixture ($c_s$ being
+the sound speed). Two fluctuating terms $\hat{{\vec{\sigma}}}$ and
+$\hat{{\vec{\xi}}}_{\zeta}$ are associated, respectivelu, to the
+diffusive current ${\vec{D}}_{\zeta}$ and to the viscous stress
+tensor ${\vec{\Pi}}$.
+
+The coupling between the fluid components
is realized by the force
\begin{equation}
\vec{g}_{\zeta}(\vec{r}) = - \rho_{\zeta}(\vec{r})
@@ -209,38 +248,59 @@ \section{The Shan Chen bicomponent fluid\label{sec:shanchen}}
\lit{lb_components}.
-\section{Coupling particle dynamics to the Shan-Chen fluid\label{sec:scmd-coupling}}
-The coupling of particle dynamics to the Shan-Chen fluid has been conceived as an extension
-of the Ahlrichs and D\"unweg's point coupling, with the force acting on a particle given by
+\section{SC as a thermostat\label{sec:scmd-coupling}}
+The coupling of particle dynamics to the Shan-Chen fluid has been
+conceived as an extension of the Ahlrichs and D\"unweg's point
+coupling, with the force acting on a particle given by
\begin{equation}
\vec{F} = -\frac{\sum_\zeta \gamma_\zeta \rho_\zeta(\vec{r})}{\sum_\zeta \rho_\zeta(\vec{r}_\zeta)} \left(\vec{v}-\vec{u}\right) + \vec{F}_R + \vec{F}^{ps},
\end{equation}
-where $\zeta$ identifies the component, $\rho_\zeta(\vec{r})$ is a linear interpolation of the component density on the nodes surrounding the particle, $\gamma_\zeta$ is the component-dependent friction coefficient, $\vec{F}_R$ is the usual random force, and
+where $\zeta$ identifies the component, $\rho_\zeta(\vec{r})$ is a
+linear interpolation of the component density on the nodes surrounding
+the particle, $\gamma_\zeta$ is the component-dependent friction
+coefficient, $\vec{F}_R$ is the usual random force, and
\begin{equation}
\vec{F}^{\mathrm{ps}}= - \sum_{\zeta} \kappa_{\zeta} \nabla \rho_{\zeta}(\vec{r}).
\end{equation}
This is an effective solvation force, that can drive the particle
-towards density maxima or minima of each component, depending on
-the sign of the constant $\kappa_\zeta$. Note that by setting the
-coupling constant to the same negative value for both components
-will, in absence of other forces, push the particle to the interfacial region.
-
-In addition to the solvation force acting on particles, another one that acts on the fluid components is present,
-representing the solvation force of particles on the
-fluid.
+towards density maxima or minima of each component, depending on the
+sign of the constant $\kappa_\zeta$. Note that by setting the coupling
+constant to the same negative value for both components will, in
+absence of other forces, push the particle to the interfacial region.
+
+In addition to the solvation force acting on particles, another one
+that acts on the fluid components is present, representing the
+solvation force of particles on the fluid.
\begin{equation}
- \vec{F}_{\zeta}^{\mathrm{fs}}(\vec{r}) = -\lambda_{\zeta} \rho_{\zeta}(\vec{r}) \sum_i \sum_{\vec{r}'} \Theta \left[\frac{(\vec{r}_i-\vec{r})}{|\vec{r}_i-\vec{r}|} \cdot \frac{(\vec{r}'-\vec{r})}{|\vec{r}'-\vec{r}|} \right] (\vec{r}'-\vec{r}),
+ \vec{F}_{\zeta}^{\mathrm{fs}}(\vec{r}) = -\lambda_{\zeta} \rho_{\zeta}(\vec{r}) \sum_i \sum_{\vec{r}'} \Theta \left[\frac{(\vec{r}_i-\vec{r})}{|\vec{r}_i-\vec{r}|} \cdot \frac{(\vec{r}'-\vec{r})}{|\vec{r}'-\vec{r}|} \right] \frac{\vec{r}'-\vec{r}}{|\vec{r}'-\vec{r}|^2},
\end{equation}
-where $\Theta(x)=1$ if $0
%%
%% This program is free software: you can redistribute it and/or modify
diff --git a/doc/ug/ug.tex b/doc/ug/ug.tex
index 280815e8cbb..4cf06cc56b7 100644
--- a/doc/ug/ug.tex
+++ b/doc/ug/ug.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+% Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
% Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
% Max-Planck-Institute for Polymer Research, Theory Group
%
@@ -49,6 +49,9 @@
\usepackage{xspace}
\usepackage{units}
\usepackage[numbers]{natbib}
+\usepackage{enumitem}
+\usepackage[table,x11names]{xcolor}
+\usepackage{longtable}
%\usepackage{showframe} % Turn this on when debugging the
% margin etc.
@@ -183,7 +186,7 @@
\raggedright%
}{}
-%% Layout thesyntax description box
+%% Layout the syntax description box
\newsavebox{\theessyntaxbox}
\newlength{\essyntaxboxheight}
\newlength{\essyntaxboxdepth}
@@ -209,7 +212,7 @@
\setcounter{essyntaxcounter}{0}
\newenvironment{essyntax}{%
\stepcounter{essyntaxcounter}%
- \label{essyntax:\arabic{essyntaxcounter}}
+ \label{essyntax:\arabic{essyntaxcounter}}%
% Create headings
\minisec{Syntax}\nopagebreak%
\smallskip\nopagebreak%
@@ -317,6 +320,7 @@
\include{io}
\include{aux}
\include{lb}
+\include{electrokinetics}
\include{fsi}
\include{mbtools}
diff --git a/maintainer/Espresso.spec b/maintainer/Espresso.spec
index 5f02f6a853e..5c0c40f6129 100644
--- a/maintainer/Espresso.spec
+++ b/maintainer/Espresso.spec
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright 2009,2010 Christoph Junghans
#
# This file is part of ESPResSo.
diff --git a/maintainer/check_features.py b/maintainer/check_features.py
index 1c243f2bfb5..70381837aff 100644
--- a/maintainer/check_features.py
+++ b/maintainer/check_features.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 The ESPResSo project
+# Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
@@ -18,13 +18,14 @@
#
# Check whether all features used in the code are defined
#
+from __future__ import print_function
import sys, os
sys.path.append(os.path.join(sys.path[0], '..', 'config'))
import featuredefs
if len(sys.argv) != 2:
- print "Usage: %s FILE" % sys.argv[0]
+ print("Usage: %s FILE" % sys.argv[0])
exit(2)
fdefs = featuredefs.defs(sys.argv[1])
diff --git a/maintainer/espresso-2.1.2j.ebuild b/maintainer/espresso-2.1.2j.ebuild
index 9dde82eebf7..09410f1f907 100644
--- a/maintainer/espresso-2.1.2j.ebuild
+++ b/maintainer/espresso-2.1.2j.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2010,2011,2012,2013 The ESPResSo project
+# Copyright 2010,2011,2012,2013,2014 The ESPResSo project
# Copyright 1999-2009 Gentoo Foundation
#
# This file is part of ESPResSo.
diff --git a/maintainer/files_with_header.sh b/maintainer/files_with_header.sh
index d10774f8c6b..e666b4b46f2 100644
--- a/maintainer/files_with_header.sh
+++ b/maintainer/files_with_header.sh
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
@@ -17,12 +17,14 @@
# along with this program. If not, see .
#
git ls-files --exclude-standard |
-egrep -v '\.(gz|data|dat|tab|chk|jpg|png|pdf|fig|gif|xcf|bib|vtf|svg|ico|eps)$' |
+egrep -v '\.(blk|gz|data|dat|tab|chk|jpg|png|pdf|fig|gif|xcf|bib|vtf|vtk|svg|ico|eps)$' |
egrep -v '^testsuite/configs/|^old/' |
egrep -v '(ChangeLog|AUTHORS|COPYING|bootstrap\.sh)' |
egrep -v '(\.gitignore|pkgIndex\.tcl)' |
-egrep -v '(config/config\.guess|config/config\.sub|config/install-sh|config/myconfig-sample-header\.h\.in)' |
+egrep -v '(config/config\.guess|config/config\.sub|config/install-sh|config/myconfig-sample-header\.hpp\.in)' |
egrep -v '(Doxyfile|latexmk\.1|latexmkrc|assemble_quickref\.awk|doc/misc/homepage/palette\.html)' |
egrep -v '(src/features\.def)' |
egrep -v '(doc/ug/ug-dist\.tex)' |
-egrep -v '(featurelist)'
+egrep -v '(featurelist)' |
+egrep -v '(\.cproject|\.project|\.settings)' |
+egrep -v '(maintainer/jenkins|samples/games/highscore.txt)'
diff --git a/maintainer/find_missing_header.sh b/maintainer/find_missing_header.sh
index f77123612f2..2a82bc47c73 100644
--- a/maintainer/find_missing_header.sh
+++ b/maintainer/find_missing_header.sh
@@ -1,5 +1,5 @@
#! /bin/bash -x
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
@@ -57,5 +57,7 @@ else
fi
echo
-
+if [ -n "$nolicense" ] || [ -n "$missing_current_copyright" ]; then
+ exit 1
+fi
diff --git a/maintainer/git2changelog.py b/maintainer/git2changelog.py
index 58b26ff59b0..ab5e5a48b32 100644
--- a/maintainer/git2changelog.py
+++ b/maintainer/git2changelog.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2011 Olaf Lenz
# Copyright 2008 Marcus D. Hanwell
#
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
+from __future__ import print_function
import string, re, os
# Execute git log with the desired command line options.
@@ -106,7 +107,7 @@
elif authorLine == prevAuthorLine:
pass
else:
- print("\n" + authorLine)
+ print(("\n" + authorLine))
# Assemble the actual commit message line(s) and limit the line length
# to 80 characters.
diff --git a/maintainer/headers.txt b/maintainer/headers.txt
index cfc7625b88b..264384db03b 100644
--- a/maintainer/headers.txt
+++ b/maintainer/headers.txt
@@ -1,6 +1,6 @@
For long files, use:
-# Copyright (C) 2013 The ESPResSo project
+# Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2013 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/maintainer/jenkins/ESPResSo-nightly-3core.sh b/maintainer/jenkins/ESPResSo-nightly-3core.sh
deleted file mode 100644
index 5ebd1868efa..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-3core.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-
-bootstrap
-
-configure --with-mpi CPU_COUNT="3"
-
-# copy config file
-if [ "$myconfig" != default ]; then
- use_myconfig $myconfig
-fi
-
-# create mympiexec.sh
-echo 'exec mpiexec --bind-to-core $@' > mympiexec.sh
-chmod +x mympiexec.sh
-
-start "BUILD"
-make -j 3
-end "BUILD"
-
-check
diff --git a/maintainer/jenkins/ESPResSo-nightly-4core.sh b/maintainer/jenkins/ESPResSo-nightly-4core.sh
deleted file mode 100644
index f81672dc43f..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-4core.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-
-cd $SOURCEDIR; bootstrap
-
-cd $BUILDDIR
-start "CONFIGURE"
-./configure --with-mpi CPU_COUNT="4"
-end "CONFIGURE"
-
-# copy config file
-if [ "$myconfig" != default ]; then
- use_myconfig $myconfig
-fi
-
-# create mympiexec.sh
-echo 'exec mpiexec --bind-to-core $@' > mympiexec.sh
-chmod +x mympiexec.sh
-
-start "BUILD"
-make -j 4
-end "BUILD"
-
-check
-
diff --git a/maintainer/jenkins/ESPResSo-nightly-CUDA.sh b/maintainer/jenkins/ESPResSo-nightly-CUDA.sh
deleted file mode 100644
index acddab9162e..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-CUDA.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-
-cd $SOURCEDIR; bootstrap
-
-cd $BUILDDIR
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
-
-start "CONFIGURE"
-./configure --with-mpi --with-cuda CPU_COUNT="4"
-end "CONFIGURE"
-
-use_myconfig LBGPU
-
-start "BUILD"
-make -j 4
-end "BUILD"
-
-check
-
diff --git a/maintainer/jenkins/ESPResSo-nightly-mpich.sh b/maintainer/jenkins/ESPResSo-nightly-mpich.sh
deleted file mode 100644
index 6ac113b01e9..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-mpich.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-bootstrap
-
-start "CONFIGURE"
-./configure \
- CC=/home/jenkins/mpich/bin/mpicc \
- CXX=/home/jenkins/mpich/bin/mpic++ \
- MPIEXEC=/home/jenkins/mpich/bin/mpiexec \
- CPU_COUNT=4
-end "CONFIGURE"
-
-use_myconfig maxset
-
-start "BUILD"
-make -j 4
-end "BUILD"
-
-check
diff --git a/maintainer/jenkins/ESPResSo-nightly-nofftw.sh b/maintainer/jenkins/ESPResSo-nightly-nofftw.sh
deleted file mode 100644
index fbd2220e945..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-nofftw.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-
-echo "#error ERROR: fftw not really present but used somewhere." > src/fftw3.h
-
-bootstrap
-
-start "CONFIGURE"
-./configure --without-fftw CPU_COUNT=2
-end "CONFIGURE"
-
-use_myconfig nofftw
-
-start "BUILD"
-make -j 2
-end "BUILD"
-
-check
diff --git a/maintainer/jenkins/ESPResSo-nightly-nompi.sh b/maintainer/jenkins/ESPResSo-nightly-nompi.sh
deleted file mode 100644
index aef86ddb611..00000000000
--- a/maintainer/jenkins/ESPResSo-nightly-nompi.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash --login -e
-# Copyright (C) 2013 Olaf Lenz
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-source maintainer/jenkins/common.sh
-
-bootstrap
-
-start "CONFIGURE"
-./configure --without-mpi
-end "CONFIGURE"
-
-# copy config file
-if [ "$myconfig" != default ]; then
- use_myconfig $myconfig
-fi
-
-# create mympiexec.sh
-echo 'exec mpiexec --bind-to-core $@' > mympiexec.sh
-chmod +x mympiexec.sh
-
-start "BUILD"
-make
-end "BUILD"
-
-check
diff --git a/maintainer/jenkins/ESPResSo-nightly.sh b/maintainer/jenkins/bootstrap.sh
old mode 100644
new mode 100755
similarity index 65%
rename from maintainer/jenkins/ESPResSo-nightly.sh
rename to maintainer/jenkins/bootstrap.sh
index 81d24a32c02..3b5a093cb24
--- a/maintainer/jenkins/ESPResSo-nightly.sh
+++ b/maintainer/jenkins/bootstrap.sh
@@ -1,10 +1,16 @@
-#!/bin/bash --login -e
+#!/bin/bash --login
# Copyright (C) 2013 Olaf Lenz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-source maintainer/jenkins/common.sh
+DIR=`dirname $0`
+source $DIR/common.sh
+
+start "BOOTSTRAP"
+pushd $srcdir
+./bootstrap.sh || exit $?
+popd
+end "BOOTSTRAP"
-bootstrap
diff --git a/maintainer/jenkins/build.sh b/maintainer/jenkins/build.sh
new file mode 100755
index 00000000000..aadf8cdfc49
--- /dev/null
+++ b/maintainer/jenkins/build.sh
@@ -0,0 +1,43 @@
+#!/bin/bash --login
+# Copyright (C) 2013 Olaf Lenz
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+DIR=`dirname $0`
+source $DIR/common.sh
+
+start "BUILD"
+# DEFAULTS
+[ -z "$myconfig" ] && myconfig="default"
+[ -z "$build_procs" ] && build_procs=4
+outp myconfig build_procs
+
+# change into build dir
+pushd $builddir
+
+# BUILD
+
+if [ "$myconfig" = "default" ]; then
+ echo "Using default myconfig."
+ if [ -e $builddir/myconfig.hpp ]; then
+ echo "Deleting $builddir/myconfig.hpp..."
+ rm $builddir/myconfig.hpp
+ fi
+else
+ myconfig_file=$srcdir/maintainer/jenkins/configs/$myconfig.hpp
+ if [ ! -e "$myconfig_file" ]; then
+ echo "$myconfig_file does not exist!"
+ exit 1
+ fi
+ echo "Copying $myconfig.hpp to $builddir/myconfig.hpp..."
+ cp $myconfig_file $builddir/myconfig.hpp
+fi
+
+make_params="-j $build_procs"
+cmd "make $make_params" || exit $?
+
+popd
+end "BUILD"
+
diff --git a/maintainer/jenkins/check.sh b/maintainer/jenkins/check.sh
new file mode 100755
index 00000000000..f408d104f70
--- /dev/null
+++ b/maintainer/jenkins/check.sh
@@ -0,0 +1,30 @@
+#!/bin/bash --login
+# Copyright (C) 2013 Olaf Lenz
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+DIR=`dirname $0`
+source $DIR/common.sh
+
+start "TEST"
+[ -z "$with_mpi" ] && with_mpi="true"
+! $with_mpi && check_procs=1
+[ -z "$with_cuda" ] && with_cuda="true"
+[ -z "$check_procs" ] && check_procs=4
+
+outp with_mpi with_cuda check_procs
+
+$with_cuda && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
+
+# change into build dir
+pushd $builddir
+
+[ "$check_procs" != "1" ] && make_params="processors=\"$check_procs\""
+# something should be done after ||, otherwise Jenkins will mark
+# job as failed
+cmd "make check $make_params" || CHECK_UNSTABLE=1
+
+popd
+end "TEST"
diff --git a/maintainer/jenkins/check_maintainer.py b/maintainer/jenkins/check_maintainer.py
new file mode 100644
index 00000000000..b6490f263b7
--- /dev/null
+++ b/maintainer/jenkins/check_maintainer.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+from __future__ import print_function
+import sys, os, subprocess
+
+# Test for precious files in commit
+current_commit = os.environ["GIT_COMMIT"]
+
+if "GIT_PREVIOUS_COMMIT" in os.environ:
+ prev_commit = os.environ["GIT_PREVIOUS_COMMIT"]
+ refspec = "{}..{}".format(current_commit, prev_commit)
+else:
+ refspec = current_commit
+
+gitout = subprocess.check_output(["git", "diff", "--name-only", refspec])
+files = gitout.split()
+
+warnings = []
+for fname in files:
+ if fname.startswith('maintainer/') or \
+ fname == "src/myconfig-default.hpp":
+ print("check_maintainer.py: Precious file was modified: {}".format(fname))
diff --git a/maintainer/jenkins/common.sh b/maintainer/jenkins/common.sh
index 7189a439a56..6a0cb60100d 100644
--- a/maintainer/jenkins/common.sh
+++ b/maintainer/jenkins/common.sh
@@ -16,48 +16,60 @@ function end() {
echo "END $1"
}
-function bootstrap() {
- cd $SRCDIR
- start "BOOTSTRAP"
- ./bootstrap.sh
- end "BOOTSTRAP"
- cd $BUILDDIR
+function cmd() {
+ echo ">$1"
+ eval $1
}
-function configure() {
- start "CONFIGURE"
- $SRCDIR/configure $@
- end "CONFIGURE"
+function outp() {
+ for p in $*; do
+ echo " $p=${!p}"
+ done
}
-function use_myconfig() {
- myconfig=$SRCDIR/testsuite/configs/myconfig-$1.hpp
- if [ ! -e "$myconfig" ]; then
- echo "$myconfig does not exist!"
- exit 1
- fi
- echo "Using $myconfig."
- cp $myconfig myconfig.hpp
-}
+# DIR SETTINGS
+[ -z "$insource" ] && insource="true"
+[ -z "$srcdir" ] && srcdir=`pwd`
+if $insource; then
+ builddir=$srcdir
+elif [ -z "$builddir" ]; then
+ builddir=$srcdir/build
+fi
-function check() {
- start "TEST"
- # something should be done after ||, otherwise Jenkins will mark
- # job as failed
- make check || CHECK_UNSTABLE=1
- end "TEST"
-}
+outp srcdir builddir insource
-function doc() {
- start "DOC"
- make doc
- end "DOC"
-}
+if [ ! -e $srcdir/configure.ac ]; then
+ echo "Could not find configure.ac in $srcdir!"
+ exit 1
+fi
-function dist() {
- start "DIST"
- make dist
- make dist-xz
- end "DIST"
-}
+if ! $insource; then
+ if [ ! -d $builddir ]; then
+ echo "Creating $builddir..."
+ mkdir -p $builddir
+ fi
+fi
+
+# PARALLELISM SETTINGS
+if [ -n "$parallelism" ]; then
+ outp parallelism
+
+ case $parallelism in
+ ("34core")
+ with_mpi=true
+ check_procs="3 4"
+ ;;
+ ("3core")
+ with_mpi=true
+ check_procs=3
+ ;;
+ ("4core")
+ with_mpi=true
+ check_procs=4
+ ;;
+ ("nompi")
+ with_mpi=false
+ ;;
+ esac
+fi
diff --git a/testsuite/configs/myconfig-empty.hpp b/maintainer/jenkins/configs/empty.hpp
similarity index 100%
rename from testsuite/configs/myconfig-empty.hpp
rename to maintainer/jenkins/configs/empty.hpp
diff --git a/testsuite/configs/myconfig-maxset.hpp b/maintainer/jenkins/configs/maxset.hpp
similarity index 83%
rename from testsuite/configs/myconfig-maxset.hpp
rename to maintainer/jenkins/configs/maxset.hpp
index 6d66d124238..af233122b5c 100644
--- a/testsuite/configs/myconfig-maxset.hpp
+++ b/maintainer/jenkins/configs/maxset.hpp
@@ -11,13 +11,16 @@
#define COMFORCE
#define COMFIXED
#define MOLFORCES
+
+#ifdef FFTW
#define MODES
+#endif
+
#define BOND_VIRTUAL
#define COLLISION_DETECTION
#define LANGEVIN_PER_PARTICLE
#define ROTATION_PER_PARTICLE
#define CATALYTIC_REACTIONS
-#define GRANDCANONCIAL
#define NEMD
#define NPT
@@ -27,12 +30,23 @@
#define LB_BOUNDARIES
#define LB_ELECTROHYDRODYNAMICS
+#ifdef CUDA
+#define LB_GPU
+#define LB_BOUNDARIES_GPU
+#define ELECTROKINETICS
+#define EK_BOUNDARIES
+#define EK_REACTION
+#define MMM1D_GPU
+#define EWALD_GPU
+#endif
+
#define AREA_FORCE_GLOBAL
#define VOLUME_FORCE
#define TABULATED
#define LENNARD_JONES
#define LENNARD_JONES_GENERIC
+#define LJGEN_SOFTCORE
#define LJCOS
#define LJCOS2
#define GAUSSIAN
diff --git a/testsuite/configs/myconfig-molcut.hpp b/maintainer/jenkins/configs/molcut.hpp
similarity index 100%
rename from testsuite/configs/myconfig-molcut.hpp
rename to maintainer/jenkins/configs/molcut.hpp
diff --git a/testsuite/configs/myconfig-compileonly.hpp b/maintainer/jenkins/configs/nocheck-maxset.hpp
similarity index 70%
rename from testsuite/configs/myconfig-compileonly.hpp
rename to maintainer/jenkins/configs/nocheck-maxset.hpp
index 15c8deae1ee..1bac7c312cd 100644
--- a/testsuite/configs/myconfig-compileonly.hpp
+++ b/maintainer/jenkins/configs/nocheck-maxset.hpp
@@ -1,11 +1,10 @@
-/* maximal set of features usable at the same time */
-/* plus all debug switches */
+/* maximal set of features usable at the same time plus all debug switches */
+/* Do not run the testsuite with this set, only compile it. */
#define PARTIAL_PERIODIC
#define ELECTROSTATICS
#define DIPOLES
#define ROTATION
#define ROTATIONAL_INERTIA
-#define MDLC
#define EXTERNAL_FORCES
#define CONSTRAINTS
#define MASS
@@ -13,23 +12,45 @@
#define COMFORCE
#define COMFIXED
#define MOLFORCES
+
+#ifdef FFTW
#define MODES
+#endif
+
#define BOND_VIRTUAL
#define COLLISION_DETECTION
-#define GRANDCANONICAL
+#define LANGEVIN_PER_PARTICLE
+#define ROTATION_PER_PARTICLE
+#define CATALYTIC_REACTIONS
#define NEMD
#define NPT
+#define GHMC
#define LB
#define LB_BOUNDARIES
#define LB_ELECTROHYDRODYNAMICS
+#ifdef CUDA
+#define LB_GPU
+#define LB_BOUNDARIES_GPU
+#define ELECTROKINETICS
+#define EK_BOUNDARIES
+#define EK_REACTION
+#define MMM1D_GPU
+#endif
+
+#define AREA_FORCE_GLOBAL
+#define VOLUME_FORCE
+
#define TABULATED
#define LENNARD_JONES
#define LENNARD_JONES_GENERIC
+#define LJGEN_SOFTCORE
#define LJCOS
#define LJCOS2
+#define GAUSSIAN
+#define HAT
#define LJ_ANGLE
#define GAY_BERNE
#define SMOOTH_STEP
@@ -39,9 +60,13 @@
#define BUCKINGHAM
#define SOFT_SPHERE
#define INTER_RF
+#define OVERLAPPED
#define BOND_ANGLE
#define BOND_ANGLEDIST
+#define BOND_ANGLEDIST_HARMONIC
+#define BOND_ENDANGLEDIST
+#define BOND_ENDANGLEDIST_HARMONIC
#define VIRTUAL_SITES_RELATIVE
diff --git a/testsuite/configs/myconfig-restcompile1.hpp b/maintainer/jenkins/configs/rest1.hpp
similarity index 100%
rename from testsuite/configs/myconfig-restcompile1.hpp
rename to maintainer/jenkins/configs/rest1.hpp
diff --git a/testsuite/configs/myconfig-restcompile2.hpp b/maintainer/jenkins/configs/rest2.hpp
similarity index 100%
rename from testsuite/configs/myconfig-restcompile2.hpp
rename to maintainer/jenkins/configs/rest2.hpp
diff --git a/maintainer/jenkins/configs/shanchen.hpp b/maintainer/jenkins/configs/shanchen.hpp
new file mode 100644
index 00000000000..b4374d9dc27
--- /dev/null
+++ b/maintainer/jenkins/configs/shanchen.hpp
@@ -0,0 +1,6 @@
+/* minimal config to run SHANCHEN testcase */
+#define LB_GPU
+#define SHANCHEN
+#define EXTERNAL_FORCES
+#define PARTIAL_PERIODIC
+
diff --git a/testsuite/configs/myconfig-tunableslip.hpp b/maintainer/jenkins/configs/tunableslip.hpp
similarity index 100%
rename from testsuite/configs/myconfig-tunableslip.hpp
rename to maintainer/jenkins/configs/tunableslip.hpp
diff --git a/maintainer/jenkins/configure.sh b/maintainer/jenkins/configure.sh
new file mode 100755
index 00000000000..56a263d133d
--- /dev/null
+++ b/maintainer/jenkins/configure.sh
@@ -0,0 +1,81 @@
+#!/bin/bash --login
+# Copyright (C) 2013 Olaf Lenz
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+DIR=`dirname $0`
+source $DIR/common.sh
+
+start "CONFIGURE"
+
+# DEFAULTS
+[ -z "$configure_params" ] && configure_params=""
+[ -z "$configure_vars" ] && configure_vars=""
+[ -z "$with_cuda" ] && with_cuda="true"
+[ -z "$with_mpi" ] && with_mpi="true"
+[ -z "$with_fftw" ] && with_fftw="true"
+[ -z "$with_tcl" ] && with_tcl="true"
+[ -z "$with_python_interface" ] && with_python_interface="false"
+outp configure_params configure_vars with_cuda with_mpi with_fftw \
+ with_tcl with_python_interface
+
+# change into build dir
+pushd $builddir
+
+# set up configure params
+configure_params="--enable-silent-rules $configure_params"
+
+if $with_mpi; then
+ configure_params="--with-mpi $configure_params"
+else
+ configure_params="--without-mpi $configure_params"
+fi
+
+CUDA_HEADER=$srcdir/src/cuda.h
+if $with_cuda; then
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
+ configure_params="--with-cuda $configure_params"
+ if [ -e $CUDA_HEADER ]; then
+ echo "Using CUDA => deleting mock $CUDA_HEADER..."
+ rm $CUDA_HEADER
+ fi
+else
+ configure_params="--without-cuda $configure_params"
+ configure_vars="$configure_vars NVCC=/bin/false"
+ echo "Not using CUDA => generating mock $CUDA_HEADER..."
+ echo "#error ERROR: cuda is not really present but used somewhere." \
+ > $CUDA_HEADER
+fi
+
+FFTW_HEADER=$srcdir/src/fftw3.h
+if $with_fftw; then
+ configure_params="--with-fftw $configure_params"
+ if [ -e $FFTW_HEADER ]; then
+ echo "Using FFTW => deleting mock $FFTW_HEADER..."
+ rm $FFTW_HEADER
+ fi
+else
+ configure_params="--without-fftw $configure_params"
+ echo "Not using FFTW => generating mock $FFTW_HEADER..."
+ echo "#error ERROR: fftw is not really present but used somewhere." \
+ > $FFTW_HEADER
+fi
+
+if $with_tcl; then
+ configure_params="--with-tcl $configure_params"
+else
+ configure_params="--without-tcl $configure_params"
+fi
+
+if $with_python_interface; then
+ configure_params="--with-python-interface $configure_params"
+else
+ configure_params="--without-python-interface $configure_params"
+fi
+
+cmd "$srcdir/configure $configure_params $configure_vars" || exit $?
+end "CONFIGURE"
+
+popd
diff --git a/maintainer/jenkins/ESPResSo-nightly-debug.sh b/maintainer/jenkins/dist.sh
old mode 100644
new mode 100755
similarity index 62%
rename from maintainer/jenkins/ESPResSo-nightly-debug.sh
rename to maintainer/jenkins/dist.sh
index 5e1c29d890f..50fa981d776
--- a/maintainer/jenkins/ESPResSo-nightly-debug.sh
+++ b/maintainer/jenkins/dist.sh
@@ -1,19 +1,19 @@
-#!/bin/bash --login -e
+#!/bin/bash --login
# Copyright (C) 2013 Olaf Lenz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-source maintainer/jenkins/common.sh
+DIR=`dirname $0`
+source $DIR/common.sh
-cd $SOURCEDIR; bootstrap
+start "DIST"
-cd $BUILDDIR
+pushd $builddir
+# DIST
+cmd "make dist dist-xz" || exit $?
-use_myconfig compileonly
-
-start "BUILD"
-make -j 4
-end "BUILD"
+popd
+end "DIST"
diff --git a/maintainer/jenkins/ESPResSo-nightly-distcheck.sh b/maintainer/jenkins/distcheck.sh
old mode 100644
new mode 100755
similarity index 50%
rename from maintainer/jenkins/ESPResSo-nightly-distcheck.sh
rename to maintainer/jenkins/distcheck.sh
index 120478684f9..5bf9fb6ff7b
--- a/maintainer/jenkins/ESPResSo-nightly-distcheck.sh
+++ b/maintainer/jenkins/distcheck.sh
@@ -1,23 +1,22 @@
-#!/bin/bash --login -ex
+#!/bin/bash --login
# Copyright (C) 2013 Olaf Lenz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-source maintainer/jenkins/common.sh
+DIR=`dirname $0`
+source $DIR/common.sh
-# clean up dir before build
-chmod -R u+w espresso-* || /bin/true
-git clean -fd
+# DEFAULTS
+[ ! -v distcheck_flags ] && distcheck_flags=""
+outp distcheck_flags
-bootstrap
-export LD_LIBRARY_PATH=/usr/local/cuda/lib64
-
-start "CONFIGURE"
-./configure
-end "CONFIGURE"
+# change into build dir
+pushd $builddir
start "DISTCHECK"
-make distcheck DISTCHECK_CONFIGURE_FLAGS="CPU_COUNT=2"
+cmd "make distcheck DISTCHECK_CONFIGURE_FLAGS=\"$distcheck_flags\"" || exit $?
end "DISTCHECK"
+
+popd
diff --git a/maintainer/jenkins/ESPResSo.sh b/maintainer/jenkins/doc.sh
old mode 100644
new mode 100755
similarity index 51%
rename from maintainer/jenkins/ESPResSo.sh
rename to maintainer/jenkins/doc.sh
index 21286230af6..b5a7e97485a
--- a/maintainer/jenkins/ESPResSo.sh
+++ b/maintainer/jenkins/doc.sh
@@ -1,25 +1,18 @@
-#!/bin/bash --login -e
+#!/bin/bash --login
# Copyright (C) 2013 Olaf Lenz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-BUILDDIR="$(pwd)"
-SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../.."
+DIR=`dirname $0`
+source $DIR/common.sh
-source maintainer/jenkins/common.sh
+# change into build dir
+pushd $builddir
-bootstrap
+start "DOC"
+cmd "make doc" || exit $?
+end "DOC"
-configure CPU_COUNT=4
-
-use_myconfig maxset
-
-start "BUILD"
-make -j 4
-end "BUILD"
-
-check
-doc
-dist
+popd
diff --git a/maintainer/run_multiconfig.sh b/maintainer/run_multiconfig.sh
new file mode 100644
index 00000000000..d990e447c9b
--- /dev/null
+++ b/maintainer/run_multiconfig.sh
@@ -0,0 +1,142 @@
+#!/bin/bash
+# Copyright (C) 2013,2014 Axel Arnold
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+# parallelism levels to check
+parallelisms="34core nompi"
+# default build dir
+builddir=build_multiconfig
+# continue after encountering an error
+contaftererror=n
+# number of processors to build on
+build_procs=8
+
+# parse options
+########################################################
+configure_params=""
+while test -n "$1"; do
+ case "$1" in
+ --myconfigs) myconfigs="$2"; shift ;;
+ --continue) contaftererror=y ;;
+ --build-dir) builddir="$2"; shift ;;
+ --build-procs) build_procs="$2"; shift ;;
+ --help) echo "usage: $0 [--myconfigs \"config1 config2...\"] [--continue] [--build-dir ] [--build-procs ] " 1>&2 ; exit 1 ;;
+ *) configure_params="$configure_params $1" ;;
+ esac
+ shift
+done
+
+# get the topdir
+########################################################
+topdir="`dirname $0`/.."
+
+sourcefile="$topdir/src/features.def"
+if ! test -f $sourcefile; then
+ echo "Cannot determine the source directory." 1>&2
+ echo "I am >$0< and think the source directory is >$topdir<." 1>&2
+ echo "However, >$sourcefile< is missing." 1>&2
+ exit 1
+fi
+
+# check the build directory
+########################################################
+
+if test -d "$builddir"; then
+ if ! test -f "$builddir/.multiconfig_stamp"; then
+ echo "Refusing to build in existing directory $builddir, which was not created by $0." 1>&2
+ echo "Remove the directory first." 1>&2
+ exit 1
+ fi
+else
+ mkdir -p "$builddir"
+fi
+touch "$builddir/.multiconfig_stamp"
+
+# make builddir absolute path
+builddir="`cd "$builddir"; pwd -P`"
+
+# get the configs we have
+########################################################
+
+if test -z "$myconfigs"; then
+ myconfigs=""
+ pushd "$topdir/maintainer/jenkins/configs"
+ for file in *.hpp; do
+ myconfigs="$myconfigs ${file%.hpp}"
+ done
+ popd
+fi
+
+# run the tests
+########################################################
+
+logdir="$builddir/log"
+mkdir -p "$logdir"
+
+export builddir
+export insource=false
+export build_procs
+export configure_params
+
+log="$logdir/configure"
+set -o pipefail
+bash "$topdir"/maintainer/jenkins/configure.sh 2>&1 | tee "$log"
+# don't put that into if, pipefail doesn't work then, and we don't really want to continue
+if test "$?" != 0 ; then
+ echo "Could not configure Espresso, see $log and $builddir/config.log for details" 1>&2
+ echo "Exiting..." 1>&2
+ exit 1
+fi
+
+for myconfig in $myconfigs; do
+ for parallelism in $parallelisms; do
+ log="$logdir/$myconfig-$parallelism"
+ export myconfig
+ export parallelism
+ # cleanup first to force rebuild
+ ( cd "$builddir" && make clean )
+
+ bash "$topdir"/maintainer/jenkins/build.sh 2>&1 | tee "$log"
+ if test "$?" != 0 ; then
+ buildfails="$buildfails $myconfig-$parallelism"
+ else
+ bash "$topdir"/maintainer/jenkins/check.sh 2>&1 | tee -a "$log"
+ if test "$?" != 0 ; then
+ checkfails="$checkfails $myconfig-$parallelism"
+ else
+ # failed tests are reported differently, figure out from the log
+ if grep -q "Not all test cases were successful!" "$log"; then
+ checkfails="$checkfails $myconfig-$parallelism"
+ fi
+ fi
+ fi
+ # save runtest.log
+ mv "$builddir/testsuite/runtest.log" "$log-runtest"
+ done
+done
+
+if test -n "$buildfails"; then
+ echo ""
+ echo "The following test configurations could not be compiled, see $logdir/ for details:"
+ for conf in $buildfails; do echo $conf; done
+fi
+if test -n "$checkfails"; then
+ echo ""
+ echo "The following test configurations could be compiled, but tests failed, see $logdir/ and $logdir/-runtest for details:"
+ for conf in $checkfails; do echo $conf; done
+fi
diff --git a/maintainer/travis/build.sh b/maintainer/travis/build.sh
new file mode 100755
index 00000000000..357731106f8
--- /dev/null
+++ b/maintainer/travis/build.sh
@@ -0,0 +1,147 @@
+#!/usr/bin/env bash
+# Copyright (C) 2014 Olaf Lenz
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+
+# HELPER FUNCTIONS
+
+# output value of env variables
+function outp {
+ for p in $*; do
+ echo " $p=${!p}"
+ done
+}
+
+# start a block
+function start {
+ echo "=================================================="
+ echo "START $1"
+ echo "=================================================="
+}
+
+# end a block
+function end {
+ echo "=================================================="
+ echo "END $1"
+ echo "=================================================="
+}
+
+# execute and output a command
+function cmd {
+ echo ">$1"
+ eval $1
+}
+
+
+# handle environment variables
+[ -z "$insource" ] && insource="true"
+[ -z "$srcdir" ] && srcdir=`pwd`
+[ -z "$configure_params" ] && configure_params=""
+[ -z "$configure_vars" ] && configure_vars=""
+[ -z "$with_mpi" ] && with_mpi="true"
+[ -z "$with_fftw" ] && with_fftw="true"
+[ -z "$with_tcl" ] && with_tcl="true"
+[ -z "$with_python_interface" ] && with_python_interface="false"
+[ -z "$myconfig" ] && myconfig="default"
+! $with_mpi && check_procs=1
+[ -z "$check_procs" ] && check_procs=4
+[ -z "$make_check" ] && make_check="true"
+
+if $insource; then
+ builddir=$srcdir
+elif [ -z "$builddir" ]; then
+ builddir=$srcdir/build
+fi
+
+outp insource srcdir builddir \
+ configure_params configure_vars with_mpi with_fftw \
+ with_tcl with_python_interface myconfig check_procs
+
+if ! $insource; then
+ if [ ! -d $builddir ]; then
+ echo "Creating $builddir..."
+ mkdir -p $builddir
+ fi
+fi
+
+# BOOTSTRAP
+start "BOOTSTRAP"
+$srcdir/bootstrap.sh || exit $?
+end "BOOTSTRAP"
+
+if ! $insource ; then
+ cd $builddir
+fi
+
+# CONFIGURE
+start "CONFIGURE"
+
+if $with_mpi; then
+ configure_params="--with-mpi $configure_params"
+ configure_vars="CXX=mpic++"
+else
+ configure_params="--without-mpi $configure_params"
+fi
+
+FFTW_HEADER=$srcdir/src/core/fftw3.h
+if $with_fftw; then
+ configure_params="--with-fftw $configure_params"
+else
+ configure_params="--without-fftw $configure_params"
+ echo "Not using FFTW => generating mock $FFTW_HEADER..."
+ echo "#error ERROR: fftw is not really present but used somewhere." \
+ > $FFTW_HEADER
+fi
+
+if $with_tcl; then
+ configure_params="--with-tcl $configure_params"
+else
+ configure_params="--without-tcl $configure_params"
+fi
+
+if $with_python_interface; then
+ configure_params="--with-python-interface $configure_params"
+else
+ configure_params="--without-python-interface $configure_params"
+fi
+
+cmd "$srcdir/configure $configure_params $configure_vars" || exit $?
+end "CONFIGURE"
+
+# BUILD
+start "BUILD"
+
+MYCONFIG_DIR=$srcdir/maintainer/jenkins/configs
+if [ "$myconfig" = "default" ]; then
+ echo "Using default myconfig."
+else
+ myconfig_file=$MYCONFIG_DIR/$myconfig.hpp
+ if [ ! -e "$myconfig_file" ]; then
+ echo "$myconfig_file does not exist!"
+ exit 1
+ fi
+ echo "Copying $myconfig.hpp to $builddir/myconfig.hpp..."
+ cp $myconfig_file $builddir/myconfig.hpp
+fi
+
+cmd "make" || exit $?
+
+end "BUILD"
+
+# CHECK
+if $make_check; then
+ start "TEST"
+
+ cmd "make check $make_params"
+ ec=$?
+ if [ $ec != 0 ]; then
+ cat $srcdir/testsuite/runtest.log
+ exit $ec
+ fi
+
+ end "TEST"
+fi
diff --git a/maintainer/update_header.sh b/maintainer/update_header.sh
index c20ae6b6d01..9127b99bbf9 100644
--- a/maintainer/update_header.sh
+++ b/maintainer/update_header.sh
@@ -1,4 +1,4 @@
-# Copyright (C) 2012,2013 Olaf Lenz
+# Copyright (C) 2012,2013,2014 Olaf Lenz
#
# This file is part of ESPResSo.
#
diff --git a/packages/mbtools/README b/packages/mbtools/README
index 668167ec738..020970a2035 100644
--- a/packages/mbtools/README
+++ b/packages/mbtools/README
@@ -70,7 +70,7 @@ set message_allowlist { }
####################################
# License and Copyright ###
####################################
-Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
diff --git a/packages/mbtools/analysis/analysis.tcl b/packages/mbtools/analysis/analysis.tcl
index ae6d567773f..2937a7a0ebe 100644
--- a/packages/mbtools/analysis/analysis.tcl
+++ b/packages/mbtools/analysis/analysis.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/boxl.tcl b/packages/mbtools/analysis/boxl.tcl
index 56ee40a1fe2..d652280ffcf 100644
--- a/packages/mbtools/analysis/boxl.tcl
+++ b/packages/mbtools/analysis/boxl.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/clusters.tcl b/packages/mbtools/analysis/clusters.tcl
index 7f9c2e47537..3abea9d86a6 100644
--- a/packages/mbtools/analysis/clusters.tcl
+++ b/packages/mbtools/analysis/clusters.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/cylinder_radius.tcl b/packages/mbtools/analysis/cylinder_radius.tcl
index fb5fc013373..ff6524aa163 100644
--- a/packages/mbtools/analysis/cylinder_radius.tcl
+++ b/packages/mbtools/analysis/cylinder_radius.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/density_profile.tcl b/packages/mbtools/analysis/density_profile.tcl
index cc10208816f..d69b99bb6ef 100644
--- a/packages/mbtools/analysis/density_profile.tcl
+++ b/packages/mbtools/analysis/density_profile.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/distance.tcl b/packages/mbtools/analysis/distance.tcl
index 4e5e395e040..65de01bb876 100644
--- a/packages/mbtools/analysis/distance.tcl
+++ b/packages/mbtools/analysis/distance.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/energy.tcl b/packages/mbtools/analysis/energy.tcl
index 843990bb74b..137e6d71fda 100644
--- a/packages/mbtools/analysis/energy.tcl
+++ b/packages/mbtools/analysis/energy.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/flipflop.tcl b/packages/mbtools/analysis/flipflop.tcl
index d515c51a80d..d4bac9b44c8 100644
--- a/packages/mbtools/analysis/flipflop.tcl
+++ b/packages/mbtools/analysis/flipflop.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/fluctuations.tcl b/packages/mbtools/analysis/fluctuations.tcl
index fb37722eb82..2bc97b10161 100644
--- a/packages/mbtools/analysis/fluctuations.tcl
+++ b/packages/mbtools/analysis/fluctuations.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/localheights.tcl b/packages/mbtools/analysis/localheights.tcl
index 09622e337a7..91e9bc44ca4 100644
--- a/packages/mbtools/analysis/localheights.tcl
+++ b/packages/mbtools/analysis/localheights.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/localorients.tcl b/packages/mbtools/analysis/localorients.tcl
index 47ab1e4fcce..a25796453fb 100644
--- a/packages/mbtools/analysis/localorients.tcl
+++ b/packages/mbtools/analysis/localorients.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/molcom.tcl b/packages/mbtools/analysis/molcom.tcl
index e4d0c3698c1..241833fbc91 100644
--- a/packages/mbtools/analysis/molcom.tcl
+++ b/packages/mbtools/analysis/molcom.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/molforce.tcl b/packages/mbtools/analysis/molforce.tcl
index c15ca936cb4..9c99a32434b 100644
--- a/packages/mbtools/analysis/molforce.tcl
+++ b/packages/mbtools/analysis/molforce.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/oop.tcl b/packages/mbtools/analysis/oop.tcl
index 6f5489e2ba1..4a765345aa0 100644
--- a/packages/mbtools/analysis/oop.tcl
+++ b/packages/mbtools/analysis/oop.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/pressure.tcl b/packages/mbtools/analysis/pressure.tcl
index 8cb1b59cb22..4c3f4e513ef 100644
--- a/packages/mbtools/analysis/pressure.tcl
+++ b/packages/mbtools/analysis/pressure.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/radial_density_profile.tcl b/packages/mbtools/analysis/radial_density_profile.tcl
index 330b8ebf6cb..67ad213b3b3 100644
--- a/packages/mbtools/analysis/radial_density_profile.tcl
+++ b/packages/mbtools/analysis/radial_density_profile.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/stray.tcl b/packages/mbtools/analysis/stray.tcl
index 1a4177b856e..c2f032b2215 100644
--- a/packages/mbtools/analysis/stray.tcl
+++ b/packages/mbtools/analysis/stray.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/stress_profile.tcl b/packages/mbtools/analysis/stress_profile.tcl
index b40e8d9b0b6..0e18c0a45ac 100644
--- a/packages/mbtools/analysis/stress_profile.tcl
+++ b/packages/mbtools/analysis/stress_profile.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/stress_tensor.tcl b/packages/mbtools/analysis/stress_tensor.tcl
index ba1a1b46396..340183e57dc 100644
--- a/packages/mbtools/analysis/stress_tensor.tcl
+++ b/packages/mbtools/analysis/stress_tensor.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/analysis/tiltangle.tcl b/packages/mbtools/analysis/tiltangle.tcl
index 028453a3fe9..7226a832826 100644
--- a/packages/mbtools/analysis/tiltangle.tcl
+++ b/packages/mbtools/analysis/tiltangle.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/packages/mbtools/doc/analysis.html b/packages/mbtools/doc/analysis.html
index ea0957147bb..891bfbe2d1a 100644
--- a/packages/mbtools/doc/analysis.html
+++ b/packages/mbtools/doc/analysis.html
@@ -1,6 +1,6 @@
Warning! <--"
- puts "----------------"
- puts "--> Could not find 'countBonds.tcl' which is required for execution!"
- puts "Aborting..."
- exit
- }
- }
- puts "Done."
- } elseif { [lsearch [info procs] "polyBlockWrite"] == -1 } {
- puts -nonewline "\n Function 'polyBlockWrite' is missing - trying to reload... "
- flush stdout
- if { [catch [source auxiliary.tcl]]!=0 } {
- if { [catch [source ./scripts/auxiliary.tcl]]!=0 && [catch [source $ESPRESSO_SCRIPTS/auxiliary.tcl]]!=0 } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> Could not find 'auxiliary.tcl' which is required for execution!"
- puts "Aborting..."
- exit
- }
- }
- puts "Done."
- } else {
- puts "Done (all required functions accounted for)."
- }
-
- # The internal names of the Deserno-variables from 'polygelSetup' will be stored in 'conf',
- # the corresponding counterparts for 'Espresso' in 'corr' at the same relative position within the lists;
- # 'spec' specifies any special properties one has to take into account when using the parameters
- puts -nonewline " Correlate parameter names... "
- flush stdout
- global conf corr spec iptq
- set conf [concat { prefix postfix seed startTime endTime deltaT
- integrationSteps saveResults saveConfig N_P N_CPP chargeDist
- val_CI N_Salt val_pS val_nS N_T boxLen subbox_1D
- skin rcut_P3M k_FENE r_FENE eps_LJ rcut_LJ alpha mesh ip
- Bjerrum Temp Gamma N_CR } ]
- # ...and correlate it with the ones from 'Espresso'
- # ('NA' = there's no implementation in 'Espresso')
- set corr [concat { NA NA NA NA NA time_step
- NA NA NA NA NA NA
- NA NA NA NA max_part box_l NA
- skin p3m_r_cut NA NA NA NA p3m_alpha p3m_mesh NA
- bjerrum temp gamma NA } ]
- # Note the special properties some 'Espresso' variables have:
- # 'ro' = read only; '3d' = 3D input required; 'OK' = nothing special
- set spec [concat { OK OK OK OK OK OK
- OK OK OK OK OK OK
- OK OK OK OK ro 3d OK
- OK OK OK OK OK OK OK 3d OK
- OK OK OK OK } ]
- set iptq "id pos type q"
- # sets which informations (out of pos|type|q|v|f) on the particles should be saved to disk ('Deserno2MD' only)
- puts "Done."
-
- puts -nonewline " Preparing global variables... "
- flush stdout
- # Determine which type-number should be assigned to monomers, counter-ions, salt-ions, ...
- global type_P type_CI type_S
- set type_P 0
- set type_CI 1
- set type_S 2
- # Determine which type-number should be assigned to the interactions
- global type_FENE type_bend
- set type_FENE 0
- set type_bend 1
- # Specify additional parameters for the potentials
- global pot_bend pot_LJ_sigma pot_LJ_shift pot_LJ_offset pot_ramp_cut pot_ramp_fmax
- set pot_bend 1
- set pot_LJ_sigma 1.0
- set pot_LJ_shift 0
- set pot_LJ_offset 0
- set pot_ramp_cut 1.3
- set pot_ramp_fmax 100
- # Define additional parameters which are not supplied by Deserno but have to be calculated later on
- global MPC N_CI N_pS N_nS N_S
- # MPC = [expr ($N_CPP-1)*$chargeDist+1] is the number of monomers per polymer chain
- # N_CI = [expr $N_P*$N_CPP/$val_CI] is the number of counterions
- # N_pS = [expr $N_Salt*$val_pS] is the number of positively charged salt ions
- # N_nS = [expr $N_Salt*$val_nS] is the number of negatively charged salt ions
- # N_S = [expr $N_pS+$N_nS] is the total number of salt ions
- # (not to be confused with N_Salt, which is the number of salt _molecules_)
- # Define auxiliary parameters
- global step foldCoord
- # step = amount of integration steps taken so far
- # (only used for MD2Deserno; has to be supplied by user)
- set foldCoord 0
- # foldCoord = decides whether to periodically fold the particle's coordinates before working with them;
- # this is important, since 'polygelSetup' by default creates an unfolded system of polymers,
- # centered in a box with boxlenght L, but extending outside, too.
- puts "Done."
-
- # Mark this initialization procedure as being completed
- global convertInitDone
- set convertInitDone 1
- puts " Initialization completed."
-}
-
-
-
-#############################################################
-# convertDeserno2MD #
-#############################################################
-
-proc convertDeserno2MD {origin destination} {
- # Initialize necessary parameters
- initConversion
-
- # Continue
- convertDeserno2MDmain "$origin" "$destination"
-}
-
-
-#############################################################
-# convertDeserno2MDmain #
-#############################################################
-
-proc convertDeserno2MDmain {origin destination} {
- # Check if initialization was done
- global convertInitDone
- if { $convertInitDone!=1 } {
- puts " !!! Warning !!! You're bypassing the initialization sequence! Continuing at your own risk..."
- }
-
- # Note that tcl requires to have the name of used global variables repeated here
- # => cross-check with 'initConversion' to make sure everything there matches an entry here
- global conf corr spec iptq
- global type_P type_CI type_S
- global type_FENE type_bend
- global pot_bend pot_LJ_sigma pot_LJ_shift pot_LJ_offset pot_ramp_cut pot_ramp_fmax
- global MPC N_CI N_pS N_nS N_S
- global foldCoord
-
-
- # Check the supplied file-names for existence and correctness
- if { ![ file exists $origin ] } {
- puts "Failed.\n "
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The file containing the Deserno-configuration could not be found!"
- puts "--> (You supplied: $origin)"
- puts "Aborting...\n"
- exit
- }
- if { $destination == "-1" } {
- puts " No output-file was given, everything will be submitted without saving to 'Espresso' only..."
- }
-
-
- # Open the input-file which must have the Deserno-format, e.g. created by 'polygelSetup'
- # looking like this:
- # Line defining a parameter --> '# Description............: '
- # Line defining coordinates --> ''
- # Line defining crosslinking parameters --> '# Description......: var = '
- # Line defining the crosslinks --> ''
- puts -nonewline " Preparing Deserno-configuration to be read from '[lindex [split $origin \"/\"] end]'... "
- flush stdout
- set in [open $origin "r"]
- puts "Done."
-
-
-# Import entries in Deserno-file
-#############################################################
-
- # Now get the file's entries and assign them to the corresponding variable
- puts " Conversion in progress..."
- flush stdout
- set i 0
- set j 0
- while { ![eof $in] } {
- # Consecutively load in each line of the input-file
- # and assign it to the names in 'conf'
- # (call it 'dummy' if you've run out of names)
- if {$i<[llength $conf]} {
- set tmp_var [lindex $conf $i]
- } else {
- set tmp_var "dummy"
- }
- eval global $tmp_var T$tmp_var
- eval gets $in $tmp_var
- # This trick allows to access the current variable's name by '$tmp_var'
- # while using the variable itself by 'eval ... $$tmp_var'
-
-# Submit Parameters
-#############################################################
-
- # If the current line starts with '#' it contains a parameter
- if { [eval string compare -length 1 \"$$tmp_var\" \"\#\"]==0 } then {
- if {$j==0} { set sep ":" } else { set sep "=" }
-
- # Check for consistency
- if { ![expr $i<[llength $conf]] } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> There are more parameters found in the file than specified in 'conf'!"
- puts "--> Supply more tags in 'conf', 'corr' and 'spec'!"
- puts "Aborting...\n"
- exit
- }
-
- # Split the line into its components:
- # Left part is the parameter's description -> e.g. 'Tprefix' (with 'T'='Text')
- eval set T$tmp_var \"[lindex [eval split \"$$tmp_var\" $sep] 0]: \"
- # Right part is the value of the parameter -> e.g. 'prefix' (as stored in 'conf')
- eval set $tmp_var \"[string trim [lindex [eval split \"$$tmp_var\" $sep] 1] ]\"
-
- # If possible, sent the value to 'Espresso':
- if { [string compare "[lindex $corr $i]" "NA"]!=0 } {
- # Intercept 'read-only' parameters until they are available in 'Espresso'
- if { [string compare "[lindex $spec $i]" "ro"]!=0 } {
- puts -nonewline " ---> Espresso <--- Submitting "
- eval puts -nonewline \"'$[concat "T$tmp_var"] [lindex $conf $i]' \"
- puts -nonewline "\t to "
- eval puts \"'[lindex $corr $i]' (= $$tmp_var).\"
-
- # some parameters require 3D, although Deserno specified only one
- if { [string compare "[lindex $spec $i]" "3d"]==0 } {
- setmd [lindex $corr $i] [eval concat \"$$tmp_var\"] \
- [eval concat \"$$tmp_var\"] [eval concat \"$$tmp_var\"]
- } else {
- # regular parameters don't make trouble ;-/
- setmd [lindex $corr $i] [eval concat \"$$tmp_var\"]
- }
- } else {
- # If read-only, the parameter is not submitted, but stored in a global variable
- # for further use in this or any other script
- puts -nonewline " Setting read-only variable "
- eval puts \"'$[concat "T$tmp_var"] [lindex $conf $i]' (= $$tmp_var).\"
- }
- } else {
- # Even if they're not sent to 'Espresso' the parameters are set up globally
- # for further use in this or any other script
- puts -nonewline " Assigning global variable "
- eval puts \"'$[concat "T$tmp_var"] [lindex $conf $i]' (= $$tmp_var).\"
- }
-
- # Goto next parameter in 'conf'
- incr i
-
- # Otherwise (i.e. if the current line read from $origin does not start with '#')
- # it's probably either the particles' coordinates or the crosslinks' configurations
- } else {
- # Switch from indirect variables (needed for the parameters) to direct access
- eval set tmp_var $$tmp_var
-
- # Distinguish between particles (second block) and crosslinks (fourth block)
- if {$j==0} {
- # Derive some additional parameters
- set MPC [expr ($N_CPP-1)*$chargeDist+1]
- set N_CI [expr $N_P*$N_CPP/$val_CI]
- set N_pS [expr $N_Salt*$val_pS]
- set N_nS [expr $N_Salt*$val_nS]
- set N_S [expr $N_pS+$N_nS]
-
-# Submit Interactions
-#############################################################
-
- # Create the bonded interactions
- puts " Preparing bonded interactions: "
- puts -nonewline " Lennard-Jones (eps=[format %4.2f $eps_LJ], "
- puts -nonewline "sigma=[format %4.2f $pot_LJ_sigma], rcut=[format %4.2f $rcut_LJ], "
- puts "shift=[format %4.2f $pot_LJ_shift], offset=[format %4.2f $pot_LJ_offset]) between: "
- puts -nonewline " Polymer-Polymer... "
- flush stdout
- inter $type_P $type_P lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts -nonewline "Polymer-Counterion... "
- flush stdout
- inter $type_P $type_CI lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts -nonewline "Polymer-Salt... "
- flush stdout
- inter $type_P $type_S lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts " "
- puts -nonewline " Counterion-Counterion... "
- flush stdout
- inter $type_CI $type_CI lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts -nonewline "Counterion-Salt... "
- flush stdout
- inter $type_CI $type_S lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts -nonewline "Salt-Salt... "
- flush stdout
- inter $type_S $type_S lennard-jones $eps_LJ $pot_LJ_sigma $rcut_LJ $pot_LJ_shift $pot_LJ_offset
- puts " "
-
- # Create the non-bonded interactions
- puts " Preparing non-bonded interactions: "
- puts " Type $type_FENE: FENE (k=[format %4.2f $k_FENE], r=[format %4.2f $r_FENE])... "
- inter $type_FENE fene $k_FENE $r_FENE
- puts " Type $type_bend: Cosine (pot_bend=$pot_bend)... "
- inter $type_bend angle $pot_bend
-
- puts " Interactions completed."
-
-# Submit Polymers
-#############################################################
-
- # Setting up the polymers
- puts -nonewline " Submitting $N_P polymers with $MPC monomers (of type $type_P) each... "
- flush stdout
- set old [expr 10*($N_P*$MPC)]
- set k 0
- for {set j 0} {$j<[expr $N_P*$MPC]} {incr j} {
- # Draw a status bar for every 10% of progress
- if { [expr $j*100]>=$old} {
- set old [expr $old + 10*($N_P*$MPC)]
- puts -nonewline ".,."
- flush stdout
- }
- # upon entering this part of the program we already have an unprocessed line stored in 'tmp_var'
- # (which we used to detect that it does not contain a parameter), hence we only load additional
- # lines once we've processed this one, i.e. for $j>0
- if { $j>0 } { gets $in tmp_var }
-
- # Submit the data to 'Espresso'
- if { $foldCoord == 1 } {
- part $j pos [expr [lindex $tmp_var 0] - floor([lindex $tmp_var 0] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 1] - floor([lindex $tmp_var 1] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 2] - floor([lindex $tmp_var 2] / $boxLen)*$boxLen]
- } else {
- part $j pos [lindex $tmp_var 0] [lindex $tmp_var 1] [lindex $tmp_var 2]
- }
- part $j v [lindex $tmp_var 3] [lindex $tmp_var 4] [lindex $tmp_var 5]
- part $j q [lindex $tmp_var 6]
- part $j type $type_P
-
- # Setting a bond between all $MPC monomers of the same polymer
- # => omit monomer 0, 1*$MPC, 2*$MPC,..., ($N_P-1)*$MPC
- if { [expr $j%$MPC]!=0 } {
- part $j bond $type_FENE [expr $j-1]
- # Note that Espresso stores bonds only with the particle of lower particle-number;
- # hence, a bond between 'a' and 'b' for 'a use the function 'countBonds' to get a tcl-list 'bonds'
- # which has '{0 a}' at particle 'b' as well!
- incr k
- }
- }
- puts ".,. $j particles total, $k of which bounded (by type $type_FENE)."
-
-# Submit remaining Particles
-#############################################################
-
- # Setting up some counterions
- puts -nonewline " Submitting $N_CI counterions (of type $type_CI)... "
- flush stdout
- set old [expr 10*$N_CI+100*($N_P*$MPC)]
- for {set j $j} {$j<[expr $N_CI+($N_P*$MPC)] } {incr j} {
- # Draw a status bar for every 10% of progress
- if { [expr $j*100]>=$old } {
- set old [expr $old + 10*$N_CI]
- puts -nonewline ".,."
- flush stdout
- }
- gets $in tmp_var
- # Submit the data to 'Espresso'
- if { $foldCoord == 1 } {
- part $j pos [expr [lindex $tmp_var 0] - floor([lindex $tmp_var 0] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 1] - floor([lindex $tmp_var 1] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 2] - floor([lindex $tmp_var 2] / $boxLen)*$boxLen]
- } else {
- part $j pos [lindex $tmp_var 0] [lindex $tmp_var 1] [lindex $tmp_var 2]
- }
- part $j v [lindex $tmp_var 3] [lindex $tmp_var 4] [lindex $tmp_var 5]
- part $j q [lindex $tmp_var 6]
- part $j type $type_CI
- }
- puts ".,. [expr $j-($N_P*$MPC)] particles with valency $val_CI total."
-
- # Setting up the salt-molecules
- puts -nonewline " Submitting $N_nS "
- for {set k 0} {$k<$val_nS} {incr k} {puts -nonewline "-"}
- puts -nonewline " and $N_pS "
- for {set k 0} {$k<$val_pS} {incr k} {puts -nonewline "+"}
- puts -nonewline " salt ions (of type $type_S)... "
- flush stdout
- set old [expr 10*$N_S+100*($N_CI+$N_P*$MPC)]
- for {set j $j} {$j<[expr $N_S+($N_CI+$N_P*$MPC)] } {incr j} {
- # Draw a status bar for every 10% of progress
- if { [expr $j*100]>=$old } {
- set old [expr $old + 10*$N_S]
- puts -nonewline ".,."
- flush stdout
- }
- gets $in tmp_var
- # Submit the data to 'Espresso'
- if { $foldCoord == 1 } {
- part $j pos [expr [lindex $tmp_var 0] - floor([lindex $tmp_var 0] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 1] - floor([lindex $tmp_var 1] / $boxLen)*$boxLen] \
- [expr [lindex $tmp_var 2] - floor([lindex $tmp_var 2] / $boxLen)*$boxLen]
- } else {
- part $j pos [lindex $tmp_var 0] [lindex $tmp_var 1] [lindex $tmp_var 2]
- }
- part $j v [lindex $tmp_var 3] [lindex $tmp_var 4] [lindex $tmp_var 5]
- part $j q [lindex $tmp_var 6]
- part $j type $type_S
- }
- puts ".,. [expr $j-($N_CI+$N_P*$MPC)] particles in $N_Salt molecules total."
-
-# Submit Crosslinks
-#############################################################
-
- # Deal with crosslinks between the polymer chains
- } elseif {$j==[expr ($N_CI+$N_P*$MPC)+$N_S] && [string length $tmp_var]>0} {
- # Connecting cross-linked monomers
- puts -nonewline " Crosslinking [expr 2*$N_CR] monomers... "
- flush stdout
- set old [expr 10*$N_CR+100*($N_S+$N_CI+$N_P*$MPC)]
- for {set j $j} {$j<[expr $N_CR+($N_S+$N_CI+$N_P*$MPC)]} {incr j} {
- # Draw a status bar for every 10% of progress
- if { [expr $j*100]>=$old } {
- set old [expr $old + 10*$N_CR]
- puts -nonewline ".,."
- flush stdout
- }
- # upon entering this part of the program we already have an unprocessed line stored in 'tmp_var'
- # (which we used to detect that it does not contain a parameter), hence we only load additional
- # lines once we've processed this one, i.e. for $j>($N_S+$N_CI+$N_P*$MPC)
- if { $j>[expr $N_S+$N_CI+$N_P*$MPC] } { gets $in tmp_var }
-
- # Crosslink particles
- part [lindex $tmp_var 0] bond $type_FENE [lindex $tmp_var 1]
- # Note that Espresso stores bonds only with the particle of lower particle-number;
- # hence, a bond between 'a' and 'b' for 'a use the function 'countBonds' to get a tcl-list 'bonds'
- # which has '{0 a}' at particle 'b' as well!
- }
- puts ".,. [expr $j-($N_S+$N_CI+$N_P*$MPC)] additional bonds (of type $type_FENE) created."
- } elseif {[string length $N_CR]==0 } {
- set N_CR 0
- }
- }
- }
- # Finish up the conversion part by closing the input-file
- close $in
- puts " Conversion completed."
-
-
-# Write output file
-#############################################################
-
- # Save all converted configurations, parameters, and interactions to $destination
- # using AxA's blockfile-format for 'Espresso'; skip if user specified "-1" as file-name
- if { $destination != "-1" } {
- # The converted configurations should be compressed on-the-fly using
- # 'set f [open "|gzip -c - >$destination" w]' for output, allowing later usage with
- # 'set f [open "|gzip -cd $destination" r]' to read it in
- # This is done in 'polyBlockWrite' which writes all we've done so far to a 'Espresso'-compatible file
- puts -nonewline " Saving all configurations in 'Espresso'-format to '[lindex [split $destination \"/\"] end]'... "
- flush stdout
- foreach j $corr {
- if { $j != "NA" } { lappend tmp_corr $j }
- }
- polyBlockWrite $destination $tmp_corr $iptq
- puts "Done "
-
- } else {
- puts " Skipping to save converted configurations: Nothing will be written to disk, only 'Espresso' will have them!"
- }
-
-
- # End this script
- puts " Function successfully completed. Returning control to calling script..."
-}
-
-
-
-
-#############################################################
-# convertMD2Deserno #
-#############################################################
-
-proc convertMD2Deserno {origin destination} {
- # Initialize necessary parameters
- initConversion
-
- # Set parameters which cannot be determined from 'Espresso' or from $origin
- global conf
- foreach i $conf { global $i }
- global step
- set prefix AA0000
- set postfix 0
- set seed -1
- set startTime -1
- set endTime -1
- set integrationSteps -1
- set saveResults -1
- set saveConfig -1
- set subbox_1D -1
- set ip -1
- set step -1
-
- # Continue
- convertMD2DesernoMain "$origin" "$destination"
-}
-
-
-#############################################################
-# convertMD2DesernoMain #
-#############################################################
-
-proc convertMD2DesernoMain {origin destination} {
- # Check if initialization was done
- global convertInitDone
- if { $convertInitDone!=1 } {
- puts " !!! Warning !!! You're bypassing the initialization sequence! Continuing at your own risk..."
- }
-
- # Note that tcl requires to have the name of used global variables repeated here
- # => cross-check with 'initConversion' to make sure everything there matches an entry here
- global conf corr spec iptq
- foreach i $conf { global $i }
- global type_P type_CI type_S
- global type_FENE type_bend
- global pot_bend pot_LJ_sigma pot_LJ_shift pot_LJ_offset pot_ramp_cut pot_ramp_fmax
- global MPC N_CI N_pS N_nS N_S
- global step
-
-
-# Import entries from file
-#############################################################
-
- # If the user specified '-1' for $origin, then there is no input-file and everything is directly taken from Espresso
- if { [string compare "$origin" "-1"]==0 } {
- puts " No input-file was specified, let's hope that all required informations are accessible from 'Espresso'!"
- } else {
- # Open the (compressed) input-file which is expected to contain a configuration in 'Espresso'-blockfile-format
- puts -nonewline " Preparing 'Espresso'-configuration to be read from '[lindex [split $origin \"/\"] end]'... "
- flush stdout
- if { [string compare [lindex [split $origin "."] end] "gz"]==0 } {
- set in [open "|gzip -cd $origin" "r"]
- } else {
- set in [open "$origin" "r"]
- }
- puts "Done."
-
- # Now get the file's entries
- puts " Reading content of '[lindex [split $origin \"/\"] end]' (this may take a while)... "
- while {[blockfile $in read auto] != "eof" } {}
- puts " Got coordinates for [expr [setmd max_part] + 1] particles total..."
- puts " Got all the bonds between particles..."
- puts " Got all the interactions..."
- close $in
- puts " ... and closed the file."
- }
-
-
-# Get the rest from 'tcl-md'
-#############################################################
-
- # Now everything should either have been loaded from the blockfile $origin into 'Espresso'
- # or (in case $origin==-1) it was already there
- puts " Gathering informations from 'Espresso'... "
- flush stdout
-
- # Load everything useful out of 'Espresso'
- puts -nonewline " Getting"
- foreach i $corr j $conf {
- if { [string compare "$i" "NA"]!=0 } {
- puts -nonewline " $i/"
- flush stdout
- set $j [lindex [setmd $i] 0]
- puts -nonewline "$j ."
- }
- }
-
- # Load interactions parameters:
- puts "..\n Load interactions parameters..."
- flush stdout
- set tmp_FENE 0
- set tmp_LJ 0
- set tmp_int [inter]
- for {set i 0} {$i<[llength $tmp_int]} {incr i} {
- set tmp_var [lindex $tmp_int $i]
- # FENE,...
- if { [string compare [lindex $tmp_var 1] "FENE"]==0 } {
- if { $tmp_FENE==0 } {
- puts -nonewline " Setting FENE-parameters "
- set k_FENE [lindex $tmp_var 2]
- puts -nonewline " (k_FENE = $k_FENE, "
- flush stdout
- set r_FENE [lindex $tmp_var 3]
- puts -nonewline "r_FENE = $r_FENE)... "
- set tmp_FENE 1
- puts "Done."
- } elseif { $k_FENE!=[lindex $tmp_var 2] || $r_FENE!=[lindex $tmp_var 3] } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> FENE-interaction parameters must be constant for all bonds!"
- puts "--> (Found $k_FENE=k_FENE=[lindex $tmp_var 2] and $r_FENE=r_FENE=[lindex $tmp_var 3])"
- puts "Aborting...\n"
- exit
- }
- # ...and Lennard-Jones
- } elseif {[string compare [lindex $tmp_var 2] "lennard-jones"]==0} {
- if { $tmp_LJ==0 } {
- puts -nonewline " Setting Lennard-Jones-parameters "
- set eps_LJ [lindex $tmp_var 3]
- puts -nonewline " (eps_LJ = $eps_LJ, "
- set rcut_LJ [lindex $tmp_var 5]
- puts -nonewline "rcut_LJ = $rcut_LJ)... "
- set tmp_LJ 1
- puts "Done."
- } elseif { $eps_LJ!=[lindex $tmp_var 3] || $rcut_LJ!=[lindex $tmp_var 5] } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> Lennard-Jones parameters must be constant for all particles!"
- puts "--> (Found $eps_LJ=eps_LJ=[lindex $tmp_var 3] and $rcut_LJ=rcut_LJ=[lindex $tmp_var 5])"
- puts "Aborting...\n"
- exit
- }
- }
- }
- puts " Done with interactions."
-
- # Load all particle data
- puts -nonewline " Getting informations on any particle... "
- flush stdout
- set part_all [part]
- set N_T [llength $part_all]
- puts "Done (got $N_T particles)."
-
- # Everything should be back in this function now
- puts " Gathering completed."
-
-
-# Re-build network structure
-#############################################################
-
- # Now create a tcl-list with all bonds in it
- set bonds [countBonds $part_all]
-
-
- # Get an idea of the network structure
- puts " Analyzing network structure... "
-
- # In a polymer melt the monomers on a chain have usually two bonds while their ends have just one;
- # in a end-to-end-linked network the ends are cross-linked, too, so that their new partners have three bonds
- puts -nonewline " Checking number of bonds on $N_T particles... "
- flush stdout
- set part_end {}
- set part_lin {}
- set part_crs {}
- set old [expr 10*$N_T]
- for {set i 0} {$i<$N_T} {incr i} {
- # Draw a status bar for every 10% of progress
- if { [expr $i*100]>=$old } {
- set old [expr $old + 10*$N_T]
- puts -nonewline ".,."
- flush stdout
- }
- # Check if the current particle has any cross-links (e.g. counter-ions have not).
- # Note, that $bonds contains an entry for every particle (i.e. the particle_number),
- # hence the number of bonds is -1 smaller than the length of that entry.
- if { [llength [lindex $bonds $i]]>1 } {
- # Check the number of cross-links:
- switch [llength [lindex $bonds $i]] {
- 2 { # 1 bond: particle is the end of a polymer chain
- lappend part_end $i }
- 3 { # 2 bonds: particle is monomer in a chain
- lappend part_lin $i }
- 4 { # 3 bonds: particle also has a cross-link to another chain
- lappend part_crs $i }
- default {
- # 4+ bonds??? => hmm... too much?!
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> Current particle [lindex [lindex $bonds $i] 0] (found at index $i) has too many bonds!"
- puts "--> (Got: [expr [llength [lindex $bonds $i]]-1]; expected: 1-3)"
- puts "Aborting...\n"
- exit
- }
- }
- } else {
- # no bonds, no cross-links => must be something else (counter-ion, etc.), but must _not_ be a monomer
- if { [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] type]]!=$type_P } {
- lappend part_else $i
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts -nonewline "--> Current particle [lindex [lindex $bonds $i] 0] (found at index $i) "
- puts "is a loose monomer (type $type_P) without any bonds!"
- puts "--> (Stats: [lindex $part_all $i])"
- puts "Aborting...\n"
- exit
- }
- }
- }
- puts ".,. found [llength $part_end] ends, [llength $part_lin] linear bonds, [llength $part_crs] cross-links."
-
-
-# Identify Polymer Melt
-#############################################################
-
- # If 'part_crs' is empty, there's no network but only a melt; hence, the polymer chains are easy to identify
- if { [llength $part_crs]==0 } {
- puts " => polymer melt/solution detected."
- set N_CR 0
- puts -nonewline " Identifying polymer chains... "
- flush stdout
- set tmp_CPP 0
- set tmp_cD 0
- set tmp_NP 0
- set tmp_MPC 0
- set old_i 0
- set old_e [llength $part_end]
- set old [expr 10*$old_e]
-
- # loop all particles found having only one bond, because these are the chains' ends
- foreach i $part_end {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- # make sure that current end is not the end of a previously reconstructed chain
- set tmp_var 0
- if { $tmp_NP>0} {
- for {set j 0} {$j<[llength $polymer_chains]} {incr j} {
- if { [expr [lindex [lindex $polymer_chains $j] 0]==$i] || \
- [expr [lindex [lindex $polymer_chains $j] end]==$i] } {
- set tmp_var 1
- }
- }
- }
- if { $tmp_var==1 } continue
-
- # build the chain following the bond information stored with each particle
- set chains [lindex [lindex $bonds $i] 0]
- set tmp_CPP_k 0
- set tmp_cD_k -1
- set tmp_MPC_k 0
- while { $tmp_MPC_k<$N_T } {
- set j [lindex $chains end]
- set j_bond [lrange [lindex $bonds $j] 1 end]
- set j_bond_nr 0
- # is current particle charged? => keep track of the amount of charges and the distances between them
- if { [lindex [lindex $part_all $j] [findPropPos [lindex $part_all $j] q]]!=0 } {
- if { [expr $tmp_cD_k+1]==$tmp_cD || $tmp_cD_k==-1 } {
- incr tmp_CPP_k
- set tmp_cD_k 0
- } elseif { $tmp_cD==0 } {
- incr tmp_CPP_k
- set tmp_cD [expr $tmp_cD_k+1]
- set tmp_cD_k 0
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The distance between charges on a chain must be constant!"
- puts "--> (Found a chain with distances $tmp_cD and $tmp_cD_k)"
- puts "Aborting...\n"
- exit
- }
- } elseif { $tmp_cD_k>-1 } { incr tmp_cD_k }
- # agglomerate the monomers
- if { [llength $j_bond]==1 } {
- if { $tmp_MPC_k>0 } {
- # last particle -> wrap up evaluation
- incr tmp_MPC_k
- break
- }
- } else {
- # check which of the bonds lead "forward" on the chain
- if { [lindex [lindex $j_bond 0] 1]==[lindex $chains end-1] } {
- set j_bond_nr 1
- }
- }
- lappend chains [lindex [lindex $j_bond $j_bond_nr] 1]
- incr tmp_MPC_k
- }
-
- # check for consistency
- if { $tmp_CPP_k!=$tmp_CPP } {
- if { $tmp_CPP==0 } {
- set tmp_CPP $tmp_CPP_k
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The amount of charges on a chain must be constant!"
- puts "--> (Found chains with $tmp_CPP and $tmp_CPP_k)"
- puts "Aborting...\n"
- exit
- }
- }
- if { $tmp_MPC_k==$tmp_MPC } {
- lappend polymer_chains $chains
- incr tmp_NP
- } elseif { [lindex $part_end 0]==$i} {
- set tmp_MPC $tmp_MPC_k
- lappend polymer_chains $chains
- incr tmp_NP
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The number of monomers on all chains must be constant!"
- puts "--> (Found chains with $tmp_MPC and $tmp_MPC_k)"
- puts "Aborting...\n"
- exit
- }
- }
- set N_CPP $tmp_CPP
- set chargeDist $tmp_cD
- set N_P $tmp_NP
- set MPC $tmp_MPC
- puts -nonewline ".,. reconstructed $N_P chains with $MPC monomers each "
- puts -nonewline "($N_CPP charged with distance $chargeDist"
- if { $chargeDist>0 } {
- puts -nonewline ", like "
- for {set j 0} {$j<3} {incr j} {
- puts -nonewline "c"
- for {set i 0} {$i<[expr $chargeDist-1]} {incr i} { puts -nonewline "." }
- }
- puts -nonewline "c etc."
- }
- puts ")."
-
-
-# Identify cross-linked Network
-#############################################################
-
- # If 'part_end' is empty, this is an end-to-end cross-linked network,
- # where any of the three partners in 'part_end' may be one of the chain's end;
- # therefore, one has to have a closer look
- } elseif { [llength $part_end]==0 } {
- puts " => end-to-end crosslinked network detected."
- puts " (Note that the reconstruction will only be successful if the chains are aligned consecutively!)"
- puts -nonewline " Attempting to identify polymer chains... "
- flush stdout
- set tmp_CPP 0
- set tmp_cD 0
- set tmp_NP 0
- set tmp_MPC 0
- set tmp_NCR 0
- set old_i 0
- set old_e [expr [llength $part_crs]+[llength $part_lin]]
- set old [expr 10*$old_e]
-
- # loop all particles with at least two bonds
- for {set i 0} {$i<$old_e} {incr i} {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- # get the bonding informations on the current particle & check if they comply with the rules
- set tmp_bond [lindex $bonds $i]
- set tmp_current [lindex $tmp_bond 0]
- if {[llength $tmp_bond]<2} {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> An end-to-end crosslinked network may only be reconstructed"
- puts "--> if the chains are aligned consecutively!"
- puts -nonewline "--> (Expected $old_e particles with bonds, but found particle $tmp_current "
- puts "(at index $i) having none)"
- puts "Aborting...\n"
- exit
- }
- set tmp_bond [lrange $tmp_bond 1 end]
-
- # build the chain following the bond information stored with each particle
- # and making use of the requirement that all chains have to be aligned
- set tmp_end -1
- for {set j 0} {$j<[llength $tmp_bond]} {incr j} {
- set tmp_partner [lindex [lindex $tmp_bond $j] 1]
- if { $tmp_partner==[expr $tmp_current-1] } {
- # bonding partner is left neighbour => append $i to the chain
- lappend chains $tmp_current
- incr tmp_MPC_k
- # is current particle charged? => keep track of the amount of charges and the distances between them
- if { [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] q]]!=0 } {
- if { [expr $tmp_cD_k+1]==$tmp_cD || $tmp_cD_k==-1 } {
- incr tmp_CPP_k
- set tmp_cD_k 0
- } elseif { $tmp_cD==0 } {
- incr tmp_CPP_k
- set tmp_cD [expr $tmp_cD_k+1]
- set tmp_cD_k 0
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The distance between charges on a chain must be constant!"
- puts "--> (Found a chain with distances $tmp_cD and $tmp_cD_k)"
- puts "Aborting...\n"
- exit
- }
- } elseif { $tmp_cD_k>-1 } { incr tmp_cD_k }
- } elseif { $tmp_partner!=[expr $tmp_current+1] } {
- # bonding partner is not on this chain => append to crosslinks
- # if the current particle is at the end of a chain
- if { [llength $tmp_bond]==2 } {
- set tmp_end $j
- if {$tmp_partner < $tmp_current} {
- lappend cross "{$tmp_partner $tmp_current}"
- } else {
- lappend cross "{$tmp_current $tmp_partner}"
- }
- incr tmp_NCR
- }
- }
- }
- # if current particle is at the end of a chain,
- # check if it's the left one => in that case open a new chain
- if {$tmp_end > -1} {
- set tmp_partner [lindex [lindex $tmp_bond [expr $tmp_end*(-1)+1]] 1]
- if { $tmp_partner==[expr $tmp_current+1] } {
- # left end => new chain
- set chains $tmp_current
- set tmp_MPC_k 1
- # is current particle charged? => keep track of the amount of charges and the distances between them
- if { [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] q]]!=0 } {
- set tmp_CPP_k 1
- set tmp_cD_k 0
- } else {
- set tmp_CPP_k 0
- set tmp_cD_k -1
- }
- } else {
- # right end => wrap up evaluation of this chain by checking for consistency
- if { $tmp_CPP_k!=$tmp_CPP } {
- if { $tmp_CPP==0 } {
- set tmp_CPP $tmp_CPP_k
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The amount of charges on a chain must be constant!"
- puts "--> (Found chains with $tmp_CPP and $tmp_CPP_k)"
- puts "Aborting...\n"
- exit
- }
- }
- if { $tmp_MPC_k==$tmp_MPC } {
- lappend polymer_chains $chains
- incr tmp_NP
- } elseif { $tmp_MPC==0 && $tmp_NP==0 } {
- set tmp_MPC $tmp_MPC_k
- lappend polymer_chains $chains
- incr tmp_NP
- } else {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The number of monomers on all chains must be constant!"
- puts "--> (Found chains with $tmp_MPC and $tmp_MPC_k)"
- puts "Aborting...\n"
- exit
- }
- }
- }
- }
- set N_CPP $tmp_CPP
- set chargeDist $tmp_cD
- set N_P $tmp_NP
- set MPC $tmp_MPC
- set N_CR $tmp_NCR
- puts -nonewline ".,. reconstructed $N_P chains with $MPC monomers each ($N_CPP charged with distance $chargeDist"
- if { $chargeDist>0 } {
- puts -nonewline ", like "
- for {set j 0} {$j<3} {incr j} {
- puts -nonewline "c"
- for {set i 0} {$i<[expr $chargeDist-1]} {incr i} { puts -nonewline "." }
- }
- puts -nonewline "c etc."
- }
- puts "), found $N_CR crosslinks."
- }
- puts " Analysis completed."
-
-
-# Derive remaining particle informations
-#############################################################
-
- # Determine N_CPP, chargeDist, val_CI, N_Salt, val_pS, val_nS
- puts " Analyzing particle data..."
-
- # Determine val_CI, N_Salt, val_pS, val_nS
- puts -nonewline " Determining valency of counter-ions and salt-molecules... "
- flush stdout
- set tmp_CI 0
- set tmp_valCI 0
- set tmp_Salt 0
- set tmp_pS 0
- set tmp_nS 0
- set old_i 0
- set old_e [llength $part_else]
- set old [expr 10*$old_e]
-
- # loop all remaining particles with no bonds
- foreach i $part_else {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- set tmp_if [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] type]]
- if { $tmp_if==$type_CI } {
- # it's a counter-ion
- set tmp_var [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] q]]
- if { $tmp_CI==0} {
- set tmp_valCI $tmp_var
- } elseif { $tmp_valCI!=$tmp_var } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The valency of the counter-ions must be constant!"
- puts "--> (Found some with $tmp_valCI and others with $tmp_var)"
- puts "Aborting...\n"
- exit
- }
- incr tmp_CI
- } elseif { $tmp_if==$type_S } {
- # it's a salt-molecule
- set tmp_var [lindex [lindex $part_all $i] [findPropPos [lindex $part_all $i] q]]
- if { $tmp_var>0 } { set tmp_S tmp_pS } else { set tmp_S tmp_nS }
- if { [eval expr $$tmp_S==0] } {
- eval set $tmp_S $tmp_var
- } elseif { [eval expr $$tmp_S!=$tmp_var] } {
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts "--> The valency of the salt ions must be constant!"
- eval puts "--> (Found some with $$tmp_S and others with $tmp_var)"
- puts "Aborting...\n"
- exit
- }
- incr tmp_Salt
- } else {
- # neither salt nor counter-ion but having no bonds at all??? => hmm... something's wrong?!
- puts "Failed.\n"
- puts "----------------"
- puts "--> Warning! <--"
- puts "----------------"
- puts -nonewline "--> Found unbound particle $i which is neither counter-ion ($type_CI) "
- puts "nor salt ($type_S), but of type $tmp_if!"
- puts "--> Confused: What shall I do with it?"
- puts "--> (Stats: [lindex $part_all $i])"
- puts "Aborting...\n"
- exit
- }
- }
- set N_CI $tmp_CI
- set val_CI $tmp_valCI
- set N_Salt $tmp_Salt
- set val_pS $tmp_pS
- set val_nS [expr (-1)*$tmp_nS]
- puts -nonewline ".,. found $N_CI counter-ions with valency $val_CI and $N_Salt salt-molecules"
- if { $val_nS>0 || $val_pS>0} {
- puts -nonewline " with valency "
- for {set k 0} {$k<$val_nS} {incr k} {puts -nonewline "-"}
- puts -nonewline " or "
- for {set k 0} {$k<$val_pS} {incr k} {puts -nonewline "+"}
- }
- puts "."
-
-
- # So much for the particle data
- puts " Analysis completed."
-
-
-# Write output file
-#############################################################
-
- # Open output-file
- puts -nonewline " Preparing converted configurations to be written to '[lindex [split $destination \"/\"] end]'... "
- flush stdout
- set out [open $destination "w"]
- puts "Done."
-
- # Now write all we've done so far to a Deserno-compatible file
- puts " Saving all configurations in Deserno-format to disk... "
- puts -nonewline " Writing file header... "
- flush stdout
- puts $out "# Praefix-String......................: $prefix"
- puts $out "# Postfix-Nummer......................: $postfix"
- puts $out "# Zufallszahlen-Seed..................: $seed"
- puts $out "# Physikalische Zeit..................: [expr $startTime+$step*$deltaT]"
- puts $out "# Physikalische Endzeit...............: $endTime"
- puts $out "# Diskretisierungs-Schritt............: $deltaT"
- puts $out "# Anzahl der Integrationsschritte.....: $integrationSteps"
- puts $out "# Messergebnisse herausschreiben......: $saveResults"
- puts $out "# Konfigurationen herausschreiben.....: $saveConfig"
- puts $out "# Anzahl der Polymere.................: $N_P"
- puts $out "# Ladungen pro Polymer................: $N_CPP"
- puts $out "# Ladungsabstand......................: $chargeDist"
- puts $out "# Valenz der Polymer-Gegenionen.......: $val_CI"
- puts $out "# Anzahl der Salzmolekuele............: $N_Salt"
- puts $out "# Valenz der positiven Salzionen......: $val_pS"
- puts $out "# Valenz der negativen Salzionen......: $val_nS"
- puts $out "# Teilchenzahl........................: $N_T"
- puts $out "# Boxlaenge...........................: $boxLen"
- puts $out "# Subboxen pro Boxlaenge..............: $subbox_1D"
- puts $out "# Skin................................: $skin"
- puts $out "# Ortsraum-Cutoff.....................: $rcut_P3M"
- puts $out "# k-FENE..............................: $k_FENE"
- puts $out "# r-FENE..............................: $r_FENE"
- puts $out "# epsilon-LJ..........................: $eps_LJ"
- puts $out "# LJ-Cutoff...........................: $rcut_LJ"
- puts $out "# alpha...............................: $alpha"
- puts $out "# FFT-Mesh............................: $mesh"
- puts $out "# Gitter-ip...........................: $ip"
- puts $out "# Bjerrum-Laenge......................: $Bjerrum"
- puts $out "# Temperatur..........................: $Temp"
- puts $out "# Gamma...............................: $Gamma"
- puts "Done."
-
- # Note the format requirements:
- # 1. Monomers MMMM MMMM MMMM MMMM | ++++ ++++ ++++ | ++++ ++++ ++++ | ---- ---- ----
- # 2. Counter-ions First, N_P polymer | Second, | Third, | Last,
- # 3. Positive Salt chains with MPC | N_CI | val_pS*N_Salt | val_nS*N_Salt
- # 4. Negative Salt monomers each | counter-ions | positive salt | negative salt
-
- # Write out the polymer chains
- set old_i 0
- set old_e [expr $N_P*$MPC]
- set old [expr 10*$old_e]
- puts -nonewline " Writing $N_P polymer chains with $MPC monomers and $N_CPP charges each... "
- flush stdout
- foreach i $polymer_chains {
- # The Deserno-file-format requires that first the monomer's data has to be written in the order of the chains
- foreach j $i {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- # write monomer
- set tmp_part [lindex $part_all $j]
- set tmp_var [findPropPos $tmp_part pos]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+1]]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+2]]\t"
- set tmp_var [findPropPos $tmp_part v]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+1]]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+2]]\t"
- set tmp_var [findPropPos $tmp_part q]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\n"
- }
- }
- puts ".,. completed."
-
- # Write out any remaining counter-ions or salt molecules
- puts -nonewline " Writing [expr $N_CPP*$N_P/$val_CI] counter-ions and $N_Salt salt molecules... "
- flush stdout
- set old_i 0
- set old_e [expr 3*[llength $part_else]]
- set old [expr 10*$old_e]
- for {set j 0} {$j<3} {incr j} {
- # The Deserno-file-format requires that after the monomer's datas
- # first the counter-ions, then the positive salt ions, and last the negative salt ions
- # have to be written; hence we'll pass this loop three times... *sigh*
- foreach i $part_else {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- # write particles
- set tmp_part [lindex $part_all $i]
- set tmp_if [lindex $tmp_part [findPropPos $tmp_part type]]
- set tmp_fi [lindex $tmp_part [findPropPos $tmp_part q]]
- set tmp_d 0
- if { $j==0 && $tmp_if==$type_CI } { set tmp_d 1 }
- if { $j==1 && $tmp_if==$type_S && $tmp_fi>0 } { set tmp_d 1 }
- if { $j==2 && $tmp_if==$type_S && $tmp_fi<0 } { set tmp_d 1 }
- if { $tmp_d==1 } {
- set tmp_var [findPropPos $tmp_part pos]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+1]]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+2]]\t"
- set tmp_var [findPropPos $tmp_part v]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+1]]\t"
- puts -nonewline $out "[lindex $tmp_part [expr $tmp_var+2]]\t"
- set tmp_var [findPropPos $tmp_part q]
- puts -nonewline $out "[lindex $tmp_part $tmp_var]\n"
- }
- }
- }
- puts ".,. completed."
-
- # Write out cross-links (if any)
- if { $N_CR>0 } {
- puts -nonewline " Writing $N_CR cross-links... "
- flush stdout
- puts $out "# Number of Crosslinks.........: N_CR = $N_CR"
- set old_i 0
- set old_e $N_CR
- set old [expr 10*$old_e]
- foreach i $cross {
- # draw a status bar for every 10% of progress
- if { [expr $old_i*100]>=$old } {
- set old [expr $old + 10*$old_e]
- puts -nonewline ".,."
- flush stdout
- }
- incr old_i
-
- # write cross-links
- puts $out "[lindex $i 0]\t[lindex $i 1]"
- }
- puts ".,. completed."
- }
-
- # Done
- puts " Saving completed."
-
-
- # Now finish up by closing the file
- puts -nonewline " Closing output file... "
- flush stdout
- close $out
- puts "Done."
- puts " Function successfully completed. Returning control to calling script..."
-}
diff --git a/scripts/obsolete/pov.tcl b/scripts/obsolete/pov.tcl
deleted file mode 100644
index 15bd533d376..00000000000
--- a/scripts/obsolete/pov.tcl
+++ /dev/null
@@ -1,192 +0,0 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
-# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
-# Max-Planck-Institute for Polymer Research, Theory Group
-#
-# This file is part of ESPResSo.
-#
-# ESPResSo is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# ESPResSo is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-proc writepov {file {folded "no"} {boxopt "no"} {render "no"} {rotate "-10 22.5 0"} {nofold_list 0} } {
-#writes the current configuration in pov-ray format
-#file is the name of the output
-#use -folded if you want folded coordinates
-#use -box if you want to output the box
-#use -render if you want to render the pov-ray file
-#render contains a vector by which the entire configuration is rotated
-#nofold_list contains a list of types that should not be folded if 'folded' is set to -folded
- if {$folded == "-folded"} {
- set de "folded"
- } else {set de "pos"}
- if {[file exists "$file"] } {
- error "ERROR: $file already exists; please use a different file name!\nAborting..."
- } else {
- set f [open $file "w"]
- }
- set box [setmd box_l]
-
- #write background, camera, lighting
- puts $f "background {color rgb <0.98,0.98,0.98>}"
- puts $f "light_source \{\n<1000,1000,-100>\ncolor rgb 1\n\}"
- puts $f "light_source \{\n<-1000,1000,-100>\ncolor rgb 1\n\}"
- puts $f "camera \{\northographic\nlocation <[expr [lindex $box 0]*0.5],\
- [expr [lindex $box 1]*0.5],-[expr [lindex $box 2]*1.5]>\n\
- look_at <[expr [lindex $box 0]*0.5],[expr [lindex $box 1]*0.5],[expr [lindex $box 2]*0.5]>\n\}"
-
- #write atoms and bonds
- set radius [expr [lindex $box 0]*0.004]
- set b_radius [expr $radius*0.25]
- lappend color <0.36,0.57,0.31> <0.66,0.0,0.12> <0.20,0.32,0.53>
- set mp [setmd max_part]
- set texture "texture { finish { ambient 0.000 diffuse 0.650 phong 0.1 phong_size 40.000 specular 0.500 } }"
- puts $f "union \{"
- for {set p 0} { $p <= $mp} {incr p} {
- set type [part $p print type]
- # if {$type==0 || $type==1} {set de "pos"} else {set de "folded"}
- if {$nofold_list != 0} { if {[lsearch $nofold_list $type] != -1 } {set de "pos"} else {set de "folded"} }
- set pos [part $p print $de]
- puts $f "\/\/ $p POS\nsphere \{\n<[lindex $pos 0],[lindex $pos 1],[lindex $pos 2]>,\n$radius\n$texture\n\
- pigment \{color rgb [lindex $color $type] \}\nno_shadow\n\}"
- if {[llength [lindex [part $p print bond] 0]] > 0} {
- set n_bond [llength [lindex [part $p print bond] 0]]
- for {set q 0} {$q < $n_bond} {incr q} {
- set end [part [lindex [part $p print bond] 0 $q 1] print $de]
- if {[veclen [vecsub $pos $end]] < [expr [lindex $box 0]*0.8]} {
- puts $f "\/\/ $p [lindex [part $p print bond] 0 $q 1] BOND\n\
- cylinder \{\n<[lindex $pos 0],[lindex $pos 1],[lindex $pos 2]>,\n\
- <[lindex $end 0],[lindex $end 1],[lindex $end 2]>,\n$b_radius\n\
- $texture\npigment \{ color rgb [lindex $color $type]\}\nno_shadow\n\}"
- }
- }
- }
- }
- #write box
- if {$boxopt == "-box"} {
- set c_radius [expr $radius*1.5]
- puts $f "\/\/ box"
- puts $f "cylinder \{\n<0,0,0>,\n<[lindex $box 0],0,0>,\n$c_radius\n$texture\npigment \{ color rgb [lindex $color 0]\}\
- no_shadow \n \}"
- puts $f "cylinder \{\n<0,0,0>,\n<0,[lindex $box 1],0>,\n$c_radius\n$texture\npigment \{ color rgb [lindex $color 0]\}\
- no_shadow \n \}"
- puts $f "cylinder \{\n<0,0,0>,\n<0,0,[lindex $box 2]>,\n$c_radius\n$texture\npigment \{ color rgb [lindex $color 0]\}\
- no_shadow \n \}"
-
- puts $f "cylinder \{\n<[lindex $box 0],0,[lindex $box 2]>,\n<[lindex $box 0],0,0>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<[lindex $box 0],0,[lindex $box 2]>,\n<[lindex $box 0],[lindex $box 1],[lindex $box 2]>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<[lindex $box 0],0,[lindex $box 2]>,\n<0,0,[lindex $box 2]>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
-
- puts $f "cylinder \{\n<[lindex $box 0],[lindex $box 1],0>,\n<[lindex $box 0],0,0>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<[lindex $box 0],[lindex $box 1],0>,\n<0,[lindex $box 1],0>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<[lindex $box 0],[lindex $box 1],0>,\n<[lindex $box 0],[lindex $box 1],[lindex $box 2]>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
-
- puts $f "cylinder \{\n<0,[lindex $box 1],[lindex $box 2]>,\n<0,[lindex $box 1],0>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<0,[lindex $box 1],[lindex $box 2]>,\n<0,0,[lindex $box 2]>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- puts $f "cylinder \{\n<0,[lindex $box 1],[lindex $box 2]>,\n<[lindex $box 0],[lindex $box 1],[lindex $box 2]>,\n$c_radius\n$texture\npigment\
- \{ color rgb [lindex $color 0]\} \nno_shadow \n \}"
- }
- #write rotation
- puts $f "rotate <[lindex $rotate 0],[lindex $rotate 1],[lindex $rotate 2]>"
- puts $f "\}"
- close $f
-
- #Render pov-file
- if {$render=="-render"} {
- catch { exec povray +FT +W800 +H600 +A0.2 -I$file -O$file.tga }
- }
-}
-
-proc morph {f1 f2 f3 {arg 100} {render ""}} {
-# morphs 2 povray-files in arg steps
-#f1 is the start of the morph
-#f2 is the end of the morph
-#f3 is the name of the output
-
- set inp2 [open $f2 r]
- set list ""
- while {[eof $inp2]==0} {
- set l2 [gets $inp2]
- set wl2 [string map { "\{" " "} $l2]
- if {[lindex $wl2 2]=="POS"} {
- gets $inp2
- set l2 [gets $inp2]
- lappend list $l2
- }
- }
- close $inp2
-
- for {set j 0} {$j < [expr $arg+1]} {incr j} {
- set outp [open $f3-[format %05d $j].pov w]
- set inp1 [open $f1 r]
-
- while {[eof $inp1]==0} {
-
- set l1 [gets $inp1]
- set wl1 [string map { "\{" " "} $l1]
- set wl1 [string map { "\}" " "} $wl1]
-
- if {[lindex $wl1 2]=="POS"} {
- puts $outp $l1
- set part [lindex $l1 1]
- set l1 [gets $inp1]
- puts $outp $l1
- set l1 [gets $inp1]
- set l2 [lindex $list $part]
- set pos1 [string map { "<" " "} $l1]
- set pos2 [string map { "<" " "} $l2]
- set pos1 [string map { ">" " "} $pos1]
- set pos2 [string map { ">" " "} $pos2]
- set pos1 [string map { "," " "} $pos1]
- set pos2 [string map { "," " "} $pos2]
- set morph_pos [vecadd $pos1 [vecscale [expr $j.0/$arg.0] [vecsub $pos2 $pos1]]]
- puts $outp "<[lindex $morph_pos 0],[lindex $morph_pos 1],[lindex $morph_pos 2]>"
- set l1 [gets $inp1]
- puts $outp $l1
- set l1 [gets $inp1]
- puts $outp $l1
- set l1 [gets $inp1]
- set rgb [string map { "<" " "} $l1]
- set rgb [string map { ">" " "} $rgb]
- set rgb [string map { "," " "} $rgb]
- set color "[lindex $rgb 1 2] [lindex $rgb 1 3] [lindex $rgb 1 4]"
- puts $outp "pigment \{ color rgbt <[lindex $color 0],[lindex $color 1],[lindex $color 2],0.6> \}"
- set l1 [gets $inp1]
- puts $outp $l1
- set l1 [gets $inp1]
- puts $outp $l1
- } elseif {[lindex $wl1 3]=="BOND"} {
-
- for {set cnt 0} {$cnt < 8} {incr cnt} {
- gets $inp1
- }
- } else {
- puts $outp $l1
- }
- }
- close $outp
- close $inp1
-
- if {$render=="-render"} {
- puts "rendering"
- catch {exec povray +FT +W800 +H600 +A0.2 -I$f3-[format %05d $j].pov -O$f3-[format %05d $j].tga}
- puts "rendering done"
- }
- }
-}
diff --git a/scripts/parallel_tempering.tcl b/scripts/parallel_tempering.tcl
index 9c99d3e270d..34b86207eda 100644
--- a/scripts/parallel_tempering.tcl
+++ b/scripts/parallel_tempering.tcl
@@ -4,7 +4,7 @@
#
#############################################################
#
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2007,2008,2009,2010 Axel Arnold
#
# This file is part of ESPResSo.
diff --git a/scripts/pdb.tcl b/scripts/pdb.tcl
index 0762944f913..925065ad213 100644
--- a/scripts/pdb.tcl
+++ b/scripts/pdb.tcl
@@ -1,4 +1,4 @@
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/scripts/polymer.tcl b/scripts/polymer.tcl
index 1ccf4fb9a3a..9984f6c62e4 100644
--- a/scripts/polymer.tcl
+++ b/scripts/polymer.tcl
@@ -6,7 +6,7 @@
# Script to setup polymer chains & networks. #
# #
#############################################################
-# Copyright (C) 2010,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
# Max-Planck-Institute for Polymer Research, Theory Group
#
diff --git a/scripts/statistics.tcl b/scripts/statistics.tcl
index fdb054ce48a..778c78faeac 100644
--- a/scripts/statistics.tcl
+++ b/scripts/statistics.tcl
@@ -7,7 +7,7 @@
# #
#############################################################
#
-# Copyright (C) 2010,2011,2012,2013 The ESPResSo project
+# Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
#
# Max-Planck-Institute for Polymer Research, Theory Group
diff --git a/scripts/vtf.tcl b/scripts/vtf.tcl
index a729d516d09..14118789e28 100644
--- a/scripts/vtf.tcl
+++ b/scripts/vtf.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2006,2007,2008,2009,2010,2011 Olaf Lenz
#
# This file is part of ESPResSo.
@@ -98,7 +98,6 @@ proc writevsf { file args } {
set typedesc {}
set radius {}
set short 0
- set no_charges 0
# Parse options
for { set argnum 0 } { $argnum < [llength $args] } { incr argnum } {
@@ -113,9 +112,6 @@ proc writevsf { file args } {
set radius $val
incr argnum
}
- "ignore_charges" {
- set no_charges 1
- }
"verbose" { set short 0 }
"short" { set short 1 }
default {
@@ -129,6 +125,13 @@ proc writevsf { file args } {
global vtf_pid
array unset vtf_pid
+ # Print unitcell data
+ if { $short } then {
+ puts $file "p [setmd box_l]"
+ } else {
+ puts $file "pbc [setmd box_l]"
+ }
+
set max_pid [setmd max_part]
# compute the maximal type
@@ -143,51 +146,70 @@ proc writevsf { file args } {
set typedesclist [get_typedesc_list $max_type $typedesc]
set radiuslist [get_radius_list $max_type $radius]
- ##################################################
- # OUTPUT
- ##################################################
- # Print unitcell data
- if { $short } then {
- puts $file "p [setmd box_l]"
- } else {
- puts $file "pbc [setmd box_l]"
- }
-
- # Print atom data
- set from 0
- set to 0
- set prev_type "na"
-
- # Output the type
+ # collect combinations of charge and type
+ set uses_electrostatics [has_feature "ELECTROSTATICS"]
+ set qs ""
for { set pid 0 } { $pid <= $max_pid } { incr pid } {
- if { [part $pid] != "na" } then {
- # look for the type
- set type [part $pid print type]
- if { $prev_type == "na" } then {
- set prev_type $type
- } elseif { $prev_type == $type } then {
- set to $pid
- } else {
- # output from $from to $pid
- puts $file [get_atom_record $from $to $prev_type]
-
- set to $pid
- set from $pid
- set prev_type $type
- }
- }
+ set type [part $pid print type]
+ if { $uses_electrostatics } then {
+ set q [part $pid print q]
+ set qs "q$q"
+ }
+ set this "t$type$qs"
+ if { ! [info exists combination($this)] } then {
+ set combination($this) $pid
+ set desc "radius [lindex $radiuslist $type]"
+ set desc "$desc [lindex $typedesclist $type]"
+ if { $uses_electrostatics } then { set desc "$desc q $q" }
+ set combination("desc-$this") $desc
+ } else {
+ lappend combination($this) $pid
+ }
}
- puts $file [get_atom_record $from $to $prev_type]
- if { [has_feature "ELECTROSTATICS"] && !$no_charges} {
- # 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]"
- }
- }
+ # loop over the combinations and create atom record
+ foreach c [array names combination "t*"] {
+ set pids $combination($c)
+ set desc $combination("desc-$c")
+ set to [vtfpid [lindex $pids 0]]
+ set aids ""
+ foreach pid $pids {
+ set vpid [vtfpid $pid]
+ if { [expr $vpid-1] != $to } then {
+ if { [info exists from] } then {
+ # print out records from $from to $to
+ if { $from == $to } then {
+ lappend aids "$to"
+ } else {
+ lappend aids "$from:$to"
+ }
+ }
+ set from $vpid
+ }
+ set to $vpid
+ }
+ if { $from == $to } then {
+ lappend aids "$to"
+ } else {
+ lappend aids "$from:$to"
+ }
+ unset from
+ # let's group atom ranges, so that there are no more than 8 per line
+ # This fixes a problem with the vmd plugin, and makes the vtf more
+ # readable anyway.
+ set start 0
+ set maxlen 8
+ set ll [llength [lrange $aids $start end ]]
+ while { $ll >= $maxlen } {
+ puts $file "atom [join [lrange $aids $start [expr $start + $maxlen -1]] ,] $desc"
+ incr start $maxlen
+ set ll [llength [lrange $aids $start end ]]
+ }
+ if { $start < [llength $aids ] } {
+ puts $file "atom [join [lrange $aids $start end] ,] $desc"
+ }
}
-
+
# Print bond data
for { set from 0 } { $from <= $max_pid } { incr from } {
if { [part $from] != "na" } then {
diff --git a/scripts/vtk.tcl b/scripts/vtk.tcl
index 13cd645f9ad..134246c16c2 100644
--- a/scripts/vtk.tcl
+++ b/scripts/vtk.tcl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2012,2013 The ESPResSo project
+# Copyright (C) 2012,2013,2014 The ESPResSo project
# Copyright (C) 2006,2007,2008,2009,2010,2011 Olaf Lenz
#
# This file is part of ESPResSo.
diff --git a/src/Makefile.am b/src/Makefile.am
index d317a5bb063..93d5dac0219 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,4 @@
-# Copyright (C) 2012,2013 The ESPResSo project
-# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
+# Copyright (C) 2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
@@ -17,409 +16,18 @@
# along with this program. If not, see .
#
-# List headers that are not used by the program here
-noinst_HEADERS = \
- myconfig-default.hpp
-
-noinst_LIBRARIES = libEspresso.a
-
-# List the sources of the Espresso binary here
-# config-features.cpp must be at the beginning so that it is compiled first
-nodist_libEspresso_a_SOURCES =
-libEspresso_a_SOURCES = \
- config-features.cpp \
- adresso.cpp adresso.hpp \
- cells.cpp cells.hpp \
- collision.cpp collision.hpp \
- communication.cpp communication.hpp \
- comfixed.cpp comfixed.hpp \
- comforce.hpp comforce.cpp \
- config.hpp \
- constraint.cpp constraint.hpp \
- cuda_interface.cpp cuda_interface.hpp\
- cuda_init.hpp \
- debug.cpp debug.hpp \
- domain_decomposition.cpp domain_decomposition.hpp \
- energy.cpp energy.hpp \
- errorhandling.cpp errorhandling.hpp \
- fft.cpp fft.hpp \
- fft-common.cpp fft-common.hpp \
- fft-dipolar.cpp fft-dipolar.hpp \
- forcecap.cpp forcecap.hpp \
- forces.cpp forces.hpp \
- galilei.cpp galilei.hpp \
- ghosts.cpp ghosts.hpp \
- global.cpp global.hpp \
- grid.cpp grid.hpp \
- halo.cpp halo.hpp \
- iccp3m.cpp iccp3m.hpp \
- imd.cpp imd.hpp \
- initialize.cpp initialize.hpp \
- integrate.cpp integrate.hpp \
- interaction_data.cpp interaction_data.hpp \
- lattice.cpp lattice.hpp \
- layered.cpp layered.hpp \
- lb.cpp lb.hpp \
- lb-boundaries.cpp lb-boundaries.hpp \
- lb-d3q18.hpp lb-d3q19.hpp \
- lbgpu.cpp lbgpu.hpp\
- metadynamics.cpp metadynamics.hpp \
- modes.cpp modes.hpp \
- molforces.cpp molforces.hpp \
- mol_cut.cpp mol_cut.hpp \
- nemd.cpp nemd.hpp \
- npt.hpp \
- nsquare.cpp nsquare.hpp \
- particle_data.cpp particle_data.hpp \
- polymer.cpp polymer.hpp \
- polynom.hpp \
- pressure.cpp pressure.hpp \
- random.cpp random.hpp \
- rattle.cpp rattle.hpp \
- reaction.cpp reaction.hpp \
- rotation.cpp rotation.hpp \
- specfunc.cpp specfunc.hpp \
- statistics.cpp statistics.hpp \
- statistics_chain.cpp statistics_chain.hpp \
- statistics_cluster.cpp statistics_cluster.hpp \
- statistics_correlation.cpp statistics_correlation.hpp \
- statistics_fluid.cpp statistics_fluid.hpp \
- statistics_molecule.cpp statistics_molecule.hpp \
- statistics_observable.cpp statistics_observable.hpp \
- statistics_wallstuff.cpp statistics_wallstuff.hpp \
- thermostat.cpp thermostat.hpp \
- topology.cpp topology.hpp \
- tuning.cpp tuning.hpp \
- utils.hpp \
- uwerr.cpp uwerr.hpp \
- verlet.cpp verlet.hpp \
- virtual_sites.cpp virtual_sites.hpp \
- virtual_sites_com.cpp virtual_sites_com.hpp \
- virtual_sites_relative.cpp virtual_sites_relative.hpp \
- vmdsock.cpp vmdsock.hpp \
- ghmc.cpp ghmc.hpp
-
-# nonbonded potentials and forces
-libEspresso_a_SOURCES += \
- bmhtf-nacl.cpp bmhtf-nacl.hpp \
- buckingham.cpp buckingham.hpp \
- dpd.cpp dpd.hpp \
- gaussian.cpp gaussian.hpp \
- gb.cpp gb.hpp \
- hat.cpp hat.hpp \
- hertzian.cpp hertzian.hpp \
- lj.cpp lj.hpp \
- ljangle.cpp ljangle.hpp \
- ljcos.cpp ljcos.hpp \
- ljcos2.cpp ljcos2.hpp \
- ljgen.cpp ljgen.hpp \
- morse.cpp morse.hpp \
- soft_sphere.cpp soft_sphere.hpp \
- steppot.cpp steppot.hpp \
- tab.cpp tab.hpp \
- tunable_slip.cpp tunable_slip.hpp
-
-# bonded potentials and forces
-libEspresso_a_SOURCES += \
- angle.cpp angle.hpp \
- angle_harmonic.cpp angle_harmonic.hpp \
- angle_cosine.cpp angle_cosine.hpp \
- angle_cossquare.cpp angle_cossquare.hpp \
- angledist.cpp angledist.hpp \
- dihedral.cpp dihedral.hpp \
- endangledist.cpp endangledist.hpp \
- fene.cpp fene.hpp \
- harmonic.cpp harmonic.hpp \
- overlap.cpp overlap.hpp \
- subt_lj.cpp subt_lj.hpp \
- object-in-fluid/area_force_local.cpp object-in-fluid/area_force_local.hpp \
- object-in-fluid/area_force_global.cpp object-in-fluid/area_force_global.hpp \
- object-in-fluid/bending_force.cpp object-in-fluid/bending_force.hpp \
- object-in-fluid/stretching_force.cpp object-in-fluid/stretching_force.hpp \
- object-in-fluid/stretchlin_force.cpp object-in-fluid/stretchlin_force.hpp \
- object-in-fluid/volume_force.cpp object-in-fluid/volume_force.hpp
-
-# Coulomb methods
-libEspresso_a_SOURCES += \
- debye_hueckel.cpp debye_hueckel.hpp \
- elc.cpp elc.hpp \
- magnetic_non_p3m_methods.cpp magnetic_non_p3m_methods.hpp \
- mdlc_correction.cpp mdlc_correction.hpp \
- maggs.cpp maggs.hpp \
- mmm1d.cpp mmm1d.hpp \
- mmm2d.cpp mmm2d.hpp \
- mmm-common.cpp mmm-common.hpp \
- p3m.cpp p3m.hpp \
- p3m_gpu.hpp \
- p3m-common.cpp p3m-common.hpp \
- p3m-dipolar.cpp p3m-dipolar.hpp \
- reaction_field.cpp reaction_field.hpp
-
+EXTRA_DIST =
+CLEANFILES =
+DIST_SUBDIRS = core tcl python/espressomd
+SUBDIRS = core
if TCL
-
-libEspresso_a_SOURCES += \
- tcl/adresso_tcl.cpp tcl/adresso_tcl.hpp \
- tcl/bin_tcl.cpp \
- tcl/binary_file_tcl.cpp tcl/binary_file_tcl.hpp \
- tcl/blockfile_tcl.cpp \
- tcl/cells_tcl.cpp \
- tcl/channels_tcl.cpp \
- tcl/collision_tcl.cpp \
- tcl/comfixed_tcl.cpp tcl/comfixed_tcl.hpp \
- tcl/comforce_tcl.cpp tcl/comforce_tcl.hpp \
- tcl/config_tcl.cpp \
- tcl/constraint_tcl.cpp tcl/constraint_tcl.hpp \
- tcl/domain_decomposition_tcl.cpp tcl/domain_decomposition_tcl.hpp \
- tcl/energy_tcl.cpp \
- tcl/galilei_tcl.cpp tcl/galilei_tcl.hpp \
- tcl/global_tcl.cpp tcl/global_tcl.hpp \
- tcl/grid_tcl.cpp tcl/grid_tcl.hpp \
- tcl/iccp3m_tcl.cpp tcl/iccp3m_tcl.hpp \
- tcl/imd_tcl.cpp \
- tcl/initialize_interpreter.cpp \
- tcl/integrate_tcl.cpp tcl/integrate_tcl.hpp \
- tcl/interaction_data_tcl.cpp tcl/interaction_data_tcl.hpp \
- tcl/lb-boundaries_tcl.cpp \
- tcl/lb_tcl.cpp tcl/lb_tcl.hpp \
- tcl/metadynamics_tcl.cpp tcl/metadynamics_tcl.hpp \
- tcl/nemd_tcl.cpp \
- tcl/mol_cut_tcl.cpp tcl/mol_cut_tcl.hpp \
- tcl/parser.cpp tcl/parser.hpp \
- tcl/particle_data_tcl.cpp \
- tcl/polymer_tcl.cpp tcl/polymer_tcl.hpp \
- tcl/pressure_tcl.cpp tcl/pressure_tcl.hpp \
- tcl/random_tcl.cpp tcl/random_tcl.hpp \
- tcl/reaction_tcl.cpp tcl/reaction_tcl.hpp \
- tcl/rattle_tcl.cpp tcl/rattle_tcl.hpp \
- tcl/statistics_chain_tcl.cpp tcl/statistics_chain_tcl.hpp \
- tcl/statistics_cluster_tcl.cpp tcl/statistics_cluster_tcl.hpp \
- tcl/statistics_correlation_tcl.cpp tcl/statistics_correlation_tcl.hpp \
- tcl/statistics_fluid_tcl.cpp tcl/statistics_fluid_tcl.hpp \
- tcl/statistics_observable_tcl.cpp tcl/statistics_observable_tcl.hpp \
- tcl/statistics_wallstuff_tcl.cpp tcl/statistics_wallstuff_tcl.hpp \
- tcl/statistics_tcl.cpp tcl/statistics_tcl.hpp \
- tcl/thermostat_tcl.cpp tcl/thermostat_tcl.hpp \
- tcl/topology_tcl.cpp \
- tcl/tuning_tcl.cpp \
- tcl/uwerr_tcl.cpp \
- tcl/virtual_sites_com_tcl.cpp tcl/virtual_sites_com_tcl.hpp \
- tcl/ghmc_tcl.cpp tcl/ghmc_tcl.hpp
-
-# nonbonded potentials and forces
-libEspresso_a_SOURCES += \
- tcl/bmhtf-nacl_tcl.cpp tcl/bmhtf-nacl_tcl.hpp \
- tcl/buckingham_tcl.cpp tcl/buckingham_tcl.hpp \
- tcl/dpd_tcl.cpp tcl/dpd_tcl.hpp \
- tcl/forcecap_tcl.cpp tcl/forcecap_tcl.hpp \
- tcl/gaussian_tcl.cpp tcl/gaussian_tcl.hpp \
- tcl/gb_tcl.cpp tcl/gb_tcl.hpp \
- tcl/hat_tcl.cpp tcl/hat_tcl.hpp \
- tcl/hertzian_tcl.cpp tcl/hertzian_tcl.hpp \
- tcl/lj_tcl.cpp tcl/lj_tcl.hpp \
- tcl/ljangle_tcl.cpp tcl/ljangle_tcl.hpp \
- tcl/ljcos2_tcl.cpp tcl/ljcos2_tcl.hpp \
- tcl/ljcos_tcl.cpp tcl/ljcos_tcl.hpp \
- tcl/ljgen_tcl.cpp tcl/ljgen_tcl.hpp \
- tcl/morse_tcl.cpp tcl/morse_tcl.hpp \
- tcl/soft_sphere_tcl.cpp tcl/soft_sphere_tcl.hpp \
- tcl/steppot_tcl.cpp tcl/steppot_tcl.hpp \
- tcl/tab_tcl.cpp tcl/tab_tcl.hpp \
- tcl/tunable_slip_tcl.cpp tcl/tunable_slip_tcl.hpp
-
-# bonded potentials and forces
-libEspresso_a_SOURCES += \
- tcl/angle_tcl.cpp tcl/angle_tcl.hpp \
- tcl/angle_harmonic_tcl.cpp tcl/angle_harmonic_tcl.hpp \
- tcl/angle_cosine_tcl.cpp tcl/angle_cosine_tcl.hpp \
- tcl/angle_cossquare_tcl.cpp tcl/angle_cossquare_tcl.hpp \
- tcl/angledist_tcl.cpp tcl/angledist_tcl.hpp \
- tcl/dihedral_tcl.cpp tcl/dihedral_tcl.hpp \
- tcl/endangledist_tcl.cpp tcl/endangledist_tcl.hpp \
- tcl/fene_tcl.cpp tcl/fene_tcl.hpp \
- tcl/harmonic_tcl.cpp tcl/harmonic_tcl.hpp \
- tcl/overlap_tcl.cpp tcl/overlap_tcl.hpp \
- tcl/subt_lj_tcl.cpp tcl/subt_lj_tcl.hpp \
- tcl/object-in-fluid/area_force_local_tcl.cpp \
- tcl/object-in-fluid/area_force_local_tcl.hpp \
- tcl/object-in-fluid/area_force_global_tcl.cpp \
- tcl/object-in-fluid/area_force_global_tcl.hpp \
- tcl/object-in-fluid/bending_force_tcl.cpp \
- tcl/object-in-fluid/bending_force_tcl.hpp \
- tcl/object-in-fluid/stretching_force_tcl.cpp \
- tcl/object-in-fluid/stretching_force_tcl.hpp \
- tcl/object-in-fluid/stretchlin_force_tcl.cpp \
- tcl/object-in-fluid/stretchlin_force_tcl.hpp \
- tcl/object-in-fluid/volume_force_tcl.cpp \
- tcl/object-in-fluid/volume_force_tcl.hpp
-
-# Coulomb methods
-libEspresso_a_SOURCES += \
- tcl/debye_hueckel_tcl.cpp tcl/debye_hueckel_tcl.hpp \
- tcl/elc_tcl.cpp tcl/elc_tcl.hpp \
- tcl/magnetic_non_p3m_methods_tcl.cpp tcl/magnetic_non_p3m_methods_tcl.hpp \
- tcl/maggs_tcl.cpp tcl/maggs_tcl.hpp \
- tcl/mmm1d_tcl.cpp tcl/mmm1d_tcl.hpp \
- tcl/mmm2d_tcl.cpp tcl/mmm2d_tcl.hpp \
- tcl/p3m-dipolar_tcl.cpp tcl/p3m-dipolar_tcl.hpp \
- tcl/p3m_tcl.cpp tcl/p3m_tcl.hpp \
- tcl/reaction_field_tcl.cpp tcl/reaction_field_tcl.hpp \
- tcl/mdlc_correction_tcl.cpp tcl/mdlc_correction_tcl.hpp
-
+SUBDIRS += tcl
endif
-
-if TCL
-
-#################################################################
-# Compile the (TCL) main program
-#################################################################
-
-# Two binaries are generated: Espresso for the build dir,
-# Espresso.install for the installation dir.
-# The ".install" suffix is removed upon installation.
-noinst_PROGRAMS = Espresso
-Espresso_CPPFLAGS = -D ESPRESSO_SCRIPTS_DEFAULT=\"$(buildscriptsdir)\"
-Espresso_SOURCES = tcl/scriptsdir.cpp tcl/main.cpp
-Espresso_LDADD = libEspresso.a
-
-bin_PROGRAMS = Espresso.install
-Espresso_install_CPPFLAGS = -D ESPRESSO_SCRIPTS_DEFAULT=\"$(scriptsdir)\"
-Espresso_install_SOURCES = tcl/scriptsdir.cpp tcl/main.cpp
-Espresso_install_LDADD = libEspresso.a
-
-ESPRESSO = `echo Espresso | sed '$(transform)'`$(EXEEXT)
-ESPRESSO_INSTALL = `echo Espresso.install | sed '$(transform)'`$(EXEEXT)
-# rename Espresso after installation
-install-exec-hook:
- $(am__mv) \
- $(DESTDIR)$(bindir)/$(ESPRESSO_INSTALL) \
- $(DESTDIR)$(bindir)/$(ESPRESSO)
-
-uninstall-local:
- -rm -f $(DESTDIR)$(bindir)/$(ESPRESSO)
-
+if PYTHON_INTERFACE
+SUBDIRS += python/espressomd
endif
-#################################################################
-# Handling of myconfig.hpp
-#################################################################
-nodist_libEspresso_a_SOURCES += myconfig-final.hpp
-BUILT_SOURCES = myconfig-final.hpp
-CLEANFILES = myconfig-final.hpp
-
-myconfig-final.hpp: FORCE
- @echo -n "Determining myconfig file..."
- @config_files="\
- $(top_builddir)/$(myconfig) \
- $(top_srcdir)/$(myconfig)"; \
- if test $(myconfig) = myconfig.hpp; then \
- config_files="$$config_files $(top_srcdir)/src/myconfig-default.hpp"; \
- fi; \
- for file in $$config_files; do \
- if test -e $$file; then \
- echo " $$file"; \
- myconfig_found=1; \
- if test -e $@; then \
- cmp -s $$file $@ || cp $$file $@; \
- else \
- cp $$file $@; \
- fi; \
- break; \
- fi; \
- done; \
- if test ! $$myconfig_found; then \
- echo "ERROR: Couldn't find $(myconfig) anywhere"; \
- exit 1; \
- fi
-
#################################################################
# Handling of the features
#################################################################
-# config-features.cpp must occur at the beginning of the SOURCES so that it is compiled first
-#libEspresso_a_SOURCES += config-features.cpp
-EXTRA_DIST = \
- features.def \
- config-features.hpp config-features.cpp \
- config-doxygen.hpp
-
-if HAVE_PYTHON
-
-BUILT_SOURCES += config-features.hpp config-features.cpp
-CLEANFILES += config-features.hpp config-features.cpp config-doxygen.hpp
-config-features.hpp config-features.cpp: features.def $(top_srcdir)/config/gen_featureconfig.py
- $(PYTHON) $(top_srcdir)/config/gen_featureconfig.py $(srcdir)/features.def config-features.hpp config-features.cpp
-
-config-doxygen.hpp: features.def $(top_srcdir)/config/gen_doxyconfig.py
- $(PYTHON) $(top_srcdir)/config/gen_doxyconfig.py $(srcdir)/features.def config-doxygen.hpp
-
-else
-
-config-doxygen.hpp config-features.hpp config-features.cpp: features.def
- @echo "Python was not found in your PATH."
- @echo "If you change the set of features, you need Python!"
- @echo "Install it and rerun configure."
-
-endif
-
-doc doxygen: config-doxygen.hpp
-
-#################################################################
-# Handling of the version
-#################################################################
-libEspresso_a_SOURCES += config-version.cpp
-BUILT_SOURCES += config-version.cpp
-CLEANFILES += config-version.cpp
-config-version.cpp: FORCE
- VERSION=`cd $(top_srcdir); sh config/genversion.sh -c`; \
- if ! test -e "config-version.cpp" || \
- test "$$VERSION" != "`cat config-version.cpp`"; then \
- echo "$$VERSION" > config-version.cpp; \
- fi
-
-#################################################################
-# Handling of the MPI fake implementation
-#################################################################
-if MPI_FAKE
-libEspresso_a_SOURCES += mpifake/mpi.h mpifake/mpi.cpp
-# mpifake should come before any system includes
-AM_CPPFLAGS = -I$(srcdir)/mpifake
-if TCL
-Espresso_CPPFLAGS += $(AM_CPPFLAGS)
-Espresso_install_CPPFLAGS += $(AM_CPPFLAGS)
-endif
-endif
-
-##################################################
-# CUDA rules
-##################################################
-if CUDA
-SUFFIXES=.cu
-.cu.o:
- $(NVCC) -c $(NVCCFLAGS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(INCLUDES) $(DEFS) -o $@ $<
-
-CUDA_SOURCES = \
- cuda_init_cuda.cu \
- cuda_common_cuda.cu \
- lbgpu_cuda.cu \
- p3m_gpu_cuda.cu
-
-cuda_interface.o: cuda_interface.hpp myconfig-final.hpp
-cuda_init.o: cuda_init.hpp myconfig-final.hpp
-lbgpu.o: lbgpu.hpp myconfig-final.hpp
-p3m_gpu.o: p3m_gpu.hpp myconfig-final.hpp
-
-if TCL
-
-Espresso_SOURCES += cuda_is_cpp.cpp
-Espresso_install_SOURCES += cuda_is_cpp.cpp
-CUDA_SOURCES += \
- tcl/cuda_init_tcl.cpp
-
-endif
-
-libEspresso_a_SOURCES += $(CUDA_SOURCES)
-
-EXTRA_DIST += $(CUDA_SOURCES)
-endif
-
-.PHONY: FORCE
-FORCE:
+EXTRA_DIST += features.def featuredefs.py
diff --git a/src/adresso.cpp b/src/adresso.cpp
deleted file mode 100644
index cb3f8c63182..00000000000
--- a/src/adresso.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- Copyright (C) 2010,2011,2012,2013 The ESPResSo project
- Copyright (C) 2008,2009,2010
- Max-Planck-Institute for Polymer Research, Theory Group
-
- This file is part of ESPResSo.
-
- ESPResSo is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- ESPResSo is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-*/
-/** \file adresso.c
- This is the place for adaptive resolution scheme
- Implementation of adresso.h
-*/
-
-#include "adresso.hpp"
-#include "interaction_data.hpp"
-#include "communication.hpp"
-#include "cells.hpp"
-#include "grid.hpp"
-
-/** \name Privat Functions */
-/************************************************************/
-/*@{*/
-#ifdef ADRESS
-/** calc weighting function of a distance
- @param dist distance
- @return weight of the distance
-*/
-double adress_wf(double dist);
-
-#endif
-
-/*@}*/
-
-double adress_vars[7] = {0, 0, 0, 0, 0, 0, 0};
-
-#ifdef ADRESS
-
-double adress_wf_vector(double x[3]){
- int topo=(int)adress_vars[0];
- double dist;
- int dim;
-
-
-
- switch (topo) {
- case 0:
- return 0.0;
- break;
- case 1:
- return adress_vars[1];
- break;
- case 2:
- dim=(int)adress_vars[3];
- //dist=fabs(x[dim]-adress_vars[4]);
- dist = x[dim]-adress_vars[4];
- if(dist>0)
- while(dist>box_l[dim]/2.0)
- dist = dist - box_l[dim];
- else if(dist < 0)
- while(dist< -box_l[dim]/2.0)
- dist = dist + box_l[dim];
- dist = fabs(dist);
- return adress_wf(dist);
- break;
- case 3:
- //int img_box[3];
- //double temp_pos[3];
- //for(dim=0;dim<3;dim++){
- // img_box[dim]=0;
- // temp_pos[dim]=x[dim];
- //}
- //fold_position(temp_pos,img_box);
- dist=distance(x,&(adress_vars[3]));
- return adress_wf(dist);
- break;
- default:
- return 0.0;
- break;
- }
-}
-
-double adress_wf(double dist){
- int wf;
- double tmp;
-
- //explicit region
- if (dist < adress_vars[1]) return 1;
- //cg regime
- else if (dist> adress_vars[1]+adress_vars[2]) return 0;
- else {
- wf=(int)adress_vars[6];
- if (wf == 0){ //cos
- tmp=PI/2/adress_vars[2]*(dist-adress_vars[1]);
- return cos(tmp)*cos(tmp);
- }
- else{ //wf == 1
- tmp=(dist-adress_vars[1]);
- return 1+2*tmp*tmp-3*tmp*tmp*tmp;
- }
- }
-}
-
-void adress_update_weights(){
- Particle *p;
- int i, np, c;
- Cell *cell;
- for (c = 0; c < local_cells.n; c++) {
- cell = local_cells.cell[c];
- p = cell->part;
- np = cell->n;
- for(i = 0; i < np; i++) {
- if (ifParticleIsVirtual(&p[i])) {
- p[i].p.adress_weight=adress_wf_vector((&p[i])->r.p);
- //printf("LOCAL %f %f\n", p[i].r.p[0], p[i].p.adress_weight);
- }
- }
- }
- for (c = 0; c < local_cells.n; c++) {
- cell = ghost_cells.cell[c];
- p = cell->part;
- np = cell->n;
- for(i = 0; i < np; i++) {
- if (ifParticleIsVirtual(&p[i])) {
- p[i].p.adress_weight=adress_wf_vector((&p[i])->r.p);
- //printf("GHOST %f %f\n", p[i].r.p[0], p[i].p.adress_weight);
- }
- }
- }
-}
-
-#ifdef INTERFACE_CORRECTION
-int adress_tab_set_params(int part_type_a, int part_type_b, char* filename)
-{
- IA_parameters *data;
- FILE* fp;
- //int ic_points;
- int npoints;
- double minval,minval2, maxval, maxval2;
- int i, j, newsize;
- int token;
- double dummr;
- token = 0;
-
- data = get_ia_param_safe(part_type_a, part_type_b);
-
- if (!data)
- return 1;
-
- if (strlen(filename) > MAXLENGTH_ADRESSTABFILE_NAME-1 )
- return 2;
-
- /*Open the file containing force and energy tables */
- fp = fopen( filename , "r");
- if ( !fp )
- return 3;
-
- /*Look for a line starting with # */
- while ( token != EOF) {
- token = fgetc(fp);
- if ( token == 35 ) { break; } // magic number for # symbol
- }
- if ( token == EOF ) {
- fclose(fp);
- return 4;
- }
-
- /* First read two important parameters we read in the data later*/
- //fscanf( fp , "%d ", &ic_points);
- fscanf( fp , "%d ", &npoints);
- fscanf( fp, "%lf ", &minval);
- fscanf( fp, "%lf ", &maxval);
-
- // Set the newsize to the same as old size : only changed if a new force table is being added.
- newsize = adress_tab_forces.max;
-
- if ( data->ADRESS_TAB_npoints == 0){
- // A new potential will be added so set the number of points, the startindex and newsize
- //considering that if ic_points = 0, we have two forces: ex and cg
- //we keep the same for npoints
- data->ADRESS_TAB_npoints = npoints;
- data->ADRESS_TAB_startindex = adress_tab_forces.max;
- newsize += 2*npoints;
- } else {
- // We have existing data for this pair of monomer types check array sizing
- if ( data->ADRESS_TAB_npoints != npoints ) {
- fclose(fp);
- return 5;
- }
- }
-
- /* Update parameters */
- data->ADRESS_TAB_maxval = maxval;
- data->ADRESS_TAB_minval = minval;
- strcpy(data->ADRESS_TAB_filename,filename);
-
- /* Calculate dependent parameters */
- maxval2 = maxval*maxval;
- minval2 = minval*minval;
- data->ADRESS_TAB_stepsize = (maxval-minval)/(double)(data->ADRESS_TAB_npoints - 1);
-
- /* Allocate space for new data */
- realloc_doublelist(&adress_tab_forces,newsize);
- realloc_doublelist(&adress_tab_energies,newsize);
-
- /* Read in the new force and energy table data */
- for (i =0 ; i < npoints ; i++)
- {
- fscanf(fp,"%lf",&dummr);
- //for (j =0 ; j < ic_points + 2; j++)
- for (j =0 ; j < 2; j++)
- {
- //j = 0 -> CG FORCE
- //j = 1 -> CG_ic FORCE
-
- fscanf(fp,"%lf", &(adress_tab_forces.e[j*npoints+i+data->ADRESS_TAB_startindex]));
- fscanf(fp,"%lf", &(adress_tab_energies.e[j*npoints+i+data->ADRESS_TAB_startindex]));
- }
- }
- fclose(fp);
-
- /* broadcast interaction parameters including force and energy tables*/
- mpi_bcast_ia_params(part_type_a, part_type_b);
-
- //no force cap for the moment!
- //if (force_cap != -1.0) {
- // mpi_cap_forces(force_cap);}
- return 0;
-}
-
-#endif
-
-int tf_set_params(int part_type, double prefactor, char * filename)
-{
- TF_parameters *data;
- FILE *fp;
- int npoints;
- double minval, maxval;
- int i, newsize;
- int token = 0;
- double dummr;
-
- make_particle_type_exist(part_type);
- data = get_tf_param(part_type);
- if (!data)
- return 1;
-
- if (strlen(filename) > MAXLENGTH_TABFILE_NAME-1 )
- return 2;
-
- /*Open the file containing force and energy tables */
- fp = fopen( filename , "r");
- if ( !fp )
- return 3;
-
- /*Look for a line starting with # */
- while ( token != EOF) {
- token = fgetc(fp);
- if ( token == 35 ) { break; } // magic number for # symbol
- }
- if ( token == EOF ) {
- fclose(fp);
- return 4;
- }
-
- /* First read two important parameters we read in the data later*/
- if (fscanf( fp , "%d ", &npoints) != 1 ||
- fscanf( fp, "%lf ", &minval) != 1 ||
- fscanf( fp, "%lf ", &maxval) != 1)
- return 5;
- // Set the newsize to the same as old size : only changed if a new force table is being added.
- newsize = thermodynamic_forces.max;
- if ( data->TF_TAB_npoints == 0){
- // A new potential will be added so set the number of points, the startindex and newsize
- data->TF_TAB_npoints = npoints;
- data->TF_TAB_startindex = thermodynamic_forces.max;
- newsize += npoints;
- } else {
- // We have existing data for this pair of monomer type check array sizing
- if ( data->TF_TAB_npoints != npoints ) {
- fclose(fp);
- return 5;
- }
- }
-
- /* Update parameters */
- data->TF_TAB_maxval = maxval;
- data->TF_TAB_minval = minval;
- strcpy(data->TF_TAB_filename, filename);
- data->TF_prefactor = prefactor;
-
- data->TF_TAB_stepsize = (maxval-minval)/(double)(data->TF_TAB_npoints - 1);
-
- /* Allocate space for new data */
- realloc_doublelist(&thermodynamic_forces, newsize);
- realloc_doublelist(&thermodynamic_f_energies, newsize);
-
- /* Read in the new force and energy table data */
- for (i = 0 ; i < npoints ; i++){
- if (fscanf(fp, "%lf", &dummr) != 1 ||
- fscanf(fp, "%lf", &(thermodynamic_forces.e[i+data->TF_TAB_startindex])) != 1 ||
- fscanf(fp, "%lf", &(thermodynamic_f_energies.e[i+data->TF_TAB_startindex])) != 1)
- return 5;
- if(i==0 && dummr !=0) {
- fprintf(stderr, "First point of the thermodynamic force has to be zero.\n");
- errexit();
- }
- else if (i== npoints-1 && dummr != 1){
- fprintf(stderr, "Last point of the thermodynamic force has to be one.\n");
- errexit();
- }
- }
-
- fclose(fp);
-
- /* broadcast interaction parameters including force and energy tables */
- mpi_bcast_tf_params(part_type);
-
- return ES_OK;
-}
-
-#endif
diff --git a/src/adresso.hpp b/src/adresso.hpp
deleted file mode 100644
index 3885b966593..00000000000
--- a/src/adresso.hpp
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- Copyright (C) 2010,2012,2013 The ESPResSo project
- Copyright (C) 2008,2009,2010
- Max-Planck-Institute for Polymer Research, Theory Group
-
- This file is part of ESPResSo.
-
- ESPResSo is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- ESPResSo is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-*/
-#ifndef _ADRESSO_H
-#define _ADRESSO_H
-/** \file adresso.h
- This is the place for adaptive resolution scheme (adress)
- Implementation of adresso.h
-
- For more details about adress see:
- - M. Praprotnik, L. Delle Site and K. Kremer, JCP 123, 224106, 2005.
- - M. Praprotnik, L. Delle Site and K. Kremer, Annu. Rev. Phys. Chem. 59, 545-571, 2008.
- - S. Poblete, M. Praprotnik, K. Kremer and L. Delle Site, J. Chem. Phys. 132, 114101, 2010.
-
- For more detail about the implementation here see:
- - C. Junghans and S. Poblete, Comp. Phys. Comm. 181, 1449, 2010.
-*/
-
-#include "particle_data.hpp"
-#include "interaction_data.hpp"
-#include "virtual_sites.hpp"
-#include "grid.hpp"
-
-/** \name Exported Variables */
-/************************************************************/
-/*@{*/
-extern double adress_vars[7];
-/*@}*/
-
-/** \name Exported Functions */
-/************************************************************/
-/*@{*/
-/** Implements the Tcl command "adress". This allows for seetings for adress
-*/
-
-#ifdef ADRESS
-
-/** Calc adress weight function of a vector
- @param x input vector
- @return weight of the vector
-*/
-double adress_wf_vector(double x[3]);
-
-/** Calc adress weight function of a particle
- @param p input particle
- @return weight of the particle
-*/
-inline double adress_wf_particle(Particle *p){
- if (p==NULL) return 0.0;
- if (ifParticleIsVirtual(p)){
- return p->p.adress_weight;
- }
- else{
- return adress_wf_particle(get_mol_com_particle(p));
- }
-}
-
-/** Update adress weight of all particles
-*/
-void adress_update_weights();
-
-inline double adress_non_bonded_force_weight(Particle *p1,Particle *p2){
- double adress_weight_1,adress_weight_2,force_weight;
- int virtual_1,virtual_2;
-
- //NOTE this is in order of probability to appear
- adress_weight_1=adress_wf_particle(p1);
- virtual_1=ifParticleIsVirtual(p1);
-
- //if particles 1 is ex, but in the cg regime
- if ( (adress_weight_11-ROUND_ERROR_PREC) return 0.0;
- force_weight=1-force_weight;
-
- }
- //both are ex -> force_weight is already set
- //if ((virtual_1+virtual_2)==0) force_weight=force_weight;
- //(ifParticleIsVirtual(p1) ==0 || ifParticleIsVirtual(p2) ==0)
- // printf(" particle %d %d virtual %d %d weights %f %f product %f\n", p1->p.identity, p2->p.identity, ifParticleIsVirtual(p1), ifParticleIsVirtual(p2), adress_weight_1, adress_weight_2, force_weight);
- return force_weight;
-}
-
-inline double adress_bonded_force_weight(Particle *p1,Particle *p2){
- double weight=1.0;
- if((get_mol_com_particle(p1))->p.identity == (get_mol_com_particle(p2))->p.identity )
- weight=1.0;
- else {
- double weight_1, weight_2;
- int virtual_1, virtual_2, n_part_int=2;
- weight_1=adress_wf_particle(p1);
- virtual_1=ifParticleIsVirtual(p1);
- if( (weight_10 && sum_virtualp.identity == (get_mol_com_particle(p2))->p.identity &&(get_mol_com_particle(p1))->p.identity == (get_mol_com_particle(p3))->p.identity )
- weight=1.0;
- else {
- double weight_1, weight_2, weight_3;
- int virtual_1, virtual_2, virtual_3, n_part_int=3;
- weight_1=adress_wf_particle(p1);
- virtual_1=ifParticleIsVirtual(p1);
- if( (weight_10 && sum_virtualp.identity == (get_mol_com_particle(p2))->p.identity &&(get_mol_com_particle(p1))->p.identity == (get_mol_com_particle(p3))->p.identity && (get_mol_com_particle(p1))->p.identity == (get_mol_com_particle(p4))->p.identity)
- weight=1.0;
- else {
- double weight_1, weight_2, weight_3, weight_4;
- int virtual_1, virtual_2, virtual_3, virtual_4, n_part_int=4;
- weight_1=adress_wf_particle(p1);
- virtual_1=ifParticleIsVirtual(p1);
- if( (weight_10 && sum_virtualADRESS_TAB_npoints;
- double phi, dindex, fac;
- double maxval = ia_params->ADRESS_TAB_maxval;
- double minval = ia_params->ADRESS_TAB_minval;
- //int ic_points = ia_params->ADRESS_IC_npoints;
- //int max_index = 1;
-
- fac = 0.0;
-
- //if(index == max_index)
- //return;
- if ( maxval > 0 ) {
- if ( dist < maxval){
- table_start = ia_params->ADRESS_TAB_startindex;
- dindex = (dist-minval)/ia_params->ADRESS_TAB_stepsize;
- tablepos = (int)(floor(dindex));
-
- if ( dist > minval ) {
- phi = dindex - tablepos;
- fac = adress_tab_forces.e[inter_index + table_start + tablepos]*(1-phi) + adress_tab_forces.e[inter_index + table_start + tablepos+1]*phi;
- }
- else {
- /* Use an extrapolation beyond the table */
- if ( dist > 0 ) {
- tablepos = 0;
- phi = dindex - tablepos;
- fac = (adress_tab_forces.e[inter_index + table_start]*minval)*(1-phi) +
- (adress_tab_forces.e[inter_index + table_start+1]*(minval+ia_params->ADRESS_TAB_stepsize))*phi;
- fac = fac/dist;
- }
- else { /* Particles on top of each other .. leave fac as 0.0 */
- }
- }
-
- }
- for(j=0;j<3;j++)
- force[j] += fac * d[j];
- }
-
-
-}
-
-inline double correction_function(double x){
- /* correction function goes between zero and one */
- double ic_s;
- ic_s = 4.0*(sqrt(x)-0.5)*(sqrt(x)-0.5);
- return ic_s;
-}
-
-///
-int adress_tab_set_params(int part_type_a, int part_type_b, char* filename);
-
-/** Adds force in an Adress way. Also useful for virial calculations */
-inline void add_adress_tab_pair_force(Particle *p1, Particle *p2, IA_parameters *ia_params,
- double d[3], double dist, double force[3])
-{
- int j;
- //int ic_points = ia_params->ADRESS_IC_npoints;
- //int max_index = 1;
-
- double left_force[3] = {0,0,0};
- double right_force[3] = {0,0,0};
- //double ex_force[3] = {0,0,0};
- double cg_force[3] = {0,0,0};
- //int left_index, right_index;
-
- //ASK FOR THE WEIGHTING FUNCTIONS!!!
- double x = p1->p.adress_weight*p2->p.adress_weight;
- //double x = local_particles[p1->p.identity]->p.adress_weight*local_particles[p2->p.identity]->p.adress_weight;
-
- //NO EXPLICIT CASE!!!
- //EXPLICIT CASE - just for non-virtual particles
- if(x == 1){
- //adress_interpolation(ia_params, d, dist, force,ic_points+1);
- return;
- }
- //COARSE-GRAINED CASE
- else if(x == 0){
- adress_interpolation(ia_params, d, dist, cg_force, 0);
- for(j=0;j<3;j++){
- force[j] += cg_force[j];
- }
- //if (sqrt(cg_force[0]*cg_force[0]+cg_force[1]*cg_force[1]+cg_force[2]*cg_force[2])!=0)
- //printf("%f %f\n", dist, sqrt(cg_force[0]*cg_force[0]+cg_force[1]*cg_force[1]+cg_force[2]*cg_force[2]));
- return;
- }
- //INTERFACE PRESSURE CORRECTION: we restrict ourselves to the switching region
- else {
- //THE EXPLICIT CONTRIBUTION - just if particles are not virtual
- //adress_interpolation(ia_params, d, dist, ex_force, ic_points+1);
- //for(j=0;j<3;j++)
- // force[j] += x*ex_force[j];
-
- //THE COARSE-GRAINED CONTRIBUTION
- //classify the position of the particle:
- //if(ic_points !=0) {
- //double ic_step = 1.0/((double)ic_points + 1.0);
- // double w = 0;
- // while(x > w+ic_step){
- //left_index++;
- //w = w+ic_step;
- //}
- //right_index = left_index+1;
-
- //if(right_index < max_index){
- adress_interpolation(ia_params,d,dist,left_force, 0);
- adress_interpolation(ia_params,d,dist,right_force, 1);
-
- for(j=0;j<3;j++)
- cg_force[j] = correction_function(x)*left_force[j] + (1.0 - correction_function(x))*right_force[j];
- //} else {
- //adress_interpolation(ia_params,d,dist,cg_force,left_index);
- //}
-
- for(j=0;j<3;j++){
- force[j] += cg_force[j];
- }
- return;
- }
-
-}
-#endif
-
-/* #ifdef THERMODYNAMIC_FORCE */
-
-inline double inverse_weight(double w){
- if(adress_vars[0] == 2) {
- return 2/M_PI*asin(sqrt(w));
- } else {
- fprintf(stderr, "Thermodynamic force not implemented for this topology.\n");
- errexit();
- }
- return 0;
-}
-
-inline double adress_dw_dir(double pos[3], double dir[3]){
- int topo=(int)adress_vars[0];
- double dist, mod=0;
- int i, dim;
-
- for(i=0;i<3;i++)
- dir[i]=0.0;
-
- switch (topo) {
- case 0:
- return 0.0;
- break;
- case 1:
- return 0.0;
- break;
- case 2:
- dim=(int)adress_vars[3];
- //dist=fabs(x[dim]-adress_vars[4]);
- dist = pos[dim]-adress_vars[4];
- if(dist>0)
- while(dist>box_l[dim]/2.0)
- dist = dist - box_l[dim];
- else if(dist < 0)
- while(dist< -box_l[dim]/2.0)
- dist = dist + box_l[dim];
- dir[dim]=1;
- if(dist>0)
- return -1;
- else return 1;
-
- break;
- case 3:
- /* NOT TESTED */
- dist=distance(pos,&(adress_vars[3]));
- for(i=0;i<3;i++)
- mod += (pos[i]-adress_vars[3+i])*(pos[i]-adress_vars[3+i]);
- if(mod == 0){
- fprintf(stderr,"Particle located at the center of the box: Thermodynamic force not defined.\n");
- errexit();
- }
- for(i=0;i<3;i++)
- dir[i]=(pos[i]-adress_vars[3+i])/mod;
- if(dist < adress_vars[1]+adress_vars[2])
- return -1;
- else return 1;
- break;
- default:
- return 0.0;
- break;
- }
-}
-
-///
-int tf_set_params(int part_type, double prefactor, char * filename);
-
-inline double tf_profile(double x_com, int type, TF_parameters * tf_params){
- double phi, dindex, force, pol;
- int tablepos, table_start;
- //double maxval = tf_params->TF_TAB_maxval;
- double minval = tf_params->TF_TAB_minval;
-
- //if(weight == 0 || weight == 1)
- //force = 0.0;
- //else {
- table_start = tf_params->TF_TAB_startindex;
- dindex = (x_com-minval)/tf_params->TF_TAB_stepsize;
- tablepos = (int)(floor(dindex));
- phi = dindex - tablepos;
- pol = thermodynamic_forces.e[table_start + tablepos]*(1-phi) + thermodynamic_forces.e[table_start + tablepos+1]*phi;
-
- /* THERE IS NO EXTRAPOLATION!
- the table has to start and end ALWAYS at zero and one respectively
- */
- force = pol;
- //}
-
- return force;
-}
-
-inline void add_thermodynamic_force(Particle * p){
- TF_parameters *tf_params = get_tf_param(p->p.type);
- double pref = tf_params->TF_prefactor;
- if (pref !=0){
- double weight, width, force, sign;
- int i, type;
- double dir[3] = {0,0,0};
-
- weight = p->p.adress_weight;
- if(weight>0 && weight < 1){
- type = p->p.type;
- width = adress_vars[2];
- sign = adress_dw_dir(p->r.p, dir);
-
-
- force = pref*sign*tf_profile(inverse_weight(weight), type, tf_params)/width;
-
- for(i=0;i<3;i++)
- p->f.f[i] += force*dir[i];
- }
- }
-}
-
-/* #endif */
-
-#endif
-/*@}*/
-#endif
diff --git a/src/core/EspressoSystemInterface.cpp b/src/core/EspressoSystemInterface.cpp
new file mode 100644
index 00000000000..917bf48d09f
--- /dev/null
+++ b/src/core/EspressoSystemInterface.cpp
@@ -0,0 +1,158 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#include "EspressoSystemInterface.hpp"
+#include "cells.hpp"
+#include "particle_data.hpp"
+#include "grid.hpp"
+#include "cuda_interface.hpp"
+
+#include
+
+/* Need explicite specialization, otherwise some compilers do not produce the objects. */
+
+template class EspressoSystemInterface::const_iterator;
+template class EspressoSystemInterface::const_iterator;
+template class EspressoSystemInterface::const_iterator;
+
+/********************************************************************************************/
+
+template
+value_type EspressoSystemInterface::const_iterator::operator*() const {
+ return (*m_const_iterator);
+}
+
+template
+SystemInterface::const_iterator &EspressoSystemInterface::const_iterator::operator=(const SystemInterface::const_iterator &rhs) {
+ m_const_iterator = static_cast &>(rhs).m_const_iterator;
+ return *this;
+}
+
+template
+EspressoSystemInterface::const_iterator &EspressoSystemInterface::const_iterator::operator=(typename std::vector::const_iterator rhs) {
+ m_const_iterator = rhs;
+ return *this;
+}
+
+template
+bool EspressoSystemInterface::const_iterator::operator==(SystemInterface::const_iterator const &rhs) const {
+ return (m_const_iterator == static_cast &>(rhs).m_const_iterator);
+}
+
+template
+bool EspressoSystemInterface::const_iterator::operator!=(SystemInterface::const_iterator const &rhs) const {
+ return (m_const_iterator != static_cast &>(rhs).m_const_iterator);
+}
+
+template
+SystemInterface::const_iterator &EspressoSystemInterface::const_iterator::operator++() {
+ ++m_const_iterator;
+ return *this;
+}
+
+/********************************************************************************************/
+
+void EspressoSystemInterface::gatherParticles() {
+ Cell *cell;
+ Particle *p;
+ int i,c,np;
+
+ // get particles from other nodes
+#ifdef CUDA
+ if (m_gpu)
+ {
+ if(gpu_get_global_particle_vars_pointer_host()->communication_enabled) {
+ ESIF_TRACE(puts("Calling copy_part_data_to_gpu()"));
+ copy_part_data_to_gpu();
+ reallocDeviceMemory(gpu_get_global_particle_vars_pointer_host()->number_of_particles);
+ if(m_splitParticleStructGpu && (this_node == 0))
+ split_particle_struct();
+ }
+ }
+#endif
+
+ if (needsQ() || needsR()) {
+ R.clear();
+ #ifdef ELECTROSTATICS
+ Q.clear();
+ #endif
+
+ for (c = 0; c < local_cells.n; c++) {
+ cell = local_cells.cell[c];
+ p = cell->part;
+ np = cell->n;
+ if(needsR())
+ R.reserve(R.size()+np);
+#ifdef ELECTROSTATICS
+ if(needsQ())
+ Q.reserve(Q.size()+np);
+#endif
+ for(i = 0; i < np; i++) {
+ if(needsR())
+ R.push_back(Vector3(p[i].r.p));
+#ifdef ELECTROSTATICS
+ if(needsQ())
+ Q.push_back(p[i].p.q);
+#endif
+ }
+ }
+ }
+}
+
+void EspressoSystemInterface::init() {
+ gatherParticles();
+}
+
+void EspressoSystemInterface::update() {
+ gatherParticles();
+}
+
+SystemInterface::const_vec_iterator &EspressoSystemInterface::rBegin() {
+ m_r_begin = R.begin();
+ return m_r_begin;
+}
+
+const SystemInterface::const_vec_iterator &EspressoSystemInterface::rEnd() {
+ m_r_end = R.end();
+ return m_r_end;
+}
+
+#ifdef ELECTROSTATICS
+SystemInterface::const_real_iterator &EspressoSystemInterface::qBegin() {
+ m_q_begin = Q.begin();
+ return m_q_begin;
+}
+
+const SystemInterface::const_real_iterator &EspressoSystemInterface::qEnd() {
+ m_q_end = Q.end();
+ return m_q_end;
+}
+
+#endif
+
+unsigned int EspressoSystemInterface::npart() {
+ return m_npart;
+}
+
+SystemInterface::Vector3 EspressoSystemInterface::box() {
+ return Vector3(box_l);
+}
+
+
+
+EspressoSystemInterface espressoSystemInterface;
diff --git a/src/core/EspressoSystemInterface.hpp b/src/core/EspressoSystemInterface.hpp
new file mode 100644
index 00000000000..c62d59d3265
--- /dev/null
+++ b/src/core/EspressoSystemInterface.hpp
@@ -0,0 +1,183 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef ESPRESSOSYSTEMINTERFACE_H
+#define ESPRESSOSYSTEMINTERFACE_H
+
+#define ESIF_TRACE(A)
+
+#include "SystemInterface.hpp"
+#include "cuda_interface.hpp"
+
+class EspressoSystemInterface : public SystemInterface {
+public:
+ EspressoSystemInterface() : m_gpu_npart(0), m_gpu(false), m_r_gpu_begin(0), m_r_gpu_end(0), m_v_gpu_begin(0), m_v_gpu_end(0), m_q_gpu_begin(0), m_q_gpu_end(0), m_needsParticleStructGpu(false), m_splitParticleStructGpu(false) {};
+ virtual ~EspressoSystemInterface() {}
+
+ void init();
+ void update();
+
+ SystemInterface::Vector3 box();
+ unsigned int npart();
+
+ typedef std::vector Vector3Container;
+ typedef std::vector RealContainer;
+
+ template
+ class const_iterator : public SystemInterface::const_iterator {
+ public:
+ value_type operator*() const;
+ SystemInterface::const_iterator &operator=(const SystemInterface::const_iterator &rhs);
+ EspressoSystemInterface::const_iterator &operator=(typename std::vector::const_iterator rhs);
+ bool operator==(SystemInterface::const_iterator const &rhs) const;
+ bool operator!=(SystemInterface::const_iterator const &rhs) const;
+ SystemInterface::const_iterator &operator++();
+ private:
+ typename std::vector::const_iterator m_const_iterator;
+ };
+
+ typedef const_iterator const_real_iterator;
+ typedef const_iterator const_vec_iterator;
+ typedef const_iterator const_int_iterator;
+
+
+ SystemInterface::const_vec_iterator &rBegin();
+ const SystemInterface::const_vec_iterator &rEnd();
+ bool hasR() { return true; };
+
+#ifdef ELECTROSTATICS
+ SystemInterface::const_real_iterator &qBegin();
+ const SystemInterface::const_real_iterator &qEnd();
+ bool hasQ() { return true; };
+#endif
+
+#ifdef CUDA
+ float *rGpuBegin() { return m_r_gpu_begin; };
+ float *rGpuEnd() { return m_r_gpu_end; };
+ bool hasRGpu() { return true; };
+ bool requestRGpu() {
+ m_needsRGpu = hasRGpu();
+ m_splitParticleStructGpu |= m_needsRGpu;
+ m_gpu |= m_needsRGpu;
+ if(m_gpu)
+ enableParticleCommunication();
+ return m_needsRGpu;
+ };
+
+ float *vGpuBegin() { return m_v_gpu_begin; };
+ float *vGpuEnd() { return m_v_gpu_end; };
+ bool hasVGpu() { return true; };
+ bool requestVGpu() {
+ m_needsVGpu = hasVGpu();
+ m_splitParticleStructGpu |= m_needsVGpu;
+ m_gpu |= m_needsVGpu;
+ if(m_gpu)
+ enableParticleCommunication();
+ return m_needsVGpu;
+ };
+
+ float *qGpuBegin() { return m_q_gpu_begin; };
+ float *qGpuEnd() { return m_q_gpu_end; };
+ bool hasQGpu() { return true; };
+ bool requestQGpu() {
+ m_needsQGpu = hasQGpu();
+ m_splitParticleStructGpu |= m_needsQGpu;
+ m_gpu |= m_needsQGpu;
+ if(m_gpu)
+ enableParticleCommunication();
+ return m_needsQGpu;
+ };
+
+ bool requestParticleStructGpu() {
+ m_needsParticleStructGpu = true;
+ m_gpu |= m_needsParticleStructGpu;
+ if(m_gpu)
+ enableParticleCommunication();
+ return true;
+ }
+
+ float *fGpuBegin() { return (float *)gpu_get_particle_force_pointer(); };
+ float *fGpuEnd() { return (float *)(gpu_get_particle_force_pointer()) + 3*m_gpu_npart; };
+ float *eGpu() { return (float *)gpu_get_energy_pointer(); };
+ bool hasFGpu() { return true; };
+ bool requestFGpu() {
+ m_needsFGpu = hasFGpu();
+ m_gpu |= m_needsFGpu;
+ if(m_gpu)
+ enableParticleCommunication();
+ return m_needsFGpu;
+ };
+#endif
+
+ unsigned int npart_gpu() {
+#ifdef CUDA
+ return m_gpu_npart;
+#else
+ return 0;
+#endif
+ };
+
+protected:
+ void gatherParticles();
+ void split_particle_struct();
+#ifdef CUDA
+ void enableParticleCommunication() {
+ if(!gpu_get_global_particle_vars_pointer_host()->communication_enabled) {
+ ESIF_TRACE(puts("gpu communication not enabled;"));
+ ESIF_TRACE(puts("enableParticleCommunication"));
+ gpu_init_particle_comm();
+ cuda_bcast_global_part_params();
+ reallocDeviceMemory(gpu_get_global_particle_vars_pointer_host()->number_of_particles);
+ }
+ };
+ void reallocDeviceMemory(int n);
+#endif
+
+ Vector3Container R;
+ #ifdef ELECTROSTATICS
+ RealContainer Q;
+ #endif
+
+ const_vec_iterator m_r_begin;
+ const_vec_iterator m_r_end;
+
+ const_real_iterator m_q_begin;
+ const_real_iterator m_q_end;
+
+ int m_gpu_npart;
+ bool m_gpu;
+
+ float *m_r_gpu_begin;
+ float *m_r_gpu_end;
+
+ float *m_v_gpu_begin;
+ float *m_v_gpu_end;
+
+ float *m_q_gpu_begin;
+ float *m_q_gpu_end;
+
+ unsigned int m_npart;
+ Vector3 m_box;
+
+ bool m_needsParticleStructGpu;
+ bool m_splitParticleStructGpu;
+};
+
+extern EspressoSystemInterface espressoSystemInterface;
+
+#endif
diff --git a/src/core/EspressoSystemInterface_cuda.cu b/src/core/EspressoSystemInterface_cuda.cu
new file mode 100644
index 00000000000..b2a0cc87def
--- /dev/null
+++ b/src/core/EspressoSystemInterface_cuda.cu
@@ -0,0 +1,123 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#include "EspressoSystemInterface.hpp"
+#include "cuda_interface.hpp"
+#include "cuda_utils.hpp"
+
+__global__ void split_kernel_rq(CUDA_particle_data *particles, float *r, float *q, int n) {
+ int idx = blockDim.x*blockIdx.x + threadIdx.x;
+ if(idx >= n)
+ return;
+
+ CUDA_particle_data p = particles[idx];
+
+ r[3*idx + 0] = p.p[0];
+ r[3*idx + 1] = p.p[1];
+ r[3*idx + 2] = p.p[2];
+ #ifdef ELECTROSTATICS
+ q[idx] = p.q;
+ #endif
+}
+
+__global__ void split_kernel_q(CUDA_particle_data *particles,float *q, int n) {
+ int idx = blockDim.x*blockIdx.x + threadIdx.x;
+ if(idx >= n)
+ return;
+
+#ifdef ELECTROSTRATICS
+ CUDA_particle_data p = particles[idx];
+
+ q[idx] = p.q;
+#endif
+}
+
+__global__ void split_kernel_r(CUDA_particle_data *particles, float *r, int n) {
+ int idx = blockDim.x*blockIdx.x + threadIdx.x;
+ if(idx >= n)
+ return;
+
+ CUDA_particle_data p = particles[idx];
+
+ idx *= 3;
+
+ r[idx + 0] = p.p[0];
+ r[idx + 1] = p.p[1];
+ r[idx + 2] = p.p[2];
+}
+
+__global__ void split_kernel_v(CUDA_particle_data *particles, float *v, int n) {
+ int idx = blockDim.x*blockIdx.x + threadIdx.x;
+ if(idx >= n)
+ return;
+
+ CUDA_particle_data p = particles[idx];
+
+ idx *= 3;
+
+ v[idx + 0] = p.v[0];
+ v[idx + 1] = p.v[1];
+ v[idx + 2] = p.v[2];
+}
+
+void EspressoSystemInterface::reallocDeviceMemory(int n) {
+
+ if(m_needsRGpu && ((n != m_gpu_npart) || (m_r_gpu_begin == 0))) {
+ if(m_r_gpu_begin != 0)
+ cuda_safe_mem(cudaFree(m_r_gpu_begin));
+ cuda_safe_mem(cudaMalloc(&m_r_gpu_begin, 3*n*sizeof(float)));
+ m_r_gpu_end = m_r_gpu_begin + 3*n;
+ }
+
+ if(m_needsVGpu && ((n != m_gpu_npart) || (m_v_gpu_begin == 0))) {
+ if(m_v_gpu_begin != 0)
+ cuda_safe_mem(cudaFree(m_v_gpu_begin));
+ cuda_safe_mem(cudaMalloc(&m_v_gpu_begin, 3*n*sizeof(float)));
+ m_v_gpu_end = m_v_gpu_begin + 3*n;
+ }
+
+ if(m_needsQGpu && ((n != m_gpu_npart) || (m_q_gpu_begin == 0))) {
+ if(m_q_gpu_begin != 0)
+ cuda_safe_mem(cudaFree(m_q_gpu_begin));
+ cuda_safe_mem(cudaMalloc(&m_q_gpu_begin, 3*n*sizeof(float)));
+ m_q_gpu_end = m_q_gpu_begin + 3*n;
+ }
+
+ m_gpu_npart = n;
+}
+
+void EspressoSystemInterface::split_particle_struct() {
+ int n = gpu_get_global_particle_vars_pointer_host()->number_of_particles;
+ if(n == 0)
+ return;
+
+ ESIF_TRACE(printf("n = %d, m_gpu_npart = %d\n", n, m_gpu_npart));
+
+ dim3 grid(n/512+1,1,1);
+ dim3 block(512,1,1);
+
+ if(m_needsQGpu && m_needsRGpu)
+ split_kernel_rq<<>>(gpu_get_particle_pointer(), m_r_gpu_begin,m_q_gpu_begin,n);
+ if(m_needsQGpu && !m_needsRGpu)
+ split_kernel_q<<>>(gpu_get_particle_pointer(), m_q_gpu_begin,n);
+ if(!m_needsQGpu && m_needsRGpu)
+ split_kernel_r<<>>(gpu_get_particle_pointer(), m_r_gpu_begin,n);
+ if(m_needsVGpu)
+ split_kernel_v<<>>(gpu_get_particle_pointer(), m_v_gpu_begin,n);
+}
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
new file mode 100644
index 00000000000..20cb936e9ab
--- /dev/null
+++ b/src/core/Makefile.am
@@ -0,0 +1,329 @@
+# Copyright (C) 2012,2013,2014 The ESPResSo project
+# Copyright (C) 2007,2008,2009,2010,2011 Olaf Lenz, Axel Arnold
+#
+# This file is part of ESPResSo.
+#
+# ESPResSo is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ESPResSo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+EXTRA_DIST =
+CLEANFILES =
+
+AM_DEFAULT_SOURCE_EXT = .cpp
+
+noinst_LTLIBRARIES = libEspresso.la
+# List the sources of the Espresso binary here
+# config-features.cpp must be at the beginning so that it is compiled first
+libEspresso_la_SOURCES = \
+ config-features.cpp \
+ cells.cpp cells.hpp \
+ collision.cpp collision.hpp \
+ communication.cpp communication.hpp \
+ comfixed.cpp comfixed.hpp \
+ comforce.hpp comforce.cpp \
+ config.hpp \
+ constraint.cpp constraint.hpp \
+ cuda_interface.cpp cuda_interface.hpp\
+ cuda_init.hpp \
+ debug.cpp debug.hpp \
+ domain_decomposition.cpp domain_decomposition.hpp \
+ electrokinetics_pdb_parse.cpp electrokinetics_pdb_parse.hpp \
+ energy.cpp energy_inline.hpp energy.hpp \
+ external_potential.hpp external_potential.cpp \
+ errorhandling.cpp errorhandling.hpp \
+ fft.cpp fft.hpp \
+ fft-common.cpp fft-common.hpp \
+ fft-dipolar.cpp fft-dipolar.hpp \
+ forcecap.cpp forcecap.hpp \
+ forces.cpp forces_inline.hpp forces.hpp \
+ galilei.cpp galilei.hpp \
+ ghosts.cpp ghosts.hpp \
+ global.cpp global.hpp \
+ grid.cpp grid.hpp \
+ halo.cpp halo.hpp \
+ iccp3m.cpp iccp3m.hpp \
+ imd.cpp imd.hpp \
+ initialize.cpp initialize.hpp \
+ integrate.cpp integrate.hpp \
+ interaction_data.cpp interaction_data.hpp \
+ lattice.cpp lattice_inline.hpp lattice.hpp \
+ layered.cpp layered.hpp \
+ lb.cpp lb.hpp \
+ lb-boundaries.cpp lb-boundaries.hpp \
+ lb-d3q18.hpp lb-d3q19.hpp \
+ lbgpu.cpp lbgpu.hpp\
+ lees_edwards.cpp lees_edwards.hpp \
+ lees_edwards_domain_decomposition.cpp lees_edwards_domain_decomposition.hpp \
+ lees_edwards_comms_manager.cpp lees_edwards_comms_manager.hpp \
+ metadynamics.cpp metadynamics.hpp \
+ modes.cpp modes.hpp \
+ molforces.cpp molforces.hpp \
+ mol_cut.cpp mol_cut.hpp \
+ nemd.cpp nemd.hpp \
+ npt.hpp \
+ nsquare.cpp nsquare.hpp \
+ particle_data.cpp particle_data.hpp \
+ polymer.cpp polymer.hpp \
+ polynom.hpp \
+ pressure.cpp pressure.hpp \
+ random.cpp random.hpp \
+ rattle.cpp rattle.hpp \
+ reaction.cpp reaction.hpp \
+ Ringbuffer.hpp \
+ rotation.cpp rotation.hpp \
+ RuntimeErrorCollector.cpp RuntimeErrorCollector.hpp \
+ specfunc.cpp specfunc.hpp \
+ statistics.cpp statistics.hpp \
+ statistics_chain.cpp statistics_chain.hpp \
+ statistics_cluster.cpp statistics_cluster.hpp \
+ statistics_correlation.cpp statistics_correlation.hpp \
+ statistics_fluid.cpp statistics_fluid.hpp \
+ statistics_molecule.cpp statistics_molecule.hpp \
+ statistics_observable.cpp statistics_observable.hpp \
+ statistics_wallstuff.cpp statistics_wallstuff.hpp \
+ thermostat.cpp thermostat.hpp \
+ topology.cpp topology.hpp \
+ tuning.cpp tuning.hpp \
+ utils.hpp \
+ uwerr.cpp uwerr.hpp \
+ verlet.cpp verlet.hpp \
+ virtual_sites.cpp virtual_sites.hpp \
+ virtual_sites_com.cpp virtual_sites_com.hpp \
+ virtual_sites_relative.cpp virtual_sites_relative.hpp \
+ vmdsock.cpp vmdsock.hpp \
+ ghmc.cpp ghmc.hpp \
+ Vector.hpp \
+ SystemInterface.hpp \
+ EspressoSystemInterface.hpp EspressoSystemInterface.cpp
+
+# nonbonded potentials and forces
+libEspresso_la_SOURCES += \
+ bmhtf-nacl.cpp bmhtf-nacl.hpp \
+ buckingham.cpp buckingham.hpp \
+ dpd.cpp dpd.hpp \
+ gaussian.cpp gaussian.hpp \
+ gb.cpp gb.hpp \
+ hat.cpp hat.hpp \
+ hertzian.cpp hertzian.hpp \
+ lj.cpp lj.hpp \
+ ljangle.cpp ljangle.hpp \
+ ljcos.cpp ljcos.hpp \
+ ljcos2.cpp ljcos2.hpp \
+ ljgen.cpp ljgen.hpp \
+ morse.cpp morse.hpp \
+ soft_sphere.cpp soft_sphere.hpp \
+ steppot.cpp steppot.hpp \
+ tab.cpp tab.hpp \
+ tunable_slip.cpp tunable_slip.hpp
+
+# bonded potentials and forces
+libEspresso_la_SOURCES += \
+ angle.cpp angle.hpp \
+ angle_harmonic.cpp angle_harmonic.hpp \
+ angle_cosine.cpp angle_cosine.hpp \
+ angle_cossquare.cpp angle_cossquare.hpp \
+ angledist.cpp angledist.hpp \
+ dihedral.cpp dihedral.hpp \
+ endangledist.cpp endangledist.hpp \
+ fene.cpp fene.hpp \
+ harmonic.cpp harmonic.hpp \
+ quartic.cpp quartic.hpp \
+ overlap.cpp overlap.hpp \
+ bonded_coulomb.cpp bonded_coulomb.hpp \
+ subt_lj.cpp subt_lj.hpp \
+ object-in-fluid/area_force_local.cpp object-in-fluid/area_force_local.hpp \
+ object-in-fluid/area_force_global.cpp object-in-fluid/area_force_global.hpp \
+ object-in-fluid/bending_force.cpp object-in-fluid/bending_force.hpp \
+ object-in-fluid/stretching_force.cpp object-in-fluid/stretching_force.hpp \
+ object-in-fluid/stretchlin_force.cpp object-in-fluid/stretchlin_force.hpp \
+ object-in-fluid/volume_force.cpp object-in-fluid/volume_force.hpp
+
+# Coulomb methods
+libEspresso_la_SOURCES += \
+ debye_hueckel.cpp debye_hueckel.hpp \
+ elc.cpp elc.hpp \
+ magnetic_non_p3m_methods.cpp magnetic_non_p3m_methods.hpp \
+ mdlc_correction.cpp mdlc_correction.hpp \
+ maggs.cpp maggs.hpp \
+ mmm1d.cpp mmm1d.hpp \
+ mmm2d.cpp mmm2d.hpp \
+ mmm-common.cpp mmm-common.hpp \
+ p3m.cpp p3m.hpp \
+ p3m-common.cpp p3m-common.hpp \
+ p3m-dipolar.cpp p3m-dipolar.hpp \
+ reaction_field.cpp reaction_field.hpp
+
+# Generic actors
+libEspresso_la_SOURCES += \
+ actor/Actor.hpp \
+ actor/ActorList.cpp actor/ActorList.hpp \
+ actor/HarmonicWell.cpp actor/HarmonicWell.hpp \
+ actor/Mmm1dgpuForce.cpp actor/Mmm1dgpuForce.hpp \
+ actor/EwaldgpuForce.cpp actor/EwaldgpuForce.hpp actor/EwaldgpuForce_ShortRange.hpp \
+ actor/mmm-common_cuda.hpp actor/specfunc_cuda.hpp
+
+##################################################
+# CUDA rules
+##################################################
+if CUDA
+
+SUFFIXES=.cu
+
+CUDA_HEADER_FILES = \
+ cuda_utils.hpp \
+ cuda_interface.hpp \
+ p3m_gpu.hpp \
+ cuda_init.hpp \
+ actor/mmm-common_cuda.hpp actor/specfunc_cuda.hpp \
+ electrokinetics.hpp
+
+CUDA_SOURCE_FILES = \
+ cuda_init_cuda.cu \
+ cuda_common_cuda.cu \
+ electrokinetics_cuda.cu \
+ lbgpu_cuda.cu \
+ p3m_gpu_cuda.cu \
+ EspressoSystemInterface_cuda.cu \
+ actor/Mmm1dgpuForce_cuda.cu \
+ actor/EwaldgpuForce_cuda.cu \
+ actor/HarmonicWell_cuda.cu
+
+# include the dependency tracking files
+include ./$(DEPDIR)/cuda_init_cuda.Plo
+include ./$(DEPDIR)/cuda_common_cuda.Plo
+include ./$(DEPDIR)/electrokinetics_cuda.Plo
+include ./$(DEPDIR)/libgpu_cuda.Plo
+include ./$(DEPDIR)/p3m_gpu_cuda.Plo
+include ./$(DEPDIR)/EspressoSystemInterface_cuda.Plo
+include ./actor/$(DEPDIR)/HarmonicWell_cuda.Plo
+include ./actor/$(DEPDIR)/Mmm1dgpuForce.Plo
+include ./actor/$(DEPDIR)/Mmm1dgpuForce_cuda.Plo
+include ./actor/$(DEPDIR)/EwaldgpuForce.Plo
+include ./actor/$(DEPDIR)/EwaldgpuForce_cuda.Plo
+
+LOFILES = $(CUDA_SOURCE_FILES:.cu=.lo)
+
+cuda_verbose = $(cuda_verbose_@AM_V@)
+cuda_verbose_ = $(cuda_verbose_@AM_DEFAULT_V@)
+cuda_verbose_0 = @echo " NVCC $@";
+
+# nvcc does not allow for option MF for dependency generation,
+# therefore make a separate run to generate dependencies
+# putting them into DEPDIR ensures configure creates empties dummies
+$(LOFILES): %.lo: %.cu
+ $(cuda_verbose)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ $(NVCC) $(NVCCFLAGS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(INCLUDES) $(DEFS) \
+ -M -MT $@ -o $$depbase.Plo $<; \
+ $(LIBTOOL) $(AM_V_lt) --tag=CUDA $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(NVCC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_NVCCFLAGS) $(NVCCFLAGS) -c -o $@ $<
+
+libEspresso_la_LIBADD = $(LOFILES)
+EXTRA_DIST += $(CUDA_SOURCE_FILES) $(CUDA_HEADER_FILES)
+CLEANFILES += $(LOFILES)
+
+endif
+
+
+#################################################################
+# Handling of myconfig.hpp
+#################################################################
+noinst_HEADERS = myconfig-default.hpp
+CLEANFILES += myconfig-final.hpp
+BUILT_SOURCES = myconfig-final.hpp
+
+if MYCONFIG
+myconfig-final.hpp: FORCE
+ @if test -e $(top_builddir)/@MYCONFIG@; then \
+ echo " GEN $@ <= @MYCONFIG@"; \
+ if test -e $@; then \
+ cmp -s $(top_builddir)/@MYCONFIG@ $@ || cp $(top_builddir)/@MYCONFIG@ $@; \
+ else \
+ cp $(top_builddir)/@MYCONFIG@ $@; \
+ fi; \
+ else \
+ echo "ERROR: Couldn't find @MYCONFIG@."; \
+ exit 1; \
+ fi
+else
+myconfig-final.hpp: FORCE
+ @config_files="\
+ $(top_builddir)/myconfig.hpp \
+ $(top_srcdir)/myconfig.hpp \
+ $(srcdir)/myconfig-default.hpp"; \
+ for file in $$config_files; do \
+ if test -e $$file; then \
+ echo " GEN $@ <= $$file"; \
+ myconfig_found=1; \
+ if test -e $@; then \
+ cmp -s $$file $@ || cp $$file $@; \
+ else \
+ cp $$file $@; \
+ fi; \
+ break; \
+ fi; \
+ done; \
+ if test ! $$myconfig_found; then \
+ echo "ERROR: Couldn't find $(myconfig) anywhere"; \
+ exit 1; \
+ fi
+endif
+
+#################################################################
+# Handling of the features
+#################################################################
+EXTRA_DIST += gen_featureconfig.py config-features.hpp config-features.cpp
+
+if HAVE_PYTHON
+
+BUILT_SOURCES += config-features.hpp config-features.cpp
+CLEANFILES += config-features.hpp config-features.cpp
+config-features.hpp config-features.cpp: $(top_srcdir)/src/features.def $(srcdir)/gen_featureconfig.py
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_featureconfig.py \
+ $(top_srcdir)/src/features.def config-features.hpp config-features.cpp \
+ > /dev/null
+
+else
+
+config-features.hpp config-features.cpp: features.def
+ @echo "Python was not found in your PATH."
+ @echo "If you change the set of features, you need Python!"
+ @echo "Install it and rerun configure."
+
+endif
+
+#################################################################
+# Handling of the version
+#################################################################
+libEspresso_la_SOURCES += config-version.cpp
+CLEANFILES += config-version.cpp
+config-version.cpp: FORCE
+ $(AM_V_GEN)VERSION=`cd $(top_srcdir); sh config/genversion.sh -c`; \
+ if ! test -e "config-version.cpp" || \
+ test "$$VERSION" != "`cat config-version.cpp`"; then \
+ echo "$$VERSION" > config-version.cpp; \
+ fi
+
+#################################################################
+# Handling of the MPI fake implementation
+#################################################################
+if MPI_FAKE
+libEspresso_la_SOURCES += mpifake/mpi.h mpifake/mpi.cpp
+# mpifake should come before any system includes
+AM_CPPFLAGS = -I$(srcdir)/mpifake
+endif
+
+.PHONY: FORCE
+FORCE:
diff --git a/src/core/Ringbuffer.hpp b/src/core/Ringbuffer.hpp
new file mode 100644
index 00000000000..f4b7dbd7534
--- /dev/null
+++ b/src/core/Ringbuffer.hpp
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2010,2011,2012,2013,2014 The ESPResSo project
+ Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
+ Max-Planck-Institute for Polymer Research, Theory Group
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#ifndef __RINGBUFFER_HPP
+#define __RINGBUFFER_HPP
+
+#include
+
+template
+class Ringbuffer {
+public:
+ Ringbuffer(int _n) {
+ if(_n =< 0)
+ n = 1;
+ else if (_n > d.max_size())
+ n = d.max_size();
+ else
+ n = _n;
+ };
+ void Ringbuffer::push(T value) {
+ if(d.size() >= n)
+ d.pop_front();
+ d.push_back(value);
+ };
+ std::deque::iterator begin() { return d.begin(); };
+ std::deque::iterator end() { return d.end(); };
+private:
+ int n;
+ std::deque d;
+};
+
+#endif
diff --git a/src/core/RuntimeErrorCollector.cpp b/src/core/RuntimeErrorCollector.cpp
new file mode 100644
index 00000000000..cee2f9c6794
--- /dev/null
+++ b/src/core/RuntimeErrorCollector.cpp
@@ -0,0 +1,137 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#include "RuntimeErrorCollector.hpp"
+#include
+#include "communication.hpp"
+
+using namespace std;
+
+RuntimeErrorCollector::
+RuntimeErrorCollector(MPI_Comm _comm) {
+ this->comm = _comm;
+}
+
+void RuntimeErrorCollector::
+warning(const string &msg,
+ const char* function, const char* file, const int line) {
+ ostringstream ostr;
+ ostr << "{ WARNING: ";
+ ostr << msg;
+ ostr << " in function " << function << " (" << file << ":" << line
+ << ") on node " << this_node;
+ ostr << " } ";
+ errors.push_back(ostr.str());
+}
+
+void RuntimeErrorCollector::
+warning(const char *msg,
+ const char* function, const char* file, const int line) {
+ this->warning(string(msg), function, file, line);
+}
+
+void RuntimeErrorCollector::
+warning(const ostringstream &mstr,
+ const char* function, const char* file, const int line) {
+ this->warning(mstr.str(), function, file, line);
+}
+
+void RuntimeErrorCollector::
+error(const string &msg,
+ const char* function, const char* file, const int line) {
+ ostringstream ostr;
+ ostr << "{ ERROR: ";
+ ostr << msg;
+ ostr << " in function " << function << " (" << file << ":" << line
+ << ") on node " << this_node;
+ ostr << " } ";
+ errors.push_back(ostr.str());
+}
+
+void RuntimeErrorCollector::
+error(const char *msg,
+ const char* function, const char* file, const int line) {
+ this->error(string(msg), function, file, line);
+}
+
+void RuntimeErrorCollector::
+error(const ostringstream &mstr,
+ const char* function, const char* file, const int line) {
+ this->error(mstr.str(), function, file, line);
+}
+
+
+int RuntimeErrorCollector::
+count() {
+ int numMessages = this->errors.size();
+ MPI_Allreduce(MPI_IN_PLACE, &numMessages, 1, MPI_INT, MPI_SUM, this->comm);
+ return numMessages;
+}
+
+void RuntimeErrorCollector::clear() {
+ errors.clear();
+}
+
+list RuntimeErrorCollector::
+gather() {
+ int numMessages = this->count();
+
+ // If no processor encountered an error, return
+ if (numMessages == 0) return list();
+
+ list allerrors = this->errors;
+
+ // subtract the number of messages on the master, as they are not to be sent
+ numMessages -= this->errors.size();
+
+ MPI_Status status;
+ int count;
+ for (int i = 0; i < numMessages; ++i) {
+ // get the next message
+ MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, this->comm, &status);
+ MPI_Get_count(&status, MPI_CHAR, &count);
+
+ char buffer[count];
+ MPI_Recv(buffer, count, MPI_CHAR,
+ MPI_ANY_SOURCE, MPI_ANY_TAG, this->comm, MPI_STATUS_IGNORE);
+
+ allerrors.push_back(string());
+ string &s = allerrors.back();
+ s.assign(buffer, count);
+ }
+
+ this->clear();
+
+ return allerrors;
+}
+
+void RuntimeErrorCollector::
+gatherSlave() {
+ // If no processor encountered an error, return
+ if (this->count() == 0) return;
+
+ // send all messages
+ for (list::iterator it = this->errors.begin();
+ it != errors.end(); ++it) {
+ MPI_Send(const_cast(it->data()), it->length(), MPI_CHAR, 0, 42, this->comm);
+ }
+
+ // finally empty the list
+ this->clear();
+}
+
diff --git a/src/core/RuntimeErrorCollector.hpp b/src/core/RuntimeErrorCollector.hpp
new file mode 100644
index 00000000000..59e0441f1bc
--- /dev/null
+++ b/src/core/RuntimeErrorCollector.hpp
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#ifndef _RUNTIMEERRORCOLLECTOR_HPP
+#define _RUNTIMEERRORCOLLECTOR_HPP
+
+#include "config.hpp"
+#include
+#include
+#include "mpi.h"
+
+class RuntimeErrorCollector {
+ std::list errors;
+ MPI_Comm comm;
+public:
+ RuntimeErrorCollector(MPI_Comm comm);
+
+ void
+ warning(const std::string &msg,
+ const char* function, const char* file, const int line);
+ void
+ warning(const char *msg,
+ const char* function, const char* file, const int line);
+ void
+ warning(const std::ostringstream &mstr,
+ const char* function, const char* file, const int line);
+
+ void
+ error(const std::string &msg,
+ const char* function, const char* file, const int line);
+ void
+ error(const char *msg,
+ const char* function, const char* file, const int line);
+ void
+ error(const std::ostringstream &mstr,
+ const char* function, const char* file, const int line);
+
+ int count();
+ void clear();
+
+ std::list gather();
+ void gatherSlave();
+};
+
+#endif
diff --git a/src/core/SystemInterface.hpp b/src/core/SystemInterface.hpp
new file mode 100644
index 00000000000..23d61a8451c
--- /dev/null
+++ b/src/core/SystemInterface.hpp
@@ -0,0 +1,161 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef SYSTEMINTERFACE_H
+#define SYSTEMINTERFACE_H
+
+#include "Vector.hpp"
+#include
+
+/** @todo: Turn needsXY in getter/setter **/
+
+class SystemInterface {
+public:
+ SystemInterface() : m_needsR(false), m_needsV(false), m_needsQ(false), m_needsRGpu(false), m_needsVGpu(false), m_needsQGpu(false) {};
+ typedef Vector3d Vector3;
+ typedef double Real;
+
+ virtual void init() = 0;
+ virtual void update() = 0;
+
+ template
+ class const_iterator {
+ public:
+ virtual value_type operator*() const = 0;
+ virtual const_iterator &operator=(const const_iterator &rhs) = 0;
+ virtual bool operator==(const_iterator const &rhs) const = 0;
+ virtual bool operator!=(const_iterator const &rhs) const = 0;
+ virtual const_iterator &operator++() = 0;
+ };
+
+ class null_vec_iterator : public SystemInterface::const_iterator {
+ public:
+ Vector3 operator*() const { return Vector3(); };
+ const_iterator &operator=(const const_iterator &rhs) { return *this; };
+ bool operator==(const_iterator const &rhs) const { return true; };
+ bool operator!=(const_iterator const &rhs) const { return false; };
+ const_iterator &operator++() {return *this;};
+ };
+
+ null_vec_iterator null_vector;
+
+ class null_real_iterator : public SystemInterface::const_iterator {
+ public:
+ Real operator*() const { return Real(); };
+ const_iterator &operator=(const const_iterator &rhs) { return *this; };
+ bool operator==(const_iterator const &rhs) const { return true; };
+ bool operator!=(const_iterator const &rhs) const { return false; };
+ const_iterator &operator++() {return *this;};
+ };
+
+ null_real_iterator null_scalar;
+
+ template
+ class const_iterator_stl : public SystemInterface::const_iterator {
+ public:
+ const_iterator_stl(typename stl_container::const_iterator it) {
+ m_const_iterator = it;
+ };
+ const_iterator_stl() {};
+ const typename stl_container::value_type operator*() const {
+ return (*m_const_iterator);
+ };
+ SystemInterface::const_iterator &operator=(const SystemInterface::const_iterator &rhs) {
+ m_const_iterator = static_cast &>(rhs).m_const_iterator;
+ return static_cast &>(*this);
+ };
+ const_iterator_stl &operator=(const typename stl_container::const_iterator &rhs) {
+ m_const_iterator = rhs;
+ return *this;
+ };
+
+ const_iterator_stl &operator=(const const_iterator_stl &rhs) {
+ m_const_iterator = rhs.m_const_iterator;
+ return *this;
+ };
+
+ bool operator==(SystemInterface::const_iterator const &rhs) const {
+ return (m_const_iterator == static_cast &>(rhs).m_const_iterator);
+ };
+ bool operator!=(SystemInterface::const_iterator const &rhs) const {
+ return (m_const_iterator != static_cast &>(rhs).m_const_iterator);
+ };
+ const_iterator &operator++() {
+ ++m_const_iterator;
+ return *this;
+ };
+ private:
+ typename stl_container::const_iterator m_const_iterator;
+ };
+
+ typedef const_iterator const_vec_iterator;
+ typedef const_iterator const_real_iterator;
+ typedef const_iterator const_int_iterator;
+
+ virtual const_vec_iterator &rBegin() { return SystemInterface::null_vector; };
+ virtual const const_vec_iterator &rEnd() { return SystemInterface::null_vector; };
+ virtual bool hasR() { return false; };
+ virtual bool requestR() { m_needsR = hasR(); return m_needsR; }
+
+ virtual float *rGpuBegin() { return 0; };
+ virtual float *rGpuEnd() { return 0; };
+ virtual bool hasRGpu() { return false; };
+ virtual bool requestRGpu() { m_needsRGpu = hasRGpu(); return m_needsRGpu; }
+
+ virtual float *vGpuBegin() { return 0; };
+ virtual float *vGpuEnd() { return 0; };
+ virtual bool hasVGpu() { return false; };
+ virtual bool requestVGpu() { m_needsVGpu = hasVGpu(); return m_needsVGpu; }
+
+ virtual float *qGpuBegin() { return 0; };
+ virtual float *qGpuEnd() { return 0; };
+ virtual bool hasQGpu() { return false; };
+ virtual bool requestQGpu() { m_needsQGpu = hasQGpu(); return m_needsQGpu; }
+
+ virtual float *fGpuBegin() { return 0; };
+ virtual float *fGpuEnd() { return 0; };
+ virtual float *eGpu() { return 0; };
+ virtual bool hasFGpu() { return false; };
+ virtual bool requestFGpu() { m_needsFGpu = hasFGpu(); return m_needsFGpu; }
+
+ virtual const_real_iterator &qBegin() { return null_scalar; };
+ virtual const const_real_iterator &qEnd() { return null_scalar; };
+ virtual bool hasQ() { return false; };
+ virtual bool requestQ() { m_needsQ = hasQ(); return m_needsQ; }
+
+ virtual unsigned int npart() = 0;
+ virtual unsigned int npart_gpu() { return 0; };
+ virtual Vector3 box() = 0;
+
+ virtual bool needsR() { return m_needsR; };
+ virtual bool needsRGpu() { return m_needsRGpu;};
+ virtual bool needsQGpu() { return m_needsQGpu;};
+ virtual bool needsQ() { return m_needsQ;};
+ virtual bool needsFGpu() { return m_needsFGpu; };
+
+protected:
+ bool m_needsR;
+ bool m_needsV;
+ bool m_needsQ;
+ bool m_needsRGpu;
+ bool m_needsVGpu;
+ bool m_needsQGpu;
+ bool m_needsFGpu;
+};
+
+#endif
diff --git a/src/core/Vector.hpp b/src/core/Vector.hpp
new file mode 100644
index 00000000000..222b17a813d
--- /dev/null
+++ b/src/core/Vector.hpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#include
+
+template
+class Vector {
+private:
+ Scalar *d;
+public:
+ Vector() : d(new Scalar[n]) {};
+
+ Vector(Scalar *a) : d(new Scalar[n]) {
+ for (int i = 0; i < n; i++)
+ d[i] = a[i];
+ };
+
+ ~Vector() {
+ delete[] d;
+ }
+
+ Vector(const Vector& rhs) : d(new Scalar[n]) {
+ std::copy(rhs.d,rhs.d+n,d);
+ }
+
+ void swap(Vector& rhs) {
+ std::swap(d,rhs.d);
+ }
+
+ Vector& operator=(Vector& rhs) {
+ Vector tmp(rhs); swap(rhs); return *this;
+ };
+
+ Scalar &operator[](int i) {
+ return d[i];
+ };
+
+ Scalar dot(Vector b) {
+ Scalar sum = 0.0;
+ for(int i = 0; i < n; i++)
+ sum += d[i]*b[i];
+ return sum;
+ };
+};
+
+typedef Vector<3, double> Vector3d;
+
diff --git a/src/core/actor/Actor.hpp b/src/core/actor/Actor.hpp
new file mode 100644
index 00000000000..30194091f19
--- /dev/null
+++ b/src/core/actor/Actor.hpp
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef _ACTOR_ACTOR_HPP
+#define _ACTOR_ACTOR_HPP
+
+#include "SystemInterface.hpp"
+
+/**
+ * Generic abstract potential class.
+ * All potentials should be derived from this one.
+ */
+class Actor {
+public:
+ virtual void computeForces(SystemInterface &s) = 0;
+ virtual void computeEnergy(SystemInterface &s) = 0;
+ virtual ~Actor() {}
+};
+
+#endif /* _ACTOR_ACTOR_HPP */
diff --git a/src/core/actor/ActorList.cpp b/src/core/actor/ActorList.cpp
new file mode 100644
index 00000000000..ee0b074e9cb
--- /dev/null
+++ b/src/core/actor/ActorList.cpp
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#include "ActorList.hpp"
+#include
+#include
+
+void ActorList::add(Actor *actor) {
+ this->push_back(actor);
+}
+
+void ActorList::remove(Actor *actor) {
+ iterator needle = std::find(this->begin(), this->end(), actor);
+ assert(needle != this->end());
+ this->erase(needle);
+}
diff --git a/src/core/actor/ActorList.hpp b/src/core/actor/ActorList.hpp
new file mode 100644
index 00000000000..6895a52df6b
--- /dev/null
+++ b/src/core/actor/ActorList.hpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2014 The ESPResSo project
+
+ This file is part of ESPResSo.
+
+ ESPResSo is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ ESPResSo is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+#ifndef _ACTOR_ACTORLIST_HPP
+#define _ACTOR_ACTORLIST_HPP
+
+#include
+#include "Actor.hpp"
+
+class ActorList : public std::vector {
+public:
+ void add(Actor *actor);
+ void remove(Actor *actor);
+};
+
+#endif /* ACTORLIST_HPP_ */
diff --git a/src/core/actor/EwaldgpuForce.cpp b/src/core/actor/EwaldgpuForce.cpp
new file mode 100644
index 00000000000..78cfb660d9e
--- /dev/null
+++ b/src/core/actor/EwaldgpuForce.cpp
@@ -0,0 +1,340 @@
+#include "actor/EwaldgpuForce.hpp"
+
+#ifdef EWALD_GPU
+
+#include
+#include
+#include "tuning.hpp"
+#include "integrate.hpp"
+#include "grid.hpp"
+#include "interaction_data.hpp"
+#include "cells.hpp"
+
+typedef ewaldgpu_real real;
+extern Ewaldgpu_params ewaldgpu_params;
+
+//Compute reciprocal space vectors k
+void EwaldgpuForce::compute_num_k()
+{
+ int Index=0;//Arrayindex
+
+ for (long long ix=0; ix<=m_num_kx; ix++)
+ {
+ for (long long iy=-m_num_ky; iy<=m_num_ky; iy++)
+ {
+ for (long long iz=-m_num_kz; iz<=m_num_kz; iz++)
+ {
+ if(ix*(2*m_num_ky+1)*(2*m_num_kz+1)+iy*(2*m_num_kz+1)+iz >= 0//Half m_k-space
+ and SQR(ix)*SQR(m_num_ky)*SQR(m_num_kz)
+ + SQR(iy)*SQR(m_num_kx)*SQR(m_num_kz)
+ + SQR(iz)*SQR(m_num_kx)*SQR(m_num_ky)
+ <=SQR(m_num_kx)*SQR(m_num_ky)*SQR(m_num_kz))//m_k-space ellipsoid
+ {
+ Index+=1;
+ }
+ }
+ }
+ }
+ m_num_k=Index;
+}
+void EwaldgpuForce::compute_k_AND_influence_factor()
+{
+ real k_sqr;//Absolute square of m_k-vector
+ int Index=0;//Arrayindex
+
+ for (long long ix=0; ix<=m_num_kx; ix++)//Half m_k-space
+ {
+ for (long long iy=-m_num_ky; iy<=m_num_ky; iy++)
+ {
+ for (long long iz=-m_num_kz; iz<=m_num_kz; iz++)
+ {
+ if(ix*(2*m_num_ky+1)*(2*m_num_kz+1)+iy*(2*m_num_kz+1)+iz >= 0//Half m_k-space
+ and SQR(ix)*SQR(m_num_ky)*SQR(m_num_kz)
+ + SQR(iy)*SQR(m_num_kx)*SQR(m_num_kz)
+ + SQR(iz)*SQR(m_num_kx)*SQR(m_num_ky)
+ <=SQR(m_num_kx)*SQR(m_num_ky)*SQR(m_num_kz))//m_k-space ellipsoid
+ {
+ //m_k vectors
+ m_k[Index] = 2*M_PI/m_box_l[0]*ix;
+ m_k[Index+m_num_k] = 2*M_PI/m_box_l[1]*iy;
+ m_k[Index+2*m_num_k] = 2*M_PI/m_box_l[2]*iz;
+ //Influence factor
+ k_sqr= SQR(m_k[Index]) + SQR(m_k[Index+m_num_k]) + SQR(m_k[Index+2*m_num_k]);
+ m_infl_factor[Index] = 8*M_PI/m_V*expf(-k_sqr/(4*SQR(m_alpha)))/k_sqr;
+ //Index
+ Index+=1;
+ }
+ }
+ }
+ } m_infl_factor[0] = 0;//Influence factor at m_k=(0,0,0)
+}
+
+//Real space
+void EwaldgpuForce::EwaldCPU_EnergySelf()
+{
+ m_energy_self=coulomb.prefactor * (-m_alpha/sqrt(M_PI) * m_q_sqr[0]);
+}
+
+//Parameters
+int EwaldgpuForce::set_params(double rcut, int num_kx, int num_ky, int num_kz, double alpha)
+{
+ IA_parameters *data = get_ia_param_safe(0, 0);
+ data->max_cut = rcut;
+ ewaldgpu_params.rcut = rcut;
+ ewaldgpu_params.num_kx = num_kx;
+ ewaldgpu_params.num_ky = num_ky;
+ ewaldgpu_params.num_kz = num_kz;
+ ewaldgpu_params.alpha = alpha;
+
+ return 0;
+}
+int EwaldgpuForce::set_params_tune(double accuracy, double precision, int K_max, int time_calc_steps)
+{
+ ewaldgpu_params.accuracy = accuracy;
+ ewaldgpu_params.precision = precision;
+ ewaldgpu_params.K_max = K_max;
+ ewaldgpu_params.time_calc_steps = time_calc_steps;
+
+ return 0;
+}
+
+//Tuning
+int EwaldgpuForce::adaptive_tune(char **log,SystemInterface &s)
+{
+ ewaldgpu_params.isTuned = false;
+ int Kmax = ewaldgpu_params.K_max;
+ double alpha_array[Kmax]; //All computed alpha in dependence of K
+ double rcut_array[Kmax]; //All computed r_cut in dependence of all computed alpha
+
+ //Squared charge
+ Particle *particle;
+ particle = (Particle*)malloc(n_part*sizeof(Particle));
+ mpi_get_particles(particle, NULL);
+ double q_sqr = compute_q_sqare(particle);
+
+ char b[3*ES_INTEGER_SPACE + 3*ES_DOUBLE_SPACE + 128];
+
+ if (skin == -1) {
+ *log = strcat_alloc(*log, "ewaldgpu cannot be tuned, since the skin is not yet set");
+ return ES_ERROR;
+ }
+
+ //Compute alpha for all reciprocal k-sphere radius K
+ for(int K = 0; K < Kmax ;K++)
+ {
+ alpha_array[K] = tune_alpha(ewaldgpu_params.accuracy/sqrt(2), ewaldgpu_params.precision, K+1, box_l[0]*box_l[1]*box_l[2], q_sqr, n_part);
+ //printf("K:%i alpha:%f\n",K+1,alpha_array[K]);
+ }
+ //Compute r_cut for all computed alpha
+ for(int K = 0; K < Kmax ;K++)
+ {
+ rcut_array[K] = tune_rcut(ewaldgpu_params.accuracy/sqrt(2), ewaldgpu_params.precision, alpha_array[K], box_l[0]*box_l[1]*box_l[2], q_sqr, n_part);
+ //printf("K:%i rcut:%f \n",K+1,rcut_array[K]);
+ }
+ //Test if accuracy was reached
+ if(rcut_array[Kmax-1]<0)
+ {
+ return ES_ERROR;
+ }
+
+ /***********************************************************************************
+ PERFORMANCE TIME
+ ***********************************************************************************/
+
+ //Test performance time for the diverent (K, rcut, alpha)
+ double int_time_best = 1E30;
+ int K_best = Kmax;
+ for(int K = 0; K < Kmax ;K++)
+ {
+ if(alpha_array[K]>0 and rcut_array[K]>0 and rcut_array[K]<(std::min(box_l[0],std::min(box_l[1],box_l[2])))/2.0-skin)
+ {
+ set_params(rcut_array[K], K+1, K+1, K+1, alpha_array[K]);
+ mpi_bcast_coulomb_params();
+ double int_time = time_force_calc(ewaldgpu_params.time_calc_steps);
+ if(int_time 0.0)
+ {
+ return -1; // Value unusable
+ }
+
+ do
+ {
+ alpha_guess = 0.5 *(alpha_low + alpha_high);
+ fkt_guess = error_estimate_k(q_sqr, N, K, V, alpha_guess, accuracy);
+ if (fkt_low*fkt_guess < 0.0) alpha_high = alpha_guess;
+ else alpha_low = alpha_guess;
+
+ } while (fabs(alpha_low-alpha_high) > precision);
+
+ return 0.5 *(alpha_low + alpha_high);
+}
+double EwaldgpuForce::tune_rcut(double accuracy, double precision, double alpha, double V, double q_sqr, int N)
+{
+ double rcut_low=0.0;
+ double rcut_high=0.5 * std::max(box_l[0],std::max(box_l[1],box_l[2]));
+ double rcut_guess;
+ double fkt_low;
+ double fkt_high;
+ double fkt_guess;
+
+ // Find rcut with given K in k-space error estimate via bisection
+ fkt_low = error_estimate_r(q_sqr, N, rcut_low, V, alpha, accuracy);
+ fkt_high = error_estimate_r(q_sqr, N, rcut_high, V, alpha, accuracy);
+
+ if (fkt_low*fkt_high > 0.0)
+ {
+ return -1; // Value unusable
+ }
+
+ do
+ {
+ rcut_guess = 0.5 *(rcut_low + rcut_high);
+ fkt_guess = error_estimate_r(q_sqr, N, rcut_guess, V, alpha, accuracy);
+ if (fkt_low*fkt_guess < 0.0) rcut_high = rcut_guess;
+ else rcut_low = rcut_guess;
+
+ } while (fabs(rcut_low-rcut_high) > precision);
+
+ return 0.5 *(rcut_low + rcut_high);
+}
+int EwaldgpuForce::determine_calc_time_steps()
+{
+ Cell *cell;
+ Particle *part;
+ int i,c,np;
+ int sum_qpart =0;
+
+ for (c = 0; c < local_cells.n; c++)
+ {
+ cell = local_cells.cell[c];
+ part = cell->part;
+ np = cell->n;
+ for(i=0;i 0.0)
+ {
+ fprintf(stderr, "Error: Could not init method to find optimal alpha!\n");
+ exit(1);
+ }
+
+ do
+ {
+ alpha_guess = 0.5 *(alpha_low + alpha_high);
+ f_guess = compute_E_error_estimate_r(alpha_guess, rcut, q_sqr, box_l) - compute_E_error_estimate_k(alpha_guess, num_kx, num_ky, num_kz, q_sqr, box_l);
+ if (f_low*f_guess < 0.0) alpha_high = alpha_guess;
+ else alpha_low = alpha_guess;
+ counter++;
+ if(counter>10000)
+ {
+ fprintf(stderr, "Find optimal alpha: Maximum number of loops exceeded: %i loops",counter);
+ exit(1);
+ }
+ } while (fabs(alpha_low-alpha_high) > precision);
+
+ return 0.5 *(alpha_low + alpha_high);
+}
+double EwaldgpuForce::compute_q_sqare(Particle *particle)
+{
+ double q_sqr=0;
+
+ for(int i = 0; i < n_part; i++)
+ {
+ q_sqr += SQR(particle[i].p.q);
+ }
+ return q_sqr;
+}
+
+#endif
diff --git a/src/core/actor/EwaldgpuForce.hpp b/src/core/actor/EwaldgpuForce.hpp
new file mode 100644
index 00000000000..38a0b5cd0ee
--- /dev/null
+++ b/src/core/actor/EwaldgpuForce.hpp
@@ -0,0 +1,109 @@
+#ifndef EWALDGPUFORCE_HPP
+#define EWALDGPUFORCE_HPP
+#include "config.hpp"
+
+#ifdef EWALD_GPU
+
+#include "SystemInterface.hpp"
+#include "Actor.hpp"
+#include "particle_data.hpp"
+#include
+
+typedef float ewaldgpu_real;
+
+void addEwaldgpuForce(double r_cut, int num_kx, int num_ky, int num_kz, double alpha);
+
+typedef struct {
+ //Ewald parameters
+ double rcut;
+ int num_kx;
+ int num_ky;
+ int num_kz;
+ double alpha;
+ //Tuning
+ double accuracy;
+ double precision;
+ bool isTuned; // Tuning is over
+ bool isTunedFlag; // Flag tuning is over
+ int K_max; // Maximal reciprocal K-vector in tuning
+ int time_calc_steps; // Steps in time_force_calc function
+} Ewaldgpu_params;
+
+extern Ewaldgpu_params ewaldgpu_params;
+
+class EwaldgpuForce : public Actor {
+public:
+ EwaldgpuForce(SystemInterface &s, double r_cut, int num_kx, int num_ky, int num_kz, double alpha);
+ ~EwaldgpuForce();
+ void setup(SystemInterface &s);
+ void computeForces(SystemInterface &s);
+ void computeEnergy(SystemInterface &s);
+ //Set parameters
+ int set_params(double rcut, int num_kx, int num_ky, int num_kz, double alpha);
+ int set_params_tune(double accuracy, double precision, int K_max, int time_calc_steps);
+ //Tuning
+ int adaptive_tune(char **log, SystemInterface &s);
+ double error_estimate_r(double q_sqr, int N, double r_cut, double V, double alpha, double accuracy);
+ double error_estimate_k(double q_sqr, int N, int K, double V, double alpha, double accuracy);
+ double tune_alpha(double accuracy, double precision, int K, double V, double q_sqr, int N);
+ double tune_rcut(double accuracy, double precision, double alpha, double V, double q_sqr, int N);
+ int determine_calc_time_steps();
+ //Kolaffa compute optimal alpha
+ double compute_E_error_estimate_r(double alpha, double rcut, double q_sqr, double box_l[3]);
+ double compute_E_error_estimate_k(double alpha, int num_kx, int num_ky, int num_kz, double q_sqr, double box_l[3]);
+ double E_estimate_error(double rcut, int num_kx, int num_ky, int num_kz, double alpha, double q_sqr, double box_l[3]);
+ double compute_optimal_alpha(double rcut, int num_kx, int num_ky, int num_kz, double q_sqr, double box_l[3], double precision);
+ double compute_q_sqare(Particle *particle);
+
+protected:
+ //System
+ double m_box_l[3]; //Box length
+ double m_V; //Volume
+ double m_coulomb_prefactor; //Forces, energy is multiplied with this factor
+ int m_N; //Number of particles
+ ewaldgpu_real *m_k; //k-vectors
+ ewaldgpu_real *m_dev_k; //k-vectors
+ ewaldgpu_real *m_forces_reci; //Forces k-space
+ ewaldgpu_real *m_dev_forces_reci; //Forces k-space
+ ewaldgpu_real *m_infl_factor; //Influence factor
+ ewaldgpu_real *m_dev_infl_factor; //Influence factor
+ ewaldgpu_real *m_rho_hat; //Rho hat
+ ewaldgpu_real *m_dev_rho_hat; //Rho hat
+ ewaldgpu_real *m_energy_reci; //Energy k-space
+ ewaldgpu_real *m_dev_energy_reci; //Energy k-space
+ ewaldgpu_real *m_q_sqr; //Sum of the squares of the particle charges
+ ewaldgpu_real *m_dev_q_sqr; //Sum of the squares of the particle charges
+ ewaldgpu_real m_energy_self; //Energy self
+ ewaldgpu_real m_energy_tot; //Energy total
+ //Parameters
+ double m_alpha; //Separation parameter
+ double m_rcut; //Cutoff radius
+ int m_num_kx, m_num_ky, m_num_kz, m_num_k; //Number of k's in xyz-direction
+
+protected:
+ //Variables
+ bool m_isTuned; //Tuning is over
+ SystemInterface *System;
+ //Ccompute k's
+ void compute_num_k(); //Compute the number of k's in sphere respectively in ellipsoid
+ void compute_k_AND_influence_factor(); //Compute the k-vectors in sphere respectively in ellipsoid and influence factor
+ //GPU program
+ void GPU_Forces(SystemInterface &s); //Run GPU forces part
+ void GPU_Energy(SystemInterface &s); //Run GPU energy part
+ void GPU_q_sqr(SystemInterface &s); // Compute q squared
+ int nextPow2(int x); //Determine the next power of x
+ bool isPow2(int x); //Determine if x of power 2
+ void getNumBlocksAndThreads(int Size, int maxBlocks, int maxThreads, int &blocks, int &threads); // Determine the number of blocks and threads in GPU part
+ //Output
+ void Output(); //Output in terminal
+ //Real space
+ void EwaldCPU_EnergySelf(); //Calculate the self energy
+};
+
+extern EwaldgpuForce *ewaldgpuForce;
+
+void addEwaldgpuForce(double rcut, int num_kx, int num_ky, int num_kz, double alpha);
+
+#endif
+#endif
+
diff --git a/src/core/actor/EwaldgpuForce_ShortRange.hpp b/src/core/actor/EwaldgpuForce_ShortRange.hpp
new file mode 100644
index 00000000000..4d80342c8de
--- /dev/null
+++ b/src/core/actor/EwaldgpuForce_ShortRange.hpp
@@ -0,0 +1,37 @@
+#ifndef EWALDGPUFORCESHORTRANGE_HPP_
+#define EWALDGPUFORCESHORTRANGE_HPP_
+
+#ifdef EWALD_GPU
+#include "actor/EwaldgpuForce.hpp"
+
+//Add energy
+inline double ewaldgpu_coulomb_pair_energy(double chgfac, double *d,double dist2,double dist)
+{
+ if (dist < ewaldgpu_params.rcut)
+ {
+ return coulomb.prefactor*chgfac*erfc(ewaldgpu_params.alpha*dist)/dist;
+ }
+ return 0.0;
+}
+
+//Add forces
+inline void add_ewald_gpu_coulomb_pair_force(Particle *p1, Particle *p2, double d[3], double dist, double force[3])
+{
+ int j;
+ double fac;
+ double rcut=ewaldgpu_params.rcut;
+ if(dist < rcut)
+ {
+ fac=coulomb.prefactor * p1->p.q * p2->p.q * ( 2*ewaldgpu_params.alpha/sqrt(M_PI) * exp(-pow(ewaldgpu_params.alpha *dist,2)) + erfc(ewaldgpu_params.alpha*dist)/dist )/pow(dist,2);
+
+ for(j=0;j<3;j++)
+ force[j] += fac * d[j];
+
+ ONEPART_TRACE(if(p1->p.identity==check_id) fprintf(stderr,"%d: OPT: EWALD_GPU f = (%.3e,%.3e,%.3e) with part id=%d at dist %f fac %.3e\n",this_node,p1->f.f[0],p1->f.f[1],p1->f.f[2],p2->p.identity,dist,fac));
+ ONEPART_TRACE(if(p2->p.identity==check_id) fprintf(stderr,"%d: OPT: EWALD_GPU f = (%.3e,%.3e,%.3e) with part id=%d at dist %f fac %.3e\n",this_node,p2->f.f[0],p2->f.f[1],p2->f.f[2],p1->p.identity,dist,fac));
+ }
+}
+
+#endif
+
+#endif /* EWALDGPUFORCESHORTRANGE_HPP_ */
diff --git a/src/core/actor/EwaldgpuForce_cuda.cu b/src/core/actor/EwaldgpuForce_cuda.cu
new file mode 100644
index 00000000000..1e950ff1928
--- /dev/null
+++ b/src/core/actor/EwaldgpuForce_cuda.cu
@@ -0,0 +1,1097 @@
+#include "actor/EwaldgpuForce.hpp"
+#include "cuda_utils.hpp"
+
+#ifdef EWALD_GPU
+
+#include
+#include
+
+#include "interaction_data.hpp"
+#include "EspressoSystemInterface.hpp"
+
+#if defined(OMPI_MPI_H) || defined(_MPI_H)
+#error CU-file includes mpi.h! This should not happen!
+#endif
+
+typedef ewaldgpu_real real;
+Ewaldgpu_params ewaldgpu_params;
+
+//Stream
+cudaEvent_t *start, *stop;
+cudaStream_t *stream0;
+
+void cuda_check_error(const dim3 &block, const dim3 &grid,const char *function, const char *file, unsigned int line);
+
+//Error handler
+static void HandleError(cudaError_t err,const char *file,int line)
+{
+ if( cudaSuccess != err) {
+ fprintf(stderr, "Cuda Memory error at %s:%u.\n", file, line);
+ printf("CUDA error: %s\n", cudaGetErrorString(err));
+ if ( err == cudaErrorInvalidValue )
+ fprintf(stderr, "You may have tried to allocate zero memory at %s:%u.\n", file, line);
+ exit(EXIT_FAILURE);
+ } else {
+ err=cudaGetLastError();
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Error found during memory operation. Possibly however from an failed operation before. %s:%u.\n", file, line);
+ printf("CUDA error: %s\n", cudaGetErrorString(err));
+ if ( err == cudaErrorInvalidValue )
+ fprintf(stderr, "You may have tried to allocate zero memory before %s:%u.\n", file, line);
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))
+#define HANDLE_NULL( a ) {if (a == NULL) {printf( "Host memory failed in %s at line %d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE );}}
+
+//Kernels
+/*Here MaxThreads/LowThreads means that, if for example 10000 Particles/k-Vectors are given and the GPU uses 256 Threads the first 19*(2*256)=9728 will be
+reduced by the MaxThread function and the remaining 272 Particles will be reduced by the LowThread function*/
+//Structure factor
+template
+__global__ void EwaldGPU_Rho_hat_MaxThreads(real *k,real *r_i, real *q_i, real *rho_hat, int N, int num_k, int maxThreadsPerBlock,int loops)
+{
+ //Reject unneeded blocks
+ if (blockIdx.x*gridDim.x+blockIdx.y >= num_k) return;
+
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ real kr;
+ real factor;
+ real sin_kr;
+ real cos_kr;
+ real *sin_ptr=&sin_kr;
+ real *cos_ptr=&cos_kr;
+ int blockId = blockIdx.x*gridDim.x+blockIdx.y;
+ int l = loops;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+ sdata[tid+2*blockSize] = 0;
+
+ //Reduction
+ while (i < mTPB)
+ {
+ kr = k[blockId]*r_i[3*(i+2*l*mTPB)]+k[blockId+num_k]*r_i[3*(i+2*l*mTPB)+1]+k[blockId+2*num_k]*r_i[3*(i+2*l*mTPB)+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = q_i[i+2*l*mTPB];
+ sdata[tid] += factor*cos_kr;
+ sdata[tid+2*blockSize] += -factor*sin_kr;
+
+ //BECAUSE nIsPow2=True
+ kr = k[blockId]*r_i[3*(i+2*l*mTPB+blockSize)]+k[blockId+num_k]*r_i[3*(i+2*l*mTPB+blockSize)+1]+k[blockId+2*num_k]*r_i[3*(i+2*l*mTPB+blockSize)+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = q_i[i+2*l*mTPB+blockSize];
+ sdata[tid] += factor*cos_kr;
+ sdata[tid+2*blockSize] += -factor*sin_kr;
+
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ rho_hat[blockId] += sdata[0];
+ rho_hat[blockId+num_k] += sdata[2*blockSize];
+ }
+ __syncthreads();
+}
+template
+__global__ void EwaldGPU_Rho_hat_LowThreads(real *k,real *r_i, real *q_i, real *rho_hat, int N, int num_k,int maxThreadsPerBlock,int elapsedLoops)
+{
+ //Reject unneeded blocks
+ if (blockIdx.x*gridDim.x+blockIdx.y >= num_k) return;
+
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ int l=elapsedLoops;
+ real kr;
+ real factor;
+ real sin_kr;
+ real cos_kr;
+ real *sin_ptr=&sin_kr;
+ real *cos_ptr=&cos_kr;
+ int blockId = blockIdx.x*gridDim.x+blockIdx.y;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+ sdata[tid+2*blockSize] = 0;
+
+ //Reduction
+ while (i < N-2*l*mTPB)
+ {
+ kr = k[blockId]*r_i[3*(i+2*l*mTPB)]+k[blockId+num_k]*r_i[3*(i+2*l*mTPB)+1]+k[blockId+2*num_k]*r_i[3*(i+2*l*mTPB)+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = q_i[i+2*l*mTPB];
+
+ sdata[tid] += factor*cos_kr;
+ sdata[tid+2*blockSize] += -factor*sin_kr;
+ if (nIsPow2 || i + blockSize < N-2*l*mTPB)
+ {
+ kr = k[blockId]*r_i[3*(i+blockSize+2*l*mTPB)]+k[blockId+num_k]*r_i[3*(i+blockSize+2*l*mTPB)+1]+k[blockId+2*num_k]*r_i[3*(i+blockSize+2*l*mTPB)+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = q_i[i+2*l*mTPB+blockSize];
+ sdata[tid] += factor*cos_kr;
+ sdata[tid+2*blockSize] += -factor*sin_kr;
+ }
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ rho_hat[blockId] += sdata[0];
+ rho_hat[blockId+num_k] += sdata[2*blockSize];
+ }
+}
+//Forces in reciprocal space
+template
+__global__ void EwaldGPU_ForcesReci_MaxThreads(real *k,real *r_i, real *q_i, real *rho_hat, real *infl_factor, real *forces_reci, int N, int num_k, real V, real coulomb_prefactor, int maxThreadsPerBlock,int loops)
+{
+ //Reject unneeded blocks
+ if (blockIdx.x*gridDim.x+blockIdx.y >= N) return;
+
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ real kr;
+ real factor;
+ real sin_kr;
+ real cos_kr;
+ real *sin_ptr=&sin_kr;
+ real *cos_ptr=&cos_kr;
+ int blockId = blockIdx.x*gridDim.x+blockIdx.y;
+ int l = loops;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+ sdata[tid+2*blockSize] = 0;
+ sdata[tid+4*blockSize] = 0;
+
+ //Reduction
+ while (i < mTPB)
+ {
+ kr = k[i+2*l*mTPB]*r_i[3*blockId] + k[i+2*l*mTPB+num_k]*r_i[3*blockId+1] + k[i+2*l*mTPB+2*num_k]*r_i[3*blockId+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = infl_factor[i+2*l*mTPB] * q_i[blockId];
+
+ sdata[tid] += factor * (k[i+2*l*mTPB]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ sdata[tid+2*blockSize] += factor * (k[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ sdata[tid+4*blockSize] += factor * (k[i+2*l*mTPB+2*num_k]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB+2*num_k]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ //BECAUSE nIsPow2=True
+ kr = k[i+2*l*mTPB+blockSize]*r_i[3*blockId] + k[i+2*l*mTPB+num_k+blockSize]*r_i[3*blockId+1] + k[i+2*l*mTPB+2*num_k+blockSize]*r_i[3*blockId+2];
+ factor = infl_factor[i+2*l*mTPB+blockSize]* q_i[blockId];
+ sincos(kr,sin_ptr,cos_ptr);
+ sdata[tid] += factor * (k[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+ sdata[tid+2*blockSize] += factor * (k[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+ sdata[tid+4*blockSize] += factor * (k[i+2*l*mTPB+2*num_k+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+2*num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 512];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 256];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 128];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 64]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 32];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 16];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 8]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 4]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 2]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 1]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ forces_reci[3*blockId] += sdata[0]*coulomb_prefactor;
+ forces_reci[3*blockId+1] += sdata[2*blockSize]*coulomb_prefactor;
+ forces_reci[3*blockId+2] += sdata[4*blockSize]*coulomb_prefactor;
+ }
+ __syncthreads();
+}
+template
+__global__ void EwaldGPU_ForcesReci_LowThreads(real *k,real *r_i, real *q_i, real *rho_hat, real *infl_factor, real *forces_reci, int N, int num_k, real V, real coulomb_prefactor, int maxThreadsPerBlock,int elapsedLoops)
+{
+ //Reject unneeded blocks
+ if (blockIdx.x*gridDim.x+blockIdx.y >= N) return;
+
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ int l=elapsedLoops;
+ real kr;
+ real factor;
+ real sin_kr;
+ real cos_kr;
+ real *sin_ptr=&sin_kr;
+ real *cos_ptr=&cos_kr;
+ int blockId = blockIdx.x*gridDim.x+blockIdx.y;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+ sdata[tid+2*blockSize] = 0;
+ sdata[tid+4*blockSize] = 0;
+ while (i < num_k-2*l*mTPB)
+ {
+ kr = k[i+2*l*mTPB]*r_i[3*blockId] + k[i+2*l*mTPB+num_k]*r_i[3*blockId+1] + k[i+2*l*mTPB+2*num_k]*r_i[3*blockId+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = infl_factor[i+2*l*mTPB] * q_i[blockId];
+
+ //Reduction
+ sdata[tid] += factor * (k[i+2*l*mTPB]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ sdata[tid+2*blockSize] += factor * (k[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ sdata[tid+4*blockSize] += factor * (k[i+2*l*mTPB+2*num_k]*rho_hat[i+2*l*mTPB] * sin_kr + k[i+2*l*mTPB+2*num_k]*rho_hat[i+2*l*mTPB+num_k] * cos_kr);
+ if (nIsPow2 || i + blockSize < num_k-2*l*mTPB)
+ {
+ kr = k[i+2*l*mTPB+blockSize]*r_i[3*blockId] + k[i+2*l*mTPB+num_k+blockSize]*r_i[3*blockId+1] + k[i+2*l*mTPB+2*num_k+blockSize]*r_i[3*blockId+2];
+ sincos(kr,sin_ptr,cos_ptr);
+ factor = infl_factor[i+2*l*mTPB+blockSize] * q_i[blockId];
+ sdata[tid] += factor * (k[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+ sdata[tid+2*blockSize] += factor * (k[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+ sdata[tid+4*blockSize] += factor * (k[i+2*l*mTPB+2*num_k+blockSize]*rho_hat[i+2*l*mTPB+blockSize] * sin_kr + k[i+2*l*mTPB+2*num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize] * cos_kr);
+ }
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 512];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 256];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 128];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 64]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 32];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16];sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 16];sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 8]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 4]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 2]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; sdata[tid+2*blockSize] += sdata[tid+2*blockSize + 1]; sdata[tid+4*blockSize] += sdata[tid+4*blockSize + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ forces_reci[3*blockId] += sdata[0]*coulomb_prefactor;
+ forces_reci[3*blockId+1] += sdata[2*blockSize]*coulomb_prefactor;
+ forces_reci[3*blockId+2] += sdata[4*blockSize]*coulomb_prefactor;
+ }
+}
+//Energy in reciprocal space
+template
+__global__ void EwaldGPU_EnergyReci_MaxThreads(real *rho_hat, real *infl_factor,real *energy_reci, int N, int num_k, real V,int maxThreadsPerBlock,int loops,real coulomb_prefactor)
+{
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ real factor;
+ int l = loops;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+
+ //Reduction
+ while (i < mTPB)
+ {
+ factor = infl_factor[i+2*l*mTPB] / 2;
+
+ sdata[tid] += factor * (rho_hat[i+2*l*mTPB]*rho_hat[i+2*l*mTPB] + rho_hat[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB+num_k]);
+ //BECAUSE nIsPow2=True
+ factor = infl_factor[i+2*l*mTPB+blockSize] / 2;
+ sdata[tid] += factor * (rho_hat[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+blockSize] + rho_hat[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize]);
+
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ energy_reci[0] += sdata[0]*coulomb_prefactor;
+ }
+ __syncthreads();
+}
+template
+__global__ void EwaldGPU_EnergyReci_LowThreads(real *rho_hat, real *infl_factor,real *energy_reci, int N, int num_k, real V,int maxThreadsPerBlock,int elapsedLoops,real coulomb_prefactor)
+{
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ int l=elapsedLoops;
+ real factor;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+
+ //Reduction
+ while (i < num_k-2*l*mTPB)
+ {
+ factor = infl_factor[i+2*l*mTPB] / 2;
+
+ sdata[tid] += factor * (rho_hat[i+2*l*mTPB]*rho_hat[i+2*l*mTPB] + rho_hat[i+2*l*mTPB+num_k]*rho_hat[i+2*l*mTPB+num_k]);
+ if (nIsPow2 || i + blockSize < num_k-2*l*mTPB)
+ {
+ factor = infl_factor[i+2*l*mTPB+blockSize] / 2;
+ sdata[tid] += factor * (rho_hat[i+2*l*mTPB+blockSize]*rho_hat[i+2*l*mTPB+blockSize] + rho_hat[i+2*l*mTPB+num_k+blockSize]*rho_hat[i+2*l*mTPB+num_k+blockSize]);
+ }
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ energy_reci[0] += sdata[0]*coulomb_prefactor;
+ }
+}
+//q squared
+template
+__global__ void EwaldGPU_q_sqr_MaxThreads(real *q_i, real *q_sqr, int N, int maxThreadsPerBlock,int loops)
+{
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ int l = loops;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+
+ //Reduction
+ while (i < mTPB)
+ {
+ sdata[tid] += q_i[i+2*l*mTPB]*q_i[i+2*l*mTPB];
+ //BECAUSE nIsPow2=True
+ sdata[tid] += q_i[i+2*l*mTPB+blockSize]*q_i[i+2*l*mTPB+blockSize];
+
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ q_sqr[0] += sdata[0];
+ }
+ __syncthreads();
+}
+template
+__global__ void EwaldGPU_q_sqr_LowThreads(real *q_i, real *q_sqr, int N, int maxThreadsPerBlock,int elapsedLoops)
+{
+ //Variables
+ extern __shared__ real sdata[];
+ int tid = threadIdx.x;
+ int i = tid;
+ int gridSize = blockSize*2*gridDim.x;
+ int mTPB=maxThreadsPerBlock;
+ int l=elapsedLoops;
+
+ //Init
+ i = tid;
+ sdata[tid] = 0;
+
+ //Reduction
+ while (i < N-2*l*mTPB)
+ {
+ sdata[tid] += q_i[i+2*l*mTPB]*q_i[i+2*l*mTPB];
+ if (nIsPow2 || i + blockSize < N-2*l*mTPB)
+ {
+ sdata[tid] += q_i[i+2*l*mTPB+blockSize]*q_i[i+2*l*mTPB+blockSize];
+ }
+ i += gridSize;
+ }
+ __syncthreads();
+
+ if (blockSize >= 1024){ if (tid < 512) { sdata[tid] += sdata[tid + 512]; } __syncthreads(); }
+ if (blockSize >= 512) { if (tid < 256) { sdata[tid] += sdata[tid + 256]; } __syncthreads(); }
+ if (blockSize >= 256) { if (tid < 128) { sdata[tid] += sdata[tid + 128]; } __syncthreads(); }
+ if (blockSize >= 128) { if (tid < 64) { sdata[tid] += sdata[tid + 64]; } __syncthreads(); }
+ if (tid < 32) {
+ if (blockSize >= 64) {sdata[tid] += sdata[tid + 32]; __syncthreads(); }
+ if (blockSize >= 32) {sdata[tid] += sdata[tid + 16]; __syncthreads(); }
+ if (blockSize >= 16) {sdata[tid] += sdata[tid + 8]; __syncthreads(); }
+ if (blockSize >= 8) {sdata[tid] += sdata[tid + 4]; __syncthreads(); }
+ if (blockSize >= 4) {sdata[tid] += sdata[tid + 2]; __syncthreads(); }
+ if (blockSize >= 2) {sdata[tid] += sdata[tid + 1]; __syncthreads(); }
+ }
+ //Write result for this block to global memory
+ if (tid == 0)
+ {
+ q_sqr[0] += sdata[0];
+ }
+}
+
+//Ewaldgpuforce
+EwaldgpuForce::EwaldgpuForce(SystemInterface &s, double rcut, int num_kx, int num_ky, int num_kz, double alpha)
+:m_dev_k(NULL), m_k(NULL), m_dev_rho_hat(NULL), m_rho_hat(NULL), m_dev_infl_factor(NULL), m_infl_factor(NULL), m_dev_energy_reci(NULL), m_energy_reci(NULL), m_dev_q_sqr(NULL), m_q_sqr(NULL)
+{
+ //Interface sanity checks
+ if(!s.requestFGpu())
+ std::cerr << "EwaldgpuForce needs access to forces on GPU!" << std::endl;
+
+ if(!s.requestRGpu())
+ std::cerr << "EwaldgpuForce needs access to positions on GPU!" << std::endl;
+
+ if(!s.requestQGpu())
+ std::cerr << "EwaldgpuForce needs access to charges on GPU!" << std::endl;
+
+ //Initialization values
+ m_rcut = rcut;
+ m_num_kx = num_kx;
+ m_num_ky = num_ky;
+ m_num_kz = num_kz;
+ m_alpha = alpha;
+ m_isTuned = false;
+
+ //Compute the number of k's in k-sphere
+ compute_num_k();
+
+ set_params(m_rcut, m_num_kx, m_num_ky, m_num_kz, m_alpha);
+ if(ewaldgpu_params.time_calc_steps==-1) ewaldgpu_params.time_calc_steps = determine_calc_time_steps();
+}
+EwaldgpuForce::~EwaldgpuForce()
+{
+ HANDLE_ERROR(cudaFree(m_k));
+ HANDLE_ERROR(cudaFree(m_dev_k));
+ HANDLE_ERROR(cudaFree(m_forces_reci));
+ HANDLE_ERROR(cudaFree(m_dev_forces_reci));
+ HANDLE_ERROR(cudaFree(m_infl_factor));
+ HANDLE_ERROR(cudaFree(m_dev_infl_factor));
+ HANDLE_ERROR(cudaFree(m_rho_hat));
+ HANDLE_ERROR(cudaFree(m_dev_rho_hat));
+ HANDLE_ERROR(cudaFree(m_energy_reci));
+ HANDLE_ERROR(cudaFree(m_dev_energy_reci));
+ HANDLE_ERROR(cudaFree(m_q_sqr));
+ HANDLE_ERROR(cudaFree(m_dev_q_sqr));
+}
+void EwaldgpuForce::setup(SystemInterface &s)
+{
+ if (s.npart_gpu() == m_N and ewaldgpu_params.isTunedFlag) // unchanged
+ {
+ return;
+ }
+ ewaldgpu_params.isTunedFlag = ewaldgpu_params.isTuned;
+
+ //Initialization values
+ m_rcut = ewaldgpu_params.rcut;
+ m_num_kx = ewaldgpu_params.num_kx;
+ m_num_ky = ewaldgpu_params.num_ky;
+ m_num_kz = ewaldgpu_params.num_kz;
+ m_alpha = ewaldgpu_params.alpha;
+ m_coulomb_prefactor = coulomb.prefactor;
+
+ //Compute the number of k's in k-sphere
+ compute_num_k();
+
+ if (m_dev_k)
+ HANDLE_ERROR(cudaFree(m_dev_k));
+ HANDLE_ERROR(cudaMalloc((void**)&(m_dev_k),3*m_num_k*sizeof(real)));
+ if (m_k)
+ HANDLE_ERROR(cudaFreeHost(m_k));
+ HANDLE_ERROR(cudaMallocHost((void**)&(m_k),3*m_num_k*sizeof(real)));
+ if (m_dev_rho_hat)
+ HANDLE_ERROR(cudaFree(m_dev_rho_hat));
+ HANDLE_ERROR(cudaMalloc((void**)&(m_dev_rho_hat),2*m_num_k*sizeof(real)));
+ if (m_rho_hat)
+ HANDLE_ERROR(cudaFreeHost(m_rho_hat));
+ HANDLE_ERROR(cudaMallocHost((void**)&(m_rho_hat),2*m_num_k*sizeof(real)));
+ if (m_dev_infl_factor)
+ HANDLE_ERROR(cudaFree(m_dev_infl_factor));
+ HANDLE_ERROR(cudaMalloc((void**)&(m_dev_infl_factor),m_num_k*sizeof(real)));
+ if (m_infl_factor)
+ HANDLE_ERROR(cudaFreeHost(m_infl_factor));
+ HANDLE_ERROR(cudaMallocHost((void**)&(m_infl_factor),m_num_k*sizeof(real)));
+ if (m_dev_energy_reci)
+ HANDLE_ERROR(cudaFree(m_dev_energy_reci));
+ HANDLE_ERROR(cudaMalloc((void**)&(m_dev_energy_reci),sizeof(real)));
+ if (m_energy_reci)
+ HANDLE_ERROR(cudaFreeHost(m_energy_reci));
+ HANDLE_ERROR(cudaMallocHost((void**)&(m_energy_reci),sizeof(real)));
+ if (m_dev_q_sqr)
+ HANDLE_ERROR(cudaFree(m_dev_q_sqr));
+ HANDLE_ERROR(cudaMalloc((void**)&(m_dev_q_sqr),sizeof(real)));
+ if (m_q_sqr)
+ HANDLE_ERROR(cudaFreeHost(m_q_sqr));
+ HANDLE_ERROR(cudaMallocHost((void**)&(m_q_sqr),sizeof(real)));
+
+ //Resize box
+ m_box_l[0] = s.box()[0];
+ m_box_l[1] = s.box()[1];
+ m_box_l[2] = s.box()[2];
+
+
+ //Particle number
+ m_N = s.npart_gpu();
+
+ //Compute reciprocal space vectors k
+ m_V=m_box_l[0]*m_box_l[1]*m_box_l[2];
+ compute_k_AND_influence_factor();
+
+ //Init GPU stream
+ stream0 = (cudaStream_t *) malloc (1 * sizeof(cudaStream_t));
+ start = (cudaEvent_t *) malloc (1 * sizeof(cudaEvent_t));
+ stop = (cudaEvent_t *) malloc (1 * sizeof(cudaEvent_t));
+ HANDLE_ERROR(cudaEventCreate(&(*start)));
+ HANDLE_ERROR(cudaEventCreate(&(*stop)));
+ HANDLE_ERROR(cudaStreamCreate(&(*stream0)));
+ HANDLE_ERROR(cudaDeviceSynchronize());
+ HANDLE_ERROR(cudaEventRecord(*start, 0));
+
+ //Parameters
+ set_params(m_rcut, m_num_kx, m_num_ky, m_num_kz, m_alpha);
+
+ //q squared
+ memset(m_q_sqr,0,sizeof(real));
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_q_sqr, m_q_sqr, sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+ GPU_q_sqr(s);
+}
+
+//Compute forces and energy
+void EwaldgpuForce::computeForces(SystemInterface &s)
+{
+ if (coulomb.method != COULOMB_EWALD_GPU) // EWALDGPU was disabled. nobody cares about our calculations anymore
+ {
+ std::cerr << "EwaldGPU: coulomb.method has been changed, skipping calculation" << std::endl;
+ return;
+ }
+
+ setup(s);
+
+ //Resize box
+ m_box_l[0] = s.box()[0];
+ m_box_l[1] = s.box()[1];
+ m_box_l[2] = s.box()[2];
+
+ //Set to NULL
+ memset(m_rho_hat,0,2*m_num_k*sizeof(real));
+ memset(m_energy_reci,0,sizeof(real));
+
+ //Copy arrays on the GPU
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_k, m_k, 3*m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ));
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_rho_hat, m_rho_hat, 2*m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_infl_factor, m_infl_factor, m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_energy_reci, m_energy_reci, sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+
+ //Start GPU calculation
+ GPU_Forces(s);
+}
+void EwaldgpuForce::computeEnergy(SystemInterface &s)
+{
+ if (coulomb.method != COULOMB_EWALD_GPU) // EWALDGPU was disabled. nobody cares about our calculations anymore
+ {
+ std::cerr << "EwaldGPU: coulomb.method has been changed, skipping calculation" << std::endl;
+ return;
+ }
+ setup(s);
+
+ //Resize box
+ m_box_l[0] = s.box()[0];
+ m_box_l[1] = s.box()[1];
+ m_box_l[2] = s.box()[2];
+ //Set to NULL
+ memset(m_energy_reci,0,sizeof(real));
+ //Copy arrays on the GPU
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_k, m_k, 3*m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ));
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_rho_hat, m_rho_hat, 2*m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_infl_factor, m_infl_factor, m_num_k*sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+ HANDLE_ERROR( cudaMemcpyAsync( m_dev_energy_reci, m_energy_reci, sizeof(real), cudaMemcpyHostToDevice, 0 ) );
+
+ //Start GPU calculation
+ GPU_Energy(s);
+ //Self energy
+ EwaldCPU_EnergySelf();
+ //Total energy
+ m_energy_tot = m_energy_reci[0] + m_energy_self;
+
+ HANDLE_ERROR( cudaMemcpy(&(((CUDA_energy*)s.eGpu())->coulomb), &m_energy_tot,sizeof(real),cudaMemcpyHostToDevice ) );
+}
+
+//Kernel calls
+void EwaldgpuForce::GPU_Forces(SystemInterface &s)
+{
+ //Maximum Blocks/Threads
+ int maxThreadsPerBlockStructurFactor=256;
+ int maxThreadsPerBlockForce=128;
+
+ /*Kernel*/
+ //Blocks, threads
+ int threads;
+ int blocks;
+ cudaDeviceProp prop;
+ HANDLE_ERROR( cudaGetDeviceProperties( &prop, 0 ) );
+
+ /********************************************************************************************
+ Structure factor / Rho_hat
+ ********************************************************************************************/
+
+ //Blocks, threads
+ getNumBlocksAndThreads(m_N, prop.sharedMemPerBlock, maxThreadsPerBlockStructurFactor, blocks, threads);
+ blocks=(int)ceil(sqrt(m_num_k));
+ dim3 dimBlock1(threads, 1, 1);
+ dim3 dimGrid1(blocks, blocks, 1);
+ //Shared memory size
+ int smemSize = 2 * 2 * threads * sizeof(real);
+
+ //Loops needed in EwaldGPU_Rho_hat_MaxThreads
+ int loops=m_N/(2*maxThreadsPerBlockStructurFactor);
+
+ //Kernel call
+ for(int l=0;l<<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_Rho_hat_MaxThreads<512,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_Rho_hat_MaxThreads<256,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_Rho_hat_MaxThreads<128,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_Rho_hat_MaxThreads<64,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_Rho_hat_MaxThreads<32,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_Rho_hat_MaxThreads<16,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_Rho_hat_MaxThreads<8,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_Rho_hat_MaxThreads<4,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_Rho_hat_MaxThreads<2,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,l);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ }
+ }
+
+ //Blocks, threads
+ getNumBlocksAndThreads(m_N-2*loops*maxThreadsPerBlockStructurFactor, prop.sharedMemPerBlock, maxThreadsPerBlockStructurFactor, blocks, threads);
+ blocks=(int)ceil(sqrt(m_num_k));
+ dim3 dimBlock2(threads, 1, 1);
+ dim3 dimGrid2(blocks, blocks, 1);
+
+ //Kernel call
+ if (isPow2(m_N-2*loops*maxThreadsPerBlockStructurFactor) && (m_N-2*loops*maxThreadsPerBlockStructurFactor != 0))
+ {
+ switch (threads)
+ {
+ case 1024: EwaldGPU_Rho_hat_LowThreads<1024,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_Rho_hat_LowThreads<512,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_Rho_hat_LowThreads<256,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_Rho_hat_LowThreads<128,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_Rho_hat_LowThreads<64,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_Rho_hat_LowThreads<32,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_Rho_hat_LowThreads<16,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_Rho_hat_LowThreads<8,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_Rho_hat_LowThreads<4,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_Rho_hat_LowThreads<2,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 1: EwaldGPU_Rho_hat_LowThreads<1,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ }
+ }
+ if (!isPow2(m_N-2*loops*maxThreadsPerBlockStructurFactor) && (m_N-2*loops*maxThreadsPerBlockStructurFactor != 0))
+ {
+ switch (threads)
+ {
+ case 1024: EwaldGPU_Rho_hat_LowThreads<1024,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_Rho_hat_LowThreads<512,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_Rho_hat_LowThreads<256,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_Rho_hat_LowThreads<128,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_Rho_hat_LowThreads<64,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_Rho_hat_LowThreads<32,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_Rho_hat_LowThreads<16,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_Rho_hat_LowThreads<8,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_Rho_hat_LowThreads<4,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_Rho_hat_LowThreads<2,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ case 1: EwaldGPU_Rho_hat_LowThreads<1,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_N,m_num_k,maxThreadsPerBlockStructurFactor,loops); cuda_check_error(dimBlock2, dimGrid2, 0, __FILE__, __LINE__);break;
+ }
+ }
+
+ //Copy the arrays back from the GPU to the CPU
+ HANDLE_ERROR(cudaMemcpy( m_rho_hat, m_dev_rho_hat,2*m_num_k*sizeof(real),cudaMemcpyDeviceToHost));
+
+ /********************************************************************************************
+ Forces long range
+ ********************************************************************************************/
+
+ //Blocks, threads
+ getNumBlocksAndThreads(m_num_k, prop.sharedMemPerBlock, maxThreadsPerBlockForce, blocks, threads);
+ blocks=(int)ceil(sqrt(m_N));
+ dim3 dimBlock3(threads, 1, 1);
+ dim3 dimGrid3(blocks, blocks, 1);
+
+ //Shared memory size
+ smemSize = 3 * 2 * threads * sizeof(real);
+
+ //Loops needed in EwaldGPU_ForcesReci_MaxThreads
+ loops=m_num_k/(2*maxThreadsPerBlockForce);
+
+ //Kernel call
+ for(int l=0;l<<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_ForcesReci_MaxThreads<512,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_ForcesReci_MaxThreads<256,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_ForcesReci_MaxThreads<128,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_ForcesReci_MaxThreads<64,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_ForcesReci_MaxThreads<32,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_ForcesReci_MaxThreads<16,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_ForcesReci_MaxThreads<8,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_ForcesReci_MaxThreads<4,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_ForcesReci_MaxThreads<2,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,l);cuda_check_error(dimBlock3, dimGrid3, 0, __FILE__, __LINE__);break;
+ }
+ }
+
+ //Blocks, threads
+ getNumBlocksAndThreads(m_num_k-2*loops*maxThreadsPerBlockForce, prop.sharedMemPerBlock, maxThreadsPerBlockForce, blocks, threads);
+ blocks=(int)ceil(sqrt(m_N));
+ dim3 dimBlock4(threads, 1, 1);
+ dim3 dimGrid4(blocks, blocks, 1);
+
+ //Shared memory size
+ smemSize = 3 * 2 * threads * sizeof(real);
+
+ //Kernel call
+ if (isPow2(m_num_k-2*loops*maxThreadsPerBlockForce) && (m_num_k-2*loops*maxThreadsPerBlockForce != 0))
+ {
+ switch (threads)
+ {
+ case 1024: EwaldGPU_ForcesReci_LowThreads<1024,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_ForcesReci_LowThreads<512,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_ForcesReci_LowThreads<256,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_ForcesReci_LowThreads<128,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_ForcesReci_LowThreads<64,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_ForcesReci_LowThreads<32,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_ForcesReci_LowThreads<16,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_ForcesReci_LowThreads<8,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_ForcesReci_LowThreads<4,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_ForcesReci_LowThreads<2,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 1: EwaldGPU_ForcesReci_LowThreads<1,true><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ }
+ }
+ if (!isPow2(m_num_k-2*loops*maxThreadsPerBlockForce) && (m_num_k-2*loops*maxThreadsPerBlockForce != 0))
+ {
+ switch (threads)
+ {
+ case 1024: EwaldGPU_ForcesReci_LowThreads<1024,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_ForcesReci_LowThreads<512,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 256: EwaldGPU_ForcesReci_LowThreads<256,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 128: EwaldGPU_ForcesReci_LowThreads<128,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 64: EwaldGPU_ForcesReci_LowThreads<64,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 32: EwaldGPU_ForcesReci_LowThreads<32,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 16: EwaldGPU_ForcesReci_LowThreads<16,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 8: EwaldGPU_ForcesReci_LowThreads<8,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 4: EwaldGPU_ForcesReci_LowThreads<4,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 2: EwaldGPU_ForcesReci_LowThreads<2,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ case 1: EwaldGPU_ForcesReci_LowThreads<1,false><<>>(m_dev_k,s.rGpuBegin(),s.qGpuBegin(),m_dev_rho_hat,m_dev_infl_factor,s.fGpuBegin(),m_N,m_num_k,m_V,m_coulomb_prefactor,maxThreadsPerBlockForce,loops); cuda_check_error(dimBlock4, dimGrid4, 0, __FILE__, __LINE__);break;
+ }
+ }
+}
+void EwaldgpuForce::GPU_Energy(SystemInterface &s)
+{
+ //Maximum Blocks/Threads
+ int maxThreadsPerBlockEnergie=128;
+
+ /*Kernel*/
+ //Blocks, threads
+ int threads;
+ int blocks;
+ cudaDeviceProp prop;
+ HANDLE_ERROR( cudaGetDeviceProperties( &prop, 0 ) );
+
+ /********************************************************************************************
+ Energy
+ ********************************************************************************************/
+
+ //Blocks, threads
+ getNumBlocksAndThreads(m_num_k, prop.sharedMemPerBlock, maxThreadsPerBlockEnergie, blocks, threads);
+ blocks=1;
+ dim3 dimBlock1(threads, 1, 1);
+ dim3 dimGrid1(blocks, 1, 1);
+
+ //Shared memory size
+ int smemSize = 1 * 2 * threads * sizeof(real);
+
+ //Loops needed in EwaldGPU_ForcesReci_MaxThreads
+ int loops=m_num_k/(2*maxThreadsPerBlockEnergie);
+
+ //Kernel call
+ for(int l=0;l<<>>(m_dev_rho_hat,m_dev_infl_factor,&(((CUDA_energy*)s.eGpu())->coulomb),m_N,m_num_k,m_V,maxThreadsPerBlockEnergie,l,m_coulomb_prefactor);cuda_check_error(dimBlock1, dimGrid1, 0, __FILE__, __LINE__);break;
+ case 512: EwaldGPU_EnergyReci_MaxThreads<512,true><<