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 std::string
const * paramFileDirName;
304 for (
int i = 0; i < numberParameterFiles; ++i)
306 std::string
const * paramFileName;
310 LOG_ERROR(
"Unable to get parameter file name");
313 std::string filename = *paramFileDirName +
"/" + *paramFileName;
314 parameterFilePointers[i] = fopen(filename.c_str(),
"r");
315 if (parameterFilePointers[i] == 0)
319 "LennardJones612 parameter file number %d cannot be opened",
323 for (
int j = i - 1; j >= 0; --j) { fclose(parameterFilePointers[j]); }
334 #undef KIM_LOGGER_OBJECT_NAME 335 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 337 int LennardJones612Implementation::ProcessParameterFiles(
343 int endOfFileFlag = 0;
346 int iIndex, jIndex, indx, iiIndex, jjIndex;
347 double nextCutoff, nextEpsilon, nextSigma;
349 nextLinePtr = nextLine;
352 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
353 ier = sscanf(nextLine,
"%d %d", &N, &shift_);
356 sprintf(nextLine,
"unable to read first line of the parameter file");
359 fclose(parameterFilePointers[0]);
362 numberModelSpecies_ =
N;
363 numberUniqueSpeciesPairs_
364 = ((numberModelSpecies_ + 1) * numberModelSpecies_) / 2;
365 AllocateParameterMemory();
368 for (
int i = 0; i < ((N + 1) * N / 2); i++)
377 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>
379 std::vector<KIM::SpeciesName> speciesNameVector;
384 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
385 while (endOfFileFlag == 0)
387 ier = sscanf(nextLine,
396 sprintf(nextLine,
"error reading lines of the parameter file");
406 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
408 = modelSpeciesMap.find(specName1);
409 if (iIter == modelSpeciesMap.end())
411 modelSpeciesMap[specName1] = index;
412 modelSpeciesCodeList_.push_back(index);
413 speciesNameVector.push_back(specName1);
422 iIndex = modelSpeciesMap[specName1];
424 std::map<KIM::SpeciesName const, int, KIM::SPECIES_NAME::Comparator>::
426 = modelSpeciesMap.find(specName2);
427 if (jIter == modelSpeciesMap.end())
429 modelSpeciesMap[specName2] = index;
430 modelSpeciesCodeList_.push_back(index);
431 speciesNameVector.push_back(specName2);
440 jIndex = modelSpeciesMap[specName2];
443 if (iIndex >= jIndex)
445 indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2;
449 indx = iIndex * N + jIndex - (iIndex * iIndex + iIndex) / 2;
451 cutoffs_[indx] = nextCutoff;
452 epsilons_[indx] = nextEpsilon;
453 sigmas_[indx] = nextSigma;
456 parameterFilePointers[0], nextLinePtr,
MAXLINE, &endOfFileFlag);
460 std::stringstream ss;
461 ss <<
"There are not values for like-like pairs of:";
462 for (
int i = 0; i <
N; i++)
464 if (cutoffs_[(i * N + i - (i * i + i) / 2)] == -1)
467 ss << (speciesNameVector[i].ToString()).c_str();
478 for (
int jIndex = 0; jIndex <
N; jIndex++)
480 jjIndex = (jIndex * N + jIndex - (jIndex * jIndex + jIndex) / 2);
481 for (
int iIndex = (jIndex + 1); iIndex <
N; iIndex++)
483 indx = jIndex * N + iIndex - (jIndex * jIndex + jIndex) / 2;
484 if (cutoffs_[indx] == -1)
486 iiIndex = (iIndex * N + iIndex - (iIndex * iIndex + iIndex) / 2);
487 epsilons_[indx] = sqrt(epsilons_[iiIndex] * epsilons_[jjIndex]);
488 sigmas_[indx] = (sigmas_[iiIndex] + sigmas_[jjIndex]) / 2.0;
489 cutoffs_[indx] = (cutoffs_[iiIndex] + cutoffs_[jjIndex]) / 2.0;
500 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'))
514 nextLinePtr = (nextLinePtr + 1);
516 }
while ((strncmp(
"#", nextLinePtr, 1) == 0) || (strlen(nextLinePtr) == 0));
520 void LennardJones612Implementation::CloseParameterFiles(
521 int const numberParameterFiles,
524 for (
int i = 0; i < numberParameterFiles; ++i)
525 fclose(parameterFilePointers[i]);
529 #undef KIM_LOGGER_OBJECT_NAME 530 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 532 int LennardJones612Implementation::ConvertUnits(
550 double convertLength = 1.0;
559 requestedTemperatureUnit,
569 LOG_ERROR(
"Unable to convert length unit");
572 if (convertLength !=
ONE)
574 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
576 cutoffs_[i] *= convertLength;
577 sigmas_[i] *= convertLength;
581 double convertEnergy = 1.0;
590 requestedTemperatureUnit,
600 LOG_ERROR(
"Unable to convert energy unit");
603 if (convertEnergy !=
ONE)
605 for (
int i = 0; i < numberUniqueSpeciesPairs_; ++i)
607 epsilons_[i] *= convertEnergy;
612 ier = modelDriverCreate->
SetUnits(requestedLengthUnit,
619 LOG_ERROR(
"Unable to set units to requested values");
629 int LennardJones612Implementation::RegisterKIMModelSettings(
639 #undef KIM_LOGGER_OBJECT_NAME 640 #define KIM_LOGGER_OBJECT_NAME modelComputeArgumentsCreate 642 int LennardJones612Implementation::RegisterKIMComputeArgumentsSettings(
680 static_cast<std::ostringstream const &>(std::ostringstream() \ 684 #undef KIM_LOGGER_OBJECT_NAME 685 #define KIM_LOGGER_OBJECT_NAME modelDriverCreate 687 int LennardJones612Implementation::RegisterKIMParameters(
697 "If (shift == 1), all LJ potentials are shifted to zero energy " 698 "at their respective cutoff distance. Otherwise, no shifting is " 707 numberUniqueSpeciesPairs_,
710 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
712 "in row-major storage. Ordering is according to SpeciesCode " 714 "For example, to find the parameter related to SpeciesCode 'i' and " 715 "SpeciesCode 'j' (i >= j), use (zero-based) " 716 "index = (j*N + i - (j*j + j)/2).");
723 numberUniqueSpeciesPairs_,
726 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
728 "in row-major storage. Ordering is according to SpeciesCode " 730 "For example, to find the parameter related to SpeciesCode 'i' and " 731 "SpeciesCode 'j' (i >= j), use (zero-based) " 732 "index = (j*N + i - (j*j + j)/2).");
739 numberUniqueSpeciesPairs_,
742 "Lower-triangular matrix (of size N=" +
SNUM(numberModelSpecies_)
744 "in row-major storage. Ordering is according to SpeciesCode " 746 "For example, to find the parameter related to SpeciesCode 'i' and " 747 "SpeciesCode 'j' (i >= j), use (zero-based) " 748 "index = (j*N + i - (j*j + j)/2).");
761 int LennardJones612Implementation::RegisterKIMFunctions(
780 reinterpret_cast<KIM::Function *>(destroy))
785 reinterpret_cast<KIM::Function *>(refresh))
790 reinterpret_cast<KIM::Function *>(compute))
795 reinterpret_cast<KIM::Function *>(CACreate))
800 reinterpret_cast<KIM::Function *>(CADestroy));
805 template<
class ModelObj>
806 int LennardJones612Implementation::SetRefreshMutableValues(
807 ModelObj *
const modelObj)
815 for (
int i = 0; i < numberModelSpecies_; ++i)
817 for (
int j = 0; j <= i; ++j)
819 int const index = j * numberModelSpecies_ + i - (j * j + j) / 2;
820 cutoffsSq2D_[i][j] = cutoffsSq2D_[j][i]
821 = (cutoffs_[index] * cutoffs_[index]);
822 fourEpsilonSigma6_2D_[i][j] = fourEpsilonSigma6_2D_[j][i]
823 = 4.0 * epsilons_[index] * pow(sigmas_[index], 6.0);
824 fourEpsilonSigma12_2D_[i][j] = fourEpsilonSigma12_2D_[j][i]
825 = 4.0 * epsilons_[index] * pow(sigmas_[index], 12.0);
826 twentyFourEpsilonSigma6_2D_[i][j] = twentyFourEpsilonSigma6_2D_[j][i]
827 = 6.0 * fourEpsilonSigma6_2D_[i][j];
828 fortyEightEpsilonSigma12_2D_[i][j] = fortyEightEpsilonSigma12_2D_[j][i]
829 = 12.0 * fourEpsilonSigma12_2D_[i][j];
830 oneSixtyEightEpsilonSigma6_2D_[i][j]
831 = oneSixtyEightEpsilonSigma6_2D_[j][i]
832 = 7.0 * twentyFourEpsilonSigma6_2D_[i][j];
833 sixTwentyFourEpsilonSigma12_2D_[i][j]
834 = sixTwentyFourEpsilonSigma12_2D_[j][i]
835 = 13.0 * fortyEightEpsilonSigma12_2D_[i][j];
840 influenceDistance_ = 0.0;
842 for (
int i = 0; i < numberModelSpecies_; i++)
844 int indexI = modelSpeciesCodeList_[i];
846 for (
int j = 0; j < numberModelSpecies_; j++)
848 int indexJ = modelSpeciesCodeList_[j];
850 if (influenceDistance_ < cutoffsSq2D_[indexI][indexJ])
852 influenceDistance_ = cutoffsSq2D_[indexI][indexJ];
857 influenceDistance_ = sqrt(influenceDistance_);
858 modelObj->SetInfluenceDistancePointer(&influenceDistance_);
859 modelObj->SetNeighborListPointers(
862 &modelWillNotRequestNeighborsOfNoncontributingParticles_);
866 double const *
const *
const constFourEpsSig6_2D = fourEpsilonSigma6_2D_;
867 double const *
const *
const constFourEpsSig12_2D = fourEpsilonSigma12_2D_;
871 for (
int iSpecies = 0; iSpecies < numberModelSpecies_; iSpecies++)
873 for (
int jSpecies = 0; jSpecies <= iSpecies; jSpecies++)
875 int const index = jSpecies * numberModelSpecies_ + iSpecies
876 - (jSpecies * jSpecies + jSpecies) / 2;
877 double const rij2 = cutoffs_[index] * cutoffs_[index];
878 double const r2iv = 1.0 / rij2;
879 double const r6iv = r2iv * r2iv * r2iv;
881 shifts2D_[iSpecies][jSpecies] = shifts2D_[jSpecies][iSpecies] = phi;
892 #undef KIM_LOGGER_OBJECT_NAME 893 #define KIM_LOGGER_OBJECT_NAME modelComputeArguments 895 int LennardJones612Implementation::SetComputeMutableValues(
897 bool & isComputeProcess_dEdr,
898 bool & isComputeProcess_d2Edr2,
899 bool & isComputeEnergy,
900 bool & isComputeForces,
901 bool & isComputeParticleEnergy,
902 bool & isComputeVirial,
903 bool & isComputeParticleVirial,
908 double *& particleEnergy,
916 int compProcess_dEdr;
917 int compProcess_d2Edr2;
924 isComputeProcess_dEdr = compProcess_dEdr;
925 isComputeProcess_d2Edr2 = compProcess_d2Edr2;
945 (
double const **) &forces)
948 (
double const **) &virial)
951 (
double const **) &particleVirial);
958 isComputeEnergy = (energy != NULL);
959 isComputeParticleEnergy = (particleEnergy != NULL);
960 isComputeForces = (forces != NULL);
961 isComputeVirial = (virial != NULL);
962 isComputeParticleVirial = (particleVirial != NULL);
973 #undef KIM_LOGGER_OBJECT_NAME 974 #define KIM_LOGGER_OBJECT_NAME modelCompute 975 int LennardJones612Implementation::CheckParticleSpeciesCodes(
980 for (
int i = 0; i < cachedNumberOfParticles_; ++i)
982 if ((particleSpeciesCodes[i] < 0)
983 || (particleSpeciesCodes[i] >= numberModelSpecies_))
986 LOG_ERROR(
"unsupported particle species codes detected");
997 int LennardJones612Implementation::GetComputeIndex(
998 const bool & isComputeProcess_dEdr,
999 const bool & isComputeProcess_d2Edr2,
1000 const bool & isComputeEnergy,
1001 const bool & isComputeForces,
1002 const bool & isComputeParticleEnergy,
1003 const bool & isComputeVirial,
1004 const bool & isComputeParticleVirial,
1005 const bool & isShift)
const 1008 const int processd2E = 2;
1009 const int energy = 2;
1010 const int force = 2;
1011 const int particleEnergy = 2;
1012 const int virial = 2;
1013 const int particleVirial = 2;
1014 const int shift = 2;
1020 index += (int(isComputeProcess_dEdr)) * processd2E * energy * force
1021 * particleEnergy * virial * particleVirial * shift;
1024 index += (int(isComputeProcess_d2Edr2)) * energy * force * particleEnergy
1025 * virial * particleVirial * shift;
1028 index += (int(isComputeEnergy)) * force * particleEnergy * virial
1029 * particleVirial * shift;
1032 index += (int(isComputeForces)) * particleEnergy * virial * particleVirial
1036 index += (int(isComputeParticleEnergy)) * virial * particleVirial * shift;
1039 index += (int(isComputeVirial)) * particleVirial * shift;
1042 index += (int(isComputeParticleVirial)) * shift;
1045 index += (int(isShift));
1051 void LennardJones612Implementation::ProcessVirialTerm(
1052 const double & dEidr,
1054 const double *
const r_ij,
1059 double const v = dEidr / rij;
1061 virial[0] += v * r_ij[0] * r_ij[0];
1062 virial[1] += v * r_ij[1] * r_ij[1];
1063 virial[2] += v * r_ij[2] * r_ij[2];
1064 virial[3] += v * r_ij[1] * r_ij[2];
1065 virial[4] += v * r_ij[0] * r_ij[2];
1066 virial[5] += v * r_ij[0] * r_ij[1];
1070 void LennardJones612Implementation::ProcessParticleVirialTerm(
1071 const double & dEidr,
1073 const double *
const r_ij,
1078 double const v = dEidr / rij;
1081 vir[0] = 0.5 * v * r_ij[0] * r_ij[0];
1082 vir[1] = 0.5 * v * r_ij[1] * r_ij[1];
1083 vir[2] = 0.5 * v * r_ij[2] * r_ij[2];
1084 vir[3] = 0.5 * v * r_ij[1] * r_ij[2];
1085 vir[4] = 0.5 * v * r_ij[0] * r_ij[2];
1086 vir[5] = 0.5 * v * r_ij[0] * r_ij[1];
1088 for (
int k = 0; k < 6; ++k)
1090 particleVirial[i][k] += vir[k];
1091 particleVirial[j][k] += vir[k];
1103 int const extentZero,
1104 int const extentOne)
1106 arrayPtr =
new double *[extentZero];
1107 arrayPtr[0] =
new double[extentZero * extentOne];
1108 for (
int i = 1; i < extentZero; ++i)
1110 arrayPtr[i] = arrayPtr[i - 1] + extentOne;
1114 for (
int i = 0; i < extentZero; ++i)
1116 for (
int j = 0; j < extentOne; ++j) { arrayPtr[i][j] = 0.0; }
1123 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.
int GetParameterFileBasename(int const index, std::string const **const parameterFileBasename) const
Get a particular parameter file basename. The file is located in the Model's parameter file directory...
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.
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.
void GetParameterFileDirectoryName(std::string const **const directoryName) const
Get absolute path name of the temporary directory where parameter files provided by the model are wri...
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.