kim-api  2.3.1-git+v2.3.0-git-2-g378406f9.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Public Member Functions | List of all members
KIM::ModelComputeArguments Class Reference

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...
 

Detailed Description

Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUTINE_NAME::Compute routine.

See also
KIM_ModelComputeArguments, kim_model_compute_arguments_module::kim_model_compute_arguments_handle_type
Since
2.0

Definition at line 53 of file KIM_ModelComputeArguments.hpp.

Member Function Documentation

◆ GetArgumentPointer() [1/4]

int KIM::ModelComputeArguments::GetArgumentPointer ( ComputeArgumentName const  computeArgumentName,
int const **const  ptr 
) const

Get the data pointer for a ComputeArgumentName.

Parameters
[in]computeArgumentNameThe ComputeArgumentName of interest.
[out]ptrThe data pointer.
Returns
true if computeArgumentName is unknown.
true if computeArgumentName == SUPPORT_STATUS::notSupported.
false otherwise.
See also
KIM_ModelComputeArguments_GetArgumentPointerInteger, KIM_ModelComputeArguments_GetArgumentPointerDouble, kim_model_compute_arguments_module::kim_get_argument_pointer
Since
2.0

◆ GetArgumentPointer() [2/4]

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.

◆ GetArgumentPointer() [3/4]

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.

◆ GetArgumentPointer() [4/4]

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.

◆ GetModelBufferPointer()

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.

Parameters
[out]ptrThe model buffer data pointer.
Note
ptr == NULL if the model has not previously called ModelComputeArguments::SetModelBufferPointer.
See also
KIM_ModelComputeArguments_GetModelBufferPointer, kim_model_compute_arguments_module::kim_get_model_buffer_pointer
Since
2.0

◆ GetNeighborList()

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.

Parameters
[in]neighborListIndexZero-based index corresponding to the desired neighbor list cutoff distance.
[in]particleNumberParticle number (using the Model's Numbering, as specified in the call to ModelCreate::SetModelNumbering or ModelDriverCreate::SetModelNumbering) for the particle of interest.
[out]numberOfNeighborsNumber of neighbor particles in the list.
[out]neighborsOfParticlePointer to array of particle neighbor numbers (using the Model's Numbering).
Returns
true if neighborListIndex is invalid.
true if particleNumber is invalid.
true if the Simulator's COMPUTE_CALLBACK_NAME::GetNeighborList routine returns true.
false otherwise.
See also
KIM_ModelComputeArguments_GetNeighborList, kim_model_compute_arguments_module::kim_get_neighbor_list
Since
2.0

◆ IsCallbackPresent()

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.

Parameters
[in]computeCallbackNameThe ComputeCallbackName of interest.
[out]presentIs true if the callback's function pointer is non-NULL, and is false otherwise.
Returns
true if computeArgumentName is unknown.
true if computeArguemntName is SUPPORT_STATUS::notSupported.
false otherwise.
Postcondition
present is unchanged in an error occurs.
See also
KIM_ModelComputeArguments_IsCallbackPresent, kim_model_compute_arguments_module::kim_is_callback_present
Since
2.0

◆ LogEntry() [1/2]

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.

Parameters
[in]logVerbosityThe LogVerbosity level for the entry.
[in]messageThe body text of the log entry.
[in]lineNumberThe source code file line number.
[in]fileNameThe source code file name.
See also
KIM_ModelComputeArguments_LogEntry, kim_model_compute_arguments_module::kim_log_entry
Since
2.0

◆ LogEntry() [2/2]

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.

◆ ProcessD2EDr2Term()

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.

Todo:
Add more detailed description of Process mechanism.
Parameters
[in]deValue of D2EDr2 for particle pairs.
[in]rArray of particle pair distances.
[in]dxArray of particle pair relative position vectors.
[in]iArray 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]jArray of particle numbers (using the Model's Numbering) for second particle in each pair.
Returns
true if the Simulator's COMPUTE_CALLBACK_NAME::ProcessD2EDr2Term routine returns true.
false otherwise.
See also
KIM_ModelComputeArguments_ProcessD2EDr2Term, kim_model_compute_arguments_module::kim_process_d2edr2_term
Since
2.0

◆ ProcessDEDrTerm()

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.

Todo:
Add more detailed description of Process mechanism.
Parameters
[in]deValue of DEDr for particle pair.
[in]rValue 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]dxValue of particle pair relative position vector, \(\mathbf{r}^{(ij)}\).
[in]iParticle number (using the Model's Numbering, as specified in the call to ModelCreate::SetModelNumbering or ModelDriverCreate::SetModelNumbering) for first particle in pair.
[in]jParticle number (using the Model's Numbering) for second particle in pair.
Returns
true if the Simulator's COMPUTE_CALLBACK_NAME::ProcessDEDrTerm routine returns true.
false otherwise.
See also
KIM_ModelComputeArguments_ProcessDEDrTerm, kim_model_compute_arguments_module::kim_process_dedr_term
Since
2.0

◆ SetModelBufferPointer()

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.

Parameters
[in]ptrThe model buffer data pointer.
See also
KIM_ModelComputeArguments_SetModelBufferPointer, kim_model_compute_arguments_module::kim_set_model_buffer_pointer
Since
2.0

◆ ToString()

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.

See also
KIM_ModelComputeArguments_ToString, kim_model_compute_arguments_module::kim_to_string
Since
2.0

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