.. index:: pair: class; aux::ProblemSetUp .. _doxid-classaux_1_1_problem_set_up: class aux::ProblemSetUp ======================= .. toctree:: :hidden: Overview ~~~~~~~~ Set up the GP-dimer problem. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ProblemSetUp { public: // construction :target:`ProblemSetUp`(); virtual :target:`~ProblemSetUp`(); // methods bool :ref:`activateFrozenAtoms`(const :ref:`gpr::Coord`& R, const double activation_distance, :ref:`gpr::AtomsConfiguration`& atoms_config); void :ref:`cutOffEnergy`(const :ref:`gpr::FieldMatrixd`& E_reference, :ref:`gpr::FieldMatrixd`& E_R); void :ref:`initializeEnergyAndGradient`(const :ref:`gpr::FieldMatrixd`& E_reference, const :ref:`gpr::AtomsConfiguration`& atoms_config, const :ref:`gpr::vector3_reg`(&) system_size[3], :ref:`gpr::Observation`& middle_point, :ref:`pot::PotentialWrapper`& general_potential, :ref:`gpr::Index_t`& num_of_calls); void :ref:`calculateGeneralPotential`(const :ref:`gpr::AtomsConfiguration`& atoms_config, const :ref:`gpr::vector3_reg`(&) cell_dimensions[3], :ref:`gpr::Observation`& mid_point, :ref:`pot::PotentialWrapper`& general_potential, :ref:`gpr::Index_t`& num_of_calls, Eigen::Index batch_chunk = 0); void :ref:`updateConf`(const :ref:`gpr::Coord`& unfreezed_atoms, const :ref:`gpr::AtomsConfiguration`& atoms_config, :ref:`gpr::Coord`& coord_atom_new); void :ref:`setPairtypeForMovingAtoms`(const :ref:`gpr::FieldMatrixIdx`& atomtype_mov, :ref:`gpr::Index_t`& n_pt, :ref:`gpr::FieldMatrixi`& pairtype); void :ref:`removeDuplicatedAtoms`(const :ref:`gpr::AtomsPositionAndType`& moving_atoms, :ref:`gpr::AtomsPositionAndType`& active_atoms, :ref:`gpr::AtomsPositionAndType`& inactive_atoms); }; .. _details-classaux_1_1_problem_set_up: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Set up the GP-dimer problem. Methods ------- .. index:: pair: function; activateFrozenAtoms .. _doxid-classaux_1_1_problem_set_up_1a896f3d8032eb8705114e404a5511472c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool activateFrozenAtoms(const :ref:`gpr::Coord`& R, const double activation_distance, :ref:`gpr::AtomsConfiguration`& atoms_config) Update the active frozen-atom set for one or more configurations. If ``nn_frozen`` is positive, the active set contains the nearest ``nn_frozen`` atoms selected from the active and inactive frozen atoms, measured against every configuration in ``R``. Otherwise, inactive atoms within ``activation_distance`` are activated; a nonpositive distance activates all inactive atoms. When ``evict_frozen`` is enabled, active atoms outside a positive activation radius return to the inactive set. Radius and nearest-neighbour distances use the configured periodic cell. Pair-type indices are added when the active set introduces a new pair. Frozen atoms that coincide with moving atoms are removed from the frozen sets. The active set is rebuilt only when its membership changes, preserving feature order otherwise. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - Configurations with one row per geometry. Each row may contain moving-atom coordinates only or the full frame; frozen coordinates in a full-frame row do not participate in selection. * - activation_distance - Radius for activating and, when enabled, evicting frozen atoms. * - atoms_config - Structure and active/inactive atom sets used by the GP model. .. rubric:: Returns: True if the active frozen-atom membership changes; false otherwise. .. index:: pair: function; cutOffEnergy .. _doxid-classaux_1_1_problem_set_up_1ae9c3429518da1b3572df25142ebbac10: .. ref-code-block:: cpp :class: doxyrest-title-code-block void cutOffEnergy(const :ref:`gpr::FieldMatrixd`& E_reference, :ref:`gpr::FieldMatrixd`& E_R) Subtract reference energy value from *E_R*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - E_reference - A field with the reference enerfy * - E_R - In/out energy field .. index:: pair: function; initializeEnergyAndGradient .. _doxid-classaux_1_1_problem_set_up_1ab909264246cdac8b2d7b414cb75b157e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initializeEnergyAndGradient(const :ref:`gpr::FieldMatrixd`& E_reference, const :ref:`gpr::AtomsConfiguration`& atoms_config, const :ref:`gpr::vector3_reg`(&) system_size[3], :ref:`gpr::Observation`& middle_point, :ref:`pot::PotentialWrapper`& general_potential, :ref:`gpr::Index_t`& num_of_calls) Initialize energy and gradient. .. index:: pair: function; calculateGeneralPotential .. _doxid-classaux_1_1_problem_set_up_1aa897e81d1a3151f4cde25220f7e5821f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateGeneralPotential(const :ref:`gpr::AtomsConfiguration`& atoms_config, const :ref:`gpr::vector3_reg`(&) cell_dimensions[3], :ref:`gpr::Observation`& mid_point, :ref:`pot::PotentialWrapper`& general_potential, :ref:`gpr::Index_t`& num_of_calls, Eigen::Index batch_chunk = 0) 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,...]. Images are shared out over the MPI ranks by a layout-independent owner map, each rank evaluates its images in one call through the potential's batch surface where it has one, a failure on any rank reaches every rank before the values are exchanged, and every rank holds the same energies and gradients afterwards. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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_calls - Number of calls for the general potential * - batch_chunk - Oracle batch chunk (:ref:`pot::OracleBatchLayout::chunk `): 0 evaluates every image a rank owns in one call, K cuts the images into contiguous chunks of K .. index:: pair: function; updateConf .. _doxid-classaux_1_1_problem_set_up_1a1e46f6454c0478bbefd985192d112cb9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void updateConf(const :ref:`gpr::Coord`& unfreezed_atoms, const :ref:`gpr::AtomsConfiguration`& atoms_config, :ref:`gpr::Coord`& coord_atom_new) Update an atomic configuration with new coordinates for the unfreezed atoms. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - unfreezed_atoms - The coordinates of the unfreezed atoms * - atoms_config - The initial configuration of atoms. * - coord_atom_new - The new coordinates of all atoms. .. index:: pair: function; setPairtypeForMovingAtoms .. _doxid-classaux_1_1_problem_set_up_1af83c0cf0db4f01273be4e9af6ced7706: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPairtypeForMovingAtoms(const :ref:`gpr::FieldMatrixIdx`& atomtype_mov, :ref:`gpr::Index_t`& n_pt, :ref:`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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 .. index:: pair: function; removeDuplicatedAtoms .. _doxid-classaux_1_1_problem_set_up_1a0e7edddc45c98f4907004b4537571622: .. ref-code-block:: cpp :class: doxyrest-title-code-block void removeDuplicatedAtoms(const :ref:`gpr::AtomsPositionAndType`& moving_atoms, :ref:`gpr::AtomsPositionAndType`& active_atoms, :ref:`gpr::AtomsPositionAndType`& inactive_atoms) Remove clones of the moving atoms from the set of inactive frozen atoms.