Commit 602599bb by COULAUD Olivier

### Add a new example to compare all our implementations of 1/r kernel.

Add flag to print the transfer (M2L) matrix
parent 56fb0060
 ... ... @@ -422,21 +422,23 @@ F_{Ewald}(x_k) = -\nabla_k E_{Ewald} = F_{FMM}(x_k) + \frac{4\pi}{3V} q_k \math \subsubsection{DL\_Poly comparisons} DL\_POLY\_2 uses the following internal molecular units \\ \begin{tabular}{|l|c|c|l|} \subsection{Units} Consider the following dimensional units \begin{center} \begin{tabular}{|l|c|} \hline type & Expression & Numerical value & \\ time &$t_0$ & $10^{-12}\;s$& picosecond\\ length & $l_0$ &$10^{-10}\; m$& $\AA$ Angstrom\\ mass & $m_0$ & $1.6605402 \; 10^{−27}\; kg$& atomic mass unit\\ charge & $q_0$ & $1.60217733 \; 10^{−19} Coulombs$& unit of proton charge\\ energy & $E_0 = m_0(l_0/t_0)^2$&$1.6605402 \; 10^{−23}\; Joules$ & $10\; J\, mol^{-1}$\\ type & Expression \\ \hline time &$t_0$ \\ length & $l_0$ \\ mass & $m_0$ \\ charge & $q_0$ \\ energy & $E_0 = m_0(l_0/t_0)^2$\\ \hline \end{tabular} \end{center} In internal variables the energy writes In adimensional variables the energy writes $$U = \frac{q_0^2}{4 \pi\epsilon_0 l_0}\sum_{i=0}^{N}{\sum_{j  ... ... @@ -14,6 +14,7 @@ #include "Utils/FGlobal.hpp" #include "Utils/FPoint.hpp" #include "Files/FFmaGenericLoader.hpp" #include "Files/FDlpolyLoader.hpp" #include "Utils/FParameters.hpp" #include "Utils/FGenerateDistribution.hpp" ... ... @@ -27,6 +28,7 @@ //! General arguments: //! \param -help (-h) to see the parameters available in this driver //! \param -fin name: file name to convert (with extension .fma (ascii) or bfma (binary) //! \param -fdlpoly name file coming from a DLpoly simulation //! //! \param -fout name: generic name for files (without extension) and save data //! with following format in name.fma or name.bfma if -bin is set" ... ... @@ -38,7 +40,7 @@ //! //! Transform an ascii file in a binary file //! //! changeFormat -filename unitCubeXYZQ100.fma -outfilename unitCubeXYZQ100 -bin //! changeFormat -fin unitCubeXYZQ100.fma -fout unitCubeXYZQ100 -bin // ... ... @@ -48,7 +50,9 @@ void genDistusage() { << std::endl; std::cout << "Options "<< std::endl << " -help to see the parameters " << std::endl << " Input: only one option is allowed" << std::endl << " -fin name: file name to convert (with extension .fma (ascii) or bfma (binary) " <getNumberOfParticles() ; // particles = new FReal[arraySize] ; // std::memset(particles,0,arraySize*sizeof(FReal)); // for(int idxPart = 0 ; idxPart < NbPoints ; ++idxPart){ // // int index ; // FPoint P ; FReal t[3]; /// / loader->fillParticle(&P, t, &physicalValue,&index); // particles[(index-1)*] // // totalCharge += physicalValue ; } } else { name += ".fma"; genDistusage() ; } FFmaGenericWriter writer(name) ; writer.writeHeader( loader.getCenterOfBox(), loader.getBoxWidth() , NbPoints, sizeof(FReal), nbData) ; writer.writeArrayOfReal(particles, nbData, NbPoints); } // // Generate file for visualization purpose // if(FParameters::existParameter(argc, argv, "-visufmt")){ std::string outfilename(FParameters::getStr(argc,argv,"-fout", "output")); std::string visufile(""), fmt(FParameters::getStr(argc,argv,"-visufmt", "vtp")); if( fmt == "vtp" ){ visufile = outfilename + ".vtp" ; } else if( fmt == "vtk" ){ visufile = outfilename + ".vtk" ; } else if( fmt == "cosmo" ){ if(nbData !=4) { std::cerr << "Cosmos export accept only 4 data per particles. here: "< This diff is collapsed.  // =================================================================================== // Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas // Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Brenger Bramas // olivier.coulaud@inria.fr, berenger.bramas@inria.fr // This software is a computer program whose purpose is to compute the FMM. // ... ...  ... ... @@ -223,7 +223,19 @@ public: preExpNExp(temporaryMultiSource); const FReal one[2] = {1.0 , 0.0}; #ifdef DEBUG_SPHERICAL_M2L // std::cout << "\n ====== MultipolToLocal MatrixTransfer ====== \n"<  ... ... @@ -142,8 +142,9 @@ public: // work with a local variable FComplexe L_j_k = local_exp[index_j_k]; // n from 0 to P for (int n = 0 ; n <= /*devP or*/ Parent::devP-j ; ++n){ // n from 0 to P or do P-j // for (int n = 0 ; n <= Parent::devP /*or*/ /*Parent::devP-j*/ ; ++n){ for (int n = 0 ; n <= Parent::devP-j ; ++n){ // faster than double height Parent::devP // O_n^l : here points on the source multipole expansion term of degree n and order |l| const int index_n = Parent::harmonic.getPreExpRedirJ(n); ... ...  ... ... @@ -318,7 +318,16 @@ public: friend inline FPoint operator+(const FPoint& inPosition, const FPoint& inOther){ return FPoint(inPosition.data[0] + inOther.data[0], inPosition.data[1] + inOther.data[1], inPosition.data[2] + inOther.data[2]); } /** * Compare two points */ inline bool operator==(const FPoint& pp){ /* do actual comparison */ return this->data[0]==pp.data[0] && this->data[1]==pp.data[1]&& this->data[2]==pp.data[2]; } inline bool operator!=( const FPoint& rhs) {return !(*this == rhs);} /** * Operator stream FPoint to std::ostream ... ...  ... ... @@ -14,6 +14,7 @@ // "http://www.gnu.org/licenses". // =================================================================================== #define DEBUG_SPHERICAL_M2L #include #include "../Src/Utils/FGlobal.hpp" ... ... @@ -47,7 +48,7 @@ class TestSphericalDirect : public FUTester { template < class CellClass, class ContainerClass, class KernelClass, class LeafClass, class OctreeClass, class FmmClass> void RunTest(const bool isBlasKernel){ const int DevP = 26; const int DevP = 5; // Warning in make test the exec dir it Build/UTests // Load particles const int nbParticles = 2; ... ... @@ -92,16 +93,16 @@ class TestSphericalDirect : public FUTester { /* for(int idxLeafZ = 0 ; idxLeafZ < dimGrid ; ++idxLeafZ)*/{ //std::cout << "Shift : " << idxLeafX << " " << idxLeafY << " " << idxLeafZ << std::endl; particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 3*quarterDimLeaf, /* particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 3*quarterDimLeaf, FReal(idxLeafY)*dimLeaf + quarterDimLeaf, FReal(idxLeafZ)*dimLeaf + quarterDimLeaf); /* particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + quarterDimLeaf, 2*quarterDimLeaf, 2*quarterDimLeaf); particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 2*quarterDimLeaf, FReal(idxLeafZ)*dimLeaf + quarterDimLeaf);*/ // particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + quarterDimLeaf, // quarterDimLeaf, // quarterDimLeaf); particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 2*quarterDimLeaf, quarterDimLeaf, quarterDimLeaf); particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 2*quarterDimLeaf, /* particles[1].position = FPoint(FReal(idxLeafX)*dimLeaf + 2*quarterDimLeaf, quarterDimLeaf, quarterDimLeaf);*/ ... ... @@ -188,7 +189,7 @@ class TestSphericalDirect : public FUTester { for (int j = 0 ; j <= DevP ; ++j ){ std::cout <<"[" << j << "] ----- level \n"; for (int k=0; k<=j ;++k, ++index_j_k){ std::cout << "[" << k << "] ( " << cell->getLocal()[index_j_k].getReal() << " , " << cell->getLocal()[index_j_k].getImag() << " ) "; std::cout << "[" << k << "] ( " << cell->getLocal()[index_j_k].getReal() << " , " << cell->getLocal()[index_j_k].getImag() << " ) "; } std::cout << "\n"; } ... ... @@ -262,6 +263,10 @@ class TestSphericalDirect : public FUTester { typedef FOctree< CellClass, ContainerClass , LeafClass > OctreeClass; typedef FFmmAlgorithm FmmClass; std::cout << std::endl << std::endl << std::endl << "$$$$"<(false); ... ... @@ -311,7 +316,11 @@ class TestSphericalDirect : public FUTester { typedef FOctree< CellClass, ContainerClass , LeafClass > OctreeClass; typedef FFmmAlgorithm FmmClass; // std::cout << std::endl << std::endl << std::endl << "$$"<(true); } ... ... @@ -326,8 +335,8 @@ class TestSphericalDirect : public FUTester { AddTest(&TestSphericalDirect::TestSpherical,"Test Spherical Kernel"); //AddTest(&TestSphericalDirect::TestRotation,"Test Rotation Spherical Kernel"); #ifdef ScalFMM_USE_BLAS //AddTest(&TestSphericalDirect::TestSphericalBlas,"Test Spherical Blas Kernel"); //AddTest(&TestSphericalDirect::TestSphericalBlockBlas,"Test Spherical Block Blas Kernel"); // AddTest(&TestSphericalDirect::TestSphericalBlas,"Test Spherical Blas Kernel"); // AddTest(&TestSphericalDirect::TestSphericalBlockBlas,"Test Spherical Block Blas Kernel"); #endif } }; ... ...
 Improvemnents Improvements 1) Periodic boundary conditions for cubic box 2) ... ... @@ -7,7 +7,7 @@ Improvemnents Bugs 1) Spherical -- check the values of multipole and local coefficients. use : utestSphericalDirectDebug.cpp 2) 2) Intel compiler : need -fp-model precise -fp-model source -fimf-precision=low for Spherical (?????) ToDO ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!