kim-api
2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
|
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUTINE_NAME::Compute routine. More...
#include <KIM_ModelComputeArguments.hpp>
Public Member Functions | |
int | GetNeighborList (int const neighborListIndex, int const particleNumber, int *const numberOfNeighbors, int const **const neighborsOfParticle) const |
Get the neighbor list for a particle of interest corresponding to a particular neighbor list cutoff distance. More... | |
int | ProcessDEDrTerm (double const de, double const r, double const *const dx, int const i, int const j) const |
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine. More... | |
int | ProcessD2EDr2Term (double const de, double const *const r, double const *const dx, int const *const i, int const *const j) const |
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine. More... | |
int | GetArgumentPointer (ComputeArgumentName const computeArgumentName, int const **const ptr) const |
Get the data pointer for a ComputeArgumentName. More... | |
int | GetArgumentPointer (ComputeArgumentName const computeArgumentName, int **const ptr) const |
int | GetArgumentPointer (ComputeArgumentName const computeArgumentName, double const **const ptr) const |
int | GetArgumentPointer (ComputeArgumentName const computeArgumentName, double **const ptr) const |
int | IsCallbackPresent (ComputeCallbackName const computeCallbackName, int *const present) const |
Determine if the Simulator has provided a non-NULL function pointer for a ComputeCallbackName of interest. More... | |
void | SetModelBufferPointer (void *const ptr) |
Set the Model's buffer pointer within the ComputeArguments object. More... | |
void | GetModelBufferPointer (void **const ptr) const |
Get the Model's buffer pointer within the ComputeArguments object. More... | |
void | LogEntry (LogVerbosity const logVerbosity, std::string const &message, int const lineNumber, std::string const &fileName) const |
Write a log entry into the log file. More... | |
void | LogEntry (LogVerbosity const logVerbosity, std::stringstream const &message, int const lineNumber, std::string const &fileName) const |
std::string const & | ToString () const |
Get a string representing the internal state of the ComputeArguments object. More... | |
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUTINE_NAME::Compute routine.
Definition at line 53 of file KIM_ModelComputeArguments.hpp.
int KIM::ModelComputeArguments::GetArgumentPointer | ( | ComputeArgumentName const | computeArgumentName, |
int const **const | ptr | ||
) | const |
Get the data pointer for a ComputeArgumentName.
[in] | computeArgumentName | The ComputeArgumentName of interest. |
[out] | ptr | The data pointer. |
true
if computeArgumentName
is unknown. true
if computeArgumentName == SUPPORT_STATUS::notSupported
. false
otherwise.int KIM::ModelComputeArguments::GetArgumentPointer | ( | ComputeArgumentName const | computeArgumentName, |
int **const | ptr | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int KIM::ModelComputeArguments::GetArgumentPointer | ( | ComputeArgumentName const | computeArgumentName, |
double const **const | ptr | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int KIM::ModelComputeArguments::GetArgumentPointer | ( | ComputeArgumentName const | computeArgumentName, |
double **const | ptr | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void KIM::ModelComputeArguments::GetModelBufferPointer | ( | void **const | ptr | ) | const |
Get the Model's buffer pointer within the ComputeArguments object.
The model buffer pointer may be used by the Model to associate a memory buffer with the ComputeArguments object.
[out] | ptr | The model buffer data pointer. |
ptr == NULL
if the model has not previously called ModelComputeArguments::SetModelBufferPointer.int KIM::ModelComputeArguments::GetNeighborList | ( | int const | neighborListIndex, |
int const | particleNumber, | ||
int *const | numberOfNeighbors, | ||
int const **const | neighborsOfParticle | ||
) | const |
Get the neighbor list for a particle of interest corresponding to a particular neighbor list cutoff distance.
[in] | neighborListIndex | Zero-based index corresponding to the desired neighbor list cutoff distance. |
[in] | particleNumber | Particle number (using the Model's Numbering, as specified in the call to ModelCreate::SetModelNumbering or ModelDriverCreate::SetModelNumbering) for the particle of interest. |
[out] | numberOfNeighbors | Number of neighbor particles in the list. |
[out] | neighborsOfParticle | Pointer to array of particle neighbor numbers (using the Model's Numbering). |
true
if neighborListIndex
is invalid. true
if particleNumber
is invalid. true
if the Simulator's COMPUTE_CALLBACK_NAME::GetNeighborList routine returns true
. false
otherwise.int KIM::ModelComputeArguments::IsCallbackPresent | ( | ComputeCallbackName const | computeCallbackName, |
int *const | present | ||
) | const |
Determine if the Simulator has provided a non-NULL function pointer for a ComputeCallbackName of interest.
[in] | computeCallbackName | The ComputeCallbackName of interest. |
[out] | present | Is true if the callback's function pointer is non-NULL, and is false otherwise. |
true
if computeArgumentName
is unknown. true
if computeArguemntName
is SUPPORT_STATUS::notSupported. false
otherwise.present
is unchanged in an error occurs.void KIM::ModelComputeArguments::LogEntry | ( | LogVerbosity const | logVerbosity, |
std::string const & | message, | ||
int const | lineNumber, | ||
std::string const & | fileName | ||
) | const |
Write a log entry into the log file.
This results in a no-op if logVerbosity
is LOG_VERBOSITY::silent or if logVerbosity
is greater-than the Log object's top LogVerbosity on its stack.
[in] | logVerbosity | The LogVerbosity level for the entry. |
[in] | message | The body text of the log entry. |
[in] | lineNumber | The source code file line number. |
[in] | fileName | The source code file name. |
void KIM::ModelComputeArguments::LogEntry | ( | LogVerbosity const | logVerbosity, |
std::stringstream const & | message, | ||
int const | lineNumber, | ||
std::string const & | fileName | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int KIM::ModelComputeArguments::ProcessD2EDr2Term | ( | double const | de, |
double const *const | r, | ||
double const *const | dx, | ||
int const *const | i, | ||
int const *const | j | ||
) | const |
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine.
[in] | de | Value of D2EDr2 for particle pairs. |
[in] | r | Array of particle pair distances. |
[in] | dx | Array of particle pair relative position vectors. |
[in] | i | Array of particle numbers (using the Model's Numbering, as specified in the call to ModelCreate::SetModelNumbering or ModelDriverCreate::SetModelNumbering) for first particle in each pair. |
[in] | j | Array of particle numbers (using the Model's Numbering) for second particle in each pair. |
true
if the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine returns true
. false
otherwise.int KIM::ModelComputeArguments::ProcessDEDrTerm | ( | double const | de, |
double const | r, | ||
double const *const | dx, | ||
int const | i, | ||
int const | j | ||
) | const |
Call the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine.
[in] | de | Value of DEDr for particle pair. |
[in] | r | Value of particle pair distance, \( \|\mathbf{r}^{(ij)}\|\), where \(\mathbf{r}^{(ij)} \equiv \mathbf{r}^{(j)} - \mathbf{r}^{(i)}\) (see the Theory for the Portable Model Interface section). |
[in] | dx | Value of particle pair relative position vector, \(\mathbf{r}^{(ij)}\). |
[in] | i | Particle number (using the Model's Numbering, as specified in the call to ModelCreate::SetModelNumbering or ModelDriverCreate::SetModelNumbering) for first particle in pair. |
[in] | j | Particle number (using the Model's Numbering) for second particle in pair. |
true
if the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine returns true
. false
otherwise.void KIM::ModelComputeArguments::SetModelBufferPointer | ( | void *const | ptr | ) |
Set the Model's buffer pointer within the ComputeArguments object.
The model buffer pointer may be used by the model to associate a memory buffer with the ComputeArguments object.
[in] | ptr | The model buffer data pointer. |
std::string const& KIM::ModelComputeArguments::ToString | ( | ) | const |
Get a string representing the internal state of the ComputeArguments object.
This string is primarily meant for use as a debugging tool. The string may be quite long. It begins and ends with lines consisting only of ='s
.