BALL 1.5.0
Loading...
Searching...
No Matches
forceField.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: forceField.h,v 1.33 2005/12/23 17:01:51 amoll Exp $
5//
6
7#ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
8#define BALL_MOLMEC_COMMON_FORCEFIELD_H
9
10#ifndef BALL_COMMON_H
11# include <BALL/common.h>
12#endif
13
14#ifndef BALL_KERNEL_SYSTEM_H
15# include <BALL/KERNEL/system.h>
16#endif
17
18#ifndef BALL_DATATYPE_OPTIONS_H
20#endif
21
22#ifndef BALL_CONCEPT_TIMESTAMP_H
24#endif
25
26#ifndef BALL_MOLMEC_PARAMETER_FORCEFIELDPARAMETERS_H
28#endif
29
30#ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
32#endif
33
34#ifndef BALL_MOLMEC_COMMON_PERIODIC_BOUNDARY_H
36#endif
37
38#ifndef BALL_MOLMEC_COMMON_ATOMVECTOR_H
40#endif
41
42#include <vector>
43
44namespace BALL
45{
46 class ForceFieldComponent;
47
86 {
87 public:
88
89 friend class ForceFieldComponent;
90
94
99 typedef std::vector<std::pair<Atom*, Atom*> > PairVector;
100
102
105
107
108
113
119
124 ForceField(System& system, const Options& options);
125
128 ForceField(const ForceField& force_field);
129
132 virtual ~ForceField();
133
136 virtual void clear()
137 ;
138
140
143
146 ForceField& operator = (const ForceField& force_field);
147
149
152
157 bool isValid() const
158 ;
159
161
164
167 bool setup(System& system);
168
171 bool setup(System& system, const Options& options);
172
177 virtual bool specificSetup();
178
183 void setMaximumNumberOfErrors(Size nr);
184
188 Size getMaximumNumberOfErrors() const;
189
191 HashSet<const Atom*>& getUnassignedAtoms();
192
194
197
200 void setName(const String& name);
201
204 String getName() const;
205
208 Size getNumberOfAtoms() const;
209
217 Size getNumberOfMovableAtoms() const;
218
222 const AtomVector& getAtoms() const ;
223
227 System* getSystem() ;
228
232 const System* getSystem() const ;
233
237 bool getUseSelection() const ;
238
242 void disableSelection() ;
243
247 void enableSelection() ;
248
251 bool isSelectionEnabled() const ;
252
255 ForceFieldParameters& getParameters();
256
259 Size countComponents() const;
260
268 const TimeStamp& getUpdateTime() const
269 ;
270
278 const TimeStamp& getSetupTime() const
279 ;
280
285 void insertComponent(ForceFieldComponent* force_field_component);
286
290 void removeComponent(const ForceFieldComponent* force_field_component);
291
294 void removeComponent(const String& name);
295
301 ForceFieldComponent* getComponent(const Size index) const;
302
306 ForceFieldComponent* getComponent(const String& name) const;
307
313 double getEnergy() const;
314
317 double updateEnergy();
318
321 void updateForces();
322
325 double getRMSGradient() const;
326
331 virtual Size getUpdateFrequency() const;
332
342 virtual void update();
343
347 virtual String getResults() const
348 { return "undefined";}
349
350 //_ Report an error and increase the error counter
351 std::ostream& error();
352
354
357
361
365
367
368 protected:
369 /*_ Collect all atoms into the atoms_ vector.
370 */
371 void collectAtoms_(const System& system);
372
373 /*_ Sort the atom vector wrt selection.
374 */
376
381
382 /*_ @name Protected Attributes
383 */
384 //_@{
385
386 /*_ The system the force field is bound to
387 */
389
390 /*_ The atoms in the simulated system
391 */
393
394 /*_ An object containing the force field parameters read from a file
395 */
397
398 /*_ The boolean variable indicates if the setup of the force field was successful
399 */
400 bool valid_;
401
402 /*_ The force field name
403 */
405
406 /*_ The total energy
407 */
408 double energy_;
409
410 /*_ The components of the force field
411 */
412 vector<ForceFieldComponent*> components_;
413
414 /*_ The number of movable atoms in the force field
415 */
417
418 /*_ Do we have to check whether atoms are selected?
419 */
421
422 /*_ This flag can temporarily disable the selection.
423 */
425
426 /*_ The time of the last call to update.
427 */
429
430 /*_ The time of the last call to setup.
431 */
433
434 //_ Atoms, for which the setup of the force field fails
436
437 //_ max number of unassigned atoms
439
441
442 //_@}
443 };
444
445# ifndef BALL_NO_INLINE_FUNCTIONS
446# include <BALL/MOLMEC/COMMON/forceField.iC>
447# endif
448
449} // namespace BALL
450
451#endif // BALL_MOLMEC_COMMON_FORCEFIELD_H
#define BALL_CREATE(name)
Definition create.h:62
#define BALL_INLINE
Definition debug.h:15
std::ostream & error()
PeriodicBoundary periodic_boundary
Definition forceField.h:364
std::vector< std::pair< Atom *, Atom * > > PairVector
Definition forceField.h:99
Size max_number_of_errors_
Definition forceField.h:438
Size number_of_movable_atoms_
Definition forceField.h:416
ForceFieldParameters parameters_
Definition forceField.h:396
vector< ForceFieldComponent * > components_
Definition forceField.h:412
void collectAtoms_(const System &system)
void sortSelectedAtomVector_()
AtomVector atoms_
Definition forceField.h:392
TimeStamp setup_time_stamp_
Definition forceField.h:432
virtual void performRequiredUpdates_()
TimeStamp update_time_stamp_
Definition forceField.h:428
HashSet< const Atom * > unassigned_atoms_
Definition forceField.h:435
#define BALL_EXPORT