Exemplo n.º 1
0
void ParticleSet::resetGroups()
{
  int nspecies=mySpecies.getTotalNum();
  if(nspecies==0)
  {
    APP_ABORT("ParticleSet::resetGroups() Failed. No species exisits");
  }
  int natt=mySpecies.numAttributes();
  int qind=mySpecies.addAttribute("charge");
  if(natt==qind)
  {
    app_log() << " Missing charge attribute of the SpeciesSet " << myName << " particleset" << endl;
    app_log() << " Assume neutral particles Z=0.0 " << endl;
    for(int ig=0; ig<nspecies; ig++)
      mySpecies(qind,ig)=0.0;
  }
  for(int iat=0; iat<Z.size(); iat++)
    Z[iat]=mySpecies(qind,GroupID[iat]);
  natt=mySpecies.numAttributes();
  int massind=mySpecies.addAttribute("mass");
  if(massind==natt)
  {
    for(int ig=0; ig<nspecies; ig++)
      mySpecies(massind,ig)=1.0;
  }
  for(int iat=0; iat<Mass.size(); iat++)
    Mass[iat]=mySpecies(massind,GroupID[iat]);
  vector<int> ng(nspecies,0);
  for(int iat=0; iat<GroupID.size(); iat++)
  {
    if(GroupID[iat]<nspecies)
      ng[GroupID[iat]]++;
    else
      APP_ABORT("ParticleSet::resetGroups() Failed. GroupID is out of bound.");
  }
  SubPtcl.resize(nspecies+1);
  SubPtcl[0]=0;
  for(int i=0; i<nspecies; ++i)
    SubPtcl[i+1]=SubPtcl[i]+ng[i];
  int membersize= mySpecies.addAttribute("membersize");
  for(int ig=0; ig<nspecies; ++ig)
    mySpecies(membersize,ig)=ng[ig];
  //orgID=ID;
  //orgGroupID=GroupID;
  int new_id=0;
  for(int i=0; i<nspecies; ++i)
    for(int iat=0; iat<GroupID.size(); ++iat)
      if(GroupID[iat]==i)
        IndirectID[new_id++]=ID[iat];
  IsGrouped=true;
  for(int iat=0; iat<ID.size(); ++iat)
    IsGrouped &= (IndirectID[iat]==ID[iat]);
  if(IsGrouped)
    app_log() << "Particles are grouped. Safe to use groups " << endl;
  else
    app_log() << "ID is not grouped. Need to use IndirectID for species-dependent operations " << endl;
}
Exemplo n.º 2
0
 void LocalECPotential::resetTargetParticleSet(ParticleSet& P) {
   int tid=P.addTable(IonConfig);
   if(tid != myTableIndex)
   {
     APP_ABORT("  LocalECPotential::resetTargetParticleSet found a different distance table index.");
   }
 }
Exemplo n.º 3
0
RNDiracDeterminantBase::GradType
RNDiracDeterminantBase::evalGradSource(ParticleSet& P, ParticleSet& source,
                                       int iat)
{
  APP_ABORT("What?! released node and forces?");
  return GradType();
}
Exemplo n.º 4
0
 units energy_unit(const string& su)
 {
   units u;
   if(su=="J")
     u = J; 
   else if(su=="eV")
     u = eV;
   else if(su=="Ry")
     u = Ry;
   else if(su=="Ha")
     u = Ha;
   else if(su=="kJ/mol")
     u = kJ_mol;
   else if(su=="K")
     u = K;
   else if(su=="joule")
     u = J; 
   else if(su=="electron_volt")
     u = eV;
   else if(su=="rydberg")
     u = Ry;
   else if(su=="hartree")
     u = Ha;
   else if(su=="kilojoule_per_mole")
     u = kJ_mol;
   else if(su=="kelvin")
     u = K;
   else
     APP_ABORT("units::energy_unit\n  invalid energy unit: "+su+"\n  valid options are: J/joule, eV/electron_volt, Ry/rydberg, Ha/hartree, kJ/mol/kilo_joule_per_mole, K/kelvin");
   return u;
 }
Exemplo n.º 5
0
std::vector<T> AdiosCheckpointInput::retrieveVector(const std::string& var_name)
{
  /*
    Retrieve one of the buffers that we have read from the file system.
  */
  void* buff_to_return;
  int buff_size;
  bool buff_found = false;
  for (int i = 0; i < read_queue.size(); i++)
  {
    if (read_queue[i] == var_name)
    {
      buff_found = true;
      buff_to_return = buffers[i];
      buff_size = sizes[i];
      //delete this value from the queues
      buffers.erase(buffers.begin() + i);
      sizes.erase(sizes.begin() + i);
      read_queue.erase(read_queue.begin() + i);
      break;
    }
  }
  if (!buff_found)
  {
    qmcplusplus::app_error() << "Checkpoint file does not contain: " << var_name << std::endl;
    APP_ABORT("qmcapp");
    return ;
  }
  T* raw_buff = static_cast<T*>(buff_to_return);
  vector<T> vec_buff(raw_buff, raw_buff + buff_size);
  //free some memory
  free(raw_buff);
  return vec_buff;
}
Exemplo n.º 6
0
 units pressure_unit(const string& su)
 {
   units u;
   if(su=="Pa")
     u = Pa; 
   else if(su=="bar")
     u = bar;
   else if(su=="Mbar")
     u = Mbar;
   else if(su=="GPa")
     u = GPa;
   else if(su=="atm")
     u = atm;
   else if(su=="pascal")
     u = Pa; 
   else if(su=="megabar")
     u = Mbar;
   else if(su=="gigapascal")
     u = GPa;
   else if(su=="atmosphere")
     u = atm;
   else
     APP_ABORT("units::pressure_unit\n  invalid pressure unit: "+su+"\n  valid options are: Pa/pascal, bar/bar, Mbar/megabar, GPa/gigapascal, atm/atmosphere");
   return u;
 }
Exemplo n.º 7
0
 units distance_unit(const string& su)
 {
   units u;
   if(su=="m")
     u = m; 
   else if(su=="A")
     u = A;
   else if(su=="B")
     u = B;
   else if(su=="nm")
     u = nm;
   else if(su=="pm")
     u = pm;
   else if(su=="fm")
     u = fm;
   else if(su=="meter")
     u = m;
   else if(su=="angstrom")
     u = A;
   else if(su=="bohr")
     u = B;
   else if(su=="nanometer")
     u = nm;
   else if(su=="picometer")
     u = pm;
   else if(su=="femtometer")
     u = fm;
   else
     APP_ABORT("units::distance_unit\n  invalid distance unit: "+su+"\n  valid options are: m/meter, A/angstrom, B/bohr, nm/nanometer, pm/picometer, fm/femtometer");
   return u;
 }
Exemplo n.º 8
0
 units time_unit(const string& su)
 {
   units u;
   if(su=="s")
     u = s; 
   else if(su=="ms")
     u = ms;
   else if(su=="ns")
     u = ns;
   else if(su=="ps")
     u = ps;
   else if(su=="fs")
     u = fs;
   else if(su=="second")
     u = s; 
   else if(su=="millisecond")
     u = ms;
   else if(su=="nanosecond")
     u = ns;
   else if(su=="picosecond")
     u = ps;
   else if(su=="femtosecond")
     u = fs;
   else
     APP_ABORT("units::time_unit\n  invalid time unit: "+su+"\n  valid options are: s/second, ms/millisecond, ns/nanosecond, ps/picosecond, fs/femtosecond");
   return u;
 }
Exemplo n.º 9
0
 units mass_unit(const string& su)
 {
   units u;
   if(su=="kg")
     u = kg; 
   else if(su=="me")
     u = me;
   else if(su=="mp")
     u = mp;
   else if(su=="amu")
     u = amu;
   else if(su=="Da")
     u = Da;
   else if(su=="kilogram")
     u = kg; 
   else if(su=="electron_mass")
     u = me;
   else if(su=="proton_mass")
     u = mp;
   else if(su=="atomic_mass_unit")
     u = amu;
   else if(su=="dalton")
     u = Da;
   else
     APP_ABORT("units::mass_unit\n  invalid mass unit: "+su+"\n  valid options are: kg/kilogram, me/electron_mass, mp/proton_mass, amu/atomic_mass_unit, Da/dalton");
   return u;
 }
Exemplo n.º 10
0
Array_Descriptor_Type *Array_Descriptor_Type::Get_Descriptor_From_Cache ( const Internal_Index & I , const Internal_Index & J )
   {
     Array_Descriptor_Type *Return_Descriptor = NULL;

  // 1D descriptor cache!
  // Store descriptor in chain of lists (Data_Base, Access_Base, Length)
     if (Descriptor_Dimension == 2 && Constant_Data_Base && Constant_Unit_Stride)
        {
          int Data_Base_Key      = Data_Base[0] % DATA_BASE_2D_HASH_TABLE_LENGTH;
          int Access_Base_I_Key  = I.Base       % ACCESS_BASE_2D_HASH_TABLE_LENGTH;
          int Access_Base_J_Key  = J.Base       % ACCESS_BASE_2D_HASH_TABLE_LENGTH;
          int Access_Bound_I_Key = I.Bound      % ACCESS_BOUND_2D_HASH_TABLE_LENGTH;
          int Access_Bound_J_Key = J.Bound      % ACCESS_BOUND_2D_HASH_TABLE_LENGTH;
          int Size_I_Key         = Size[0]      % SIZE_2D_HASH_TABLE_LENGTH;
          int Size_J_Key         = Size[1]      % SIZE_2D_HASH_TABLE_LENGTH;

          if ( (Descriptor_2D_Cache != NULL) && 
               ( (*Descriptor_2D_Cache)[Data_Base_Key] != NULL) &&
               ( (*(*Descriptor_2D_Cache)[Data_Base_Key])[Access_Base_I_Key ][Access_Base_J_Key ] != NULL) &&
               ( (*(*(*Descriptor_2D_Cache)[Data_Base_Key])[Access_Base_I_Key][Access_Base_J_Key])
                                                  [Access_Bound_I_Key][Access_Bound_J_Key] != NULL) &&
               ( (*(*(*(*Descriptor_2D_Cache)[Data_Base_Key])[Access_Base_I_Key ][Access_Base_J_Key ])
                                                  [Access_Bound_I_Key][Access_Bound_J_Key])
                                                  [Size_I_Key        ][Size_J_Key        ] != NULL) )
             {
               Return_Descriptor = (*(*(*(*Descriptor_2D_Cache)[Data_Base_Key])[Access_Base_I_Key][Access_Base_J_Key])
                                                    [Access_Bound_I_Key][Access_Bound_J_Key])[Size_I_Key][Size_J_Key];

            // Since only constant stride and constant data base info goes into the cache
            // we can skip checking for these constant values when we get descriptors from the cache!
               if ( (Return_Descriptor->Bound[0]     != I.Bound)      || (Return_Descriptor->Size[0] != Size[0]) ||
                    (Return_Descriptor->Data_Base[0] != Data_Base[0]) || (Return_Descriptor->Base[0] != I.Base) )
                  {
                    bool Found     = FALSE;
                    Return_Descriptor = Return_Descriptor->Next_Cache_Link;
                    while (Return_Descriptor != NULL && !Found)
                       {
                         if ( (Return_Descriptor->Bound[0] == I.Bound) && 
                              (Return_Descriptor->Size[0] == Size[0]) &&
                              (Return_Descriptor->Data_Base[0] == Data_Base[0]) && 
                              (Return_Descriptor->Base[0] == I.Base) )
                            {
                              Found = TRUE;
                            }
                           else
                            {
                              Return_Descriptor = Return_Descriptor->Next_Cache_Link;
                            }
                       }
                  }
             }
        }

     printf ("Line commented out so constructor could be inlined! \n");
     APP_ABORT();
  // if (Return_Descriptor == NULL)
  //      Return_Descriptor = new Array_Descriptor_Type ( *this , I );

     return Return_Descriptor;
   }
Exemplo n.º 11
0
 /** move was accepted, update the real container
  */
 void AGPDeterminant::acceptMove(ParticleSet& P, int iat) 
 {
   PhaseValue += evaluatePhase(curRatio);
   LogValue +=std::log(std::abs(curRatio));
   //CurrentDet *= curRatio;
   if(UpdateMode == ORB_PBYP_RATIO)
   {
     APP_ABORT("Incomplete AGPDeterminant::acceptMove Turn on useDrift " );
     if(iat<Nup)
       InverseUpdateByRow(psiM,psiU,workV1,workV2,iat,curRatio);
     else
       InverseUpdateByColumn(psiM,psiD,workV1,workV2,iat-Nup,curRatio);
     psiM_temp=psiM;
     //psiM = psiM_temp;
   }
   else
   {
     psiM = psiM_temp;
     myG = myG_temp;
     myL = myL_temp;
     //std::copy(GeminalBasis->dy(0),GeminalBasis->dy(0)+BasisSize,dY[iat]);
     //std::copy(GeminalBasis->d2y(0),GeminalBasis->d2y(0)+BasisSize,d2Y[iat]);
     std::copy(GeminalBasis->dPhi.begin(),GeminalBasis->dPhi.end(),dY[iat]);//@@
     std::copy(GeminalBasis->d2Phi.begin(),GeminalBasis->d2Phi.end(),d2Y[iat]);//@@
   }
   curRatio=1.0;
 }
Exemplo n.º 12
0
void
ZeroVarianceForce::resetTargetParticleSet(ParticleSet& P)
{
  int tid=P.addTable(Ions);
  if(tid != myTableIndex)
    APP_ABORT("ZeroVarianceForce::resetTargetParticleSet found inconsistent table index");
}
Exemplo n.º 13
0
 DiracDeterminantBase::ValueType DiracDeterminantBase::logRatio(ParticleSet& P, int iat,
     ParticleSet::ParticleGradient_t& dG, 
     ParticleSet::ParticleLaplacian_t& dL) {
   APP_ABORT("  logRatio is not allowed");
   //THIS SHOULD NOT BE CALLED
   ValueType r=ratio(P,iat,dG,dL);
   return LogValue = evaluateLogAndPhase(r,PhaseValue);
 }
Exemplo n.º 14
0
 void ParticleSet::convert2UnitInBox(const ParticlePos_t& pin, ParticlePos_t& pout) 
 {
   APP_ABORT("Do implement ParticleSet::convert2UnitInBox");
   for(int i=0; i<pin.size(); ++i)
   {
     //MinimumImageBConds<RealType,DIM>::apply(Lattice.G,pin[i]);
   }
 }
Exemplo n.º 15
0
SPOSetBasePtr FermionBase::getSPO(const string& aname)
{
  spo_set_type::iterator sit=mySPOSet.find(aname);
  if(sit == mySPOSet.end())
  {
    APP_ABORT("FermionBase::getSPO failed. Missing SPOSet with " + aname);
  }
  return (*sit).second;
}
Exemplo n.º 16
0
void CoulombPBCAB::resetTargetParticleSet(ParticleSet& P)
{
  int tid=P.addTable(PtclA);
  if(tid != myTableIndex)
  {
    APP_ABORT("CoulombPBCAB::resetTargetParticleSet found inconsistent table index");
  }
  AB->resetTargetParticleSet(P);
}
Exemplo n.º 17
0
RNDiracDeterminantBase::GradType
RNDiracDeterminantBase::evalGradSource
(ParticleSet& P, ParticleSet& source,int iat,
 TinyVector<ParticleSet::ParticleGradient_t, OHMMS_DIM> &grad_grad,
 TinyVector<ParticleSet::ParticleLaplacian_t,OHMMS_DIM> &lapl_grad)
{
  APP_ABORT("What?! released node and forces?");
  return GradType();
}
Exemplo n.º 18
0
 units count_unit(const string& su)
 {
   units u;
   if(su=="mol")
     u = mol;
   else if(su=="mole")
     u = mol;
   else
     APP_ABORT("units::count_unit\n  invalid count unit: "+su+"\n  valid options are: mol");
   return u;
 }
Exemplo n.º 19
0
///add a new SPOSet to the list of determinants
void FermionBase::addSPO(const string& aname, SPOSetBase* sposet)
{
  if (mySPOSet.find(aname) == mySPOSet.end())
  {
    mySPOSet[aname] = sposet;
    sposet->objectName = aname;
  }
  else
  {
    APP_ABORT(" FermionBase::addSPO(sposet,aname) cannot reuse the " + aname );
  }
}
Exemplo n.º 20
0
Array_Descriptor_Type *Array_Descriptor_Type::Get_Descriptor_From_Cache ( 
          const Array_Descriptor_Type & X )
   {
     Array_Descriptor_Type *Return_Descriptor = NULL;

     printf ("SORRY NO IMPLEMENTED, Descriptor caching not implemented yet! \n");
     APP_ABORT();

     if (Return_Descriptor == NULL)
          Return_Descriptor = new Array_Descriptor_Type (X);

     return Return_Descriptor;
   }
Exemplo n.º 21
0
 MCWalkerConfiguration* ParticleSetPool::getWalkerSet(const string& pname)
 {
   ParticleSet* mc=0;
   if(myPool.size() ==1) 
     mc=(*myPool.begin()).second;
   else
     mc=getParticleSet(pname);
   if(mc ==0) 
   {
     APP_ABORT("ParticleSePool::getWalkerSet missing "+ pname);
   }
   return dynamic_cast<MCWalkerConfiguration*>(mc);
 }
Exemplo n.º 22
0
 units force_unit(const string& su)
 {
   units u;
   if(su=="N")
     u = N; 
   else if(su=="pN")
     u = pN;
   else if(su=="newton")
     u = N; 
   else if(su=="piconewton")
     u = pN;
   else
     APP_ABORT("units::force_unit\n  invalid force unit: "+su+"\n  valid options are: N/newton, pN/piconewton");
   return u;
 }
Exemplo n.º 23
0
 units charge_unit(const string& su)
 {
   units u;
   if(su=="C")
     u = C; 
   else if(su=="e")
     u = e;
   else if(su=="coulomb")
     u = C; 
   else if(su=="proton_charge")
     u = e;
   else
     APP_ABORT("units::charge_unit\n  invalid charge unit: "+su+"\n  valid options are: C/coulomb, e/proton_charge");
   return u;
 }
Exemplo n.º 24
0
CoulombPBCAATemp::Return_t
CoulombPBCAATemp::evaluatePbyP(ParticleSet& P, int active)
{
  if(is_active)
  {
    const std::vector<DistanceTableData::TempDistType> &temp(P.DistTables[0]->Temp);
    Return_t z=0.5*Zat[active];
    Return_t sr=0;
    const Return_t* restrict sr_ptr=SR2[active];
    for(int iat=0; iat<NumCenters; ++iat,++sr_ptr)
    {
      if(iat==active)
        dSR[active]=0.0;
      else
        sr+=dSR[iat]=(z*Zat[iat]*temp[iat].rinv1*rVs->splint(temp[iat].r1)- (*sr_ptr));
    }
#if defined(USE_REAL_STRUCT_FACTOR)
    APP_ABORT("CoulombPBCAATemp::evaluatePbyP");
#else
    const StructFact& PtclRhoK(*(P.SK));
    const ComplexType* restrict eikr_new=PtclRhoK.eikr_temp.data();
    const ComplexType* restrict eikr_old=PtclRhoK.eikr[active];
    ComplexType* restrict d_ptr=del_eikr.data();
    for(int k=0; k<del_eikr.size(); ++k)
      *d_ptr++ = (*eikr_new++ - *eikr_old++);
    int spec2=SpeciesID[active];
    for(int spec1=0; spec1<NumSpecies; ++spec1)
    {
      Return_t zz=z*Zspec[spec1];
      sr += zz*AA->evaluate(PtclRhoK.KLists.kshell,PtclRhoK.rhok[spec1],del_eikr.data());
    }
    sr+= z*z*AA->evaluate(PtclRhoK.KLists.kshell,del_eikr.data(),del_eikr.data());
    //// const StructFact& PtclRhoK(*(PtclRef->SK));
    //const StructFact& PtclRhoK(*(P.SK));
    //const ComplexType* restrict eikr_new=PtclRhoK.eikr_temp.data();
    //const ComplexType* restrict eikr_old=PtclRhoK.eikr[active];
    //ComplexType* restrict d_ptr=del_eikr.data();
    //for(int k=0; k<del_eikr.size(); ++k) *d_ptr++ = (*eikr_new++ - *eikr_old++);
    //for(int iat=0;iat<NumCenters; ++iat)
    //{
    //  if(iat!=active)
    //    sr += z*Zat[iat]*AA->evaluate(PtclRhoK.KLists.kshell, PtclRhoK.eikr[iat],del_eikr.data());
    //}
#endif
    return NewValue=Value+2.0*sr;
  }
  else
    return Value;
Exemplo n.º 25
0
void
KContainer::UpdateKLists(ParticleLayout_t& lattice, RealType kc, bool useSphere)
{
  kcutoff = kc;
  kcut2 = kc*kc;
  if(kcutoff <= 0.0)
  {
    APP_ABORT("  Illegal cutoff for KContainer");
  }
  FindApproxMMax(lattice);
  BuildKLists(lattice,useSphere);

  app_log() << "  KContainer initialised with cutoff " << kcutoff << endl;
  app_log() << "   # of K-shell  = " << kshell.size() << endl;
  app_log() << "   # of K points = " << kpts.size() << endl;
}
Exemplo n.º 26
0
void TrialWaveFunction::evaluateDerivRatios(VirtualParticleSet& VP, const opt_variables_type& optvars,
    vector<RealType>& ratios, Matrix<RealType>& dratio)
{
#if defined(QMC_COMPLEX)
  APP_ABORT("TrialWaveFunction::evaluateDerivRatios not available for complex wavefunctions");
#else
  std::fill(ratios.begin(),ratios.end(),1.0);
  vector<ValueType> t(ratios.size());
  for (int i=0; i<Z.size(); ++i)
  {
    Z[i]->evaluateDerivRatios(VP,optvars,t,dratio);
    for (int j=0; j<ratios.size(); ++j)
      ratios[j]*=t[j];
  }
#endif
}
Exemplo n.º 27
0
/** update the particle attribute by the proposed move
 *@param iat the particle index
 *
 *When the activePtcl is equal to iat, overwrite the position and update the
 *content of the distance tables.
 */
void ParticleSet::acceptMove(Index_t iat)
{
  if (iat == activePtcl)
  {
    //Update position + distance-table
    for (int i=0; i< DistTables.size(); i++)
    {
      DistTables[i]->update(iat);
    }
    //Do not change SK: 2007-05-18
    if (SK && SK->DoUpdate)
      SK->acceptMove(iat);
  }
  else
  {
    ostringstream o;
    o << "  Illegal acceptMove " << iat << " != " << activePtcl;
    APP_ABORT(o.str());
  }
}
Exemplo n.º 28
0
//  void
//  ParticleSet::registerData(Walker_t& awalker, PooledData<RealType>& buf) {
//    R = awalker.R;
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++)
//    {
//      DistTables[i]->evaluate(*this);
//      DistTables[i]->registerData(buf);
//    }
//    if(SK)
//    {
//      SK->UpdateAllPart();
//      SK->registerData(buf);
//    }
//#else
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->evaluate(*this);
//    if(SK) SK->UpdateAllPart();
//#endif
//  }
//
//  void
//  ParticleSet::registerData(PooledData<RealType>& buf) {
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++)
//    {
//      DistTables[i]->evaluate(*this);
//      DistTables[i]->registerData(buf);
//    }
//    if(SK)
//    {
//      SK->UpdateAllPart();
//      SK->registerData(buf);
//    }
//#else
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->evaluate(*this);
//    if(SK) SK->UpdateAllPart();
//#endif
//  }
//
//  void
//  ParticleSet::updateBuffer(Walker_t& awalker, PooledData<RealType>& buf) {
//    R = awalker.R;
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++)
//    {
//      DistTables[i]->evaluate(*this);
//      DistTables[i]->updateBuffer(buf);
//    }
//    if(SK)
//    {
//      SK->UpdateAllPart();
//      SK->updateBuffer(buf);
//    }
//#else
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->evaluate(*this);
//    if(SK) SK->UpdateAllPart();
//#endif
//  }
//
//  void
//  ParticleSet::updateBuffer(PooledData<RealType>& buf) {
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++)
//    {
//      DistTables[i]->evaluate(*this);
//      DistTables[i]->updateBuffer(buf);
//    }
//    if(SK)
//    {
//      SK->UpdateAllPart();
//      SK->updateBuffer(buf);
//    }
//#else
//    //for(int i=0; i< DistTables.size(); i++) DistTables[i]->evaluate(*this);
//    if(SK) SK->UpdateAllPart();
//#endif
//  }
//
//  void
//  ParticleSet::copyToBuffer(PooledData<RealType>& buf) {
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->copyToBuffer(buf);
//    //Do not change SK: 2007-05-18
//    //if(SK) SK->copyToBuffer(buf);
//    if(SK)
//    {//need to calculate the Sk with the current position
//      if(!SK->DoUpdate) SK->UpdateAllPart();
//      SK->copyToBuffer(buf);
//    }
//#else
//    if(SK && !SK->DoUpdate) SK->UpdateAllPart();
//#endif
//  }
//
//  void
//  ParticleSet::copyFromBuffer(PooledData<RealType>& buf)
//  {
//#if defined(PACK_DISTANCETABLES)
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->copyFromBuffer(buf);
//    if(SK) SK->copyFromBuffer(buf);
//#else
//    for(int i=0; i< DistTables.size(); i++) DistTables[i]->evaluate(*this);
//    if(SK) SK->UpdateAllPart();
//#endif
//  }
//
void ParticleSet::initPropertyList()
{
  PropertyList.clear();
  //Need to add the default Properties according to the enumeration
  PropertyList.add("LogPsi");
  PropertyList.add("SignPsi");
  PropertyList.add("UmbrellaWeight");
  PropertyList.add("R2Accepted");
  PropertyList.add("R2Proposed");
  PropertyList.add("DriftScale");
  PropertyList.add("AltEnergy");
  PropertyList.add("LocalEnergy");
  PropertyList.add("LocalPotential");
  if (PropertyList.size() != NUMPROPERTIES)
  {
    app_error() << "The number of default properties for walkers  is not consistent." << endl;
    app_error() << "NUMPROPERTIES " << NUMPROPERTIES << " size of PropertyList " << PropertyList.size() << endl;
    APP_ABORT("ParticleSet::initPropertyList");
  }
}
Exemplo n.º 29
0
void AdiosCheckpointInput::getVector(const std::string& var_name, vector<T>& buffer)
{
  ADIOS_VARINFO* adios_inq = adios_inq_var(adios_file_handle, var_name.c_str());
  //Check to make sure the T is the same size as the data type on the disk
  if (adios_type_size(adios_inq->type, NULL) != sizeof(T))
  {
    qmcplusplus::app_error() << "Data type does not match data type found in file: " << std::endl;
    APP_ABORT("qmcapp");
    return ;
  }
  uint64_t total_size = 1;
  for (int i = 0; i < adios_inq->ndim; i++)
    total_size *= adios_inq->dims[i];
  //make sure we have enough space to copy all the data from the file
  buffer.reserve(total_size);
  //schedule the read
  adios_schedule_read(adios_file_handle, sel, var_name.c_str(), 0, 1, &(buffer[0]));
  //perform the read
  adios_perform_reads(adios_file_handle, 1);
  //Don't need the information about the variable anymore
  adios_free_varinfo(adios_inq);
}
Exemplo n.º 30
0
CoulombPBCAB::Return_t
CoulombPBCAB::evaluatePbyP(ParticleSet& P, int active)
{
#if defined(USE_REAL_STRUCT_FACTOR)
  APP_ABORT("CoulombPBCAB::evaluatePbyP(ParticleSet& P, int active)");
#else
  const std::vector<DistanceTableData::TempDistType> &temp(P.DistTables[myTableIndex]->Temp);
  RealType q=Qat[active];
  SRtmp=0.0;
  for(int iat=0; iat<NptclA; ++iat)
  {
    SRtmp+=Zat[iat]*q*temp[iat].rinv1*Vat[iat]->splint(temp[iat].r1);
  }
  LRtmp=0.0;
  const StructFact& RhoKA(*(PtclA.SK));
  //const StructFact& RhoKB(*(PtclB->SK));
  const StructFact& RhoKB(*(P.SK));
  for(int i=0; i<NumSpeciesA; i++)
    LRtmp+=Zspec[i]*q*AB->evaluate(RhoKA.KLists.kshell, RhoKA.rhok[i],RhoKB.eikr_temp.data());
#endif
  return NewValue=Value+(SRtmp-SRpart[active])+(LRtmp-LRpart[active]);
  //return NewValue=Value+(SRtmp-SRpart[active]);
}