6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
* documentation and/or other materials provided with the |
15 |
|
* distribution. |
28 |
|
* arising out of the use of or inability to use software, even if the |
29 |
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
* such damages. |
31 |
+ |
* |
32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
+ |
* research, please cite the appropriate papers when you publish your |
34 |
+ |
* work. Good starting points are: |
35 |
+ |
* |
36 |
+ |
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
+ |
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
+ |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
+ |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
/** |
59 |
|
#include "utils/PropertyMap.hpp" |
60 |
|
#include "brains/Snapshot.hpp" |
61 |
|
#include "brains/SnapshotManager.hpp" |
62 |
< |
namespace oopse{ |
62 |
> |
namespace OpenMD{ |
63 |
|
|
64 |
|
|
65 |
|
|
764 |
|
} |
765 |
|
|
766 |
|
|
767 |
< |
/** |
768 |
< |
* Returns the previous z-angle of this stuntDouble |
769 |
< |
* @return the z-angle of this stuntDouble |
767 |
> |
|
768 |
> |
/** |
769 |
> |
* Returns the previous particlePot of this stuntDouble |
770 |
> |
* @return the particlePot of this stuntDouble |
771 |
|
*/ |
772 |
< |
RealType getPrevZangle() { |
773 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_]; |
772 |
> |
RealType getPrevParticlePot() { |
773 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_]; |
774 |
|
} |
775 |
|
|
776 |
|
/** |
777 |
< |
* Returns the current z-angle of this stuntDouble |
778 |
< |
* @return the z-angle of this stuntDouble |
777 |
> |
* Returns the current particlePot of this stuntDouble |
778 |
> |
* @return the particlePot of this stuntDouble |
779 |
|
*/ |
780 |
< |
RealType getZangle() { |
781 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_]; |
780 |
> |
RealType getParticlePot() { |
781 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_]; |
782 |
|
} |
783 |
|
|
784 |
|
/** |
785 |
< |
* Returns the z-angle of this stuntDouble in specified snapshot |
786 |
< |
* @return the z-angle of this stuntDouble |
785 |
> |
* Returns the particlePot of this stuntDouble in specified snapshot |
786 |
> |
* |
787 |
> |
* @return the particlePot of this stuntDouble |
788 |
|
* @param snapshotNo |
789 |
|
*/ |
790 |
< |
RealType getZangle(int snapshotNo) { |
791 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_]; |
790 |
> |
RealType getParticlePot(int snapshotNo) { |
791 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_]; |
792 |
|
} |
793 |
|
|
794 |
|
/** |
795 |
< |
* Sets the previous z-angle of this stuntDouble |
796 |
< |
* @param angle new z-angle |
797 |
< |
* @see #getZangle |
795 |
> |
* Sets the previous particlePot of this stuntDouble |
796 |
> |
* |
797 |
> |
* @param particlePot new particlePot |
798 |
> |
* @see #getParticlePot |
799 |
|
*/ |
800 |
< |
void setPrevZangle(RealType angle) { |
801 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle; |
800 |
> |
void setPrevParticlePot(const RealType& particlePot) { |
801 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] = particlePot; |
802 |
|
} |
803 |
|
|
804 |
|
/** |
805 |
< |
* Sets the current z-angle of this stuntDouble |
806 |
< |
* @param angle new z-angle |
805 |
> |
* Sets the current particlePot of this stuntDouble |
806 |
> |
* @param particlePot new particlePot |
807 |
|
*/ |
808 |
< |
void setZangle(RealType angle) { |
809 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle; |
808 |
> |
void setParticlePot(const RealType& particlePot) { |
809 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] = particlePot; |
810 |
|
} |
811 |
|
|
812 |
|
/** |
813 |
< |
* Sets the z-angle of this stuntDouble in specified snapshot |
814 |
< |
* @param angle z-angle to be set |
813 |
> |
* Sets the particlePot of this stuntDouble in specified snapshot |
814 |
> |
* |
815 |
> |
* @param particlePot particlePot to be set |
816 |
|
* @param snapshotNo |
817 |
< |
* @see #getZangle |
817 |
> |
* @see #getParticlePot |
818 |
|
*/ |
819 |
< |
void setZangle(RealType angle, int snapshotNo) { |
820 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle; |
819 |
> |
void setParticlePot(const RealType& particlePot, int snapshotNo) { |
820 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] = particlePot; |
821 |
|
} |
822 |
|
|
823 |
|
/** |
824 |
< |
* Adds z-angle into the previous z-angle of this stuntDouble |
825 |
< |
* @param angle new z-angle |
826 |
< |
* @see #getZangle |
824 |
> |
* Adds particlePot into the previous particlePot of this stuntDouble |
825 |
> |
* |
826 |
> |
* @param particlePot new particlePot |
827 |
> |
* @see #getParticlePot |
828 |
|
*/ |
829 |
< |
void addPrevZangle(RealType angle) { |
830 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle; |
829 |
> |
void addPrevParticlePot(const RealType& particlePot) { |
830 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] += particlePot; |
831 |
|
} |
832 |
|
|
833 |
|
/** |
834 |
< |
* Adds z-angle into the current z-angle of this stuntDouble |
835 |
< |
* @param angle new z-angle |
834 |
> |
* Adds particlePot into the current particlePot of this stuntDouble |
835 |
> |
* @param particlePot new particlePot |
836 |
|
*/ |
837 |
< |
void addZangle(RealType angle) { |
838 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle; |
837 |
> |
void addParticlePot(const RealType& particlePot) { |
838 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] += particlePot; |
839 |
|
} |
840 |
|
|
841 |
|
/** |
842 |
< |
* Adds z-angle into the z-angle of this stuntDouble in specified snapshot |
843 |
< |
* @param angle z-angle to be add |
842 |
> |
* Adds particlePot into the particlePot of this stuntDouble in specified snapshot |
843 |
> |
* |
844 |
> |
* @param particlePot particlePot to be add |
845 |
|
* @param snapshotNo |
846 |
< |
* @see #getZangle |
846 |
> |
* @see #getParticlePot |
847 |
|
*/ |
848 |
< |
void addZangle(RealType angle, int snapshotNo) { |
849 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle; |
848 |
> |
void addParticlePot(const RealType& particlePot, int snapshotNo) { |
849 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] += particlePot; |
850 |
> |
} |
851 |
> |
|
852 |
> |
/** |
853 |
> |
* Returns the previous fluctuating charge of this stuntDouble |
854 |
> |
* @return the fluctuating charge of this stuntDouble |
855 |
> |
*/ |
856 |
> |
RealType getPrevFlucQPos() { |
857 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_]; |
858 |
> |
} |
859 |
> |
|
860 |
> |
/** |
861 |
> |
* Returns the current fluctuating charge of this stuntDouble |
862 |
> |
* @return the fluctuating charge of this stuntDouble |
863 |
> |
*/ |
864 |
> |
RealType getFlucQPos() { |
865 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_]; |
866 |
> |
} |
867 |
> |
|
868 |
> |
/** |
869 |
> |
* Returns the fluctuating charge of this stuntDouble in specified snapshot |
870 |
> |
* @return the fluctuating charge of this stuntDouble |
871 |
> |
* @param snapshotNo |
872 |
> |
*/ |
873 |
> |
RealType getFlucQPos(int snapshotNo) { |
874 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_]; |
875 |
> |
} |
876 |
> |
|
877 |
> |
/** |
878 |
> |
* Sets the previous fluctuating charge of this stuntDouble |
879 |
> |
* @param charge new fluctuating charge |
880 |
> |
* @see #getflucQPos |
881 |
> |
*/ |
882 |
> |
void setPrevFlucQPos(RealType charge) { |
883 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] = charge; |
884 |
> |
} |
885 |
> |
|
886 |
> |
/** |
887 |
> |
* Sets the current fluctuating charge of this stuntDouble |
888 |
> |
* @param charge new fluctuating charge |
889 |
> |
*/ |
890 |
> |
void setFlucQPos(RealType charge) { |
891 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] = charge; |
892 |
> |
} |
893 |
> |
|
894 |
> |
/** |
895 |
> |
* Sets the fluctuating charge of this stuntDouble in specified snapshot |
896 |
> |
* @param charge fluctuating charge to be set |
897 |
> |
* @param snapshotNo |
898 |
> |
* @see #getflucQPos |
899 |
> |
*/ |
900 |
> |
void setFlucQPos(RealType charge, int snapshotNo) { |
901 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] = charge; |
902 |
> |
} |
903 |
> |
|
904 |
> |
/** |
905 |
> |
* Adds fluctuating charge into the previous fluctuating charge of this stuntDouble |
906 |
> |
* @param charge new fluctuating charge |
907 |
> |
* @see #getflucQPos |
908 |
> |
*/ |
909 |
> |
void addPrevFlucQPos(RealType charge) { |
910 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQPos[localIndex_] += charge; |
911 |
> |
} |
912 |
> |
|
913 |
> |
/** |
914 |
> |
* Adds fluctuating charge into the current fluctuating charge of this stuntDouble |
915 |
> |
* @param charge new fluctuating charge |
916 |
> |
*/ |
917 |
> |
void addFlucQPos(RealType charge) { |
918 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQPos[localIndex_] += charge; |
919 |
> |
} |
920 |
> |
|
921 |
> |
/** |
922 |
> |
* Adds fluctuating charge into the fluctuating charge of this stuntDouble in specified snapshot |
923 |
> |
* @param value fluctuating charge to be add |
924 |
> |
* @param snapshotNo |
925 |
> |
* @see #getflucQPos |
926 |
> |
*/ |
927 |
> |
void addflucQPos(RealType charge, int snapshotNo) { |
928 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQPos[localIndex_] += charge; |
929 |
> |
} |
930 |
> |
|
931 |
> |
|
932 |
> |
/** |
933 |
> |
* Returns the previous charge velocity of this stuntDouble |
934 |
> |
* @return the charge velocity of this stuntDouble |
935 |
> |
*/ |
936 |
> |
RealType getPrevFlucQVel() { |
937 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_]; |
938 |
> |
} |
939 |
> |
|
940 |
> |
/** |
941 |
> |
* Returns the current charge velocity of this stuntDouble |
942 |
> |
* @return the charge velocity of this stuntDouble |
943 |
> |
*/ |
944 |
> |
RealType getFlucQVel() { |
945 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_]; |
946 |
> |
} |
947 |
> |
|
948 |
> |
/** |
949 |
> |
* Returns the charge velocity of this stuntDouble in specified snapshot |
950 |
> |
* @return the charge velocity of this stuntDouble |
951 |
> |
* @param snapshotNo |
952 |
> |
*/ |
953 |
> |
RealType getFlucQVel(int snapshotNo) { |
954 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_]; |
955 |
> |
} |
956 |
> |
|
957 |
> |
/** |
958 |
> |
* Sets the previous charge velocity of this stuntDouble |
959 |
> |
* @param cvel new charge velocity |
960 |
> |
* @see #getflucQVel |
961 |
> |
*/ |
962 |
> |
void setPrevFlucQVel(RealType cvel) { |
963 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] = cvel; |
964 |
> |
} |
965 |
> |
|
966 |
> |
/** |
967 |
> |
* Sets the current charge velocity of this stuntDouble |
968 |
> |
* @param cvel new charge velocity |
969 |
> |
*/ |
970 |
> |
void setFlucQVel(RealType cvel) { |
971 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] = cvel; |
972 |
> |
} |
973 |
> |
|
974 |
> |
/** |
975 |
> |
* Sets the charge velocity of this stuntDouble in specified snapshot |
976 |
> |
* @param cvel charge velocity to be set |
977 |
> |
* @param snapshotNo |
978 |
> |
* @see #getflucQVel |
979 |
> |
*/ |
980 |
> |
void setFlucQVel(RealType cvel, int snapshotNo) { |
981 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] = cvel; |
982 |
> |
} |
983 |
> |
|
984 |
> |
/** |
985 |
> |
* Adds charge velocity into the previous charge velocity of this stuntDouble |
986 |
> |
* @param cvel new charge velocity |
987 |
> |
* @see #getflucQVel |
988 |
> |
*/ |
989 |
> |
void addPrevFlucQVel(RealType cvel) { |
990 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQVel[localIndex_] += cvel; |
991 |
> |
} |
992 |
> |
|
993 |
> |
/** |
994 |
> |
* Adds charge velocity into the current charge velocity of this stuntDouble |
995 |
> |
* @param cvel new charge velocity |
996 |
> |
*/ |
997 |
> |
void addFlucQVel(RealType cvel) { |
998 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQVel[localIndex_] += cvel; |
999 |
> |
} |
1000 |
> |
|
1001 |
> |
/** |
1002 |
> |
* Adds charge velocity into the charge velocity of this stuntDouble in specified snapshot |
1003 |
> |
* @param value charge velocity to be add |
1004 |
> |
* @param snapshotNo |
1005 |
> |
* @see #getflucQVel |
1006 |
> |
*/ |
1007 |
> |
void addflucQVel(RealType cvel, int snapshotNo) { |
1008 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQVel[localIndex_] += cvel; |
1009 |
|
} |
1010 |
+ |
|
1011 |
+ |
|
1012 |
+ |
/** |
1013 |
+ |
* Returns the previous charge force of this stuntDouble |
1014 |
+ |
* @return the charge force of this stuntDouble |
1015 |
+ |
*/ |
1016 |
+ |
RealType getPrevFlucQFrc() { |
1017 |
+ |
return ((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_]; |
1018 |
+ |
} |
1019 |
+ |
|
1020 |
+ |
/** |
1021 |
+ |
* Returns the current charge force of this stuntDouble |
1022 |
+ |
* @return the charge force of this stuntDouble |
1023 |
+ |
*/ |
1024 |
+ |
RealType getFlucQFrc() { |
1025 |
+ |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_]; |
1026 |
+ |
} |
1027 |
+ |
|
1028 |
+ |
/** |
1029 |
+ |
* Returns the charge force of this stuntDouble in specified snapshot |
1030 |
+ |
* @return the charge force of this stuntDouble |
1031 |
+ |
* @param snapshotNo |
1032 |
+ |
*/ |
1033 |
+ |
RealType getFlucQFrc(int snapshotNo) { |
1034 |
+ |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_]; |
1035 |
+ |
} |
1036 |
+ |
|
1037 |
+ |
/** |
1038 |
+ |
* Sets the previous charge force of this stuntDouble |
1039 |
+ |
* @param cfrc new charge force |
1040 |
+ |
* @see #getflucQFrc |
1041 |
+ |
*/ |
1042 |
+ |
void setPrevFlucQFrc(RealType cfrc) { |
1043 |
+ |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc; |
1044 |
+ |
} |
1045 |
+ |
|
1046 |
+ |
/** |
1047 |
+ |
* Sets the current charge force of this stuntDouble |
1048 |
+ |
* @param cfrc new charge force |
1049 |
+ |
*/ |
1050 |
+ |
void setFlucQFrc(RealType cfrc) { |
1051 |
+ |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] = cfrc; |
1052 |
+ |
} |
1053 |
+ |
|
1054 |
+ |
/** |
1055 |
+ |
* Sets the charge force of this stuntDouble in specified snapshot |
1056 |
+ |
* @param cfrc charge force to be set |
1057 |
+ |
* @param snapshotNo |
1058 |
+ |
* @see #getflucQFrc |
1059 |
+ |
*/ |
1060 |
+ |
void setFlucQFrc(RealType cfrc, int snapshotNo) { |
1061 |
+ |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] = cfrc; |
1062 |
+ |
} |
1063 |
+ |
|
1064 |
+ |
/** |
1065 |
+ |
* Adds charge force into the previous charge force of this stuntDouble |
1066 |
+ |
* @param cfrc new charge force |
1067 |
+ |
* @see #getflucQFrc |
1068 |
+ |
*/ |
1069 |
+ |
void addPrevFlucQFrc(RealType cfrc) { |
1070 |
+ |
((snapshotMan_->getPrevSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc; |
1071 |
+ |
} |
1072 |
+ |
|
1073 |
+ |
/** |
1074 |
+ |
* Adds charge force into the current charge force of this stuntDouble |
1075 |
+ |
* @param cfrc new charge force |
1076 |
+ |
*/ |
1077 |
+ |
void addFlucQFrc(RealType cfrc) { |
1078 |
+ |
((snapshotMan_->getCurrentSnapshot())->*storage_).flucQFrc[localIndex_] += cfrc; |
1079 |
+ |
} |
1080 |
+ |
|
1081 |
+ |
/** |
1082 |
+ |
* Adds charge force into the charge force of this stuntDouble in specified snapshot |
1083 |
+ |
* @param value charge force to be add |
1084 |
+ |
* @param snapshotNo |
1085 |
+ |
* @see #getflucQFrc |
1086 |
+ |
*/ |
1087 |
+ |
void addflucQFrc(RealType cfrc, int snapshotNo) { |
1088 |
+ |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).flucQFrc[localIndex_] += cfrc; |
1089 |
+ |
} |
1090 |
+ |
|
1091 |
+ |
|
1092 |
+ |
/** |
1093 |
+ |
* Returns the previous electric field of this stuntDouble |
1094 |
+ |
* @return the electric field of this stuntDouble |
1095 |
+ |
*/ |
1096 |
+ |
Vector3d getPrevElectricField() { |
1097 |
+ |
return ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_]; |
1098 |
+ |
} |
1099 |
+ |
|
1100 |
+ |
/** |
1101 |
+ |
* Returns the current electric field of this stuntDouble |
1102 |
+ |
* @return the electric field of this stuntDouble |
1103 |
+ |
*/ |
1104 |
+ |
Vector3d getElectricField() { |
1105 |
+ |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_]; |
1106 |
+ |
} |
1107 |
|
|
1108 |
+ |
/** |
1109 |
+ |
* Returns the electric field of this stuntDouble in specified snapshot |
1110 |
+ |
* @return the electric field of this stuntDouble |
1111 |
+ |
* @param snapshotNo |
1112 |
+ |
*/ |
1113 |
+ |
Vector3d getElectricField(int snapshotNo) { |
1114 |
+ |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_]; |
1115 |
+ |
} |
1116 |
+ |
|
1117 |
+ |
/** |
1118 |
+ |
* Sets the previous electric field of this stuntDouble |
1119 |
+ |
* @param pos new electric field |
1120 |
+ |
* @see #getElectricField |
1121 |
+ |
*/ |
1122 |
+ |
void setPrevElectricField(const Vector3d& pos) { |
1123 |
+ |
((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] = pos; |
1124 |
+ |
} |
1125 |
+ |
|
1126 |
+ |
/** |
1127 |
+ |
* Sets the current electric field of this stuntDouble |
1128 |
+ |
* @param pos new electric field |
1129 |
+ |
*/ |
1130 |
+ |
void setElectricField(const Vector3d& pos) { |
1131 |
+ |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
1132 |
+ |
data.electricField[localIndex_] = pos; |
1133 |
+ |
//((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] = pos; |
1134 |
+ |
} |
1135 |
+ |
|
1136 |
+ |
/** |
1137 |
+ |
* Sets the electric field of this stuntDouble in specified snapshot |
1138 |
+ |
* @param pos electric field to be set |
1139 |
+ |
* @param snapshotNo |
1140 |
+ |
* @see #getElectricField |
1141 |
+ |
*/ |
1142 |
+ |
void setElectricField(const Vector3d& pos, int snapshotNo) { |
1143 |
+ |
|
1144 |
+ |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] = pos; |
1145 |
+ |
|
1146 |
+ |
} |
1147 |
+ |
|
1148 |
+ |
|
1149 |
|
/** Set the force of this stuntDouble to zero */ |
1150 |
|
void zeroForcesAndTorques(); |
1151 |
|
/** |
1229 |
|
} |
1230 |
|
|
1231 |
|
/** |
928 |
– |
* Returns the previous particle potential of this stuntDouble |
929 |
– |
* @return the particle potential of this stuntDouble |
930 |
– |
*/ |
931 |
– |
RealType getPrevParticlePot() { |
932 |
– |
return ((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_]; |
933 |
– |
} |
934 |
– |
|
935 |
– |
/** |
936 |
– |
* Returns the current particle potential of this stuntDouble |
937 |
– |
* @return the particle potential of this stuntDouble |
938 |
– |
*/ |
939 |
– |
RealType getParticlePot() { |
940 |
– |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_]; |
941 |
– |
} |
942 |
– |
|
943 |
– |
/** |
944 |
– |
* Returns the particle potential of this stuntDouble in specified snapshot |
945 |
– |
* @return the particle potential of this stuntDouble |
946 |
– |
* @param snapshotNo |
947 |
– |
*/ |
948 |
– |
RealType getParticlePot(int snapshotNo) { |
949 |
– |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_]; |
950 |
– |
} |
951 |
– |
|
952 |
– |
/** |
953 |
– |
* Sets the previous particle potential of this stuntDouble |
954 |
– |
* @param po tnew particle potential |
955 |
– |
* @see #getParticlePot |
956 |
– |
*/ |
957 |
– |
void setPrevParticlePot(RealType pot) { |
958 |
– |
((snapshotMan_->getPrevSnapshot())->*storage_).particlePot[localIndex_] = pot; |
959 |
– |
} |
960 |
– |
|
961 |
– |
/** |
962 |
– |
* Sets the current velocity of this stuntDouble |
963 |
– |
* @param vel new velocity |
964 |
– |
*/ |
965 |
– |
void setParticlePot(RealType pot) { |
966 |
– |
((snapshotMan_->getCurrentSnapshot())->*storage_).particlePot[localIndex_] = pot; |
967 |
– |
} |
968 |
– |
|
969 |
– |
/** |
970 |
– |
* Sets the particle potential of this stuntDouble in specified snapshot |
971 |
– |
* @param pot potential to be set |
972 |
– |
* @param snapshotNo |
973 |
– |
* @see #getVel |
974 |
– |
*/ |
975 |
– |
void setParticlePot(RealType pot, int snapshotNo) { |
976 |
– |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).particlePot[localIndex_] = pot; |
977 |
– |
} |
978 |
– |
|
979 |
– |
/** |
1232 |
|
* <p> |
1233 |
< |
* The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on |
1234 |
< |
* the elements of a data structure. In this way, you can change the operation being performed |
1235 |
< |
* on a structure without the need of changing the classes of the elements that you are operating |
1236 |
< |
* on. Using a Visitor pattern allows you to decouple the classes for the data structure and the |
1237 |
< |
* algorithms used upon them |
1233 |
> |
* The purpose of the Visitor Pattern is to encapsulate an |
1234 |
> |
* operation that you want to perform on the elements of a data |
1235 |
> |
* structure. In this way, you can change the operation being |
1236 |
> |
* performed on a structure without the need of changing the |
1237 |
> |
* classes of the elements that you are operating on. Using a |
1238 |
> |
* Visitor pattern allows you to decouple the classes for the data |
1239 |
> |
* structure and the algorithms used upon them |
1240 |
|
* </p> |
1241 |
|
* @param v visitor |
1242 |
|
*/ |
1307 |
|
PropertyMap properties_; |
1308 |
|
}; |
1309 |
|
|
1310 |
< |
}//end namespace oopse |
1310 |
> |
}//end namespace OpenMD |
1311 |
|
#endif //PRIMITIVES_STUNTDOUBLE_HPP |