@@ -166,12 +166,12 @@ void Input::reader(const std::string & filename) {
166166 std::vector<double > mono = chgdist.getDblVec (" MONOPOLES" );
167167 int j = 0 ;
168168 int n = int (mono.size () / 4 );
169- multipoles_ .monopoles = Eigen::VectorXd::Zero (n);
170- multipoles_ .monopolesSites = Eigen::Matrix3Xd::Zero (3 , n);
169+ fragments_ .monopoles = Eigen::VectorXd::Zero (n);
170+ fragments_ .monopolesSites = Eigen::Matrix3Xd::Zero (3 , n);
171171 for (int i = 0 ; i < n; ++i) {
172- multipoles_ .monopolesSites .col (i) =
172+ fragments_ .monopolesSites .col (i) =
173173 (Eigen::Vector3d () << mono[j], mono[j + 1 ], mono[j + 2 ]).finished ();
174- multipoles_ .monopoles (i) = mono[j + 3 ];
174+ fragments_ .monopoles (i) = mono[j + 3 ];
175175 j += 4 ;
176176 }
177177 }
@@ -180,16 +180,34 @@ void Input::reader(const std::string & filename) {
180180 std::vector<double > dipo = chgdist.getDblVec (" DIPOLES" );
181181 int j = 0 ;
182182 int n = int (dipo.size () / 6 );
183- multipoles_ .dipoles = Eigen::Matrix3Xd::Zero (3 , n);
184- multipoles_ .dipolesSites = Eigen::Matrix3Xd::Zero (3 , n);
183+ fragments_ .dipoles = Eigen::Matrix3Xd::Zero (3 , n);
184+ fragments_ .dipolesSites = Eigen::Matrix3Xd::Zero (3 , n);
185185 for (int i = 0 ; i < n; ++i) {
186- multipoles_ .dipolesSites .col (i) =
186+ fragments_ .dipolesSites .col (i) =
187187 (Eigen::Vector3d () << dipo[j], dipo[j + 1 ], dipo[j + 2 ]).finished ();
188- multipoles_ .dipoles .col (i) =
188+ fragments_ .dipoles .col (i) =
189189 (Eigen::Vector3d () << dipo[j + 3 ], dipo[j + 4 ], dipo[j + 5 ]).finished ();
190190 j += 6 ;
191191 }
192192 }
193+ // Set fluctuating charges
194+ isFQ_ = false ;
195+ if (chgdist.getKey <std::vector<double > >(" FQ" ).isDefined ()) {
196+ isFQ_ = true ;
197+ std::vector<double > fq = chgdist.getDblVec (" FQ" );
198+ int j = 0 ;
199+ int n = int (fq.size () / 5 );
200+ fragments_.FQSites = Eigen::Matrix3Xd::Zero (3 , n);
201+ fragments_.FQChi = Eigen::VectorXd::Zero (n);
202+ fragments_.FQEta = Eigen::VectorXd::Zero (n);
203+ for (int i = 0 ; i < n; ++i) {
204+ fragments_.FQSites .col (i) =
205+ (Eigen::Vector3d () << fq[j], fq[j + 1 ], fq[j + 2 ]).finished ();
206+ fragments_.FQChi (i) = fq[j + 3 ];
207+ fragments_.FQEta (i) = fq[j + 4 ];
208+ j += 5 ;
209+ }
210+ }
193211 }
194212
195213 providedBy_ = std::string (" API-side" );
@@ -264,6 +282,7 @@ void Input::reader(const PCMInput & host_input) {
264282 correction_ = host_input.correction ;
265283 hermitivitize_ = true ;
266284 isDynamic_ = false ;
285+ isFQ_ = false ;
267286
268287 providedBy_ = std::string (" host-side" );
269288}
0 commit comments