Loading...
Searching...
No Matches
ProblemSetUp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
5/*
6 * GPDimer.h
7 *
8 * Created on: 24 Sep 2020
9 * Author: Maxim Masterov
10 * Company: SURFSara
11 */
12
13#ifndef GPR_GPDIMER_H_
14#define GPR_GPDIMER_H_
15
16#include <vector>
17
21
22namespace pot {
24}
25
26namespace aux {
27
28// NOTE: tightly coupled with AtomicDimer; was originally GP_Dimer
29
34public:
36 virtual ~ProblemSetUp();
37
64 bool activateFrozenAtoms(const gpr::Coord& R,
65 const double activation_distance,
66 gpr::AtomsConfiguration& atoms_config);
67
74 void cutOffEnergy(const gpr::FieldMatrixd& E_reference,
76
81 const gpr::FieldMatrixd& E_reference,
82 const gpr::AtomsConfiguration& atoms_config,
83 const gpr::vector3_reg (&system_size)[3],
84 gpr::Observation& middle_point,
85 pot::PotentialWrapper& general_potential, gpr::Index_t& num_of_calls);
86
110 void calculateGeneralPotential(const gpr::AtomsConfiguration& atoms_config,
111 const gpr::vector3_reg (&cell_dimensions)[3],
112 gpr::Observation& mid_point,
113 pot::PotentialWrapper& general_potential,
114 gpr::Index_t& num_of_calls,
115 Eigen::Index batch_chunk = 0);
116
125 void updateConf(const gpr::Coord& unfreezed_atoms,
126 const gpr::AtomsConfiguration& atoms_config,
127 gpr::Coord& coord_atom_new);
128
142 void setPairtypeForMovingAtoms(const gpr::FieldMatrixIdx& atomtype_mov,
143 gpr::Index_t& n_pt,
144 gpr::FieldMatrixi& pairtype);
145
150 void removeDuplicatedAtoms(const gpr::AtomsPositionAndType& moving_atoms,
151 gpr::AtomsPositionAndType& active_atoms,
152 gpr::AtomsPositionAndType& inactive_atoms);
153
154private:
155 void eraseClones(const std::vector<gpr::Index_t>& clones,
157};
158
159} /* namespace aux */
160
161#endif /* GPR_GPDIMER_H_ */
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.
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.
virtual ~ProblemSetUp()
bool activateFrozenAtoms(const gpr::Coord &R, const double activation_distance, gpr::AtomsConfiguration &atoms_config)
Update the active frozen-atom set for one or more configurations.
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, Eigen::Index batch_chunk=0)
Invoke potential calculation.
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 cutOffEnergy(const gpr::FieldMatrixd &E_reference, gpr::FieldMatrixd &E_R)
Subtract reference energy value from E_R.
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.
Type-erased wrapper around any potential that provides a force() interface.
Eigen::Vector3d vector3_reg
Definition Macros.h:36
Eigen::Matrix< int, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixi
Definition Macros.h:27
Eigen::Matrix< Index_t, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixIdx
Definition Macros.h:29
FieldMatrixd Coord
Definition Macros.h:35
uint32_t Index_t
Definition Macros.h:17
Eigen::Matrix< double, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixd
Definition Macros.h:25
Potential wrappers and the batched oracle interface.
Stores configurations of all atoms in the system.
Definition Structures.h:832
Structure of atoms positions and types.
Definition Structures.h:810
Observation data: energy, gradient and positions.