00001 // QMcBeaver 00002 // 00003 // Constructed by 00004 // 00005 // Michael Todd Feldmann 00006 // and 00007 // David Randall "Chip" Kent IV 00008 // 00009 // Copyright 2000. All rights reserved. 00010 // 00011 // drkent@users.sourceforge.net mtfeldmann@users.sourceforge.net 00012 00013 #ifndef QMCPROPERTIES_H 00014 #define QMCPROPERTIES_H 00015 00016 #include <iostream> 00017 #include <string> 00018 #include <math.h> 00019 00020 #ifdef PARALLEL 00021 #include <mpi.h> 00022 #endif 00023 00024 #include "QMCProperty.h" 00025 #include "Array1D.h" 00026 00027 using namespace std; 00028 00033 class QMCProperties 00034 { 00035 public: 00036 00040 QMCProperty energy; 00041 QMCProperty tr_weight; 00042 QMCProperty energy2; 00043 00047 QMCProperty kineticEnergy; 00048 00052 QMCProperty potentialEnergy; 00053 00057 QMCProperty neEnergy; 00058 QMCProperty eeEnergy; 00059 00063 QMCProperty logWeights; 00064 00068 QMCProperty acceptanceProbability; 00069 00073 QMCProperty distanceMovedAccepted; 00074 00078 QMCProperty distanceMovedTrial; 00079 00080 QMCProperty walkerAge; 00081 QMCProperty weightChange; 00082 QMCProperty growthRate; 00083 00087 QMCProperties(); 00088 ~QMCProperties(); 00089 00093 void zeroOut(); 00094 00098 void operator = ( const QMCProperties &rhs ); 00099 00104 QMCProperties operator + ( QMCProperties &rhs ); 00105 00114 void newSample(QMCProperties* newProperties, double weight, int nwalkers); 00115 00120 void toXML(ostream& strm); 00121 00127 bool readXML(istream& strm); 00128 00132 friend ostream& operator <<(ostream& strm, QMCProperties &rhs); 00133 00134 #ifdef PARALLEL 00135 00136 private: 00140 static bool mpiTypeCreated; 00141 00145 static void buildMpiType(); 00146 00151 static void buildMpiReduce(); 00152 00156 static void Reduce_Function(QMCProperties *in, QMCProperties *inout, 00157 int *len, MPI_Datatype *dptr); 00158 00159 public: 00160 00164 static MPI_Datatype MPI_TYPE; 00165 00169 static MPI_Op MPI_REDUCE; 00170 00171 #endif 00172 }; 00173 00174 #endif 00175 00176 00177 00178 00179 00180 00181 00182