43 #define IGNORE_RESULT(fn) \ 54 #undef KIM_LOGGER_OBJECT_NAME 55 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 65 numberModelSpecies_(0),
66 numberUniqueSpeciesPairs_(0),
71 influenceDistance_(0.0),
73 modelWillNotRequestNeighborsOfNoncontributingParticles_(1),
74 fourEpsilonSigma6_2D_(NULL),
75 fourEpsilonSigma12_2D_(NULL),
76 twentyFourEpsilonSigma6_2D_(NULL),
77 fortyEightEpsilonSigma12_2D_(NULL),
78 oneSixtyEightEpsilonSigma6_2D_(NULL),
79 sixTwentyFourEpsilonSigma12_2D_(NULL),
81 cachedNumberOfParticles_(0)
84 int numberParameterFiles;
86 *ier = OpenParameterFiles(
87 modelDriverCreate, numberParameterFiles, parameterFilePointers);
90 *ier = ProcessParameterFiles(
91 modelDriverCreate, numberParameterFiles, parameterFilePointers);
92 CloseParameterFiles(numberParameterFiles, parameterFilePointers);
95 *ier = ConvertUnits(modelDriverCreate,
99 requestedTemperatureUnit,
103 *ier = SetRefreshMutableValues(modelDriverCreate);
106 *ier = RegisterKIMModelSettings(modelDriverCreate);
109 *ier = RegisterKIMParameters(modelDriverCreate);
112 *ier = RegisterKIMFunctions(modelDriverCreate);
139 #undef KIM_LOGGER_OBJECT_NAME 140 #define KIM_LOGGER_OBJECT_NAME modelRefresh 147 ier = SetRefreshMutableValues(modelRefresh);
165 bool isComputeProcess_dEdr =
false;
166 bool isComputeProcess_d2Edr2 =
false;
169 bool isComputeEnergy =
false;
170 bool isComputeForces =
false;
171 bool isComputeParticleEnergy =
false;
172 bool isComputeVirial =
false;
173 bool isComputeParticleVirial =
false;
181 double * energy = NULL;
182 double * particleEnergy = NULL;
186 ier = SetComputeMutableValues(modelComputeArguments,
187 isComputeProcess_dEdr,
188 isComputeProcess_d2Edr2,
191 isComputeParticleEnergy,
193 isComputeParticleVirial,
194 particleSpeciesCodes,
195 particleContributing,
209 bool const isShift = (1 == shift_);
221 ier = RegisterKIMComputeArgumentsSettings(modelComputeArgumentsCreate);
252 void LennardJones612Implementation::AllocatePrivateParameterMemory()
258 void LennardJones612Implementation::AllocateParameterMemory()
260 cutoffs_ =
new double[numberUniqueSpeciesPairs_];
262 cutoffsSq2D_, numberModelSpecies_, numberModelSpecies_);
264 epsilons_ =
new double[numberUniqueSpeciesPairs_];
265 sigmas_ =
new double[numberUniqueSpeciesPairs_];
267 fourEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
269 fourEpsilonSigma12_2D_, numberModelSpecies_, numberModelSpecies_);
271 twentyFourEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
273 fortyEightEpsilonSigma12_2D_, numberModelSpecies_, numberModelSpecies_);
275 oneSixtyEightEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
278 numberModelSpecies_);
281 shifts2D_, numberModelSpecies_, numberModelSpecies_);
285 #undef KIM_LOGGER_OBJECT_NAME 286 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 288 int LennardJones612Implementation::OpenParameterFiles(
290 int const numberParameterFiles,
295 if (numberParameterFiles > MAX_PARAMETER_FILES)
298 LOG_ERROR(
"LennardJones612 given too many parameter files");
302 for (
int i = 0; i < numberParameterFiles; ++i)
304 std::string
const * paramFileName;
308 LOG_ERROR(
"Unable to get parameter file name");
311 parameterFilePointers[i] = fopen(paramFileName->c_str(),
"r");
312 if (parameterFilePointers[i] == 0)
316 "LennardJones612 parameter file number %d cannot be opened",
320 for (
int j = i - 1; j >= 0; --j) { fclose(parameterFilePointers[j]); }
331 #undef KIM_LOGGER_OBJECT_NAME 332 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 334 int LennardJones612Implementation::ProcessParameterFiles(
340 int endOfFileFlag = 0;
343 int iIndex, jIndex, indx, iiIndex, jjIndex;
344 double nextCutoff, nextEpsilon, nextSigma;
346 nextLinePtr = nextLine;
349 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
350 ier = sscanf(nextLine,
"%d %d", &N, &shift_);
353 sprintf(nextLine,
"unable to read first line of the parameter file");
356 fclose(parameterFilePointers[0]);
359 numberModelSpecies_ =
N;
360 numberUniqueSpeciesPairs_
361 = ((numberModelSpecies_ + 1) * numberModelSpecies_) / 2;
362 AllocateParameterMemory();
365 for (
int i = 0; i < ((N + 1) * N / 2); i++)
374 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>
376 std::vector<KIM::SpeciesName> speciesNameVector;
381 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
382 while (endOfFileFlag == 0)
384 ier = sscanf(nextLine,
393 sprintf(nextLine,
"error reading lines of the parameter file");
403 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
405 = modelSpeciesMap.find(specName1);
406 if (iIter == modelSpeciesMap.end())
408 modelSpeciesMap[specName1] = index;
409 modelSpeciesCodeList_.push_back(index);
410 speciesNameVector.push_back(specName1);
419 iIndex = modelSpeciesMap[specName1];
421 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
423 = modelSpeciesMap.find(specName2);
424 if (jIter == modelSpeciesMap.end())
426 modelSpeciesMap[specName2] = index;
427 modelSpeciesCodeList_.push_back(index);
428 speciesNameVector.push_back(specName2);
437 jIndex = modelSpeciesMap[specName2];
440 if (iIndex >= jIndex)
441 { indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2; }
444 indx = iIndex * N + jIndex - (iIndex * iIndex + iIndex) / 2;
446 cutoffs_[indx] = nextCutoff;
447 epsilons_[indx] = nextEpsilon;
448 sigmas_[indx] = nextSigma;
451 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
455 std::stringstream ss;
456 ss <<
"There are not values for like-like pairs of:";
457 for (
int i = 0; i <
N; i++)
459 if (cutoffs_[(i * N + i - (i * i + i) / 2)] == -1)
462 ss << (speciesNameVector[i].ToString()).c_str();
473 for (
int jIndex = 0; jIndex <
N; jIndex++)
475 jjIndex = (jIndex * N + jIndex - (jIndex * jIndex + jIndex) / 2);
476 for (
int iIndex = (jIndex + 1); iIndex <
N; iIndex++)
478 indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2;
479 if (cutoffs_[indx] == -1)
481 iiIndex = (iIndex * N + iIndex - (iIndex * iIndex + iIndex) / 2);
482 epsilons_[indx] = sqrt(epsilons_[iiIndex] * epsilons_[jjIndex]);
483 sigmas_[indx] = (sigmas_[iiIndex] + sigmas_[jjIndex]) / 2.0;
484 cutoffs_[indx] = (cutoffs_[iiIndex] + cutoffs_[jjIndex]) / 2.0;
495 void LennardJones612Implementation::getNextDataLine(FILE *
const filePtr,
502 if (fgets(nextLinePtr, maxSize, filePtr) == NULL)
507 while ((nextLinePtr[0] ==
' ' || nextLinePtr[0] ==
'\t')
508 || (nextLinePtr[0] ==
'\n' || nextLinePtr[0] ==
'\r'))
509 { nextLinePtr = (nextLinePtr + 1); }
510 }
while ((strncmp(
"#", nextLinePtr, 1) == 0) || (strlen(nextLinePtr) == 0));
514 void LennardJones612Implementation::CloseParameterFiles(
515 int const numberParameterFiles,
518 for (
int i = 0; i < numberParameterFiles; ++i)
519 fclose(parameterFilePointers[i]);
523 #undef KIM_LOGGER_OBJECT_NAME 524 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 526 int LennardJones612Implementation::ConvertUnits(
544 double convertLength = 1.0;
553 requestedTemperatureUnit,
563 LOG_ERROR(
"Unable to convert length unit");
566 if (convertLength !=
ONE)
568 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
570 cutoffs_[i] *= convertLength;
571 sigmas_[i] *= convertLength;
575 double convertEnergy = 1.0;
584 requestedTemperatureUnit,
594 LOG_ERROR(
"Unable to convert energy unit");
597 if (convertEnergy !=
ONE)
599 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
601 epsilons_[i] *= convertEnergy;
606 ier = modelDriverCreate->
SetUnits(requestedLengthUnit,
613 LOG_ERROR(
"Unable to set units to requested values");
623 int LennardJones612Implementation::RegisterKIMModelSettings(
633 #undef KIM_LOGGER_OBJECT_NAME 634 #define KIM_LOGGER_OBJECT_NAME modelComputeArgumentsCreate 636 int LennardJones612Implementation::RegisterKIMComputeArgumentsSettings(
674 static_cast<std::ostringstream const &>(std::ostringstream() \ 678 #undef KIM_LOGGER_OBJECT_NAME 679 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 681 int LennardJones612Implementation::RegisterKIMParameters(
691 "If (shift == 1), all LJ potentials are shifted to zero energy " 692 "at their respective cutoff distance. Otherwise, no shifting is " 701 numberUniqueSpeciesPairs_,
704 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
706 "in row-major storage. Ordering is according to SpeciesCode " 708 "For example, to find the parameter related to SpeciesCode 'i' and " 709 "SpeciesCode 'j' (i >= j), use (zero-based) " 710 "index = (j*N + i - (j*j + j)/2).");
717 numberUniqueSpeciesPairs_,
720 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
722 "in row-major storage. Ordering is according to SpeciesCode " 724 "For example, to find the parameter related to SpeciesCode 'i' and " 725 "SpeciesCode 'j' (i >= j), use (zero-based) " 726 "index = (j*N + i - (j*j + j)/2).");
733 numberUniqueSpeciesPairs_,
736 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
738 "in row-major storage. Ordering is according to SpeciesCode " 740 "For example, to find the parameter related to SpeciesCode 'i' and " 741 "SpeciesCode 'j' (i >= j), use (zero-based) " 742 "index = (j*N + i - (j*j + j)/2).");
755 int LennardJones612Implementation::RegisterKIMFunctions(
774 reinterpret_cast<KIM::Function *>(destroy))
779 reinterpret_cast<KIM::Function *>(refresh))
784 reinterpret_cast<KIM::Function *>(compute))
789 reinterpret_cast<KIM::Function *>(CACreate))
794 reinterpret_cast<KIM::Function *>(CADestroy));
799 template<
class ModelObj>
800 int LennardJones612Implementation::SetRefreshMutableValues(
801 ModelObj *
const modelObj)
809 for (
int i = 0; i < numberModelSpecies_; ++i)
811 for (
int j = 0; j <= i; ++j)
813 int const index = j * numberModelSpecies_ + i - (j * j + j) / 2;
814 cutoffsSq2D_[i][j] = cutoffsSq2D_[j][i]
815 = (cutoffs_[index] * cutoffs_[index]);
816 fourEpsilonSigma6_2D_[i][j] = fourEpsilonSigma6_2D_[j][i]
817 = 4.0 * epsilons_[index] * pow(sigmas_[index], 6.0);
818 fourEpsilonSigma12_2D_[i][j] = fourEpsilonSigma12_2D_[j][i]
819 = 4.0 * epsilons_[index] * pow(sigmas_[index], 12.0);
820 twentyFourEpsilonSigma6_2D_[i][j] = twentyFourEpsilonSigma6_2D_[j][i]
821 = 6.0 * fourEpsilonSigma6_2D_[i][j];
822 fortyEightEpsilonSigma12_2D_[i][j] = fortyEightEpsilonSigma12_2D_[j][i]
823 = 12.0 * fourEpsilonSigma12_2D_[i][j];
824 oneSixtyEightEpsilonSigma6_2D_[i][j]
825 = oneSixtyEightEpsilonSigma6_2D_[j][i]
826 = 7.0 * twentyFourEpsilonSigma6_2D_[i][j];
827 sixTwentyFourEpsilonSigma12_2D_[i][j]
828 = sixTwentyFourEpsilonSigma12_2D_[j][i]
829 = 13.0 * fortyEightEpsilonSigma12_2D_[i][j];
834 influenceDistance_ = 0.0;
836 for (
int i = 0; i < numberModelSpecies_; i++)
838 int indexI = modelSpeciesCodeList_[i];
840 for (
int j = 0; j < numberModelSpecies_; j++)
842 int indexJ = modelSpeciesCodeList_[j];
844 if (influenceDistance_ < cutoffsSq2D_[indexI][indexJ])
845 { influenceDistance_ = cutoffsSq2D_[indexI][indexJ]; }
849 influenceDistance_ = sqrt(influenceDistance_);
850 modelObj->SetInfluenceDistancePointer(&influenceDistance_);
851 modelObj->SetNeighborListPointers(
854 &modelWillNotRequestNeighborsOfNoncontributingParticles_);
858 double const *
const *
const constFourEpsSig6_2D = fourEpsilonSigma6_2D_;
859 double const *
const *
const constFourEpsSig12_2D = fourEpsilonSigma12_2D_;
863 for (
int iSpecies = 0; iSpecies < numberModelSpecies_; iSpecies++)
865 for (
int jSpecies = 0; jSpecies <= iSpecies; jSpecies++)
867 int const index = jSpecies * numberModelSpecies_ + iSpecies
868 - (jSpecies * jSpecies + jSpecies) / 2;
869 double const rij2 = cutoffs_[index] * cutoffs_[index];
870 double const r2iv = 1.0 / rij2;
871 double const r6iv = r2iv * r2iv * r2iv;
873 shifts2D_[iSpecies][jSpecies] = shifts2D_[jSpecies][iSpecies] = phi;
884 #undef KIM_LOGGER_OBJECT_NAME 885 #define KIM_LOGGER_OBJECT_NAME modelComputeArguments 887 int LennardJones612Implementation::SetComputeMutableValues(
889 bool & isComputeProcess_dEdr,
890 bool & isComputeProcess_d2Edr2,
891 bool & isComputeEnergy,
892 bool & isComputeForces,
893 bool & isComputeParticleEnergy,
894 bool & isComputeVirial,
895 bool & isComputeParticleVirial,
900 double *& particleEnergy,
908 int compProcess_dEdr;
909 int compProcess_d2Edr2;
916 isComputeProcess_dEdr = compProcess_dEdr;
917 isComputeProcess_d2Edr2 = compProcess_d2Edr2;
937 (
double const **) &forces)
940 (
double const **) &virial)
943 (
double const **) &particleVirial);
950 isComputeEnergy = (energy != NULL);
951 isComputeParticleEnergy = (particleEnergy != NULL);
952 isComputeForces = (forces != NULL);
953 isComputeVirial = (virial != NULL);
954 isComputeParticleVirial = (particleVirial != NULL);
965 #undef KIM_LOGGER_OBJECT_NAME 966 #define KIM_LOGGER_OBJECT_NAME modelCompute 967 int LennardJones612Implementation::CheckParticleSpeciesCodes(
972 for (
int i = 0; i < cachedNumberOfParticles_; ++i)
974 if ((particleSpeciesCodes[i] < 0)
975 || (particleSpeciesCodes[i] >= numberModelSpecies_))
978 LOG_ERROR(
"unsupported particle species codes detected");
989 int LennardJones612Implementation::GetComputeIndex(
990 const bool & isComputeProcess_dEdr,
991 const bool & isComputeProcess_d2Edr2,
992 const bool & isComputeEnergy,
993 const bool & isComputeForces,
994 const bool & isComputeParticleEnergy,
995 const bool & isComputeVirial,
996 const bool & isComputeParticleVirial,
997 const bool & isShift)
const 1000 const int processd2E = 2;
1001 const int energy = 2;
1002 const int force = 2;
1003 const int particleEnergy = 2;
1004 const int virial = 2;
1005 const int particleVirial = 2;
1006 const int shift = 2;
1012 index += (int(isComputeProcess_dEdr)) * processd2E * energy * force
1013 * particleEnergy * virial * particleVirial * shift;
1016 index += (int(isComputeProcess_d2Edr2)) * energy * force * particleEnergy
1017 * virial * particleVirial * shift;
1020 index += (int(isComputeEnergy)) * force * particleEnergy * virial
1021 * particleVirial * shift;
1024 index += (int(isComputeForces)) * particleEnergy * virial * particleVirial
1028 index += (int(isComputeParticleEnergy)) * virial * particleVirial * shift;
1031 index += (int(isComputeVirial)) * particleVirial * shift;
1034 index += (int(isComputeParticleVirial)) * shift;
1037 index += (int(isShift));
1043 void LennardJones612Implementation::ProcessVirialTerm(
1044 const double & dEidr,
1046 const double *
const r_ij,
1051 double const v = dEidr / rij;
1053 virial[0] += v * r_ij[0] * r_ij[0];
1054 virial[1] += v * r_ij[1] * r_ij[1];
1055 virial[2] += v * r_ij[2] * r_ij[2];
1056 virial[3] += v * r_ij[1] * r_ij[2];
1057 virial[4] += v * r_ij[0] * r_ij[2];
1058 virial[5] += v * r_ij[0] * r_ij[1];
1062 void LennardJones612Implementation::ProcessParticleVirialTerm(
1063 const double & dEidr,
1065 const double *
const r_ij,
1070 double const v = dEidr / rij;
1073 vir[0] = 0.5 * v * r_ij[0] * r_ij[0];
1074 vir[1] = 0.5 * v * r_ij[1] * r_ij[1];
1075 vir[2] = 0.5 * v * r_ij[2] * r_ij[2];
1076 vir[3] = 0.5 * v * r_ij[1] * r_ij[2];
1077 vir[4] = 0.5 * v * r_ij[0] * r_ij[2];
1078 vir[5] = 0.5 * v * r_ij[0] * r_ij[1];
1080 for (
int k = 0; k < 6; ++k)
1082 particleVirial[i][k] += vir[k];
1083 particleVirial[j][k] += vir[k];
1095 int const extentZero,
1096 int const extentOne)
1098 arrayPtr =
new double *[extentZero];
1099 arrayPtr[0] =
new double[extentZero * extentOne];
1100 for (
int i = 1; i < extentZero; ++i)
1101 { arrayPtr[i] = arrayPtr[i - 1] + extentOne; }
1104 for (
int i = 0; i < extentZero; ++i)
1106 for (
int j = 0; j < extentOne; ++j) { arrayPtr[i][j] = 0.0; }
1113 if (arrayPtr != NULL)
delete[] arrayPtr[0];
int ComputeArgumentsCreate(KIM::ModelComputeArgumentsCreate *const modelComputeArgumentsCreate) const
int ModelComputeArgumentsDestroyFunction(ModelCompute const *const modelCompute, ModelComputeArgumentsDestroy *const modelComputeArgumentsDestroy)
Prototype for MODEL_ROUTINE_NAME::ComputeArgumentsDestroy routine.
TemperatureUnit const unused
Indicates that a TemperatureUnit is not used.
ComputeArgumentName const partialParticleEnergy
The standard partialParticleEnergy argument.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::R...
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.
static int Refresh(KIM::ModelRefresh *const modelRefresh)
An Extensible Enumeration for the TimeUnit's supported by the KIM API.
int ModelDestroyFunction(ModelDestroy *const modelDestroy)
Prototype for MODEL_ROUTINE_NAME::Destroy routine.
TimeUnit const ps
The standard picosecond unit of time.
recursive subroutine, public destroy(model_destroy_handle, ierr)
#define MAX_PARAMETER_FILES
ComputeArgumentName const coordinates
The standard coordinates argument.
#define LOG_ERROR(message)
Convenience macro for ERROR Log entries with compile-time optimization.
ModelRoutineName const Destroy
The standard Destroy routine.
ComputeArgumentName const partialVirial
The standard partialVirial argument.
ChargeUnit const unused
Indicates that a ChargeUnit is not used.
ChargeUnit const e
The standard electron unit of charge.
recursive subroutine, public refresh(model_refresh_handle, ierr)
void GetNumberOfParameterFiles(int *const numberOfParameterFiles) const
Get the number of parameter files provided by the parameterized model.
int SetArgumentSupportStatus(ComputeArgumentName const computeArgumentName, SupportStatus const supportStatus)
Set the SupportStatus of a ComputeArgumentName.
int ModelComputeFunction(ModelCompute const *const modelCompute, ModelComputeArguments const *const modelComputeArgumentsCreate)
Prototype for MODEL_ROUTINE_NAME::Compute routine.
ComputeCallbackName const ProcessD2EDr2Term
The standard ProcessD2EDr2Term callback.
double VectorOfSizeDIM[DIMENSION]
An Extensible Enumeration for the LengthUnit's supported by the KIM API.
int GetArgumentPointer(ComputeArgumentName const computeArgumentName, int const **const ptr) const
Get the data pointer for a ComputeArgumentName.
int ModelComputeArgumentsCreateFunction(ModelCompute const *const modelCompute, ModelComputeArgumentsCreate *const modelComputeArgumentsCreate)
Prototype for MODEL_ROUTINE_NAME::ComputeArgumentsCreate routine.
int SetModelNumbering(Numbering const numbering)
Set the Model's particle Numbering.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
ComputeArgumentName const particleContributing
The standard particleContributing argument.
static int ComputeArgumentsCreate(KIM::ModelCompute const *const modelCompute, KIM::ModelComputeArgumentsCreate *const modelComputeArgumentsCreate)
ComputeArgumentName const partialEnergy
The standard partialEnergy argument.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
ModelRoutineName const Refresh
The standard Refresh routine.
LennardJones612Implementation(KIM::ModelDriverCreate *const modelDriverCreate, KIM::LengthUnit const requestedLengthUnit, KIM::EnergyUnit const requestedEnergyUnit, KIM::ChargeUnit const requestedChargeUnit, KIM::TemperatureUnit const requestedTemperatureUnit, KIM::TimeUnit const requestedTimeUnit, int *const ier)
ModelRoutineName const ComputeArgumentsCreate
The standard ComputeArgumentsCreate routine.
ModelRoutineName const ComputeArgumentsDestroy
The standard ComputeArgumentsDestroy routine.
int GetParameterFileName(int const index, std::string const **const parameterFileName) const
Get a particular parameter file name.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
static int Destroy(KIM::ModelDestroy *const modelDestroy)
int SetUnits(LengthUnit const lengthUnit, EnergyUnit const energyUnit, ChargeUnit const chargeUnit, TemperatureUnit const temperatureUnit, TimeUnit const timeUnit)
Set the Model's base unit values.
An Extensible Enumeration for the EnergyUnit's supported by the KIM API.
LanguageName const cpp
The standard cpp language.
ModelRoutineName const Compute
The standard Compute routine.
ComputeArgumentName const partialParticleVirial
The standard partialParticleVirial argument.
ComputeCallbackName const ProcessDEDrTerm
The standard ProcessDEDrTerm callback.
int SetRoutinePointer(ModelRoutineName const modelRoutineName, LanguageName const languageName, int const required, Function *const fptr)
Set the function pointer for the ModelRoutineName of interest.
int Refresh(KIM::ModelRefresh *const modelRefresh)
LengthUnit const A
The standard angstrom unit of length.
int ModelRefreshFunction(ModelRefresh *const modelRefresh)
Prototype for MODEL_ROUTINE_NAME::Refresh routine.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
ComputeArgumentName const partialForces
The standard partialForces argument.
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.
~LennardJones612Implementation()
int ComputeArgumentsDestroy(KIM::ModelComputeArgumentsDestroy *const modelComputeArgumentsDestroy) const
EnergyUnit const eV
The standard electronvolt unit of energy.
static int ComputeArgumentsDestroy(KIM::ModelCompute const *const modelCompute, KIM::ModelComputeArgumentsDestroy *const modelComputeArgumentsDestroy)
ComputeArgumentName const particleSpeciesCodes
The standard particleSpeciesCodes argument.
Provides the interface to a KIM API ComputeArguments object for use by models within their MODEL_ROUT...
#define LENNARD_JONES_PHI(exshift)
An Extensible Enumeration for the ChargeUnit's supported by the KIM API.
ComputeArgumentName const numberOfParticles
The standard numberOfParticles argument.
SpeciesName const N
The standard Nitrogen species.
double VectorOfSizeSix[6]
#define LOG_INFORMATION(message)
Convenience macro for INFORMATION Log entries with compile-time optimization.
void AllocateAndInitialize2DArray(double **&arrayPtr, int const extentZero, int const extentOne)
void Deallocate2DArray(double **&arrayPtr)
int Compute(KIM::ModelCompute const *const modelCompute, KIM::ModelComputeArguments const *const modelComputeArguments)
Numbering const zeroBased
The standard zeroBased numbering.
static int Compute(KIM::ModelCompute const *const modelCompute, KIM::ModelComputeArguments const *const modelComputeArguments)
int SetSpeciesCode(SpeciesName const speciesName, int const code)
Set integer code for supported SpeciesName.
TimeUnit const unused
Indicates that a TimeUnit is not used.
An Extensible Enumeration for the SpeciesName's supported by the KIM API.
int SetCallbackSupportStatus(ComputeCallbackName const computeCallbackName, SupportStatus const supportStatus)
Set the SupportStatus of a ComputeCallbackName.
LogVerbosity const error
The standard error verbosity.
int IsCallbackPresent(ComputeCallbackName const computeCallbackName, int *const present) const
Determine if the Simulator has provided a non-NULL function pointer for a ComputeCallbackName of inte...
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 ...
SupportStatus const optional
The standard optional status.
TemperatureUnit const K
The standard Kelvin unit of temperature.