BALL  1.5.0
poissonBoltzmann.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: poissonBoltzmann.h,v 1.31 2005/12/23 17:02:00 amoll Exp $
5 //
6 
7 // Finite Difference Poisson Boltzmann Solver
8 
9 #ifndef BALL_SOLVATION_POISSONBOLTZMANN_H
10 #define BALL_SOLVATION_POISSONBOLTZMANN_H
11 
12 #ifndef BALL_COMMON_H_
13 # include <BALL/common.h>
14 #endif
15 
16 #ifndef BALL_DATATYPE_REGULARDATA3D_H
18 #endif
19 
20 #ifndef BALL_KERNEL_SYSTEM_H
21 # include <BALL/KERNEL/system.h>
22 #endif
23 
24 #ifndef BALL_DATATYPE_OPTIONS_H
25 # include <BALL/DATATYPE/options.h>
26 #endif
27 
28 #include <vector>
29 using std::vector;
30 
31 namespace BALL
32 {
37  {
38 
39  public:
40 
45  enum ErrorCode
46  {
49  ERROR__NONE = -1,
50 
53  ERROR__UNKNOWN = 0,
54 
58  ERROR__NOT_IMPLEMENTED = 1,
59 
67 
75 
85 
94 
102 
110 
118 
127 
135 
144 
151 
161 
170 
179 
188 
198 
205 
208  NUMBER_OF_ERRORS
209  };
210 
217  {
225  static const String VERBOSITY;
226 
236  static const String PRINT_TIMING;
237 
245  static const String SPACING;
246 
255  static const String BORDER;
256 
265  static const String IONIC_STRENGTH;
266 
272  static const String SOLUTE_DC;
273 
279  static const String SOLVENT_DC;
280 
286  static const String PROBE_RADIUS;
287 
292  static const String ION_RADIUS;
293 
299  static const String TEMPERATURE;
300 
308  static const String BOUNDARY;
309 
318 
330 
338  static const String OFFSET;
339 
348  static const String RMS_CRITERION;
349 
357  static const String MAX_CRITERION;
358 
366 
375  static const String MAX_ITERATIONS;
376 
385  static const String LOWER;
386 
391  static const String UPPER;
392 
399 
405 
406  };
407 
412  {
419  static const String ZERO;
420 
431  static const String DEBYE;
432 
436  static const String COULOMB;
437 
440  static const String DIPOLE;
441 
448  static const String FOCUSING;
449  };
450 
454  {
458  static const String TRILINEAR;
459 
463  static const String UNIFORM;
464  };
465 
473  {
476  static const String NONE;
477 
485  static const String UNIFORM;
486 
494  static const String HARMONIC;
495  };
496 
502  {
507  static const int VERBOSITY;
508 
513  static const bool PRINT_TIMING ;
514 
519  static const float SPACING;
520 
525  static const float BORDER;
526 
531  static const float IONIC_STRENGTH;
532 
537  static const float TEMPERATURE;
538 
545  static const float PROBE_RADIUS;
546 
551  static const float ION_RADIUS;
552 
558  static const String BOUNDARY;
559 
566 
573 
578  static const float SOLVENT_DC;
579 
584  static const float SOLUTE_DC;
585 
592  static const float RMS_CRITERION;
593 
600  static const float MAX_CRITERION;
601 
607  static const Index MAX_ITERATIONS;
608 
614  };
615 
628  {
629  float q;
630  float r;
631  float x, y, z;
633  };
634 
635  typedef struct FastAtomStruct FastAtom;
636 
637 
641 
645  FDPB();
646 
650  FDPB(const FDPB& fdpb);
651 
658  FDPB(System& system);
659 
666  FDPB(Options& new_options);
667 
675  FDPB(System& system, Options& new_options);
676 
679  virtual ~FDPB();
680 
683  void destroy();
684 
693  void destroyGrids();
694 
696 
701 
721  bool setup(System& system);
722 
731  bool setup(System& system, Options& options);
732 
757  bool setupEpsGrid(System& system);
758 
759 
760  // ?????
764  bool setupSASGrid(System& system);
765 
776  bool setupAtomArray(System& system);
777 
781 
784  bool setupQGrid();
785 
788  bool setupPhiGrid();
789 
793 
795 
798 
801  bool solve();
802 
810  double getEnergy() const;
811 
815  double getReactionFieldEnergy() const;
816 
821 
831 
833 
837 
846 
851  static String getErrorMessage(Index error_code);
853 
854 
858 
862 
866 
868 
871 
877 
882 
892 
903 
907 
911  vector<FDPB::FastAtom>* atom_array;
912 
914 
915  protected:
916 
920 
922 
923  float spacing_;
924 
925  // final energy of the last calculation
926  double energy_;
927 
928  // the reaction field energy of the last calculation
930 
931  // the indices of the boundary points,
932  // i.e., the points that have at least one neighbouring
933  // grid point that is inside the solute
934  vector<Position> boundary_points_;
935 
936  // number of iterations of the last calculation
938 
939  // error code. use getErrorMessage to access the corresponding
940  // error message
942 
943  static const char* error_message_[];
944  };
945 
946 } // namespace BALL
947 
948 #endif
BALL::FDPB::atom_array
vector< FDPB::FastAtom > * atom_array
Definition: poissonBoltzmann.h:911
BALL::FDPB::FastAtomStruct::r
float r
Definition: poissonBoltzmann.h:630
BALL::FDPB::Boundary::ZERO
static const String ZERO
Definition: poissonBoltzmann.h:419
BALL::FDPB::ErrorCode
ErrorCode
Definition: poissonBoltzmann.h:46
BALL::FDPB::Default::SOLUTE_DC
static const float SOLUTE_DC
Definition: poissonBoltzmann.h:584
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::FDPB::setupEpsGrid
bool setupEpsGrid(System &system)
BALL::FDPB::number_of_iterations_
Size number_of_iterations_
Definition: poissonBoltzmann.h:937
BALL::FDPB::ERROR__CANNOT_CREATE_EPSILON_GRID
@ ERROR__CANNOT_CREATE_EPSILON_GRID
Definition: poissonBoltzmann.h:84
BALL::FDPB::Default::TEMPERATURE
static const float TEMPERATURE
Definition: poissonBoltzmann.h:537
BALL::FDPB::DielectricSmoothing::UNIFORM
static const String UNIFORM
Definition: poissonBoltzmann.h:485
BALL::FDPB::FDPB
FDPB(const FDPB &fdpb)
BALL::FDPB::Option::BOUNDARY
static const String BOUNDARY
Definition: poissonBoltzmann.h:308
BALL::FDPB::setupQGrid
bool setupQGrid()
BALL::FDPB::Default::VERBOSITY
static const int VERBOSITY
Definition: poissonBoltzmann.h:507
BALL::FDPB::destroyGrids
void destroyGrids()
BALL::Options
Definition: options.h:48
BALL::FDPB::FastAtomStruct::index
Index index
Definition: poissonBoltzmann.h:632
BALL::TRegularData3D
Definition: regularData3D.h:46
BALL::FDPB::solve
bool solve()
BALL::FDPB::Boundary::DIPOLE
static const String DIPOLE
Definition: poissonBoltzmann.h:440
BALL::FDPB::~FDPB
virtual ~FDPB()
BALL::FDPB::results
Options results
Definition: poissonBoltzmann.h:865
BALL::FDPB::q_grid
TRegularData3D< float > * q_grid
Definition: poissonBoltzmann.h:891
BALL::System
Definition: KERNEL/system.h:40
BALL::FDPB::Option::VERBOSITY
static const String VERBOSITY
Definition: poissonBoltzmann.h:225
BALL::FDPB::getErrorMessage
static String getErrorMessage(Index error_code)
BALL::FDPB::Option::OFFSET
static const String OFFSET
Definition: poissonBoltzmann.h:338
BALL::FDPB::Default::BOUNDARY
static const String BOUNDARY
Definition: poissonBoltzmann.h:558
BALL::FDPB::Default::PROBE_RADIUS
static const float PROBE_RADIUS
Definition: poissonBoltzmann.h:545
BALL::FDPB::SAS_grid
TRegularData3D< char > * SAS_grid
Definition: poissonBoltzmann.h:906
BALL::FDPB::phi_grid
TRegularData3D< float > * phi_grid
Definition: poissonBoltzmann.h:902
BALL::FDPB::ChargeDistribution::TRILINEAR
static const String TRILINEAR
Definition: poissonBoltzmann.h:458
BALL::FDPB::FDPB
FDPB(System &system)
BALL::FDPB::getEnergy
double getEnergy() const
BALL::FDPB::ERROR__UNKNOWN_BOUNDARY_CONDITION_TYPE
@ ERROR__UNKNOWN_BOUNDARY_CONDITION_TYPE
Definition: poissonBoltzmann.h:178
BALL::FDPB::ERROR__CANNOT_CREATE_KAPPA_GRID
@ ERROR__CANNOT_CREATE_KAPPA_GRID
Definition: poissonBoltzmann.h:93
BALL::FDPB::Option::SOLUTE_DC
static const String SOLUTE_DC
Definition: poissonBoltzmann.h:272
BALL::FDPB::ChargeDistribution::UNIFORM
static const String UNIFORM
Definition: poissonBoltzmann.h:463
BALL::FDPB::ERROR__CANNOT_CREATE_CHARGE_GRID
@ ERROR__CANNOT_CREATE_CHARGE_GRID
Definition: poissonBoltzmann.h:101
BALL::String
Definition: string.h:57
BALL::FDPB::Default::SOLVENT_DC
static const float SOLVENT_DC
Definition: poissonBoltzmann.h:578
BALL::FDPB::Option::BORDER
static const String BORDER
Definition: poissonBoltzmann.h:255
BALL::FDPB::upper_
Vector3 upper_
Definition: poissonBoltzmann.h:918
BALL::FDPB::Option::IONIC_STRENGTH
static const String IONIC_STRENGTH
Definition: poissonBoltzmann.h:265
BALL::FDPB::offset_
Vector3 offset_
Definition: poissonBoltzmann.h:919
BALL::FDPB::kappa_grid
TRegularData3D< float > * kappa_grid
Definition: poissonBoltzmann.h:881
BALL::FDPB::getReactionFieldEnergy
double getReactionFieldEnergy() const
BALL::FDPB::Boundary::FOCUSING
static const String FOCUSING
Definition: poissonBoltzmann.h:448
BALL::FDPB::Default::DIELECTRIC_SMOOTHING
static const String DIELECTRIC_SMOOTHING
Definition: poissonBoltzmann.h:572
BALL::FDPB::Default::BORDER
static const float BORDER
Definition: poissonBoltzmann.h:525
BALL::FDPB::Boundary::COULOMB
static const String COULOMB
Definition: poissonBoltzmann.h:436
BALL
Definition: constants.h:13
BALL::FDPB::Boundary::DEBYE
static const String DEBYE
Definition: poissonBoltzmann.h:431
BALL::FDPB::ERROR__SETUP_REQUIRED
@ ERROR__SETUP_REQUIRED
Definition: poissonBoltzmann.h:204
BALL::FDPB::Default::IONIC_STRENGTH
static const float IONIC_STRENGTH
Definition: poissonBoltzmann.h:531
BALL::FDPB::Option::CHARGE_DISTRIBUTION
static const String CHARGE_DISTRIBUTION
Definition: poissonBoltzmann.h:317
BALL::FDPB::FastAtomStruct
Definition: poissonBoltzmann.h:628
BALL::FDPB::Default::RMS_CRITERION
static const float RMS_CRITERION
Definition: poissonBoltzmann.h:592
BALL::FDPB::Default::MAX_CRITERION
static const float MAX_CRITERION
Definition: poissonBoltzmann.h:600
BALL::FDPB::options
Options options
Definition: poissonBoltzmann.h:861
BALL::FDPB::DielectricSmoothing::HARMONIC
static const String HARMONIC
Definition: poissonBoltzmann.h:494
BALL::FDPB::DielectricSmoothing::NONE
static const String NONE
Definition: poissonBoltzmann.h:476
options.h
BALL::FDPB::DielectricSmoothing
Definition: poissonBoltzmann.h:473
BALL::FDPB::setupKappaGrid
bool setupKappaGrid()
BALL::FDPB::Option
Definition: poissonBoltzmann.h:217
BALL::FDPB::Option::SOLVENT_DC
static const String SOLVENT_DC
Definition: poissonBoltzmann.h:279
BALL_INDEX_TYPE
BALL::FDPB::use_offset_
bool use_offset_
Definition: poissonBoltzmann.h:921
BALL_SIZE_TYPE
BALL::FDPB::setup
bool setup(System &system, Options &options)
BALL::FDPB::lower_
Vector3 lower_
Definition: poissonBoltzmann.h:917
BALL::TVector3< float >
BALL::FDPB::ERROR__UNKNOWN_DIELECTRIC_SMOOTHING_METHOD
@ ERROR__UNKNOWN_DIELECTRIC_SMOOTHING_METHOD
Definition: poissonBoltzmann.h:160
BALL::FDPB::ERROR__NOT_A_VECTOR_IN_UPPER_LOWER
@ ERROR__NOT_A_VECTOR_IN_UPPER_LOWER
Definition: poissonBoltzmann.h:187
BALL::FDPB::Default::PRINT_TIMING
static const bool PRINT_TIMING
Definition: poissonBoltzmann.h:513
BALL::FDPB::error_code_
int error_code_
Definition: poissonBoltzmann.h:941
BALL::FDPB::Default::ION_RADIUS
static const float ION_RADIUS
Definition: poissonBoltzmann.h:551
BALL::FDPB::ERROR__UNKNOWN_CHARGE_DISTRIBUTION_METHOD
@ ERROR__UNKNOWN_CHARGE_DISTRIBUTION_METHOD
Definition: poissonBoltzmann.h:169
BALL::FDPB::Option::UPPER
static const String UPPER
Definition: poissonBoltzmann.h:391
BALL::FDPB::setup
bool setup(System &system)
BALL::FDPB::eps_grid
TRegularData3D< Vector3 > * eps_grid
Definition: poissonBoltzmann.h:876
BALL::FDPB::Option::PRINT_TIMING
static const String PRINT_TIMING
Definition: poissonBoltzmann.h:236
BALL::FDPB::ERROR__PHI_GRID_REQUIRED
@ ERROR__PHI_GRID_REQUIRED
Definition: poissonBoltzmann.h:143
BALL::FDPB::FastAtomStruct::q
float q
Definition: poissonBoltzmann.h:629
BALL::FDPB::Default::CHECK_AFTER_ITERATIONS
static const Index CHECK_AFTER_ITERATIONS
Definition: poissonBoltzmann.h:613
BALL::FDPB::Option::ION_RADIUS
static const String ION_RADIUS
Definition: poissonBoltzmann.h:292
BALL::FDPB::ERROR__CANNOT_CREATE_ATOM_ARRAY
@ ERROR__CANNOT_CREATE_ATOM_ARRAY
Definition: poissonBoltzmann.h:66
BALL::FDPB::setupPhiGrid
bool setupPhiGrid()
BALL::FDPB::Option::PROBE_RADIUS
static const String PROBE_RADIUS
Definition: poissonBoltzmann.h:286
BALL::FDPB::getNumberOfIterations
Size getNumberOfIterations() const
BALL::FDPB::destroy
void destroy()
BALL::FDPB::Option::CHECK_AFTER_ITERATIONS
static const String CHECK_AFTER_ITERATIONS
Definition: poissonBoltzmann.h:365
BALL::FDPB::ERROR__ILLEGAL_VALUE_FOR_LOWER_UPPER
@ ERROR__ILLEGAL_VALUE_FOR_LOWER_UPPER
Definition: poissonBoltzmann.h:197
BALL::FDPB::ERROR__CANNOT_CREATE_PHI_GRID
@ ERROR__CANNOT_CREATE_PHI_GRID
Definition: poissonBoltzmann.h:109
common.h
BALL::FDPB::energy_
double energy_
Definition: poissonBoltzmann.h:926
BALL::FDPB::FDPB
FDPB()
BALL::FDPB::Default::MAX_ITERATIONS
static const Index MAX_ITERATIONS
Definition: poissonBoltzmann.h:607
BALL::FDPB::ERROR__SAS_GRID_REQUIRED
@ ERROR__SAS_GRID_REQUIRED
Definition: poissonBoltzmann.h:117
BALL::FDPB::Option::MAX_CRITERION
static const String MAX_CRITERION
Definition: poissonBoltzmann.h:357
BALL::FDPB::ChargeDistribution
Definition: poissonBoltzmann.h:454
BALL::FDPB::Default::CHARGE_DISTRIBUTION
static const String CHARGE_DISTRIBUTION
Definition: poissonBoltzmann.h:565
system.h
BALL::FDPB::Option::RMS_CRITERION
static const String RMS_CRITERION
Definition: poissonBoltzmann.h:348
BALL::FDPB::boundary_points_
vector< Position > boundary_points_
Definition: poissonBoltzmann.h:934
BALL::FDPB::reaction_field_energy_
double reaction_field_energy_
Definition: poissonBoltzmann.h:929
BALL::FDPB::Option::BOUNDING_BOX_LOWER
static const String BOUNDING_BOX_LOWER
Definition: poissonBoltzmann.h:398
BALL::FDPB::setupAtomArray
bool setupAtomArray(System &system)
regularData3D.h
BALL::FDPB::Option::MAX_ITERATIONS
static const String MAX_ITERATIONS
Definition: poissonBoltzmann.h:375
BALL::FDPB::FDPB
FDPB(Options &new_options)
BALL::FDPB::ERROR__OUT_OF_MEMORY
@ ERROR__OUT_OF_MEMORY
Definition: poissonBoltzmann.h:150
BALL::FDPB::FDPB
FDPB(System &system, Options &new_options)
BALL::FDPB::Option::TEMPERATURE
static const String TEMPERATURE
Definition: poissonBoltzmann.h:299
BALL::FDPB::ERROR__ATOM_ARRAY_REQUIRED
@ ERROR__ATOM_ARRAY_REQUIRED
Definition: poissonBoltzmann.h:134
BALL::FDPB::Option::BOUNDING_BOX_UPPER
static const String BOUNDING_BOX_UPPER
Definition: poissonBoltzmann.h:404
BALL::FDPB::Default
Definition: poissonBoltzmann.h:502
BALL::FDPB::calculateReactionFieldEnergy
double calculateReactionFieldEnergy() const
BALL::FDPB::Option::LOWER
static const String LOWER
Definition: poissonBoltzmann.h:385
BALL::FDPB::getErrorCode
Index getErrorCode() const
BALL::FDPB::Boundary
Definition: poissonBoltzmann.h:412
BALL::FDPB::Default::SPACING
static const float SPACING
Definition: poissonBoltzmann.h:519
BALL::FDPB::FastAtomStruct::z
float z
Definition: poissonBoltzmann.h:631
BALL::FDPB::setupBoundary
bool setupBoundary()
BALL::FDPB::spacing_
float spacing_
Definition: poissonBoltzmann.h:923
BALL::FDPB::ERROR__EPSILON_GRID_REQUIRED
@ ERROR__EPSILON_GRID_REQUIRED
Definition: poissonBoltzmann.h:126
BALL::FDPB::Option::SPACING
static const String SPACING
Definition: poissonBoltzmann.h:245
BALL::FDPB::setupSASGrid
bool setupSASGrid(System &system)
BALL::FDPB::Option::DIELECTRIC_SMOOTHING
static const String DIELECTRIC_SMOOTHING
Definition: poissonBoltzmann.h:329
BALL::FDPB
Definition: poissonBoltzmann.h:37
BALL::FDPB::ERROR__CANNOT_CREATE_SAS_GRID
@ ERROR__CANNOT_CREATE_SAS_GRID
Definition: poissonBoltzmann.h:74