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);
238 (void) modelComputeArgumentsDestroy;
254 void LennardJones612Implementation::AllocatePrivateParameterMemory()
260 void LennardJones612Implementation::AllocateParameterMemory()
262 cutoffs_ =
new double[numberUniqueSpeciesPairs_];
264 cutoffsSq2D_, numberModelSpecies_, numberModelSpecies_);
266 epsilons_ =
new double[numberUniqueSpeciesPairs_];
267 sigmas_ =
new double[numberUniqueSpeciesPairs_];
269 fourEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
271 fourEpsilonSigma12_2D_, numberModelSpecies_, numberModelSpecies_);
273 twentyFourEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
275 fortyEightEpsilonSigma12_2D_, numberModelSpecies_, numberModelSpecies_);
277 oneSixtyEightEpsilonSigma6_2D_, numberModelSpecies_, numberModelSpecies_);
280 numberModelSpecies_);
283 shifts2D_, numberModelSpecies_, numberModelSpecies_);
287 #undef KIM_LOGGER_OBJECT_NAME 288 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 290 int LennardJones612Implementation::OpenParameterFiles(
292 int const numberParameterFiles,
297 if (numberParameterFiles > MAX_PARAMETER_FILES)
300 LOG_ERROR(
"LennardJones612 given too many parameter files");
304 for (
int i = 0; i < numberParameterFiles; ++i)
306 std::string
const * paramFileName;
310 LOG_ERROR(
"Unable to get parameter file name");
313 parameterFilePointers[i] = fopen(paramFileName->c_str(),
"r");
314 if (parameterFilePointers[i] == 0)
318 "LennardJones612 parameter file number %d cannot be opened",
322 for (
int j = i - 1; j >= 0; --j) { fclose(parameterFilePointers[j]); }
333 #undef KIM_LOGGER_OBJECT_NAME 334 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 336 int LennardJones612Implementation::ProcessParameterFiles(
338 int const numberParameterFiles,
342 int endOfFileFlag = 0;
345 int iIndex, jIndex, indx, iiIndex, jjIndex;
346 double nextCutoff, nextEpsilon, nextSigma;
348 (void) numberParameterFiles;
350 nextLinePtr = nextLine;
353 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
354 ier = sscanf(nextLine,
"%d %d", &N, &shift_);
357 sprintf(nextLine,
"unable to read first line of the parameter file");
360 fclose(parameterFilePointers[0]);
363 numberModelSpecies_ =
N;
364 numberUniqueSpeciesPairs_
365 = ((numberModelSpecies_ + 1) * numberModelSpecies_) / 2;
366 AllocateParameterMemory();
369 for (
int i = 0; i < ((N + 1) * N / 2); i++)
378 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>
380 std::vector<KIM::SpeciesName> speciesNameVector;
385 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
386 while (endOfFileFlag == 0)
388 ier = sscanf(nextLine,
397 sprintf(nextLine,
"error reading lines of the parameter file");
407 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
409 = modelSpeciesMap.find(specName1);
410 if (iIter == modelSpeciesMap.end())
412 modelSpeciesMap[specName1] = index;
413 modelSpeciesCodeList_.push_back(index);
414 speciesNameVector.push_back(specName1);
423 iIndex = modelSpeciesMap[specName1];
425 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
427 = modelSpeciesMap.find(specName2);
428 if (jIter == modelSpeciesMap.end())
430 modelSpeciesMap[specName2] = index;
431 modelSpeciesCodeList_.push_back(index);
432 speciesNameVector.push_back(specName2);
441 jIndex = modelSpeciesMap[specName2];
444 if (iIndex >= jIndex)
445 { indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2; }
448 indx = iIndex * N + jIndex - (iIndex * iIndex + iIndex) / 2;
450 cutoffs_[indx] = nextCutoff;
451 epsilons_[indx] = nextEpsilon;
452 sigmas_[indx] = nextSigma;
455 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
459 std::stringstream ss;
460 ss <<
"There are not values for like-like pairs of:";
461 for (
int i = 0; i <
N; i++)
463 if (cutoffs_[(i * N + i - (i * i + i) / 2)] == -1)
466 ss << (speciesNameVector[i].ToString()).c_str();
477 for (
int jIndex = 0; jIndex <
N; jIndex++)
479 jjIndex = (jIndex * N + jIndex - (jIndex * jIndex + jIndex) / 2);
480 for (
int iIndex = (jIndex + 1); iIndex <
N; iIndex++)
482 indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2;
483 if (cutoffs_[indx] == -1)
485 iiIndex = (iIndex * N + iIndex - (iIndex * iIndex + iIndex) / 2);
486 epsilons_[indx] = sqrt(epsilons_[iiIndex] * epsilons_[jjIndex]);
487 sigmas_[indx] = (sigmas_[iiIndex] + sigmas_[jjIndex]) / 2.0;
488 cutoffs_[indx] = (cutoffs_[iiIndex] + cutoffs_[jjIndex]) / 2.0;
499 void LennardJones612Implementation::getNextDataLine(FILE *
const filePtr,
506 if (fgets(nextLinePtr, maxSize, filePtr) == NULL)
511 while ((nextLinePtr[0] ==
' ' || nextLinePtr[0] ==
'\t')
512 || (nextLinePtr[0] ==
'\n' || nextLinePtr[0] ==
'\r'))
513 { nextLinePtr = (nextLinePtr + 1); }
514 }
while ((strncmp(
"#", nextLinePtr, 1) == 0) || (strlen(nextLinePtr) == 0));
518 void LennardJones612Implementation::CloseParameterFiles(
519 int const numberParameterFiles,
522 for (
int i = 0; i < numberParameterFiles; ++i)
523 fclose(parameterFilePointers[i]);
527 #undef KIM_LOGGER_OBJECT_NAME 528 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 530 int LennardJones612Implementation::ConvertUnits(
548 double convertLength = 1.0;
557 requestedTemperatureUnit,
567 LOG_ERROR(
"Unable to convert length unit");
570 if (convertLength !=
ONE)
572 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
574 cutoffs_[i] *= convertLength;
575 sigmas_[i] *= convertLength;
579 double convertEnergy = 1.0;
588 requestedTemperatureUnit,
598 LOG_ERROR(
"Unable to convert energy unit");
601 if (convertEnergy !=
ONE)
603 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
605 epsilons_[i] *= convertEnergy;
610 ier = modelDriverCreate->
SetUnits(requestedLengthUnit,
617 LOG_ERROR(
"Unable to set units to requested values");
627 int LennardJones612Implementation::RegisterKIMModelSettings(
637 #undef KIM_LOGGER_OBJECT_NAME 638 #define KIM_LOGGER_OBJECT_NAME modelComputeArgumentsCreate 640 int LennardJones612Implementation::RegisterKIMComputeArgumentsSettings(
678 static_cast<std::ostringstream &>(std::ostringstream() << std::dec << x).str() 680 #undef KIM_LOGGER_OBJECT_NAME 681 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 683 int LennardJones612Implementation::RegisterKIMParameters(
693 "If (shift == 1), all LJ potentials are shifted to zero energy " 694 "at their respective cutoff distance. Otherwise, no shifting is " 703 numberUniqueSpeciesPairs_,
706 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
708 "in row-major storage. Ordering is according to SpeciesCode " 710 "For example, to find the parameter related to SpeciesCode 'i' and " 711 "SpeciesCode 'j' (i >= j), use (zero-based) " 712 "index = (j*N + i - (j*j + j)/2).");
719 numberUniqueSpeciesPairs_,
722 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
724 "in row-major storage. Ordering is according to SpeciesCode " 726 "For example, to find the parameter related to SpeciesCode 'i' and " 727 "SpeciesCode 'j' (i >= j), use (zero-based) " 728 "index = (j*N + i - (j*j + j)/2).");
735 numberUniqueSpeciesPairs_,
738 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
740 "in row-major storage. Ordering is according to SpeciesCode " 742 "For example, to find the parameter related to SpeciesCode 'i' and " 743 "SpeciesCode 'j' (i >= j), use (zero-based) " 744 "index = (j*N + i - (j*j + j)/2).");
757 int LennardJones612Implementation::RegisterKIMFunctions(
776 reinterpret_cast<KIM::Function *>(destroy))
781 reinterpret_cast<KIM::Function *>(refresh))
786 reinterpret_cast<KIM::Function *>(compute))
791 reinterpret_cast<KIM::Function *>(CACreate))
796 reinterpret_cast<KIM::Function *>(CADestroy));
801 template<
class ModelObj>
802 int LennardJones612Implementation::SetRefreshMutableValues(
803 ModelObj *
const modelObj)
811 for (
int i = 0; i < numberModelSpecies_; ++i)
813 for (
int j = 0; j <= i; ++j)
815 int const index = j * numberModelSpecies_ + i - (j * j + j) / 2;
816 cutoffsSq2D_[i][j] = cutoffsSq2D_[j][i]
817 = (cutoffs_[index] * cutoffs_[index]);
818 fourEpsilonSigma6_2D_[i][j] = fourEpsilonSigma6_2D_[j][i]
819 = 4.0 * epsilons_[index] * pow(sigmas_[index], 6.0);
820 fourEpsilonSigma12_2D_[i][j] = fourEpsilonSigma12_2D_[j][i]
821 = 4.0 * epsilons_[index] * pow(sigmas_[index], 12.0);
822 twentyFourEpsilonSigma6_2D_[i][j] = twentyFourEpsilonSigma6_2D_[j][i]
823 = 6.0 * fourEpsilonSigma6_2D_[i][j];
824 fortyEightEpsilonSigma12_2D_[i][j] = fortyEightEpsilonSigma12_2D_[j][i]
825 = 12.0 * fourEpsilonSigma12_2D_[i][j];
826 oneSixtyEightEpsilonSigma6_2D_[i][j]
827 = oneSixtyEightEpsilonSigma6_2D_[j][i]
828 = 7.0 * twentyFourEpsilonSigma6_2D_[i][j];
829 sixTwentyFourEpsilonSigma12_2D_[i][j]
830 = sixTwentyFourEpsilonSigma12_2D_[j][i]
831 = 13.0 * fortyEightEpsilonSigma12_2D_[i][j];
836 influenceDistance_ = 0.0;
838 for (
int i = 0; i < numberModelSpecies_; i++)
840 int indexI = modelSpeciesCodeList_[i];
842 for (
int j = 0; j < numberModelSpecies_; j++)
844 int indexJ = modelSpeciesCodeList_[j];
846 if (influenceDistance_ < cutoffsSq2D_[indexI][indexJ])
847 { influenceDistance_ = cutoffsSq2D_[indexI][indexJ]; }
851 influenceDistance_ = sqrt(influenceDistance_);
852 modelObj->SetInfluenceDistancePointer(&influenceDistance_);
853 modelObj->SetNeighborListPointers(
856 &modelWillNotRequestNeighborsOfNoncontributingParticles_);
860 double const *
const *
const constFourEpsSig6_2D = fourEpsilonSigma6_2D_;
861 double const *
const *
const constFourEpsSig12_2D = fourEpsilonSigma12_2D_;
865 for (
int iSpecies = 0; iSpecies < numberModelSpecies_; iSpecies++)
867 for (
int jSpecies = 0; jSpecies <= iSpecies; jSpecies++)
869 int const index = jSpecies * numberModelSpecies_ + iSpecies
870 - (jSpecies * jSpecies + jSpecies) / 2;
871 double const rij2 = cutoffs_[index] * cutoffs_[index];
872 double const r2iv = 1.0 / rij2;
873 double const r6iv = r2iv * r2iv * r2iv;
875 shifts2D_[iSpecies][jSpecies] = shifts2D_[jSpecies][iSpecies] = phi;
886 #undef KIM_LOGGER_OBJECT_NAME 887 #define KIM_LOGGER_OBJECT_NAME modelComputeArguments 889 int LennardJones612Implementation::SetComputeMutableValues(
891 bool & isComputeProcess_dEdr,
892 bool & isComputeProcess_d2Edr2,
893 bool & isComputeEnergy,
894 bool & isComputeForces,
895 bool & isComputeParticleEnergy,
896 bool & isComputeVirial,
897 bool & isComputeParticleVirial,
902 double *& particleEnergy,
910 int compProcess_dEdr;
911 int compProcess_d2Edr2;
918 isComputeProcess_dEdr = compProcess_dEdr;
919 isComputeProcess_d2Edr2 = compProcess_d2Edr2;
939 (
double const **) &forces)
942 (
double const **) &virial)
945 (
double const **) &particleVirial);
952 isComputeEnergy = (energy != NULL);
953 isComputeParticleEnergy = (particleEnergy != NULL);
954 isComputeForces = (forces != NULL);
955 isComputeVirial = (virial != NULL);
956 isComputeParticleVirial = (particleVirial != NULL);
967 #undef KIM_LOGGER_OBJECT_NAME 968 #define KIM_LOGGER_OBJECT_NAME modelCompute 969 int LennardJones612Implementation::CheckParticleSpeciesCodes(
974 for (
int i = 0; i < cachedNumberOfParticles_; ++i)
976 if ((particleSpeciesCodes[i] < 0)
977 || (particleSpeciesCodes[i] >= numberModelSpecies_))
980 LOG_ERROR(
"unsupported particle species codes detected");
991 int LennardJones612Implementation::GetComputeIndex(
992 const bool & isComputeProcess_dEdr,
993 const bool & isComputeProcess_d2Edr2,
994 const bool & isComputeEnergy,
995 const bool & isComputeForces,
996 const bool & isComputeParticleEnergy,
997 const bool & isComputeVirial,
998 const bool & isComputeParticleVirial,
999 const bool & isShift)
const 1002 const int processd2E = 2;
1003 const int energy = 2;
1004 const int force = 2;
1005 const int particleEnergy = 2;
1006 const int virial = 2;
1007 const int particleVirial = 2;
1008 const int shift = 2;
1014 index += (int(isComputeProcess_dEdr)) * processd2E * energy * force
1015 * particleEnergy * virial * particleVirial * shift;
1018 index += (int(isComputeProcess_d2Edr2)) * energy * force * particleEnergy
1019 * virial * particleVirial * shift;
1022 index += (int(isComputeEnergy)) * force * particleEnergy * virial
1023 * particleVirial * shift;
1026 index += (int(isComputeForces)) * particleEnergy * virial * particleVirial
1030 index += (int(isComputeParticleEnergy)) * virial * particleVirial * shift;
1033 index += (int(isComputeVirial)) * particleVirial * shift;
1036 index += (int(isComputeParticleVirial)) * shift;
1039 index += (int(isShift));
1045 void LennardJones612Implementation::ProcessVirialTerm(
1046 const double & dEidr,
1048 const double *
const r_ij,
1056 double const v = dEidr / rij;
1058 virial[0] += v * r_ij[0] * r_ij[0];
1059 virial[1] += v * r_ij[1] * r_ij[1];
1060 virial[2] += v * r_ij[2] * r_ij[2];
1061 virial[3] += v * r_ij[1] * r_ij[2];
1062 virial[4] += v * r_ij[0] * r_ij[2];
1063 virial[5] += v * r_ij[0] * r_ij[1];
1067 void LennardJones612Implementation::ProcessParticleVirialTerm(
1068 const double & dEidr,
1070 const double *
const r_ij,
1075 double const v = dEidr / rij;
1078 vir[0] = 0.5 * v * r_ij[0] * r_ij[0];
1079 vir[1] = 0.5 * v * r_ij[1] * r_ij[1];
1080 vir[2] = 0.5 * v * r_ij[2] * r_ij[2];
1081 vir[3] = 0.5 * v * r_ij[1] * r_ij[2];
1082 vir[4] = 0.5 * v * r_ij[0] * r_ij[2];
1083 vir[5] = 0.5 * v * r_ij[0] * r_ij[1];
1085 for (
int k = 0; k < 6; ++k)
1087 particleVirial[i][k] += vir[k];
1088 particleVirial[j][k] += vir[k];
1100 int const extentZero,
1101 int const extentOne)
1103 arrayPtr =
new double *[extentZero];
1104 arrayPtr[0] =
new double[extentZero * extentOne];
1105 for (
int i = 1; i < extentZero; ++i)
1106 { arrayPtr[i] = arrayPtr[i - 1] + extentOne; }
1109 for (
int i = 0; i < extentZero; ++i)
1111 for (
int j = 0; j < extentOne; ++j) { arrayPtr[i][j] = 0.0; }
1118 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.