MultigridSolver¶
- class MultigridSolver(boundary_conditions=None, solvent_dielectric_constant=None)¶
The multigrid-based Poisson solver.
- Parameters:
boundary_conditions (list of
DirichletBoundaryCondition
|NeumannBoundaryCondition
|PeriodicBoundaryCondition
|MultipoleBoundaryCondition
) –A list of shape (3,2) specifying the boundary conditions on the 6 surfaces of the unit cell for the configuration. Default:
MoleculeConfiguration
:[[MultipoleBoundaryCondition()] * 2] * 3
BulkConfiguration
:[[PeriodicBoundaryCondition()] * 2] * 3
-
[[PeriodicBoundaryCondition()] * 2, [PeriodicBoundaryCondition()] * 2, [DirichletBoundaryCondition(), NeumannBoundaryCondition()]]
-
[[PeriodicBoundaryCondition()] * 2, [PeriodicBoundaryCondition()] * 2, [DirichletBoundaryCondition()] * 2]
solvent_dielectric_constant (float) – The dielectric constant of the media surrounding the configuration. Must be a number larger than 0. Default:
1.0
- boundaryConditions()¶
- Returns:
The boundary conditions for the solver.
- Return type:
list of
DirichletBoundaryCondition
|NeumannBoundaryCondition
|PeriodicBoundaryCondition
|MultipoleBoundaryCondition
- solventDielectricConstant()¶
- Returns:
The solvent dielectric constant.
- Return type:
float
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Define a MultigridSolver
with specified boundary conditions on the 6 faces:
poisson_solver = MultigridSolver(
boundary_conditions=[
[DirichletBoundaryCondition(), NeumannBoundaryCondition()],
[DirichletBoundaryCondition(), DirichletBoundaryCondition()],
[PeriodicBoundaryCondition(), PeriodicBoundaryCondition()]
]
)
calculator = LCAOCalculator(
poisson_solver=poisson_solver
)
Define a MultigridSolver
with specified boundary conditions in the A, B, and C-direction, but similar boundary conditions on opposite faces.:
poisson_solver = MultigridSolver(
boundary_conditions=[
[DirichletBoundaryCondition(), DirichletBoundaryCondition()],
[DirichletBoundaryCondition(), DirichletBoundaryCondition()],
[PeriodicBoundaryCondition(), PeriodicBoundaryCondition()]
]
)
calculator = LCAOCalculator(
poisson_solver=poisson_solver,
)
Notes¶
By setting the
solvent_dielectric_constant
it is possible to perform calculations of solvents. In this case the volume of the configuration is defined by inscribing each atom in a sphere of size given by the van der Waals radius of the element. Inside the volume of the configuration the dielectric constant is 1, outside the volume of the configuration the dielectric constant is equal to the value ofsolvent_dielectric_constant
.See also Poisson solvers.