multipole.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MULTIPOLE_HEADER
00029 #define MULTIPOLE_HEADER
00030
00031
00032 #include "realtype.h"
00033 #include "integral_info.h"
00034 #include "basisinfo.h"
00035
00036 #define MAX_MULTIPOLE_DEGREE 15
00037 #define MAX_NO_OF_MOMENTS_PER_MULTIPOLE ((MAX_MULTIPOLE_DEGREE+1)*(MAX_MULTIPOLE_DEGREE+1))
00038
00039 #define MAX_MULTIPOLE_DEGREE_BASIC BASIS_FUNC_POLY_MAX_DEGREE
00040 #define MAX_NO_OF_MOMENTS_PER_MULTIPOLE_BASIC ((MAX_MULTIPOLE_DEGREE_BASIC+1)*(MAX_MULTIPOLE_DEGREE_BASIC+1))
00041
00042
00043 typedef struct
00044 {
00045 ergo_real centerCoords[3];
00046 int degree;
00047 int noOfMoments;
00048 ergo_real momentList[MAX_NO_OF_MOMENTS_PER_MULTIPOLE];
00049 ergo_real maxAbsMomentList[MAX_MULTIPOLE_DEGREE+1];
00050 ergo_real euclideanNormList[MAX_MULTIPOLE_DEGREE+1];
00051 } multipole_struct_large;
00052
00053 typedef struct
00054 {
00055 ergo_real centerCoords[3];
00056 int degree;
00057 int noOfMoments;
00058 ergo_real momentList[MAX_NO_OF_MOMENTS_PER_MULTIPOLE_BASIC];
00059 } multipole_struct_small;
00060
00061
00062 int init_multipole_code();
00063
00064 int
00065 compute_multipole_moments(const IntegralInfo& integralInfo,
00066 const DistributionSpecStruct* distr,
00067 multipole_struct_small* result);
00068
00069 class MMTranslator {
00070 static const int MMDP1 = MAX_MULTIPOLE_DEGREE+1;
00071 ergo_real *buffer_W_cc;
00072 ergo_real *buffer_W_cs;
00073 ergo_real *buffer_W_sc;
00074 ergo_real *buffer_W_ss;
00075 public:
00076 MMTranslator();
00077 ~MMTranslator();
00078 int getTranslationMatrix(ergo_real dx,
00079 ergo_real dy,
00080 ergo_real dz,
00081 int l_1,
00082 int l_2,
00083 ergo_real* result_W);
00084 };
00085
00086 class MMInteractor {
00087 static const int MMDP1 = MAX_MULTIPOLE_DEGREE+1;
00088 ergo_real *buffer_T_cc;
00089 ergo_real *buffer_T_cs;
00090 ergo_real *buffer_T_sc;
00091 ergo_real *buffer_T_ss;
00092 public:
00093 MMInteractor();
00094 ~MMInteractor();
00095 int getInteractionMatrix(ergo_real dx,
00096 ergo_real dy,
00097 ergo_real dz,
00098 int l_1,
00099 int l_2,
00100 ergo_real* result_T);
00101 };
00102
00103
00104 int
00105 setup_multipole_maxAbsMomentList(multipole_struct_large* multipole);
00106
00107 #endif