kim-api
2.1.1+v2.1.1.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
|
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::Create routine. More...
#include <KIM_ModelDriverCreate.hpp>
Public Member Functions | |
void | GetNumberOfParameterFiles (int *const numberOfParameterFiles) const |
Get the number of parameter files provided by the parameterized model. More... | |
int | GetParameterFileName (int const index, std::string const **const parameterFileName) const |
Get a particular parameter file name. More... | |
int | SetModelNumbering (Numbering const numbering) |
Set the Model's particle Numbering. More... | |
void | SetInfluenceDistancePointer (double const *const influenceDistance) |
Set the Model's influence distance data pointer. More... | |
void | SetNeighborListPointers (int const numberOfNeighborLists, double const *const cutoffs, int const *const modelWillNotRequestNeighborsOfNoncontributingParticles) |
Set the Model's neighbor list data pointers. More... | |
int | SetRoutinePointer (ModelRoutineName const modelRoutineName, LanguageName const languageName, int const required, Function *const fptr) |
Set the function pointer for the ModelRoutineName of interest. More... | |
int | SetSpeciesCode (SpeciesName const speciesName, int const code) |
Set integer code for supported SpeciesName. More... | |
int | SetParameterPointer (int const extent, int *const ptr, std::string const &name, std::string const &description) |
Set the next parameter data pointer to be provided by the model. More... | |
int | SetParameterPointer (int const extent, double *const ptr, std::string const &name, std::string const &description) |
void | SetModelBufferPointer (void *const ptr) |
Set the Model's buffer pointer within the Model object. More... | |
int | SetUnits (LengthUnit const lengthUnit, EnergyUnit const energyUnit, ChargeUnit const chargeUnit, TemperatureUnit const temperatureUnit, TimeUnit const timeUnit) |
Set the Model's base unit values. 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 Model object. More... | |
Static Public Member Functions | |
static int | ConvertUnit (LengthUnit const fromLengthUnit, EnergyUnit const fromEnergyUnit, ChargeUnit const fromChargeUnit, TemperatureUnit const fromTemperatureUnit, TimeUnit const fromTimeUnit, LengthUnit const toLengthUnit, EnergyUnit const toEnergyUnit, ChargeUnit const toChargeUnit, TemperatureUnit const toTemperatureUnit, TimeUnit const toTimeUnit, double const lengthExponent, double const energyExponent, double const chargeExponent, double const temperatureExponent, double const timeExponent, double *const conversionFactor) |
Get the multiplicative factor to convert between a derived unit represented in two different sets of base units. More... | |
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::Create routine.
Definition at line 67 of file KIM_ModelDriverCreate.hpp.
|
static |
Get the multiplicative factor to convert between a derived unit represented in two different sets of base units.
[in] | fromLengthUnit | The "from" base length unit. |
[in] | fromEnergyUnit | The "from" base energy unit. |
[in] | fromChargeUnit | The "from" base charge unit. |
[in] | fromTemperatureUnit | The "from" base temperature unit. |
[in] | fromTimeUnit | The "from" base time unit. |
[in] | toLengthUnit | The "to" base length unit. |
[in] | toEnergyUnit | The "to" base energy unit. |
[in] | toChargeUnit | The "to" base charge unit. |
[in] | toTemperatureUnit | The "to" base temperature unit. |
[in] | toTimeUnit | The "to" base time unit. |
[in] | lengthExponent | The derived unit's length exponent. |
[in] | energyExponent | The derived unit's energy exponent. |
[in] | chargeExponent | The derived unit's charge exponent. |
[in] | temperatureExponent | The derived unit's temperature exponent. |
[in] | timeExponent | The derived unit's time exponent. |
[out] | conversionFactor | The desired conversion factor. |
true
if any of the base units are unknown. true
if any of the base units are unused
and the corresponding exponent is nonzero. false
otherwise.void KIM::ModelDriverCreate::GetNumberOfParameterFiles | ( | int *const | numberOfParameterFiles | ) | const |
Get the number of parameter files provided by the parameterized model.
[out] | numberOfParameterFiles | The number of parameter files. |
int KIM::ModelDriverCreate::GetParameterFileName | ( | int const | index, |
std::string const **const | parameterFileName | ||
) | const |
Get a particular parameter file name.
[in] | index | Zero-based index for the parameter file of interest. |
[out] | parameterFileName | The fully-qualified path name for the parameter file of interest. |
true
if the Model object is not a parameterized model true
if index
is invalid. true
if parameterFileName == NULL
. false
otherwise.void KIM::ModelDriverCreate::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::ModelDriverCreate::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.
void KIM::ModelDriverCreate::SetInfluenceDistancePointer | ( | double const *const | influenceDistance | ) |
Set the Model's influence distance data pointer.
influenceDistance
(or link to docs elsewhere?)[in] | influenceDistance | Pointer to Model's influence distance. |
void KIM::ModelDriverCreate::SetModelBufferPointer | ( | void *const | ptr | ) |
Set the Model's buffer pointer within the Model object.
The model buffer pointer may be used by the Model to associate a memory buffer with the Model object.
[in] | ptr | The model buffer data pointer. |
int KIM::ModelDriverCreate::SetModelNumbering | ( | Numbering const | numbering | ) |
Set the Model's particle Numbering.
true
if numbering
is unknown. false
otherwise.void KIM::ModelDriverCreate::SetNeighborListPointers | ( | int const | numberOfNeighborLists, |
double const *const | cutoffs, | ||
int const *const | modelWillNotRequestNeighborsOfNoncontributingParticles | ||
) |
Set the Model's neighbor list data pointers.
[in] | numberOfNeighborLists | The number of neighbor lists required by the Model. |
[in] | cutoffs | Array of cutoff values for each of the required neighbor lists. |
[in] | modelWillNotRequestNeighborsOfNoncontributingParticles | Array of integers; true or false for each neighbor list required by the Model. |
modelWillNotRequestNeighborsOfNoncontributingParticles
data. The model must use the Model's buffer pointer to retain access to this memory location and avoid a memory leak.int KIM::ModelDriverCreate::SetParameterPointer | ( | int const | extent, |
int *const | ptr, | ||
std::string const & | name, | ||
std::string const & | description | ||
) |
Set the next parameter data pointer to be provided by the model.
This routine is called once for each parameter array to be provided by the model. The order of these calls is important and determines the index assigned to each parameter array for use in the Model::GetParameter and related routines.
[in] | extent | The number of entries in the parameter array. |
[in] | ptr | The parameter array data pointer. |
[in] | name | A brief unique name for the parameter array. This name must be a valid C identifier. |
[in] | description | A free-form text description of the parameter array. This should include details about the data layout (e.g., the array corresponds to a square upper-triangular matrix in row-major storage). |
int KIM::ModelDriverCreate::SetParameterPointer | ( | int const | extent, |
double *const | ptr, | ||
std::string const & | name, | ||
std::string const & | description | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int KIM::ModelDriverCreate::SetRoutinePointer | ( | ModelRoutineName const | modelRoutineName, |
LanguageName const | languageName, | ||
int const | required, | ||
Function *const | fptr | ||
) |
Set the function pointer for the ModelRoutineName of interest.
[in] | modelRoutineName | The ModelRoutineName of interest. |
[in] | languageName | The LanguageName of the ModelRoutineName. |
[in] | required | Integer, true if the model requires the simulator to call the associated ModelRoutineName in order to be used correctly, false otherwise. |
[in] | fptr | Function pointer for the Model's ModelRoutineName routine. |
true
if modelRoutineName
or langaugeName
are unknown. true
if required == false
and modelRoutineName
has SupportStatus SUPPORT_STATUS::requiredByAPI. false
otherwise.int KIM::ModelDriverCreate::SetSpeciesCode | ( | SpeciesName const | speciesName, |
int const | code | ||
) |
Set integer code for supported SpeciesName.
A call to this routine adds/updates the list of SpeciesName's supported by the Model and associates the specified SpeciesName with the integer code to be used within the COMPUTE_ARGUMENT_NAME::particleSpeciesCodes argument.
[in] | speciesName | The SpeciesName of interest. |
[in] | code | The associated code. |
true
if speciesName
is unknown. false
otherwise.int KIM::ModelDriverCreate::SetUnits | ( | LengthUnit const | lengthUnit, |
EnergyUnit const | energyUnit, | ||
ChargeUnit const | chargeUnit, | ||
TemperatureUnit const | temperatureUnit, | ||
TimeUnit const | timeUnit | ||
) |
Set the Model's base unit values.
[in] | lengthUnit | The Model's base LengthUnit. |
[in] | energyUnit | The Model's base EnergyUnit. |
[in] | chargeUnit | The Model's base ChargeUnit. |
[in] | temperatureUnit | The Model's base TemperatureUnit. |
[in] | timeUnit | The Model's base TimeUnit. |
unused
indicates the the Model does not deal with any quantities whose derived unit involves the corresponding base unit. For example, many models only deal with quantities that are derived from just the energy and length base units (such as force, virial, etc.), and thus should set chargeUnit
, temperatureUnit
, and timeUnit
to unused
.true
if any of the base units are unknown. true
if lengthUnit
or energyUnit
are unused. false
otherwise.std::string const& KIM::ModelDriverCreate::ToString | ( | ) | const |
Get a string representing the internal state of the Model 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
.