ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ElectrostaticLayerCorrection Struct Reference

#include <elc.hpp>

Inheritance diagram for ElectrostaticLayerCorrection:
Collaboration diagram for ElectrostaticLayerCorrection:

Public Types

using BaseSolver = std::variant<std::shared_ptr<CoulombP3M>>

Public Member Functions

 ElectrostaticLayerCorrection (elc_data &&parameters, BaseSolver &&solver)
void on_activation ()
void on_boxl_change ()
 Recalculate all box-length-dependent parameters.
void on_node_grid_change () const
void on_periodicity_change () const
void on_cell_structure_change ()
void init ()
 Recalculate all derived parameters.
void sanity_checks () const
std::optional< std::string > veto_r_cut (double r_cut) const
 Veto real-space cutoff values that are incompatible with ELC.
Utils::Vector3d pair_force (double q1q2, Utils::Vector3d const &d, double dist) const
double pair_energy_correction (std::size_t p1, std::size_t p2, auto &aosoa, double q1q2) const
 Calculate short-range pair energy correction.
double pair_energy_correction (Utils::Vector3d const &pos1, Utils::Vector3d const &pos2, double q1q2) const
 Calculate short-range pair energy correction.
void add_pair_force_corrections (Utils::Vector3d const &pos1, Utils::Vector3d const &pos2, Utils::Vector3d &p1f_asym, Utils::Vector3d &p2f_asym, double q1q2) const
 Add short-range pair force corrections.
double long_range_energy () const
 Calculate long-range electrostatic energy with corrections.
void add_long_range_forces () const
 Accumulate long-range electrostatic forces with corrections.
Public Member Functions inherited from Coulomb::Actor< ElectrostaticLayerCorrection >
void set_prefactor (double new_prefactor)
void sanity_checks_charge_neutrality () const
Public Member Functions inherited from System::Leaf< Actor< ElectrostaticLayerCorrection > >
void bind_system (std::shared_ptr< System > const &system)
void detach_system (std::shared_ptr< System > const &system)

Public Attributes

elc_data elc
BoxGeometry * m_box_geo
BaseSolver base_solver
 Electrostatics solver that is adapted.
Public Attributes inherited from Coulomb::Actor< ElectrostaticLayerCorrection >
double prefactor
 Electrostatics prefactor.
double charge_neutrality_tolerance
 Relative tolerance for the charge excess during neutrality checks.

Additional Inherited Members

Static Public Attributes inherited from Coulomb::Actor< ElectrostaticLayerCorrection >
static auto constexpr charge_neutrality_tolerance_default
Protected Member Functions inherited from System::Leaf< Actor< ElectrostaticLayerCorrection > >
auto & get_system ()
Protected Attributes inherited from System::Leaf< Actor< ElectrostaticLayerCorrection > >
std::weak_ptr< System > m_system

Detailed Description

Definition at line 191 of file elc.hpp.

Member Typedef Documentation

◆ BaseSolver

using ElectrostaticLayerCorrection::BaseSolver = std::variant<std::shared_ptr<CoulombP3M>>

Definition at line 193 of file elc.hpp.

Constructor & Destructor Documentation

◆ ElectrostaticLayerCorrection()

ElectrostaticLayerCorrection::ElectrostaticLayerCorrection ( elc_data && parameters,
BaseSolver && solver )

Definition at line 1090 of file elc.cpp.

References base_solver, and elc.

Member Function Documentation

◆ add_long_range_forces()

void ElectrostaticLayerCorrection::add_long_range_forces ( ) const

Accumulate long-range electrostatic forces with corrections.

Definition at line 1231 of file elc.cpp.

References base_solver, charge_assign(), elc, System::Leaf< Actor< ElectrostaticLayerCorrection > >::get_system(), and modify_p3m_sums().

◆ add_pair_force_corrections()

void ElectrostaticLayerCorrection::add_pair_force_corrections ( Utils::Vector3d const & pos1,
Utils::Vector3d const & pos2,
Utils::Vector3d & p1f_asym,
Utils::Vector3d & p2f_asym,
double q1q2 ) const
inline

Add short-range pair force corrections.

Definition at line 335 of file elc.hpp.

References base_solver, elc, m_box_geo, and Utils::Vector< T, N >::norm().

◆ init()

void ElectrostaticLayerCorrection::init ( )
inline

Recalculate all derived parameters.

Definition at line 248 of file elc.hpp.

◆ long_range_energy()

double ElectrostaticLayerCorrection::long_range_energy ( ) const

Calculate long-range electrostatic energy with corrections.

Definition at line 1191 of file elc.cpp.

References base_solver, charge_assign(), elc, System::Leaf< Actor< ElectrostaticLayerCorrection > >::get_system(), and modify_p3m_sums().

◆ on_activation()

void ElectrostaticLayerCorrection::on_activation ( )
inline

◆ on_boxl_change()

void ElectrostaticLayerCorrection::on_boxl_change ( )
inline

Recalculate all box-length-dependent parameters.

Definition at line 224 of file elc.hpp.

◆ on_cell_structure_change()

void ElectrostaticLayerCorrection::on_cell_structure_change ( )
inline

Definition at line 237 of file elc.hpp.

References elc.

◆ on_node_grid_change()

void ElectrostaticLayerCorrection::on_node_grid_change ( ) const
inline

Definition at line 230 of file elc.hpp.

◆ on_periodicity_change()

void ElectrostaticLayerCorrection::on_periodicity_change ( ) const
inline

Definition at line 233 of file elc.hpp.

◆ pair_energy_correction() [1/2]

double ElectrostaticLayerCorrection::pair_energy_correction ( std::size_t p1,
std::size_t p2,
auto & aosoa,
double q1q2 ) const
inline

Calculate short-range pair energy correction.

Definition at line 282 of file elc.hpp.

References base_solver, elc, m_box_geo, and Utils::Vector< T, N >::norm().

◆ pair_energy_correction() [2/2]

double ElectrostaticLayerCorrection::pair_energy_correction ( Utils::Vector3d const & pos1,
Utils::Vector3d const & pos2,
double q1q2 ) const
inline

Calculate short-range pair energy correction.

Definition at line 308 of file elc.hpp.

References base_solver, elc, m_box_geo, and Utils::Vector< T, N >::norm().

◆ pair_force()

Utils::Vector3d ElectrostaticLayerCorrection::pair_force ( double q1q2,
Utils::Vector3d const & d,
double dist ) const
inline

Definition at line 274 of file elc.hpp.

References base_solver.

◆ sanity_checks()

void ElectrostaticLayerCorrection::sanity_checks ( ) const
inline

◆ veto_r_cut()

std::optional< std::string > ElectrostaticLayerCorrection::veto_r_cut ( double r_cut) const
inline

Veto real-space cutoff values that are incompatible with ELC.

When ELC is used with dielectric contrasts, the short-range cutoff needs to be smaller than the gap size to allow placement of the image charges.

Definition at line 267 of file elc.hpp.

References elc.

Member Data Documentation

◆ base_solver

BaseSolver ElectrostaticLayerCorrection::base_solver

◆ elc

◆ m_box_geo

BoxGeometry* ElectrostaticLayerCorrection::m_box_geo

The documentation for this struct was generated from the following files: