Commit 71a2140e authored by BLANCHARD Pierre's avatar BLANCHARD Pierre

Merge branch 'master' into PB_tensorialFMM

parents 731ae45d 7dcb5cc7
@article{Schmidt1991,
abstract = {The Rokhlin-Greengard fast multipole algorithm for evaluating Coulomb and multipole potentials has been implemented and analyzed in three dimensions. The implementation is presented for bounded charged systems and systems with periodic boundary conditions. The results include timings and error characterizations},
author = {Schmidt, K. E. and Lee, Michael a.},
doi = {10.1007/BF01030008},
file = {:Users/coulaud/Recherche/Bibliographie/Mendeley/Schmidt, Lee - 1991 - Implementing the fast multipole method in three dimensions.pdf:pdf},
issn = {0022-4715},
journal = {Journal of Statistical Physics},
keywords = {Ewald summation,Periodic boundary conditions,fast multipole method,macro summation,many-body problem,n-body,spherical harmonique},
mendeley-groups = {FMM},
month = jun,
number = {5-6},
pages = {1223--1235},
title = {{Implementing the fast multipole method in three dimensions}},
url = {http://link.springer.com/10.1007/BF01030008},
volume = {63},
year = {1991}
}
@article{Heyes1981,
abstract = {The Coulomb potentials and fields in infinite point charge lattices are represented by series expansions in real and reciprocal space using a method similar to that devised by Bertaut. A systematic investigation is made into the relative convergence characteristics of series derived by varying the charge spreading function which is required in the theory. A number of formulas which are already in use are compared with new expressions derived by this method.},
author = {Heyes, D. M.},
doi = {10.1063/1.441285},
file = {:Users/coulaud/Recherche/Bibliographie/Mendeley/Heyes - 1981 - Electrostatic potentials and fields in infinite point charge lattices.pdf:pdf},
issn = {00219606},
journal = {The Journal of Chemical Physics},
keywords = {Electrostatics,Lattice theory},
mendeley-groups = {Chimie},
mendeley-tags = {Electrostatics,Lattice theory},
number = {3},
pages = {1924},
title = {{Electrostatic potentials and fields in infinite point charge lattices}},
url = {http://link.aip.org/link/?JCP/74/1924/1\&Agg=doi},
volume = {74},
year = {1981}
}
@article{DeLeeuw1980,
author = {{De Leeuw}, S W and Perram, J W and Smith, E R},
file = {:Users/coulaud/Recherche/Bibliographie/Mendeley/De Leeuw, Perram, Smith - 1980 - Simulation of electrostatic systems in periodic boundary conditions. I. Lattice sums and dielectric con.pdf:pdf},
journal = {Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences},
keywords = {Periodic Boundary Conditions,dieclectric constant,lattice sums},
mendeley-groups = {Chimie},
mendeley-tags = {Periodic Boundary Conditions,dieclectric constant,lattice sums},
number = {1752},
pages = {27--56},
title = {{Simulation of electrostatic systems in periodic boundary conditions. I. Lattice sums and dielectric constants}},
url = {http://www.jstor.org/stable/2397238 http://rspa.royalsocietypublishing.org/content/373/1752/27.short},
volume = {373},
year = {1980}
}
......@@ -77,19 +77,22 @@
\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
Berenger \textsc{Bramas} % Your name
Berenger \textsc{Bramas} \\% Your name
Olivier \textsc{Coulaud} % Your name
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
\textsc{} % Supervisor's Name
%\emph{Supervisor:} \\
%\textsc{} % Supervisor's Name
\end{flushright}
\end{minipage}\\[4cm]
{\large \today}\\[3cm] % Date, change the \today to a set date if you want to be precise
{\large \today}\\[1cm] % Date, change the \today to a set date if you want to be precise
{\Large \textbf{Working note}}
\vfill % Fill the rest of the page with whitespace
\end{titlepage}
......@@ -387,6 +390,16 @@ and the force on atom $x_i$
$$
f(x_i) = \frac{q_i }{4 \pi\epsilon_0}\sum_{j=0,i\neq j}^{N}{q_j\frac{x_i-x_j}{\|x_i-x_j\|^3}}
$$
The Ewald method is equivalent to consider a surrounding conductor ($\epsilon=\infty$). The method described in this document and implemented in ScalFMM consider a finite set of the original box surrounded by a vacuum with dielectric constant $\epsilon=1$. The results by these two approaches are different \cite{DeLeeuw1980, Heyes1981} and for a very large sphere surrounding all boxes we have the following equation
\begin{equation}
E_{Ewald} = E_{FMM} -\frac{2\pi}{3V}|\sum_{i=1}^{N}{q_i x_i}|^2.
\end{equation}
By tacking the gradient of this equation, the relationship between FMM forces and Ewald forces is
\begin{equation}
F_{Ewald}(x_k) = -\nabla_k E_{Ewald} = F_{FMM}(x_k) + \frac{4\pi}{3V} q_k \sum_{i=1}^{N}{q_i x_i}.
\end{equation}
\subsubsection{DL\_Poly comparisons}
DL\_POLY\_2 uses the following internal molecular units \\
......@@ -428,12 +441,49 @@ Force &$C_{force}$& -138935.4835 & $10\,J mol^{-1}\, \AA^{-1}$\\
The force unit is the internal DL\_Poly unit.
The first test consists in a small crystal $4\times 4\times 4$ of NaCl. It is composed of 128 atoms The second tests is a larger crystal $10\times 10\times 10$ of NaCl and have X atoms.
The first test consists in a small crystal $4\times 4\times 4$ of NaCl. It is composed of 128 atoms The second tests is a larger crystal $10\times 10\times 10$ of NaCl and have 2000 atoms. The positions and the forces are stored in the \texttt{REVCON} file and the energy in the \texttt{STATIS} file. The Ewald's parameter are chosen such that the Ewald sum precision is $10^{-08}$.
\begin{center}
\begin{tabular}{|l|c|c|c|c|}
\hline
Crystal & Cube size & Cut off & reciprocal lattice vector &Energy \\
& $\AA$ & $\AA$ & & $kcal\, mol^{-1}$ \\
\hline
Small & 16 & 8 & (9,9,9) & $ -2.346403 \,10^{4} $ \\
\hline
Big & 40 & 12 & (15,15,15) & $-3.666255 \,10^{5} $ \\
\hline
\end{tabular}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusion}
A new approach has been proposed to compute a periodic FMM.
This approach can be used with any kernel and without the need of developing new operators.
Moreover, it is possible to compute an important repetition size for a small cost.
\bibliographystyle{plain}
\bibliography{fmm}
\newpage
\section*{Appendix 1 }
\begin{center}
\large DL\_poly CONTROL file
\end{center}
\begin{verbatim}
timestep 1.e-15
steps 1
temperature 0.0
ensemble nve
delr 0.5
cutoff 8.0
ewald precision 1.e-8
no vdw
traj 1,1,2
print 1
stats 1
job time 3600
close time 10
finish
\end{verbatim}
\end{document}
......@@ -71,7 +71,8 @@ public :
/** Move the read index to a position */
void seek(const int inIndex){
FAssertLF(inIndex < arrayCapacity, "FMpiBufferReader :: Aborting :: Can't move index because buffer isn't long enough");
FAssertLF(inIndex <= arrayCapacity, "FMpiBufferReader :: Aborting :: Can't move index because buffer isn't long enough ",inIndex," ",arrayCapacity);
currentIndex = inIndex;
}
......
// ===================================================================================
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, Bérenger Bramas.
// Propriétaires : INRIA.
// Copyright © 2011-2012, diffusé sous les termes et conditions d’une licence propriétaire.
// Co-auteurs : Olivier Coulaud, B��renger Bramas.
// Propri��taires : INRIA.
// Copyright �� 2011-2012, diffus�� sous les termes et conditions d���une licence propri��taire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, Bérenger Bramas.
// Co-authors: Olivier Coulaud, B��renger Bramas.
// Owners: INRIA.
// Copyright © 2011-2012, spread under the terms and conditions of a proprietardata[1] license.
// Copyright �� 2011-2012, spread under the terms and conditions of a proprietardata[1] license.
// ===================================================================================
#ifndef FPOINT_HPP
#define FPOINT_HPP
......@@ -62,7 +62,7 @@ public:
}
/**
* Assignement operator
* Assignment operator
* @param other the source class to copy
*/
FPoint(const FPoint& other, const FReal addset) {
......@@ -172,14 +172,23 @@ public:
FReal * getDataValue(){
return this->data ;
}
/**
*Compute the distance to the origin
* @return the norm of the Fpoint
*/
FReal norm() const {
return FMath::Sqrt(this->data[0]*this->data[0]+this->data[1]*this->data[1]
+this->data[2]*this->data[2]) ;
}
/**
*Compute the distance to the origin
* @return the norm of the Fpoint
*/
FReal norm() const {
return FMath::Sqrt(this->data[0]*this->data[0]+this->data[1]*this->data[1]
+this->data[2]*this->data[2]) ;
}
/**
*Compute the distance to the origin
* @return the square norm of the Fpoint
*/
FReal norm2() const {
return (this->data[0]*this->data[0]+this->data[1]*this->data[1]
+this->data[2]*this->data[2]) ;
}
/**
* Subtract to all dim the inValue
......@@ -195,7 +204,7 @@ public:
/**
* Affect to all dim the inValue
* @param inValue the value to afect
* @param inValue the value to affect
* @return the current object after being affected
*/
FPoint& operator+=(const FReal inValue){
......
This diff is collapsed.
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// 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 and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#include "FUTester.hpp"
#include "../Src/Utils/FParameters.hpp"
// compile by g++ utestMorton.cpp -o utestMorton.exe
/**
* This file is a unit test for the FTreeCoordinate class
*/
/** this class test the list container */
class TestParameters : public FUTester<TestParameters> {
void Lower(){
uassert(FParameters::toLower('A') == 'a');
uassert(FParameters::toLower('Z') == 'z');
uassert(FParameters::toLower('a') == 'a');
uassert(FParameters::toLower('z') == 'z');
uassert(FParameters::toLower('m') == 'm');
uassert(FParameters::toLower(';') == ';');
}
void CharsEquals(){
uassert(FParameters::areCharsEquals('a','A',false));
uassert(FParameters::areCharsEquals('A','A',false));
uassert(FParameters::areCharsEquals('A','a',false));
uassert(FParameters::areCharsEquals('a','a',false));
uassert(!FParameters::areCharsEquals('a','l',false));
uassert(!FParameters::areCharsEquals('a','M',false));
uassert(!FParameters::areCharsEquals('1',';',false));
uassert(!FParameters::areCharsEquals('a','A',true));
uassert(FParameters::areCharsEquals('A','A',true));
uassert(!FParameters::areCharsEquals('A','a',true));
uassert(FParameters::areCharsEquals('a','a',true));
uassert(FParameters::areCharsEquals(';',';',true));
}
void StrsEquals(){
uassert(FParameters::areStrEquals("","",false));
uassert(FParameters::areStrEquals("aa","Aa",false));
uassert(!FParameters::areStrEquals("az","azz",false));
uassert(FParameters::areStrEquals("aza","azA",false));
uassert(FParameters::areStrEquals("a","a",true));
uassert(FParameters::areStrEquals("az","az",true));
uassert(!FParameters::areStrEquals("aza","azA",true));
uassert(!FParameters::areStrEquals("az","azA",true));
}
void FindParameter(){
const int argc = 4;
const char* argv[4] = {
"toto",
"titi",
"TaTa",
"tu.tU"
};
uassert(FParameters::findParameter(argc,argv,"tOto",false) == 0);
uassert(FParameters::findParameter(argc,argv,"titi",false) == 1);
uassert(FParameters::findParameter(argc,argv,"tAtA",false) == 2);
uassert(FParameters::findParameter(argc,argv,"tu.tu",false) == 3);
for(int idx = 0 ; idx < argc ; ++idx){
uassert(FParameters::findParameter(argc,argv,argv[idx],true) == idx);
}
uassert(FParameters::findParameter(argc,argv,"tu.tu",true) == -1);
uassert(FParameters::findParameter(argc,argv,"TOTO",true) == -1);
}
void StrToOther(){
uassert(FParameters::StrToOther<int>("0") == 0);
uassert(FParameters::StrToOther<int>("a",1) == 1);
}
// set test
void SetTests(){
AddTest(&TestParameters::Lower,"Test Lower");
AddTest(&TestParameters::CharsEquals,"Test Char equality");
AddTest(&TestParameters::StrsEquals,"Test Str equality");
AddTest(&TestParameters::FindParameter,"Test Str equality");
AddTest(&TestParameters::StrToOther,"Test Convert");
}
};
// You must do this
TestClass(TestParameters)
#!/bin/bash
#
#PBS -N MG_water
#
# preciser le temps en heures, minutes, secondes
#PBS -l walltime=01:59:00
# nombre de noeuds et de coeurs
#PBS -l nodes=1:ppn=12
#PBS -l naccesspolicy=singlejob
#
# PlaFRIM environment
w
source $HOME/.bashrc
#
FMMPER_EXE="Tests/Release/testSphericalEwalAlgorithm"
FILE="../Data/forceNacl_2000_dlpolyPer.txt"
FILE="../Data/forceNacl_128_dlpolyPer.txt"
cd ~/Dev/src/ScalFMM/scalfmmT/BuildGCC
#
# RUN 1 influence de la taille de la boite sur la precision des calculs
# Regarde size, Nx ny nz energie total, dipole et le temps de calcul
#
PER_SIZE="-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18"
#
rm -f FMM_PER.out
echo "# PerSize DOMAIN_SIZE ENERGY"> FMM_PER.out
pwd
for l in $PER_SIZE
do
echo "Running per = " ${l}
echo "$FMMPER_EXE -f $FILE -h 4 -sh 2 -per $l > $FILE.out "
$FMMPER_EXE -f $FILE -h 4 -sh 2 -per $l > $FILE.out
DOMAINSIZE=`grep "Simulated box:" $FILE.out | awk '{print $3}'`
ENERGY=`grep "Energy FMM=" $FILE.out |awk '{ print $3 }'`
echo " " $l $DOMAINSIZE " " $ENERGY " " >> FMM_PER.out
done
#set terminal postscript enhanced color
#set output FMMEnergy.ps'
set key left
szt encoding iso_8859_1
set title "FMM Energy"
set xlabel "per size (per)"
set ylabel "Energy (kcal/mol)"
plot "FMM_PER.out" u ($1,$3) w l t "FMM Energy"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment