votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::EwaldRegion Class Reference

The periodic Ewald background, as a Region. More...

#include <ewaldregion.h>

Inheritance diagram for votca::xtp::EwaldRegion:
Collaboration diagram for votca::xtp::EwaldRegion:

Public Member Functions

 EwaldRegion (Index id, Logger &log)
 ~EwaldRegion () override=default
std::string identify () const override
void Initialize (const tools::Property &prop) override
bool Converged () const override
void Evaluate (std::vector< std::unique_ptr< Region > > &regions) override
void Reset () override
Index size () const override
double charge () const override
double Etotal () const override
void WriteToCpt (CheckpointWriter &w) const override
void ReadFromCpt (CheckpointReader &r) override
void WritePDB (csg::PDBWriter &writer) const override
const EwaldRegistry & Registry () const
const EwaldParameters & Parameters () const
double ApplyFieldTo (std::vector< PolarSegment > &foreground) const
void RegisterForeground (const std::vector< std::pair< Index, Eigen::Vector3d > > &foreground)
Eigen::VectorXd PotentialAt (const std::vector< Eigen::Vector3d > &points) const
Public Member Functions inherited from votca::xtp::Region
 Region (Index id, Logger &log)
virtual ~Region ()=default
bool Successful () const
std::string ErrorMsg () const
void AddResults (tools::Property &prop) const
Index getId () const

Protected Member Functions

void AppendResult (tools::Property &prop) const override
double InteractwithQMRegion (const QMRegion &) override
double InteractwithPolarRegion (const PolarRegion &) override
double InteractwithStaticRegion (const StaticRegion &) override
double InteractwithEwaldRegion (const EwaldRegion &) override
Protected Member Functions inherited from votca::xtp::Region
std::vector< double > ApplyInfluenceOfOtherRegions (std::vector< std::unique_ptr< Region > > &regions)

Private Member Functions

void BuildSums (const std::vector< PolarSegment > &fallback) const
void CheckForegroundIsSubset (const std::vector< PolarSegment > &foreground) const

Private Attributes

std::unique_ptr< EwaldRealSpaceSum > real_sum_
std::unique_ptr< EwaldReciprocalSpaceSum > recip_sum_
std::unique_ptr< EwaldShapeCorrection > shape_
std::unique_ptr< EwaldRealSpaceInteractor > interactor_
std::vector< std::pair< Index, Eigen::Vector3d > > foreground_copies_
std::vector< std::pair< Index, Eigen::Vector3d > > built_foreground_
std::vector< std::pair< Index, Eigen::Vector3d > > registered_foreground_
bool warned_no_energy_ = false
std::string checkpoint_file_
EwaldRegistry registry_
EwaldParameters params_
bool loaded_ = false

Additional Inherited Members

Protected Attributes inherited from votca::xtp::Region
bool info_ = true
std::string errormsg_ = ""
Index id_ = -1
Logger & log_

Detailed Description

The periodic Ewald background, as a Region.

SKELETON. The region plumbing is complete and correct; the periodic field evaluation is deliberately absent, and every entry point that would need it throws rather than returning a plausible zero. Filling it in is the next step.

This region is unlike the others in three ways, all consequences of the same fact – it represents an environment that was converged once, beforehand, by the ewaldbackground calculator:

  1. Its induced dipoles are FROZEN. Other regions do not polarize it, so InteractwithQMRegion/PolarRegion/StaticRegion genuinely return 0.0. Those are not stubs: "nothing happens" is the correct physics, and the same one-way relationship legacy has, where the background is computed once and the foreground alone re-polarizes.
  2. It is therefore always Converged(), and Reset() does nothing. Including it in a job cannot prevent the inter-region SCF loop from terminating.
  3. It does not own segments carved out of the job's topology. It represents the whole periodic cell, read from the background calculator's own checkpoint, and the segments a polar region holds explicitly are SUPPRESSED from it (see EwaldRealSpaceSum's own foreground documentation) rather than removed from its ownership. size() therefore reports the background's segment count, not a share of the job's segments.

The influence in the other direction – this region acting ON a polar or QM region – is implemented by THAT region's own InteractwithEwaldRegion, following the existing convention in Region::ApplyInfluenceOfOtherRegions, where each region computes the influence of others upon itself.

Definition at line 76 of file ewaldregion.h.

Constructor & Destructor Documentation

◆ EwaldRegion()

votca::xtp::EwaldRegion::EwaldRegion ( Index id,
Logger & log )
inline

Definition at line 78 of file ewaldregion.h.

◆ ~EwaldRegion()

votca::xtp::EwaldRegion::~EwaldRegion ( )
overridedefault

Member Function Documentation

◆ AppendResult()

void votca::xtp::EwaldRegion::AppendResult ( tools::Property & prop) const
overrideprotectedvirtual

Implements votca::xtp::Region.

Definition at line 152 of file ewaldregion.cc.

◆ ApplyFieldTo()

double votca::xtp::EwaldRegion::ApplyFieldTo ( std::vector< PolarSegment > & foreground) const

Definition at line 388 of file ewaldregion.cc.

◆ BuildSums()

void votca::xtp::EwaldRegion::BuildSums ( const std::vector< PolarSegment > & fallback) const
private

Definition at line 239 of file ewaldregion.cc.

◆ charge()

double votca::xtp::EwaldRegion::charge ( ) const
overridevirtual

Implements votca::xtp::Region.

Definition at line 83 of file ewaldregion.cc.

◆ CheckForegroundIsSubset()

void votca::xtp::EwaldRegion::CheckForegroundIsSubset ( const std::vector< PolarSegment > & foreground) const
private

Definition at line 204 of file ewaldregion.cc.

◆ Converged()

bool votca::xtp::EwaldRegion::Converged ( ) const
inlineoverridevirtual

Implements votca::xtp::Region.

Definition at line 87 of file ewaldregion.h.

◆ Etotal()

double votca::xtp::EwaldRegion::Etotal ( ) const
overridevirtual

Implements votca::xtp::Region.

Definition at line 99 of file ewaldregion.cc.

◆ Evaluate()

void votca::xtp::EwaldRegion::Evaluate ( std::vector< std::unique_ptr< Region > > & regions)
overridevirtual

Implements votca::xtp::Region.

Definition at line 69 of file ewaldregion.cc.

◆ identify()

std::string votca::xtp::EwaldRegion::identify ( ) const
inlineoverridevirtual

Implements votca::xtp::Region.

Definition at line 81 of file ewaldregion.h.

◆ Initialize()

void votca::xtp::EwaldRegion::Initialize ( const tools::Property & prop)
overridevirtual

Implements votca::xtp::Region.

Definition at line 49 of file ewaldregion.cc.

◆ InteractwithEwaldRegion()

double votca::xtp::EwaldRegion::InteractwithEwaldRegion ( const EwaldRegion & )
inlineoverrideprotectedvirtual

Implements votca::xtp::Region.

Definition at line 115 of file ewaldregion.h.

◆ InteractwithPolarRegion()

double votca::xtp::EwaldRegion::InteractwithPolarRegion ( const PolarRegion & )
inlineoverrideprotectedvirtual

Implements votca::xtp::Region.

Definition at line 113 of file ewaldregion.h.

◆ InteractwithQMRegion()

double votca::xtp::EwaldRegion::InteractwithQMRegion ( const QMRegion & )
inlineoverrideprotectedvirtual

Implements votca::xtp::Region.

Definition at line 112 of file ewaldregion.h.

◆ InteractwithStaticRegion()

double votca::xtp::EwaldRegion::InteractwithStaticRegion ( const StaticRegion & )
inlineoverrideprotectedvirtual

Implements votca::xtp::Region.

Definition at line 114 of file ewaldregion.h.

◆ Parameters()

const EwaldParameters & votca::xtp::EwaldRegion::Parameters ( ) const
inline

Definition at line 125 of file ewaldregion.h.

◆ PotentialAt()

Eigen::VectorXd votca::xtp::EwaldRegion::PotentialAt ( const std::vector< Eigen::Vector3d > & points) const

Definition at line 322 of file ewaldregion.cc.

◆ ReadFromCpt()

void votca::xtp::EwaldRegion::ReadFromCpt ( CheckpointReader & r)
overridevirtual

Implements votca::xtp::Region.

Definition at line 121 of file ewaldregion.cc.

◆ RegisterForeground()

void votca::xtp::EwaldRegion::RegisterForeground ( const std::vector< std::pair< Index, Eigen::Vector3d > > & foreground)

Definition at line 175 of file ewaldregion.cc.

◆ Registry()

const EwaldRegistry & votca::xtp::EwaldRegion::Registry ( ) const
inline

Definition at line 120 of file ewaldregion.h.

◆ Reset()

void votca::xtp::EwaldRegion::Reset ( )
inlineoverridevirtual

Implements votca::xtp::Region.

Definition at line 92 of file ewaldregion.h.

◆ size()

Index votca::xtp::EwaldRegion::size ( ) const
overridevirtual

Implements votca::xtp::Region.

Definition at line 77 of file ewaldregion.cc.

◆ WritePDB()

void votca::xtp::EwaldRegion::WritePDB ( csg::PDBWriter & writer) const
overridevirtual

Implements votca::xtp::Region.

Definition at line 146 of file ewaldregion.cc.

◆ WriteToCpt()

void votca::xtp::EwaldRegion::WriteToCpt ( CheckpointWriter & w) const
overridevirtual

Implements votca::xtp::Region.

Definition at line 112 of file ewaldregion.cc.

Member Data Documentation

◆ built_foreground_

std::vector<std::pair<Index, Eigen::Vector3d> > votca::xtp::EwaldRegion::built_foreground_
mutableprivate

Definition at line 235 of file ewaldregion.h.

◆ checkpoint_file_

std::string votca::xtp::EwaldRegion::checkpoint_file_
private

Definition at line 241 of file ewaldregion.h.

◆ foreground_copies_

std::vector<std::pair<Index, Eigen::Vector3d> > votca::xtp::EwaldRegion::foreground_copies_
mutableprivate

Definition at line 229 of file ewaldregion.h.

◆ interactor_

std::unique_ptr<EwaldRealSpaceInteractor> votca::xtp::EwaldRegion::interactor_
mutableprivate

Definition at line 225 of file ewaldregion.h.

◆ loaded_

bool votca::xtp::EwaldRegion::loaded_ = false
private

Definition at line 244 of file ewaldregion.h.

◆ params_

EwaldParameters votca::xtp::EwaldRegion::params_
private

Definition at line 243 of file ewaldregion.h.

◆ real_sum_

std::unique_ptr<EwaldRealSpaceSum> votca::xtp::EwaldRegion::real_sum_
mutableprivate

Definition at line 222 of file ewaldregion.h.

◆ recip_sum_

std::unique_ptr<EwaldReciprocalSpaceSum> votca::xtp::EwaldRegion::recip_sum_
mutableprivate

Definition at line 223 of file ewaldregion.h.

◆ registered_foreground_

std::vector<std::pair<Index, Eigen::Vector3d> > votca::xtp::EwaldRegion::registered_foreground_
private

Definition at line 238 of file ewaldregion.h.

◆ registry_

EwaldRegistry votca::xtp::EwaldRegion::registry_
private

Definition at line 242 of file ewaldregion.h.

◆ shape_

std::unique_ptr<EwaldShapeCorrection> votca::xtp::EwaldRegion::shape_
mutableprivate

Definition at line 224 of file ewaldregion.h.

◆ warned_no_energy_

bool votca::xtp::EwaldRegion::warned_no_energy_ = false
mutableprivate

Definition at line 239 of file ewaldregion.h.


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