class aux::ProblemSetUp

Overview

Set up the GP-dimer problem. More…

#include <ProblemSetUp.h>
 
class ProblemSetUp {
public:
    // construction
 
    ProblemSetUp();
    virtual ~ProblemSetUp();
 
    // methods
 
    bool activateFrozenAtoms(const gpr::Coord& R, const double activation_distance, gpr::AtomsConfiguration& atoms_config);
    void cutOffEnergy(const gpr::FieldMatrixd& E_reference, gpr::FieldMatrixd& E_R);
    void initializeEnergyAndGradient(const gpr::FieldMatrixd& E_reference, const gpr::AtomsConfiguration& atoms_config, const gpr::vector3_reg(&) system_size[3], gpr::Observation& middle_point, pot::PotentialWrapper& general_potential, gpr::Index_t& num_of_calls);
    void calculateGeneralPotential(const gpr::AtomsConfiguration& atoms_config, const gpr::vector3_reg(&) cell_dimensions[3], gpr::Observation& mid_point, pot::PotentialWrapper& general_potential, gpr::Index_t& num_of_calls);
    void updateConf(const gpr::Coord& unfreezed_atoms, const gpr::AtomsConfiguration& atoms_config, gpr::Coord& coord_atom_new);
    void setPairtypeForMovingAtoms(const gpr::FieldMatrixIdx& atomtype_mov, gpr::Index_t& n_pt, gpr::FieldMatrixi& pairtype);
    void removeDuplicatedAtoms(const gpr::AtomsPositionAndType& moving_atoms, gpr::AtomsPositionAndType& active_atoms, gpr::AtomsPositionAndType& inactive_atoms);
};

Detailed Documentation

Set up the GP-dimer problem.

Methods

bool activateFrozenAtoms(const gpr::Coord& R, const double activation_distance, gpr::AtomsConfiguration& atoms_config)

Activate inactive frozen atoms within the given radius.

Activates inactive frozen atoms within the radius actdist_fro from some moving atom in configurations R_new. These frozen atoms are then taken into account in the covariance function.

When a frozen atoms is activated, its coordinates and atomtype index are added to conf_info.conf_fro and conf_info.atomtype_fro, respectively, and removed from conf_info_inactive.conf_fro and conf_info_inactive.atomtype_fro. If the new frozen atom activates new pairtypes, also conf_info.pairtype and conf_info.n_pt are updated.

Parameters:

R

Coordinates of moving atoms

activation_distance

Activation distance for moving+frozen atom pairs (pass a negative value if you want to activate all atoms)

atoms_config

Structure including information about the configurations necessary for the GP model

Returns:

True if new active frozen atoms included, False if not

void cutOffEnergy(const gpr::FieldMatrixd& E_reference, gpr::FieldMatrixd& E_R)

Subtract reference energy value from E_R.

Parameters:

E_reference

A field with the reference enerfy

E_R

In/out energy field

void initializeEnergyAndGradient(const gpr::FieldMatrixd& E_reference, const gpr::AtomsConfiguration& atoms_config, const gpr::vector3_reg(&) system_size[3], gpr::Observation& middle_point, pot::PotentialWrapper& general_potential, gpr::Index_t& num_of_calls)

Initialize energy and gradient.

void calculateGeneralPotential(const gpr::AtomsConfiguration& atoms_config, const gpr::vector3_reg(&) cell_dimensions[3], gpr::Observation& mid_point, pot::PotentialWrapper& general_potential, gpr::Index_t& num_of_calls)

Invoke potential calculation.

Each row of ‘R’ represents one configuration including the coordinates of the moving atoms: [x_1,y_1,z_1,x_2,y_2,z_2,…].

Parameters:

atoms_config

Full configuration of the system (i.e. both constrained and unconstrained atoms)

cell_dimensions

Cell dimension

mid_point

Coordinates, energy and gradients of the middle point of the dimer (1 x D)

general_potential

Reference to a type-erased potential wrapper

num_of_gen_potential_calls

Number of calls for general potential

void updateConf(const gpr::Coord& unfreezed_atoms, const gpr::AtomsConfiguration& atoms_config, gpr::Coord& coord_atom_new)

Update an atomic configuration with new coordinates for the unfreezed atoms.

Parameters:

unfreezed_atoms

The coordinates of the unfreezed atoms

atoms_config

The initial configuration of atoms.

coord_atom_new

The new coordinates of all atoms.

void setPairtypeForMovingAtoms(const gpr::FieldMatrixIdx& atomtype_mov, gpr::Index_t& n_pt, gpr::FieldMatrixi& pairtype)

Set pairtype indices for moving+moving atom pairs and gives the updated number of active pairtypes.

The provided n_pt should be equal to the number of active pairtypes before the update.

Parameters:

atomtype_mov

Atomtype indices for moving atoms (1 x N_mov)

pairtype

Pairtype indices for pairs of atomtypes before the update (n_at x n_at)

n_pt

Number of active pairtypes before and after the update

void removeDuplicatedAtoms(const gpr::AtomsPositionAndType& moving_atoms, gpr::AtomsPositionAndType& active_atoms, gpr::AtomsPositionAndType& inactive_atoms)

Remove clones of the moving atoms from the set of inactive frozen atoms.