Loading...
Searching...
No Matches
poissonBoltzmann.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: poissonBoltzmann.h,v 1.31 2005/12/23 17:02:00 amoll Exp $
//
// Finite Difference Poisson Boltzmann Solver
#ifndef BALL_SOLVATION_POISSONBOLTZMANN_H
#define BALL_SOLVATION_POISSONBOLTZMANN_H
#ifndef BALL_COMMON_H_
# include <BALL/common.h>
#endif
#ifndef BALL_DATATYPE_REGULARDATA3D_H
# include <BALL/DATATYPE/regularData3D.h>
#endif
#ifndef BALL_KERNEL_SYSTEM_H
# include <BALL/KERNEL/system.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#include <vector>
using std::vector;
namespace BALL
{
class BALL_EXPORT FDPB
{
public:
enum ErrorCode
{
ERROR__NONE = -1,
ERROR__UNKNOWN = 0,
ERROR__NOT_IMPLEMENTED = 1,
ERROR__CANNOT_CREATE_ATOM_ARRAY,
ERROR__CANNOT_CREATE_SAS_GRID,
ERROR__CANNOT_CREATE_EPSILON_GRID,
ERROR__CANNOT_CREATE_KAPPA_GRID,
ERROR__CANNOT_CREATE_CHARGE_GRID,
ERROR__CANNOT_CREATE_PHI_GRID,
ERROR__SAS_GRID_REQUIRED,
ERROR__EPSILON_GRID_REQUIRED,
ERROR__ATOM_ARRAY_REQUIRED,
ERROR__PHI_GRID_REQUIRED,
ERROR__OUT_OF_MEMORY,
ERROR__UNKNOWN_DIELECTRIC_SMOOTHING_METHOD,
ERROR__UNKNOWN_CHARGE_DISTRIBUTION_METHOD,
ERROR__UNKNOWN_BOUNDARY_CONDITION_TYPE,
ERROR__NOT_A_VECTOR_IN_UPPER_LOWER,
ERROR__ILLEGAL_VALUE_FOR_LOWER_UPPER,
ERROR__SETUP_REQUIRED,
NUMBER_OF_ERRORS
};
struct BALL_EXPORT Option
{
static const String VERBOSITY;
static const String PRINT_TIMING;
static const String SPACING;
static const String BORDER;
static const String IONIC_STRENGTH;
static const String SOLUTE_DC;
static const String SOLVENT_DC;
static const String PROBE_RADIUS;
static const String ION_RADIUS;
static const String TEMPERATURE;
static const String BOUNDARY;
static const String CHARGE_DISTRIBUTION;
static const String DIELECTRIC_SMOOTHING;
static const String OFFSET;
static const String RMS_CRITERION;
static const String MAX_CRITERION;
static const String CHECK_AFTER_ITERATIONS;
static const String MAX_ITERATIONS;
static const String LOWER;
static const String UPPER;
static const String BOUNDING_BOX_LOWER;
static const String BOUNDING_BOX_UPPER;
};
struct BALL_EXPORT Boundary
{
static const String ZERO;
static const String DEBYE;
static const String COULOMB;
static const String DIPOLE;
static const String FOCUSING;
};
struct BALL_EXPORT ChargeDistribution
{
static const String TRILINEAR;
static const String UNIFORM;
};
struct BALL_EXPORT DielectricSmoothing
{
static const String NONE;
static const String UNIFORM;
static const String HARMONIC;
};
struct BALL_EXPORT Default
{
static const int VERBOSITY;
static const bool PRINT_TIMING ;
static const float SPACING;
static const float BORDER;
static const float IONIC_STRENGTH;
static const float TEMPERATURE;
static const float PROBE_RADIUS;
static const float ION_RADIUS;
static const String BOUNDARY;
static const String CHARGE_DISTRIBUTION;
static const String DIELECTRIC_SMOOTHING;
static const float SOLVENT_DC;
static const float SOLUTE_DC;
static const float RMS_CRITERION;
static const float MAX_CRITERION;
static const Index MAX_ITERATIONS;
static const Index CHECK_AFTER_ITERATIONS;
};
struct BALL_EXPORT FastAtomStruct
{
float q;
float r;
float x, y, z;
Index index;
};
typedef struct FastAtomStruct FastAtom;
FDPB();
FDPB(const FDPB& fdpb);
FDPB(System& system);
FDPB(Options& new_options);
FDPB(System& system, Options& new_options);
virtual ~FDPB();
void destroy();
void destroyGrids();
bool setup(System& system);
bool setup(System& system, Options& options);
bool setupEpsGrid(System& system);
// ?????
bool setupSASGrid(System& system);
bool setupAtomArray(System& system);
bool setupKappaGrid();
bool setupQGrid();
bool setupPhiGrid();
bool setupBoundary();
bool solve();
double getEnergy() const;
double getReactionFieldEnergy() const;
double calculateReactionFieldEnergy() const;
Size getNumberOfIterations() const;
Index getErrorCode() const;
static String getErrorMessage(Index error_code);
Options options;
Options results;
TRegularData3D<Vector3>* eps_grid;
TRegularData3D<float>* kappa_grid;
TRegularData3D<float>* q_grid;
TRegularData3D<float>* phi_grid;
TRegularData3D<char>* SAS_grid;
vector<FDPB::FastAtom>* atom_array;
protected:
Vector3 lower_;
Vector3 upper_;
Vector3 offset_;
bool use_offset_;
float spacing_;
// final energy of the last calculation
double energy_;
// the reaction field energy of the last calculation
double reaction_field_energy_;
// the indices of the boundary points,
// i.e., the points that have at least one neighbouring
// grid point that is inside the solute
vector<Position> boundary_points_;
// number of iterations of the last calculation
Size number_of_iterations_;
// error code. use getErrorMessage to access the corresponding
// error message
int error_code_;
static const char* error_message_[];
};
} // namespace BALL
#endif
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
system.h
BALL::FDPB::error_message_
static const char * error_message_[]
Definition poissonBoltzmann.h:943
BALL::FDPB::setupQGrid
bool setupQGrid()
BALL::FDPB::q_grid
TRegularData3D< float > * q_grid
Definition poissonBoltzmann.h:891
BALL::FDPB::spacing_
float spacing_
Definition poissonBoltzmann.h:923
BALL::FDPB::destroy
void destroy()
BALL::FDPB::~FDPB
virtual ~FDPB()
BALL::FDPB::SAS_grid
TRegularData3D< char > * SAS_grid
Definition poissonBoltzmann.h:906
BALL::FDPB::ErrorCode
ErrorCode
Definition poissonBoltzmann.h:46
BALL::FDPB::ERROR__NOT_A_VECTOR_IN_UPPER_LOWER
@ ERROR__NOT_A_VECTOR_IN_UPPER_LOWER
Definition poissonBoltzmann.h:187
BALL::FDPB::ERROR__ATOM_ARRAY_REQUIRED
@ ERROR__ATOM_ARRAY_REQUIRED
Definition poissonBoltzmann.h:134
BALL::FDPB::ERROR__UNKNOWN_DIELECTRIC_SMOOTHING_METHOD
@ ERROR__UNKNOWN_DIELECTRIC_SMOOTHING_METHOD
Definition poissonBoltzmann.h:160
BALL::FDPB::ERROR__CANNOT_CREATE_KAPPA_GRID
@ ERROR__CANNOT_CREATE_KAPPA_GRID
Definition poissonBoltzmann.h:93
BALL::FDPB::ERROR__CANNOT_CREATE_ATOM_ARRAY
@ ERROR__CANNOT_CREATE_ATOM_ARRAY
Definition poissonBoltzmann.h:66
BALL::FDPB::ERROR__OUT_OF_MEMORY
@ ERROR__OUT_OF_MEMORY
Definition poissonBoltzmann.h:150
BALL::FDPB::ERROR__SETUP_REQUIRED
@ ERROR__SETUP_REQUIRED
Definition poissonBoltzmann.h:204
BALL::FDPB::NUMBER_OF_ERRORS
@ NUMBER_OF_ERRORS
Definition poissonBoltzmann.h:208
BALL::FDPB::ERROR__NOT_IMPLEMENTED
@ ERROR__NOT_IMPLEMENTED
Definition poissonBoltzmann.h:58
BALL::FDPB::ERROR__PHI_GRID_REQUIRED
@ ERROR__PHI_GRID_REQUIRED
Definition poissonBoltzmann.h:143
BALL::FDPB::ERROR__EPSILON_GRID_REQUIRED
@ ERROR__EPSILON_GRID_REQUIRED
Definition poissonBoltzmann.h:126
BALL::FDPB::ERROR__UNKNOWN_CHARGE_DISTRIBUTION_METHOD
@ ERROR__UNKNOWN_CHARGE_DISTRIBUTION_METHOD
Definition poissonBoltzmann.h:169
BALL::FDPB::ERROR__CANNOT_CREATE_CHARGE_GRID
@ ERROR__CANNOT_CREATE_CHARGE_GRID
Definition poissonBoltzmann.h:101
BALL::FDPB::ERROR__UNKNOWN_BOUNDARY_CONDITION_TYPE
@ ERROR__UNKNOWN_BOUNDARY_CONDITION_TYPE
Definition poissonBoltzmann.h:178
BALL::FDPB::ERROR__ILLEGAL_VALUE_FOR_LOWER_UPPER
@ ERROR__ILLEGAL_VALUE_FOR_LOWER_UPPER
Definition poissonBoltzmann.h:197
BALL::FDPB::ERROR__NONE
@ ERROR__NONE
Definition poissonBoltzmann.h:49
BALL::FDPB::ERROR__CANNOT_CREATE_SAS_GRID
@ ERROR__CANNOT_CREATE_SAS_GRID
Definition poissonBoltzmann.h:74
BALL::FDPB::ERROR__CANNOT_CREATE_PHI_GRID
@ ERROR__CANNOT_CREATE_PHI_GRID
Definition poissonBoltzmann.h:109
BALL::FDPB::ERROR__CANNOT_CREATE_EPSILON_GRID
@ ERROR__CANNOT_CREATE_EPSILON_GRID
Definition poissonBoltzmann.h:84
BALL::FDPB::ERROR__UNKNOWN
@ ERROR__UNKNOWN
Definition poissonBoltzmann.h:53
BALL::FDPB::ERROR__SAS_GRID_REQUIRED
@ ERROR__SAS_GRID_REQUIRED
Definition poissonBoltzmann.h:117
BALL::FDPB::destroyGrids
void destroyGrids()
BALL::FDPB::getReactionFieldEnergy
double getReactionFieldEnergy() const
BALL::FDPB::FDPB
FDPB(System &system, Options &new_options)
BALL::FDPB::setupBoundary
bool setupBoundary()
BALL::FDPB::FDPB
FDPB(const FDPB &fdpb)
BALL::FDPB::solve
bool solve()
BALL::FDPB::setup
bool setup(System &system, Options &options)
BALL::FDPB::setupSASGrid
bool setupSASGrid(System &system)
BALL::FDPB::setupEpsGrid
bool setupEpsGrid(System &system)
BALL::FDPB::calculateReactionFieldEnergy
double calculateReactionFieldEnergy() const
BALL::FDPB::FDPB
FDPB(Options &new_options)
BALL::FDPB::setupKappaGrid
bool setupKappaGrid()
BALL::FDPB::setup
bool setup(System &system)
BALL::FDPB::atom_array
vector< FDPB::FastAtom > * atom_array
Definition poissonBoltzmann.h:911
BALL::FDPB::reaction_field_energy_
double reaction_field_energy_
Definition poissonBoltzmann.h:929
BALL::FDPB::energy_
double energy_
Definition poissonBoltzmann.h:926
BALL::FDPB::FDPB
FDPB()
BALL::FDPB::getNumberOfIterations
Size getNumberOfIterations() const
BALL::FDPB::getErrorCode
Index getErrorCode() const
BALL::FDPB::FDPB
FDPB(System &system)
BALL::FDPB::setupAtomArray
bool setupAtomArray(System &system)
BALL::FDPB::lower_
Vector3 lower_
Definition poissonBoltzmann.h:917
BALL::FDPB::use_offset_
bool use_offset_
Definition poissonBoltzmann.h:921
BALL::FDPB::getErrorMessage
static String getErrorMessage(Index error_code)
BALL::FDPB::kappa_grid
TRegularData3D< float > * kappa_grid
Definition poissonBoltzmann.h:881
BALL::FDPB::offset_
Vector3 offset_
Definition poissonBoltzmann.h:919
BALL::FDPB::number_of_iterations_
Size number_of_iterations_
Definition poissonBoltzmann.h:937
BALL::FDPB::setupPhiGrid
bool setupPhiGrid()
BALL::FDPB::upper_
Vector3 upper_
Definition poissonBoltzmann.h:918
BALL::FDPB::boundary_points_
vector< Position > boundary_points_
Definition poissonBoltzmann.h:934
BALL::FDPB::FastAtom
struct FastAtomStruct FastAtom
Definition poissonBoltzmann.h:635
BALL::FDPB::options
Options options
Definition poissonBoltzmann.h:861
BALL::FDPB::getEnergy
double getEnergy() const
BALL::FDPB::eps_grid
TRegularData3D< Vector3 > * eps_grid
Definition poissonBoltzmann.h:876
BALL::FDPB::results
Options results
Definition poissonBoltzmann.h:865
BALL::FDPB::error_code_
int error_code_
Definition poissonBoltzmann.h:941
BALL::FDPB::phi_grid
TRegularData3D< float > * phi_grid
Definition poissonBoltzmann.h:902
BALL::Options
Definition options.h:48
BALL::String
Definition string.h:57
BALL::System
Definition KERNEL/system.h:40
BALL::TRegularData3D
Definition regularData3D.h:46
common.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
options.h
regularData3D.h
BALL::FDPB::Boundary
Definition poissonBoltzmann.h:412
BALL::FDPB::Boundary::DEBYE
static const String DEBYE
Definition poissonBoltzmann.h:431
BALL::FDPB::Boundary::COULOMB
static const String COULOMB
Definition poissonBoltzmann.h:436
BALL::FDPB::Boundary::FOCUSING
static const String FOCUSING
Definition poissonBoltzmann.h:448
BALL::FDPB::Boundary::ZERO
static const String ZERO
Definition poissonBoltzmann.h:419
BALL::FDPB::Boundary::DIPOLE
static const String DIPOLE
Definition poissonBoltzmann.h:440
BALL::FDPB::ChargeDistribution
Definition poissonBoltzmann.h:454
BALL::FDPB::ChargeDistribution::UNIFORM
static const String UNIFORM
Definition poissonBoltzmann.h:463
BALL::FDPB::ChargeDistribution::TRILINEAR
static const String TRILINEAR
Definition poissonBoltzmann.h:458
BALL::FDPB::Default
Definition poissonBoltzmann.h:502
BALL::FDPB::Default::PRINT_TIMING
static const bool PRINT_TIMING
Definition poissonBoltzmann.h:513
BALL::FDPB::Default::SPACING
static const float SPACING
Definition poissonBoltzmann.h:519
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::Default::CHECK_AFTER_ITERATIONS
static const Index CHECK_AFTER_ITERATIONS
Definition poissonBoltzmann.h:613
BALL::FDPB::Default::VERBOSITY
static const int VERBOSITY
Definition poissonBoltzmann.h:507
BALL::FDPB::Default::RMS_CRITERION
static const float RMS_CRITERION
Definition poissonBoltzmann.h:592
BALL::FDPB::Default::SOLVENT_DC
static const float SOLVENT_DC
Definition poissonBoltzmann.h:578
BALL::FDPB::Default::TEMPERATURE
static const float TEMPERATURE
Definition poissonBoltzmann.h:537
BALL::FDPB::Default::SOLUTE_DC
static const float SOLUTE_DC
Definition poissonBoltzmann.h:584
BALL::FDPB::Default::MAX_CRITERION
static const float MAX_CRITERION
Definition poissonBoltzmann.h:600
BALL::FDPB::Default::CHARGE_DISTRIBUTION
static const String CHARGE_DISTRIBUTION
Definition poissonBoltzmann.h:565
BALL::FDPB::Default::BOUNDARY
static const String BOUNDARY
Definition poissonBoltzmann.h:558
BALL::FDPB::Default::IONIC_STRENGTH
static const float IONIC_STRENGTH
Definition poissonBoltzmann.h:531
BALL::FDPB::Default::ION_RADIUS
static const float ION_RADIUS
Definition poissonBoltzmann.h:551
BALL::FDPB::Default::PROBE_RADIUS
static const float PROBE_RADIUS
Definition poissonBoltzmann.h:545
BALL::FDPB::Default::MAX_ITERATIONS
static const Index MAX_ITERATIONS
Definition poissonBoltzmann.h:607
BALL::FDPB::DielectricSmoothing
Definition poissonBoltzmann.h:473
BALL::FDPB::DielectricSmoothing::NONE
static const String NONE
Definition poissonBoltzmann.h:476
BALL::FDPB::DielectricSmoothing::UNIFORM
static const String UNIFORM
Definition poissonBoltzmann.h:485
BALL::FDPB::DielectricSmoothing::HARMONIC
static const String HARMONIC
Definition poissonBoltzmann.h:494
BALL::FDPB::FastAtomStruct
Definition poissonBoltzmann.h:628
BALL::FDPB::FastAtomStruct::r
float r
Definition poissonBoltzmann.h:630
BALL::FDPB::FastAtomStruct::index
Index index
Definition poissonBoltzmann.h:632
BALL::FDPB::FastAtomStruct::y
float y
Definition poissonBoltzmann.h:631
BALL::FDPB::FastAtomStruct::q
float q
Definition poissonBoltzmann.h:629
BALL::FDPB::FastAtomStruct::x
float x
Definition poissonBoltzmann.h:631
BALL::FDPB::FastAtomStruct::z
float z
Definition poissonBoltzmann.h:631
BALL::FDPB::Option
Definition poissonBoltzmann.h:217
BALL::FDPB::Option::SOLUTE_DC
static const String SOLUTE_DC
Definition poissonBoltzmann.h:272
BALL::FDPB::Option::PRINT_TIMING
static const String PRINT_TIMING
Definition poissonBoltzmann.h:236
BALL::FDPB::Option::MAX_ITERATIONS
static const String MAX_ITERATIONS
Definition poissonBoltzmann.h:375
BALL::FDPB::Option::VERBOSITY
static const String VERBOSITY
Definition poissonBoltzmann.h:225
BALL::FDPB::Option::SOLVENT_DC
static const String SOLVENT_DC
Definition poissonBoltzmann.h:279
BALL::FDPB::Option::CHARGE_DISTRIBUTION
static const String CHARGE_DISTRIBUTION
Definition poissonBoltzmann.h:317
BALL::FDPB::Option::PROBE_RADIUS
static const String PROBE_RADIUS
Definition poissonBoltzmann.h:286
BALL::FDPB::Option::OFFSET
static const String OFFSET
Definition poissonBoltzmann.h:338
BALL::FDPB::Option::LOWER
static const String LOWER
Definition poissonBoltzmann.h:385
BALL::FDPB::Option::BOUNDARY
static const String BOUNDARY
Definition poissonBoltzmann.h:308
BALL::FDPB::Option::CHECK_AFTER_ITERATIONS
static const String CHECK_AFTER_ITERATIONS
Definition poissonBoltzmann.h:365
BALL::FDPB::Option::ION_RADIUS
static const String ION_RADIUS
Definition poissonBoltzmann.h:292
BALL::FDPB::Option::DIELECTRIC_SMOOTHING
static const String DIELECTRIC_SMOOTHING
Definition poissonBoltzmann.h:329
BALL::FDPB::Option::TEMPERATURE
static const String TEMPERATURE
Definition poissonBoltzmann.h:299
BALL::FDPB::Option::BORDER
static const String BORDER
Definition poissonBoltzmann.h:255
BALL::FDPB::Option::MAX_CRITERION
static const String MAX_CRITERION
Definition poissonBoltzmann.h:357
BALL::FDPB::Option::BOUNDING_BOX_UPPER
static const String BOUNDING_BOX_UPPER
Definition poissonBoltzmann.h:404
BALL::FDPB::Option::UPPER
static const String UPPER
Definition poissonBoltzmann.h:391
BALL::FDPB::Option::BOUNDING_BOX_LOWER
static const String BOUNDING_BOX_LOWER
Definition poissonBoltzmann.h:398
BALL::FDPB::Option::IONIC_STRENGTH
static const String IONIC_STRENGTH
Definition poissonBoltzmann.h:265
BALL::FDPB::Option::SPACING
static const String SPACING
Definition poissonBoltzmann.h:245
BALL::FDPB::Option::RMS_CRITERION
static const String RMS_CRITERION
Definition poissonBoltzmann.h:348