diff --git a/Doc/Src_tex/ScalFmm-PeriodicModel/periodicmodel.tex b/Doc/Src_tex/ScalFmm-PeriodicModel/periodicmodel.tex index 9a9d3adfdb8697d7ef9929a35c6f539ce565e071..aca699ddd519b7850ca1146e1d028a2ce64d3bea 100644 --- a/Doc/Src_tex/ScalFmm-PeriodicModel/periodicmodel.tex +++ b/Doc/Src_tex/ScalFmm-PeriodicModel/periodicmodel.tex @@ -118,6 +118,19 @@ can have a complexity reduced from O(n2) to O(n). But many physical problem could also have the need to compute periodic simulations. Many analytical methods have been developed but none of them is using the power of the FMM to compute the periodicity. +The potential at particle $x_i$ computed by ScalFMM code is given by +$$ +V(x_i) = \sum_{j=0,i\neq j}^{N}{\frac{q_j}{\|x_i-x_j\|}} +$$ +and the force on atom $x_i$ +$$ +f(x_i) = \sum_{j=0,i\neq j}^{N}{q_j\frac{x_i-x_j}{\|x_i-x_j\|^3}}. +$$ +Finally, the total energy of the system writes +$$ +U = \frac{1}{2}\sum_{i=0}^{N}{q_i V(x_i)}. +$$ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{State of the art} @@ -392,15 +405,20 @@ f(x_i) = -\frac{q_0^2}{4 \pi\epsilon_0 l_0^2} q_i \sum_{j=0,i\neq j}^{N}{q_j\fra $$ The Energy conversion factor is $\gamma_0 = \frac{q_0^2}{4 \pi\epsilon_0 l_0}/E_0 = 138935.4835$. The energy unit is in Joules and if you want $kcal mol^{-1}$ unit the the factor becomes $\gamma_0/418.400$. + + +To compare with the molecular dynamics code, the forces and the energy is multiplied by $C_{force}$ ($C_{energy}$ respectively). +\begin{center} \begin{tabular}{|l|c|c|c|c|c|} \hline & \multicolumn{2}{|c|}{Energy} & \multicolumn{2}{c|}{Force} \\ units& $kcal\, mol^{-1}$& & &\\ \hline $C_{energy}$& & & &\\ -$C_{force}$& & & &\\ +$C_{force}$& -138935.4835/418.400& & &\\ \hline \end{tabular} +\end{center} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Conclusion} A new approach has been proposed to compute a periodic FMM. diff --git a/Src/Files/FEwalLoader.hpp b/Src/Files/FEwalLoader.hpp index 0415d459ceebcb2f6940d5ac41620e9842f9d4ac..43c9beeb649547275ec966950d73dcf61b6f6003 100755 --- a/Src/Files/FEwalLoader.hpp +++ b/Src/Files/FEwalLoader.hpp @@ -189,7 +189,7 @@ public: else{ *inPhysicalValue = FReal(-0.41); *inIndex = HW; - std::cerr << "Atom type not defined"<< std::endl; + std::cerr << "Atom type not defined "<< type << std::endl; exit(-1); } } diff --git a/Src/Utils/FMath.cpp b/Src/Utils/FMath.cpp index 34c4394c31b6b66fb1c50931926fb78e39540428..b3252d9fa3f3afda4299094c01ed379f3084ec67 100755 --- a/Src/Utils/FMath.cpp +++ b/Src/Utils/FMath.cpp @@ -16,8 +16,8 @@ #include "FMath.hpp" // Constant values -const FReal FMath::FPi = FReal(M_PI); -const FReal FMath::FTwoPi = FReal(2.0*M_PI); +const FReal FMath::FPi = FReal(M_PI); +const FReal FMath::FTwoPi = FReal(2.0*M_PI); const FReal FMath::FPiDiv2 = FReal(M_PI_2); const FReal FMath::Epsilon = FReal(0.00000000000000000001);