BALL 1.5.0
Loading...
Searching...
No Matches
energyMinimizer.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: energyMinimizer.h,v 1.44.20.3 2007/08/07 09:12:33 aleru Exp $
5//
6
7// Energy Minimizer: A class for minimizing the energy of molecular systems
8
9#ifndef BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
10#define BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
11
12#ifndef BALL_DATATYPE_OPTIONS_H
14#endif
15
16#ifndef BALL_MOLMEC_COMMON_GRADIENT_H
18#endif
19
20namespace BALL
21{
22 class ForceField;
23 class SnapShotManager;
24
30 {
31 public:
32
36
40 {
43 static const char* MAXIMAL_NUMBER_OF_ITERATIONS;
44
47 static const char* ENERGY_OUTPUT_FREQUENCY;
48
51 static const char* SNAPSHOT_FREQUENCY;
52
55 static const char* NUMBER_OF_ITERATION;
56
59 static const char* ENERGY_DIFFERENCE_BOUND;
60
64 static const char* MAX_SAME_ENERGY;
65
69 static const char* MAX_GRADIENT;
70
73 static const char* MAXIMUM_DISPLACEMENT;
74 };
75
114
116
119
121
122
125
129
133
136 EnergyMinimizer(const EnergyMinimizer& energy_minimizer);
137
140 virtual ~EnergyMinimizer();
141
143
146
149 const EnergyMinimizer& operator=(const EnergyMinimizer& energy_minimizer);
150
152
155 bool operator == (const EnergyMinimizer& energy_minimizer) ;
156
160
163 bool isValid() const;
164
166
169
172 bool setup(ForceField& force_field);
173
176 bool setup(ForceField& force_field, SnapShotManager *ssm);
177
180 bool setup(ForceField& force_field,
181 SnapShotManager *ssm, const Options& options);
182
185 bool setup(ForceField& force_field, const Options& options);
186
189 virtual bool specificSetup();
190
192
195
208 virtual bool isConverged() const;
209
218 virtual double findStep();
219
224 virtual void updateDirection();
225
230 virtual double updateEnergy();
231
236 virtual void updateForces();
237
244
252 virtual void printEnergy() const;
253
262 virtual void takeSnapShot() const;
263
282 virtual void finishIteration();
283
287
291
295
299
302 double getEnergy() const;
303
306 double& getEnergy();
307
310 double getInitialEnergy() const;
311
315
318 void setNumberOfIterations(Size number_of_iterations);
319
323
326 void setMaxNumberOfIterations(Size number_of_iterations);
327
331 void setMaxSameEnergy(Size number);
332
337
340 void setEnergyOutputFrequency(Size energy_output_frequency);
341
345
348 void setEnergyDifferenceBound(float energy_difference_bound);
349
353
357 void setMaxGradient(float max_gradient);
358
362 float getMaxGradient() const;
363
367 void setMaximumDisplacement(float maximum_displacement);
368
372
375 void setSnapShotFrequency(Size snapshot_frequency);
376
380
384
388
392
404 virtual bool minimize(Size steps = 0, bool resume = false);
405
409
412
417 void setEnergyToAbort(float value);
418
420 float getEnergyToAbort() const;
421
425 bool wasAborted() const ;
426
428
431
436
437 protected:
438
442
446
450
454
458
462
466
470
473 bool valid_;
474
478
484
488
492
496
500
505
509
515
519
523
528
533
537 float cutlo_;
538
542 double step_;
543
544 //_
546
547 //_
549
550 //_
552
553 //_@}
554 };
555
556} // namespace Ball
557
558#endif // BALL_MOLMEC_MINIMIZATION_ENERGYMINIMIZER_H
#define BALL_EXPORT
virtual bool isConverged() const
double getEnergy() const
virtual double updateEnergy()
virtual void updateForces()
Size getEnergyUpdateCounter() const
void setSnapShotFrequency(Size snapshot_frequency)
Size getEnergyOutputFrequency() const
SnapShotManager * snapshot_
Size getMaxSameEnergy() const
Size getMaxNumberOfIterations() const
Gradient & getGradient()
float getMaximumDisplacement() const
virtual bool minimize(Size steps=0, bool resume=false)
virtual void finishIteration()
bool setup(ForceField &force_field)
bool energyAbortConditionEnabled() const
Query if the MDSimulation aborts if the Energy is greater than abort_energy_.
void setMaxSameEnergy(Size number)
float getEnergyToAbort() const
float getEnergyDifferenceBound() const
void setMaximumDisplacement(float maximum_displacement)
void setNumberOfIterations(Size number_of_iterations)
void setMaxGradient(float max_gradient)
Gradient & getInitialGradient()
void setEnergyToAbort(float value)
void setEnergyDifferenceBound(float energy_difference_bound)
virtual bool specificSetup()
float getMaxGradient() const
Size getForceUpdateCounter() const
bool isValid() const
double getInitialEnergy() const
virtual void printEnergy() const
void enableEnergyAbortCondition(bool state)
void setMaxNumberOfIterations(Size number_of_iterations)
Size getNumberOfIterations() const
Size getSnapShotFrequency() const
ForceField * getForceField()
void setEnergyOutputFrequency(Size energy_output_frequency)
bool wasAborted() const
Gradient & getDirection()
virtual void updateDirection()
virtual double findStep()
virtual void takeSnapShot() const
#define BALL_CREATE(name)
Definition create.h:62
BALL_SIZE_TYPE Size
static const char * MAXIMAL_NUMBER_OF_ITERATIONS
static const char * ENERGY_OUTPUT_FREQUENCY
static const char * SNAPSHOT_FREQUENCY
static const char * MAX_GRADIENT
static const char * MAX_SAME_ENERGY
static const char * MAXIMUM_DISPLACEMENT
static const char * ENERGY_DIFFERENCE_BOUND
static const char * NUMBER_OF_ITERATION