2#ifndef STORMM_LOCAL_EXCLUSIONMASK_H
3#define STORMM_LOCAL_EXCLUSIONMASK_H
6#include "Accelerator/hybrid.h"
7#include "DataTypes/common_types.h"
8#include "DataTypes/stormm_vector_types.h"
9#include "Math/formulas.h"
10#include "Synthesis/atomgraph_synthesis.h"
11#include "Topology/atomgraph.h"
12#include "Topology/atomgraph_abstracts.h"
13#include "energy_enumerators.h"
19using card::HybridTargetLevel;
21using synthesis::AtomGraphSynthesis;
22using topology::AtomGraph;
23using topology::ChemicalDetailsKit;
24using topology::NonbondedKit;
29static const ullint lmask_mode_a = 0x0LLU;
30static const ullint lmask_mode_b = 0x2000000000000000LLU;
31static const ullint lmask_mode_c = 0x4000000000000000LLU;
32static const ullint lmask_mode_d = 0x6000000000000000LLU;
33static const ullint lmask_mode_e = 0x8000000000000000LLU;
34static const ullint lmask_mode_f = 0xa000000000000000LLU;
39static const ullint lmask_mode_bitmask = 0xe000000000000000LLU;
40static const ullint lmask_a_excl = 0x1fffffffffffffffLLU;
41static const ullint lmask_b_excl = 0x000000007fffffffLLU;
42static const ullint lmask_b_lower_mask = 0x000001ff80000000LLU;
43static const ullint lmask_b_upper_mask = 0x0007fe0000000000LLU;
44static const ullint lmask_b_lower_shft = 0x00f8000000000000LLU;
45static const ullint lmask_b_upper_shft = 0x1f00000000000000LLU;
46static const ullint lmask_c_excl = 0x000000007fffffffLLU;
47static const ullint lmask_c_alt_mask = 0x00001fff80000000LLU;
48static const ullint lmask_c_shft = 0x1fffe00000000000LLU;
49static const ullint lmask_d_excl = 0x000000007fffffffLLU;
50static const ullint lmask_d_array_idx = 0x003fffff80000000LLU;
51static const ullint lmask_d_array_cnt = 0x1fc0000000000000LLU;
52static const ullint lmask_e_array_idx = 0x000000ffffffffffLLU;
53static const ullint lmask_e_array_cnt = 0x1fffff0000000000LLU;
54static const ullint lmask_f_idx = 0x000000000000001fLLU;
59static const int lmask_long_local_span = 30;
60static const int lmask_short_local_span = 15;
61static const int lmask_long_pivot_point = lmask_long_local_span + 1;
62static const int lmask_short_pivot_point = lmask_short_local_span + 1;
63static const int lmask_long_extra_span = 14;
64static const int lmask_short_extra_span = 10;
70static const int lmask_mode_bits = 3;
71static const int lmask_b_lower_mask_bits = lmask_short_extra_span;
72static const int lmask_b_upper_mask_bits = lmask_short_extra_span;
73static const int lmask_b_shft_bits = 5;
74static const int lmask_b_max_reach = lmask_short_local_span + 32 +
75 lmask_short_extra_span - 1;
76static const int lmask_c_alt_mask_bits = lmask_long_extra_span;
77static const int lmask_c_shft_bits = 16;
78static const int lmask_d_array_idx_bits = 23;
79static const int lmask_d_array_cnt_bits = 7;
80static const int lmask_e_array_idx_bits = 40;
81static const int lmask_e_array_cnt_bits = 21;
87static const int lmask_mode_pos = (2 * lmask_long_local_span) + 1;
88static const int lmask_b_lower_mask_pos = (2 * lmask_short_local_span) + 1;
89static const int lmask_b_upper_mask_pos = lmask_b_lower_mask_pos + lmask_short_extra_span;
90static const int lmask_b_lower_shft_pos = lmask_b_upper_mask_pos + lmask_short_extra_span;
91static const int lmask_b_upper_shft_pos = lmask_b_lower_shft_pos + lmask_b_shft_bits;
92static const int lmask_c_alt_mask_pos = (2 * lmask_short_local_span) + 1;
93static const int lmask_c_shft_pos = lmask_c_alt_mask_pos + lmask_c_alt_mask_bits;
94static const int lmask_d_array_idx_pos = (2 * lmask_short_local_span) + 1;
95static const int lmask_d_array_cnt_pos = lmask_d_array_idx_pos + lmask_d_array_idx_bits;
96static const int lmask_e_array_cnt_pos = 40;
106 const uint2* aux_masks_in);
214 NonbondedTheme theme_in = NonbondedTheme::ALL);
219 NonbondedTheme theme_in = NonbondedTheme::ALL);
222 NonbondedTheme theme_in = NonbondedTheme::ALL);
254 int getMode(
int atom_index,
int system_index = 0)
const;
263 ullint
getProfile(
int atom_index,
int system_index = 0)
const;
296 bool testExclusion(
int atom_i,
int atom_j,
int system_index)
const;
332 int total_atom_count;
336 NonbondedTheme theme;
340 int mode_a_profile_count;
341 int mode_b_profile_count;
342 int mode_c_profile_count;
343 int mode_d_profile_count;
344 int mode_e_profile_count;
345 int mode_f_profile_count;
384 void validateAtomIndex(
int atom_index,
int system_index = 0,
const char* caller =
nullptr)
const;
385 void validateAtomIndex(
int atom_index,
const char* caller)
const;
390 void countProfileKinds();
409 std::vector<int> extendMasks(
const AtomGraph *ag);
425 NonbondedTheme theme, VdwCombiningRule lj_rule);
431std::string lMaskModeToString(ullint mode);
440void appendLMaskPrintout(std::string *result,
const std::vector<int> &limits, ullint mask);
446std::string lMaskToString(ullint mask);
453bool lMaskFitsModeA(
int atom_index,
const std::vector<int> &excluded_atoms);
458bool lMaskFitsModeB(
int atom_index,
const std::vector<int> &excluded_atoms);
464bool lMaskFitsModeC(
int atom_index,
const std::vector<int> &excluded_atoms);
474bool lMaskFitsModeD(
int atom_index,
const std::vector<int> &excluded_atoms,
475 const std::vector<uint2> &tmp_secondary_masks);
493ullint lMaskCreateProfile(
int atom_index, ullint mode,
const std::vector<int> &excluded_atoms);
495std::vector<uint2> lMaskCreateProfile(
int atom_index, ullint mode,
496 const std::vector<int> &excluded_atoms, ullint *t_profile);
517void setProfile(
int pos, ullint tprof, std::vector<int> *profile_indices,
518 std::vector<ullint> *tmp_profiles);
520void setProfile(
int pos, ullint tprof, ullint mode,
521 const std::vector<uint2> &tprof_secondary_masks, std::vector<int> *profile_indices,
522 std::vector<ullint> *tmp_profiles, std::vector<uint2> *tmp_secondary_masks);
535bool evaluateLocalMask(
int atom_i,
int atom_j, ullint prof,
const uint2* secondary_ptr);
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
LocalExclusionMask(const LocalExclusionMask &original)=default
The default copy and move constructors as well as the copy and move assignment operator will suffice ...
LocalExclusionMaskReader data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the abstract for the object.
Definition local_exclusionmask.cpp:198
int getAtomCount() const
Get the number of atoms in the system.
Definition local_exclusionmask.cpp:75
size_t getSecondaryMaskCount() const
Get the number of secondary masks.
Definition local_exclusionmask.cpp:117
int getProfileCount() const
Get the number of unique profiles.
Definition local_exclusionmask.cpp:80
const AtomGraph * getTopologyPointer() const
Get a pointer to the topology associated with this object.
const AtomGraphSynthesis * getTopologySynthesisPointer() const
Get a pointer to the topology synthesis associated with this object.
const Hybrid< uint2 > getSecondaryMaskView(int atom_index, int system_index=0)
Get a POINTER-kind Hybrid object for viewing all secondary masks associated with an atom....
Definition local_exclusionmask.cpp:129
ullint getProfile(int atom_index, int system_index=0) const
Get the exclusion profile for an atom.
Definition local_exclusionmask.cpp:122
bool testExclusion(int atom_i, int atom_j) const
Return TRUE if two atoms in the same molecular system share an excluded interaction and FALSE if they...
Definition local_exclusionmask.cpp:172
void setTopology(const AtomGraph *ag_in)
Set (or reset) the topology for the object. All exclusion masks and profiles will be rebuilt if the t...
Definition local_exclusionmask.cpp:220
LocalExclusionMask(const AtomGraph *ag_in=nullptr, NonbondedTheme theme_in=NonbondedTheme::ALL)
Constructor requires a topology, and creates a blank object if nullptr is supplied.
Definition local_exclusionmask.cpp:31
int getMode(int atom_index, int system_index=0) const
Get the profile mode used by a particular atom as a positive integer.
Definition local_exclusionmask.cpp:107
std::vector< uint2 > getSecondaryMasks(int atom_index, int system_index=0) const
Get a copy of all secondary masks associated with an atom. Descriptions of parameters follow from get...
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
Definition stormm_vector_types.h:40
A lean, read-only abstract for the LocalExclusionMask class.
Definition local_exclusionmask.h:100
const uint2 * aux_masks
Definition local_exclusionmask.h:121
const int * prof_idx
Profile indices of each atom.
Definition local_exclusionmask.h:118
const ullint * profiles
Definition local_exclusionmask.h:119
LocalExclusionMaskReader(const int *prof_idx_in, const ullint *profiles_in, const uint2 *aux_masks_in)
The constructor for this and other abstracts takes input arguments for each member variable....
Definition local_exclusionmask.cpp:24
LocalExclusionMaskReader(const LocalExclusionMaskReader &original)=default
As with other abstracts, the copy and move constructors are valid and can be taken in their default f...
Information on atoms and residues which may be useful for applying atom masks or identifying specific...
Definition atomgraph_abstracts.h:382
Information needed for non-bonded real-space calculations. Templating is used as above,...
Definition atomgraph_abstracts.h:287