• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisionf0be6da1644b96ca8a27fb4b10f857ceec6d96f1 (tree)
l'heure2014-01-05 02:28:30
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

Bugs in the constructor and destructor of ghost atoms are fixed. #32750

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1613 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/base/atoms/Atom.cpp
+++ b/src/base/atoms/Atom.cpp
@@ -58,8 +58,6 @@ Atom::Atom(int index){
5858 this->index = index;
5959 }
6060
61-Atom::Atom(){}
62-
6361 Atom::~Atom(){
6462 MallocerFreer::GetInstance()->Free<double>(&this->xyz, CartesianType_end);
6563 MallocerFreer::GetInstance()->Free<double>(&this->pxyz, CartesianType_end);
@@ -163,7 +161,11 @@ double* Atom::GetPxyz() const{
163161
164162 void Atom::SetXyz(double x, double y, double z) const{
165163 #ifdef MOLDS_DBG
166- if(this->xyz==NULL) throw MolDSException(this->errorMessageSetXyzCoordinatesNull);
164+ if(this->xyz==NULL){
165+ printf("xyz\n\n");
166+ throw MolDSException("aaa");
167+ //throw MolDSException(this->errorMessageSetXyzCoordinatesNull);
168+ }
167169 #endif
168170 xyz[0]= x; xyz[1]= y; xyz[2]= z;
169171 }
--- a/src/base/atoms/Atom.h
+++ b/src/base/atoms/Atom.h
@@ -107,7 +107,6 @@ public:
107107 double GetPm3PddgParameterPa(int paIndex) const;
108108 double GetPm3PddgParameterDa(int daIndex) const;
109109 protected:
110- Atom();
111110 double* xyz; // coordinates
112111 double* pxyz; // momentum. Note that this is not velocity!!
113112 MolDS_base::AtomType atomType;
@@ -231,6 +230,7 @@ protected:
231230 double pm3DAlpha; // Table II in ref. [MH_2007] for H, C, N, O, and Table IV in re. [MMHBV_2007] for S.
232231 virtual void SetAtomicParameters() = 0;
233232 private:
233+ Atom();
234234 std::string errorMessageIonPot;
235235 std::string errorMessageAtomType;
236236 std::string errorMessageNumberValences;
--- a/src/base/atoms/Catom.cpp
+++ b/src/base/atoms/Catom.cpp
@@ -42,6 +42,8 @@ Catom::Catom(int index) : Atom(index){
4242 this->SetAtomicParameters();
4343 }
4444
45+Catom::~Catom(){}
46+
4547 void Catom::SetAtomicParameters(){
4648 this->atomType = C;
4749 this->atomicMass = 12.0107*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Catom.h
+++ b/src/base/atoms/Catom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms{
2222 class Catom : virtual public Atom {
2323 public:
2424 Catom(int index);
25+ virtual ~Catom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/Hatom.cpp
+++ b/src/base/atoms/Hatom.cpp
@@ -45,6 +45,8 @@ Hatom::Hatom(int index) : Atom(index){
4545 this->SetAtomicParameters();
4646 }
4747
48+Hatom::~Hatom(){}
49+
4850 void Hatom::SetAtomicParameters(){
4951 this->atomType = H;
5052 this->atomicMass = 1.00794*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Hatom.h
+++ b/src/base/atoms/Hatom.h
@@ -23,6 +23,7 @@ namespace MolDS_base_atoms{
2323 class Hatom : virtual public Atom {
2424 public:
2525 Hatom(int index);
26+ virtual ~Hatom();
2627 protected:
2728 void virtual SetAtomicParameters();
2829 private:
--- a/src/base/atoms/Liatom.cpp
+++ b/src/base/atoms/Liatom.cpp
@@ -43,6 +43,8 @@ Liatom::Liatom(int index) : Atom(index){
4343 this->SetAtomicParameters();
4444 }
4545
46+Liatom::~Liatom(){}
47+
4648 void Liatom::SetAtomicParameters(){
4749 this->atomType = Li;
4850 this->atomicMass = 6.941*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Liatom.h
+++ b/src/base/atoms/Liatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms{
2222 class Liatom : virtual public Atom {
2323 public:
2424 Liatom(int index);
25+ virtual ~Liatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/Natom.cpp
+++ b/src/base/atoms/Natom.cpp
@@ -42,6 +42,8 @@ Natom::Natom(int index) : Atom(index){
4242 this->SetAtomicParameters();
4343 }
4444
45+Natom::~Natom(){}
46+
4547 void Natom::SetAtomicParameters(){
4648 this->atomType = N;
4749 this->atomicMass = 14.00674*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Natom.h
+++ b/src/base/atoms/Natom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms{
2222 class Natom : virtual public Atom {
2323 public:
2424 Natom(int index);
25+ virtual ~Natom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/Oatom.cpp
+++ b/src/base/atoms/Oatom.cpp
@@ -42,6 +42,8 @@ Oatom::Oatom(int index) : Atom(index){
4242 this->SetAtomicParameters();
4343 }
4444
45+Oatom::~Oatom(){}
46+
4547 void Oatom::SetAtomicParameters(){
4648 this->atomType = O;
4749 this->atomicMass = 15.9994*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Oatom.h
+++ b/src/base/atoms/Oatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms{
2222 class Oatom : virtual public Atom {
2323 public:
2424 Oatom(int index);
25+ virtual ~Oatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/Satom.cpp
+++ b/src/base/atoms/Satom.cpp
@@ -42,6 +42,8 @@ Satom::Satom(int index) : Atom(index){
4242 this->SetAtomicParameters();
4343 }
4444
45+Satom::~Satom(){}
46+
4547 void Satom::SetAtomicParameters(){
4648 this->atomType = S;
4749 this->atomicMass = 32.066*Parameters::GetInstance()->GetGMolin2AU();
--- a/src/base/atoms/Satom.h
+++ b/src/base/atoms/Satom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms{
2222 class Satom : virtual public Atom {
2323 public:
2424 Satom(int index);
25+ virtual ~Satom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/Ghost.cpp
+++ b/src/base/atoms/ghost/Ghost.cpp
@@ -39,9 +39,12 @@ using namespace std;
3939 using namespace MolDS_base;
4040 using namespace MolDS_base_atoms;
4141 namespace MolDS_base_atoms_ghost{
42-Ghost::Ghost() : Atom(){
42+Ghost::Ghost(int index) : Atom(index){
43+ this->SetAtomicParameters();
4344 }
4445
46+Ghost::~Ghost(){}
47+
4548 void Ghost::SetAtomicParameters(){
4649 this->atomicMass = 0.0;
4750 this->coreCharge = 0.0;
--- a/src/base/atoms/ghost/Ghost.h
+++ b/src/base/atoms/ghost/Ghost.h
@@ -21,10 +21,12 @@
2121 namespace MolDS_base_atoms_ghost{
2222 class Ghost : virtual public MolDS_base_atoms::Atom {
2323 public:
24- Ghost();
24+ Ghost(int index);
25+ virtual ~Ghost();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
29+ Ghost();
2830 };
2931 }
3032 #endif
--- a/src/base/atoms/ghost/GhostCatom.cpp
+++ b/src/base/atoms/ghost/GhostCatom.cpp
@@ -41,12 +41,13 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostCatom::GhostCatom(int index) : Catom(index),Ghost(){
44+GhostCatom::GhostCatom(int index) : Atom(index),Catom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostCatom::~GhostCatom(){}
49+
4750 void GhostCatom::SetAtomicParameters(){
48- Catom::SetAtomicParameters();
49- Ghost::SetAtomicParameters();
5051 this->atomType = ghostC;
5152 }
5253 }
--- a/src/base/atoms/ghost/GhostCatom.h
+++ b/src/base/atoms/ghost/GhostCatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostCatom : public MolDS_base_atoms::Catom, public Ghost {
2323 public:
2424 GhostCatom(int index);
25+ ~GhostCatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/GhostHatom.cpp
+++ b/src/base/atoms/ghost/GhostHatom.cpp
@@ -41,12 +41,13 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostHatom::GhostHatom(int index) : Hatom(index),Ghost(){
44+GhostHatom::GhostHatom(int index) : Atom(index),Hatom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostHatom::~GhostHatom(){}
49+
4750 void GhostHatom::SetAtomicParameters(){
48- Hatom::SetAtomicParameters();
49- Ghost::SetAtomicParameters();
5051 this->atomType = ghostH;
5152 }
5253 }
--- a/src/base/atoms/ghost/GhostHatom.h
+++ b/src/base/atoms/ghost/GhostHatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostHatom : public MolDS_base_atoms::Hatom, public Ghost {
2323 public:
2424 GhostHatom(int index);
25+ ~GhostHatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/GhostLiatom.cpp
+++ b/src/base/atoms/ghost/GhostLiatom.cpp
@@ -41,9 +41,12 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostLiatom::GhostLiatom(int index) : Liatom(index),Ghost(){
44+GhostLiatom::GhostLiatom(int index) : Atom(index),Liatom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostLiatom::~GhostLiatom(){}
49+
4750 void GhostLiatom::SetAtomicParameters(){
4851 Liatom::SetAtomicParameters();
4952 Ghost::SetAtomicParameters();
--- a/src/base/atoms/ghost/GhostLiatom.h
+++ b/src/base/atoms/ghost/GhostLiatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostLiatom : public MolDS_base_atoms::Liatom, public Ghost {
2323 public:
2424 GhostLiatom(int index);
25+ ~GhostLiatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/GhostNatom.cpp
+++ b/src/base/atoms/ghost/GhostNatom.cpp
@@ -41,12 +41,13 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostNatom::GhostNatom(int index) : Natom(index),Ghost(){
44+GhostNatom::GhostNatom(int index) : Atom(index),Natom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostNatom::~GhostNatom(){}
49+
4750 void GhostNatom::SetAtomicParameters(){
48- Natom::SetAtomicParameters();
49- Ghost::SetAtomicParameters();
5051 this->atomType = ghostN;
5152 }
5253 }
--- a/src/base/atoms/ghost/GhostNatom.h
+++ b/src/base/atoms/ghost/GhostNatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostNatom : public MolDS_base_atoms::Natom, public Ghost {
2323 public:
2424 GhostNatom(int index);
25+ ~GhostNatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/GhostOatom.cpp
+++ b/src/base/atoms/ghost/GhostOatom.cpp
@@ -41,12 +41,13 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostOatom::GhostOatom(int index) : Oatom(index),Ghost(){
44+GhostOatom::GhostOatom(int index) : Atom(index),Oatom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostOatom::~GhostOatom(){}
49+
4750 void GhostOatom::SetAtomicParameters(){
48- Oatom::SetAtomicParameters();
49- Ghost::SetAtomicParameters();
5051 this->atomType = ghostO;
5152 }
5253 }
--- a/src/base/atoms/ghost/GhostOatom.h
+++ b/src/base/atoms/ghost/GhostOatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostOatom : public MolDS_base_atoms::Oatom, public Ghost {
2323 public:
2424 GhostOatom(int index);
25+ ~GhostOatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private:
--- a/src/base/atoms/ghost/GhostSatom.cpp
+++ b/src/base/atoms/ghost/GhostSatom.cpp
@@ -41,12 +41,13 @@ using namespace std;
4141 using namespace MolDS_base;
4242 using namespace MolDS_base_atoms;
4343 namespace MolDS_base_atoms_ghost{
44-GhostSatom::GhostSatom(int index) : Satom(index),Ghost(){
44+GhostSatom::GhostSatom(int index) : Atom(index),Satom(index),Ghost(index){
45+ this->SetAtomicParameters();
4546 }
4647
48+GhostSatom::~GhostSatom(){}
49+
4750 void GhostSatom::SetAtomicParameters(){
48- Satom::SetAtomicParameters();
49- Ghost::SetAtomicParameters();
5051 this->atomType = ghostS;
5152 }
5253 }
--- a/src/base/atoms/ghost/GhostSatom.h
+++ b/src/base/atoms/ghost/GhostSatom.h
@@ -22,6 +22,7 @@ namespace MolDS_base_atoms_ghost{
2222 class GhostSatom : public MolDS_base_atoms::Satom, public Ghost {
2323 public:
2424 GhostSatom(int index);
25+ ~GhostSatom();
2526 protected:
2627 void virtual SetAtomicParameters();
2728 private: