Loading...
Searching...
No Matches
gpr::AtomsConfiguration Struct Reference

Stores configurations of all atoms in the system. More...

#include <structures/Structures.h>

Public Member Functions

void seedNearestNeighbourFromActive ()
 Seed the fixed-N nearest-neighbour set from the current active (radius-activated) frozen count. Call once after the initial radius activation. No-op unless nn_auto is set and neither an explicit nn_frozen nor eviction was requested, and when there are no active frozen atoms (molecular systems).
void assignFromField (const FieldMatrixd &field)
 Extract data from a 5-column field.
void clear ()
void clearDistribution ()
void copy (const AtomsConfiguration &other)
Index_t countMovingAtoms ()

Public Attributes

Coord positions
 Positions of all atoms in the system.
FieldMatrixU8 is_frozen
 Indicates whether atom is frozen or not.
FieldMatrixIdx id
 ID of each atom (we do not use it).
FieldMatrixi atomicNrs
 Atomic Number of each atom.
Eigen::VectorXd atomic_masses
 Per-atom input masses; empty selects unit masses.
FieldMatrixIdx type
 Type of each atom.
AtomsPositionAndType atoms_froz_active
 Info on active frozen atoms.
AtomsPositionAndType atoms_froz_inactive
 Info on inactive frozen atoms.
AtomsPositionAndType atoms_mov
 Info on moving atoms.
FieldMatrixi pairtype
Index_t n_pt = 0
std::vector< Index_t > pair_type_parent
Index_t n_base_pt = 0
 Number of base pair types (0: none).
double cell [9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.}
double pair_cutoff = 0.0
double pair_cutoff_width = 0.0
bool evict_frozen = false
Index_t nn_frozen = 0
bool nn_auto = true

Detailed Description

Stores configurations of all atoms in the system.

Definition at line 832 of file Structures.h.

Member Function Documentation

◆ assignFromField()

void gpr::AtomsConfiguration::assignFromField ( const FieldMatrixd & field)
inline

Extract data from a 5-column field.

Definition at line 902 of file Structures.h.

903 {
904#ifndef NDEBUG
905 assertMsg(field.size() != 0, "The reference field cannot be empty!");
906 assertMsg(field.cols() >= 5,
907 "The reference field should have 5 or more columns!");
908#endif
909
910 Index_t counter = 0;
911
912 positions.resize(1, 3 * field.rows());
913 positions.setZero();
914 is_frozen.resize(1, field.rows());
915 is_frozen.setZero();
916 id.resize(1, field.rows());
917 id.setZero();
918
919 for (Eigen::Index i = 0; i < field.rows(); ++i) {
920 for (Eigen::Index j = 0; j < 3; ++j) {
921 *(positions.data() + counter++) = field(i, j);
922 }
923 if (field(i, 3) == 0)
924 *(is_frozen.data() + i) = MOVING_ATOM;
925 else
926 *(is_frozen.data() + i) = FROZEN_ATOM;
927 *(id.data() + i) = static_cast<Index_t>(field(i, 4));
928 }
929 }
@ FROZEN_ATOM
Definition Enums.h:36
@ MOVING_ATOM
Definition Enums.h:35
#define assertMsg(expression, msg)
uint32_t Index_t
Definition Macros.h:17
FieldMatrixU8 is_frozen
Indicates whether atom is frozen or not.
Definition Structures.h:834
Coord positions
Positions of all atoms in the system.
Definition Structures.h:833

◆ clear()

void gpr::AtomsConfiguration::clear ( )
inline

Definition at line 931 of file Structures.h.

932 {
933 positions.resize(0, 0);
934 is_frozen.resize(0, 0);
935 id.resize(0, 0);
936 atomicNrs.resize(0, 0);
937 atomic_masses.resize(0);
938 type.resize(0, 0);
939 atoms_froz_active.clear();
940 atoms_froz_inactive.clear();
941 atoms_mov.clear();
942 pairtype.resize(0, 0);
943 n_pt = 0;
944 for (int i = 0; i < 9; ++i)
945 cell[i] = 0.0;
946 pair_cutoff = 0.0;
947 pair_cutoff_width = 0.0;
948 }
FieldMatrixi atomicNrs
Atomic Number of each atom.
Definition Structures.h:836
AtomsPositionAndType atoms_froz_inactive
Info on inactive frozen atoms.
Definition Structures.h:843
AtomsPositionAndType atoms_froz_active
Info on active frozen atoms.
Definition Structures.h:841
AtomsPositionAndType atoms_mov
Info on moving atoms.
Definition Structures.h:844
FieldMatrixIdx type
Type of each atom.
Definition Structures.h:839
Eigen::VectorXd atomic_masses
Per-atom input masses; empty selects unit masses.
Definition Structures.h:838

◆ clearDistribution()

void gpr::AtomsConfiguration::clearDistribution ( )
inline

Definition at line 950 of file Structures.h.

951 {
952 atoms_froz_active.clear();
953 atoms_froz_inactive.clear();
954 atoms_mov.clear();
955 pairtype.resize(0, 0);
956 n_pt = 0;
957 }

◆ copy()

void gpr::AtomsConfiguration::copy ( const AtomsConfiguration & other)
inline

Definition at line 959 of file Structures.h.

960 {
961 *this = other;
962 }

◆ countMovingAtoms()

Index_t gpr::AtomsConfiguration::countMovingAtoms ( )
inline

Definition at line 964 of file Structures.h.

965 {
966 Index_t count = 0;
967 for (Eigen::Index i = 0; i < is_frozen.size(); ++i) {
968 if (*(is_frozen.data() + i) == MOVING_ATOM) ++count;
969 }
970 return count;
971 }

◆ seedNearestNeighbourFromActive()

void gpr::AtomsConfiguration::seedNearestNeighbourFromActive ( )
inline

Seed the fixed-N nearest-neighbour set from the current active (radius-activated) frozen count. Call once after the initial radius activation. No-op unless nn_auto is set and neither an explicit nn_frozen nor eviction was requested, and when there are no active frozen atoms (molecular systems).

Definition at line 890 of file Structures.h.

891 {
892 if (nn_auto && nn_frozen == 0 && !evict_frozen) {
893 const Index_t n =
894 static_cast<Index_t>(atoms_froz_active.positions.cols() / 3);
895 if (n > 0) nn_frozen = n;
896 }
897 }

Member Data Documentation

◆ atomic_masses

Eigen::VectorXd gpr::AtomsConfiguration::atomic_masses

Per-atom input masses; empty selects unit masses.

Definition at line 838 of file Structures.h.

◆ atomicNrs

FieldMatrixi gpr::AtomsConfiguration::atomicNrs

Atomic Number of each atom.

Definition at line 836 of file Structures.h.

◆ atoms_froz_active

AtomsPositionAndType gpr::AtomsConfiguration::atoms_froz_active

Info on active frozen atoms.

Definition at line 841 of file Structures.h.

◆ atoms_froz_inactive

AtomsPositionAndType gpr::AtomsConfiguration::atoms_froz_inactive

Info on inactive frozen atoms.

Definition at line 843 of file Structures.h.

◆ atoms_mov

AtomsPositionAndType gpr::AtomsConfiguration::atoms_mov

Info on moving atoms.

Definition at line 844 of file Structures.h.

◆ cell

double gpr::AtomsConfiguration::cell[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.}

Zero retains the unbounded inverse-distance kernel. Positive values use a C2 switching shell; zero width selects min(1 A, cutoff / 5).

Definition at line 861 of file Structures.h.

861{0., 0., 0., 0., 0., 0., 0., 0., 0.};

◆ evict_frozen

bool gpr::AtomsConfiguration::evict_frozen = false

Definition at line 873 of file Structures.h.

◆ id

FieldMatrixIdx gpr::AtomsConfiguration::id

ID of each atom (we do not use it).

Definition at line 835 of file Structures.h.

◆ is_frozen

FieldMatrixU8 gpr::AtomsConfiguration::is_frozen

Indicates whether atom is frozen or not.

Definition at line 834 of file Structures.h.

◆ n_base_pt

Index_t gpr::AtomsConfiguration::n_base_pt = 0

Number of base pair types (0: none).

ASE-style 3x3 cell, row-major lattice vectors a, b, c. All zeros is an isolated molecule: Sexpat pair vectors stay on the Cartesian difference. A nonzero cell wraps through the LODE minimage mi_* ABI.

Definition at line 855 of file Structures.h.

◆ n_pt

Index_t gpr::AtomsConfiguration::n_pt = 0

Number of active pairtypes Base pair type of every pair type when the pair types refine a coarser typing (environment sub-types of the element-and-role types); empty when every pair type stands on its own.

Definition at line 850 of file Structures.h.

◆ nn_auto

bool gpr::AtomsConfiguration::nn_auto = true

Definition at line 881 of file Structures.h.

◆ nn_frozen

Index_t gpr::AtomsConfiguration::nn_frozen = 0

Default policy: after the initial radius activation, fix the active set at that size and maintain it with the nearest-neighbour rule (seeds nn_frozen from the radius-activated count). Set false for the pure radius rule (monotonic, or eviction when evict_frozen). No effect when there are no frozen atoms (the count is zero) or nn_frozen/evict_frozen are set explicitly.

Definition at line 874 of file Structures.h.

◆ pair_cutoff

double gpr::AtomsConfiguration::pair_cutoff = 0.0

Definition at line 865 of file Structures.h.

◆ pair_cutoff_width

double gpr::AtomsConfiguration::pair_cutoff_width = 0.0

Active-frozen-set policy (config options; default monotonic radius). evict_frozen returns active atoms that leave actdist_fro to the inactive set (non-monotonic radius window). nn_frozen, when > 0, keeps the nn_frozen frozen atoms nearest the moving atoms (a fixed-size set) and takes precedence over the radius rule.

Definition at line 866 of file Structures.h.

◆ pair_type_parent

std::vector<Index_t> gpr::AtomsConfiguration::pair_type_parent

Definition at line 854 of file Structures.h.

◆ pairtype

FieldMatrixi gpr::AtomsConfiguration::pairtype

Pairtype indices for pairs of atomtypes (n_at x n_at). Active pairtypes are indexed as 0,1,2,...,n_pt-1. Inactive pairtypes are given index -1.

Definition at line 847 of file Structures.h.

◆ positions

Coord gpr::AtomsConfiguration::positions

Positions of all atoms in the system.

Definition at line 833 of file Structures.h.

◆ type

FieldMatrixIdx gpr::AtomsConfiguration::type

Type of each atom.

Definition at line 839 of file Structures.h.


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