<commit_before>/* 
 *            Copyright 2009-2018 The VOTCA Development Team
 *                       (http://www.votca.org)
 *
 *      Licensed under the Apache License, Version 2.0 (the "License")
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *              http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __VOTCA_XTP_QMATOM_H
#define	__VOTCA_XTP_QMATOM_H

// Binary archive 
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <votca/tools/vec.h> 
#include <votca/xtp/aoshell.h>

#include <votca/xtp/checkpoint.h>

namespace votca { namespace xtp {
    
/**
 *    \brief container for QM atoms 
 *
 *    Stores atom type, coordinates, charge
 */    
class QMAtom
{
     friend class AOBasis;
public:
    
   QMAtom (int _index,std::string _element, double _x, double _y, double _z)
            :index(_index), type( _element), nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=tools::vec(_x,_y,_z);}
            
   QMAtom (int _index,std::string _element, tools::vec _pos)
            :index(_index), type( _element ),nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=_pos;}
   
   
   QMAtom ()
            :index(0), type(""),nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=tools::vec(0.0);}
       
   const tools::vec & getPos() const {return pos;}
   
  
   void setPos(tools::vec position){pos=position;}

   const std::string & getType() const { return type;}
   
  int getAtomID(){ return index;}
   
   int getNuccharge() { return nuccharge-ecpcharge;}
       
   void setPartialcharge(double _q){partialcharge=_q;}
   const double & getPartialcharge() const { return partialcharge;}
   
  
   
private:
    
   int index;
   std::string type;
   tools::vec pos;// Bohr
   int nuccharge;//nuc charge is set in aobasis fill and ecpfill
   int ecpcharge;
   double partialcharge;

   
 public: 
   template<typename Archive> 
   void serialize(Archive& ar, const unsigned version) {
       ar & index;
       ar & type;
       ar & pos;
       ar & nuccharge;
       ar & ecpcharge;
       ar & partialcharge;
       

   }

   void WriteToCpt(CptLoc parent){
       hdf5_utils::Writer w(parent);

       w(index, "index");
       w(type, "type");
       w(pos, "pos");
       w(nuccharge, "nuccharge");
       w(ecpcharge, "ecpcharge");
       w(partialcharge, "partialcharge");
   }
};
    
}}

#endif	/* __VOTCA_XTP_QMATOM_H */

<commit_msg>Add code to read qmatoms<commit_after>/* 
 *            Copyright 2009-2018 The VOTCA Development Team
 *                       (http://www.votca.org)
 *
 *      Licensed under the Apache License, Version 2.0 (the "License")
 *
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *              http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __VOTCA_XTP_QMATOM_H
#define	__VOTCA_XTP_QMATOM_H

// Binary archive 
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <votca/tools/vec.h> 
#include <votca/xtp/aoshell.h>

#include <votca/xtp/checkpoint.h>

namespace votca { namespace xtp {
    
/**
 *    \brief container for QM atoms 
 *
 *    Stores atom type, coordinates, charge
 */    
class QMAtom
{
     friend class AOBasis;
public:
    
   QMAtom (int _index,std::string _element, double _x, double _y, double _z)
            :index(_index), type( _element), nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=tools::vec(_x,_y,_z);}
            
   QMAtom (int _index,std::string _element, tools::vec _pos)
            :index(_index), type( _element ),nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=_pos;}
   
   
   QMAtom ()
            :index(0), type(""),nuccharge(0), ecpcharge(0),partialcharge(0.0)
            {pos=tools::vec(0.0);}
       
   const tools::vec & getPos() const {return pos;}
   
  
   void setPos(tools::vec position){pos=position;}

   const std::string & getType() const { return type;}
   
  int getAtomID(){ return index;}
   
   int getNuccharge() { return nuccharge-ecpcharge;}
       
   void setPartialcharge(double _q){partialcharge=_q;}
   const double & getPartialcharge() const { return partialcharge;}
   
  
   
private:
    
   int index;
   std::string type;
   tools::vec pos;// Bohr
   int nuccharge;//nuc charge is set in aobasis fill and ecpfill
   int ecpcharge;
   double partialcharge;

   
 public: 
   template<typename Archive> 
   void serialize(Archive& ar, const unsigned version) {
       ar & index;
       ar & type;
       ar & pos;
       ar & nuccharge;
       ar & ecpcharge;
       ar & partialcharge;
       

   }

   void WriteToCpt(CptLoc parent){
       hdf5_utils::Writer w(parent);

       w(index, "index");
       w(type, "type");
       w(pos, "pos");
       w(nuccharge, "nuccharge");
       w(ecpcharge, "ecpcharge");
       w(partialcharge, "partialcharge");
   }

   void ReadFromCpt(CptLoc parent){
       hdf5_utils::Reader r(parent);

       r(index, "index");
       r(type, "type");
       r(pos, "pos");
       r(nuccharge, "nuccharge");
       r(ecpcharge, "ecpcharge");
       r(partialcharge, "partialcharge");
   }
};
    
}}

#endif	/* __VOTCA_XTP_QMATOM_H */


{'fraction_non_alphanumeric': 0.11858170262585717, 'fraction_numerical': 0.009533366783743101, 'mean_word_length': 2.691358024691358, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3713125', 'n_tokens_mistral': 1982, 'n_tokens_neox': 1958, 'n_words': 519}