kim-api 2.3.0+AppleClang.AppleClang.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Loading...
Searching...
No Matches
KIM_ModelCreate.hpp
Go to the documentation of this file.
1//
2// KIM-API: An API for interatomic models
3// Copyright (c) 2013--2022, Regents of the University of Minnesota.
4// All rights reserved.
5//
6// Contributors:
7// Ryan S. Elliott
8//
9// SPDX-License-Identifier: LGPL-2.1-or-later
10//
11// This library is free software; you can redistribute it and/or
12// modify it under the terms of the GNU Lesser General Public
13// License as published by the Free Software Foundation; either
14// version 2.1 of the License, or (at your option) any later version.
15//
16// This library is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19// Lesser General Public License for more details.
20//
21// You should have received a copy of the GNU Lesser General Public License
22// along with this library; if not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24//
25
26//
27// Release: This file is part of the kim-api-2.3.0 package.
28//
29
30
31#ifndef KIM_MODEL_CREATE_HPP_
32#define KIM_MODEL_CREATE_HPP_
33
34#include <sstream>
35#include <string>
36
37#ifndef KIM_FUNCTION_TYPES_HPP_
38#include "KIM_FunctionTypes.hpp" // IWYU pragma: export
39#endif
40
41namespace KIM
42{
43// Forward declarations
44class LogVerbosity;
45class LanguageName;
46class Numbering;
47class ModelRoutineName;
48class SpeciesName;
49class LengthUnit;
50class EnergyUnit;
51class ChargeUnit;
52class TemperatureUnit;
53class TimeUnit;
54class ModelCreateImplementation;
55
56
65{
66 public:
80 int SetModelNumbering(Numbering const numbering);
81
100 void SetInfluenceDistancePointer(double const * const influenceDistance);
101
127 int const numberOfNeighborLists,
128 double const * const cutoffs,
129 int const * const modelWillNotRequestNeighborsOfNoncontributingParticles);
130
135
153 int SetRoutinePointer(ModelRoutineName const modelRoutineName,
154 LanguageName const languageName,
155 int const required,
156 Function * const fptr);
157
176 int SetSpeciesCode(SpeciesName const speciesName, int const code);
177
207 int SetParameterPointer(int const extent,
208 int * const ptr,
209 std::string const & name,
210 std::string const & description);
211
213 int SetParameterPointer(int const extent,
214 double * const ptr,
215 std::string const & name,
216 std::string const & description);
217
232 void SetModelBufferPointer(void * const ptr);
233
258 int SetUnits(LengthUnit const lengthUnit,
259 EnergyUnit const energyUnit,
260 ChargeUnit const chargeUnit,
261 TemperatureUnit const temperatureUnit,
262 TimeUnit const timeUnit);
263
294 static int ConvertUnit(LengthUnit const fromLengthUnit,
295 EnergyUnit const fromEnergyUnit,
296 ChargeUnit const fromChargeUnit,
297 TemperatureUnit const fromTemperatureUnit,
298 TimeUnit const fromTimeUnit,
299 LengthUnit const toLengthUnit,
300 EnergyUnit const toEnergyUnit,
301 ChargeUnit const toChargeUnit,
302 TemperatureUnit const toTemperatureUnit,
303 TimeUnit const toTimeUnit,
304 double const lengthExponent,
305 double const energyExponent,
306 double const chargeExponent,
307 double const temperatureExponent,
308 double const timeExponent,
309 double * const conversionFactor);
310
326 void LogEntry(LogVerbosity const logVerbosity,
327 std::string const & message,
328 int const lineNumber,
329 std::string const & fileName) const;
330
332 void LogEntry(LogVerbosity const logVerbosity,
333 std::stringstream const & message,
334 int const lineNumber,
335 std::string const & fileName) const;
336
347 std::string const & ToString() const;
348
349 private:
350 // do not allow copy constructor or operator=
351 ModelCreate(ModelCreate const &);
352 void operator=(ModelCreate const &);
353
354 ModelCreate();
355 ~ModelCreate();
356
357 ModelCreateImplementation * pimpl;
358}; // class ModelCreate
359} // namespace KIM
360
361#endif // KIM_MODEL_CREATE_HPP_
An Extensible Enumeration for the ChargeUnit's supported by the KIM API.
An Extensible Enumeration for the EnergyUnit's supported by the KIM API.
An Extensible Enumeration for the LanguageName's supported by the KIM API.
An Extensible Enumeration for the LengthUnit's supported by the KIM API.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
std::string const & ToString() const
Get a string representing the internal state of the Model object.
void SetInfluenceDistancePointer(double const *const influenceDistance)
Set the Model's influence distance data pointer.
int SetRoutinePointer(ModelRoutineName const modelRoutineName, LanguageName const languageName, int const required, Function *const fptr)
Set the function pointer for the ModelRoutineName of interest.
void 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 o...
int SetSpeciesCode(SpeciesName const speciesName, int const code)
Set integer code for supported SpeciesName.
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.
int 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 o...
int SetModelNumbering(Numbering const numbering)
Set the Model's particle Numbering.
void SetNeighborListPointers(int const numberOfNeighborLists, double const *const cutoffs, int const *const modelWillNotRequestNeighborsOfNoncontributingParticles)
Set the Model's neighbor list data pointers.
void SetModelBufferPointer(void *const ptr)
Set the Model's buffer pointer within the Model object.
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 ...
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.
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 ModelRoutineName's supported by the KIM API.
An Extensible Enumeration for the Numbering's supported by the KIM API.
An Extensible Enumeration for the SpeciesName's supported by the KIM API.
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.
An Extensible Enumeration for the TimeUnit's supported by the KIM API.
void() Function(void)
Generic function type.