// // edip.hpp // // LGPL Version 2.1 HEADER START // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301 USA // // LGPL Version 2.1 HEADER END // // // Copyright (c) 2021, Regents of the University of Minnesota. // All rights reserved. // // Contributors: // Yaser Afshar // #ifndef EDIP_HPP #define EDIP_HPP #include #include "KIM_ModelDriverHeaders.hpp" extern "C" { int ModelDriverCreateRoutine( KIM::ModelDriverCreate *const model_driver_create, KIM::LengthUnit const requested_length_unit, KIM::EnergyUnit const requested_energy_unit, KIM::ChargeUnit const requested_charge_unit, KIM::TemperatureUnit const requested_temperature_unit, KIM::TimeUnit const requested_time_unit); } // Forward declaration class EDIPImplementation; /*! * \brief EDIP model driver class for %KIM API * * * \note * There is no need to make these "extern" since KIM will only access them * via function pointers. "static" is required so that there is not * n implicit this pointer added to the prototype by the C++ compiler */ class EDIP { public: /*! * \brief Construct a new EDIP object * * \param model_driver_create An interface to a %KIM API Model object * \param requested_length_unit The requested length unit * \param requested_energy_unit The requested energy unit * \param requested_charge_unit The requested charge unit * \param requested_temperature_unit The requested temperature unit * \param requested_time_unit The requested time unit * \param ierr 0|false if everything goes well and 1|true if it fails */ EDIP(KIM::ModelDriverCreate *const model_driver_create, KIM::LengthUnit const requested_length_unit, KIM::EnergyUnit const requested_energy_unit, KIM::ChargeUnit const requested_charge_unit, KIM::TemperatureUnit const requested_temperature_unit, KIM::TimeUnit const requested_time_unit, int *const ierr); /*! * \brief Destroy the EDIP object * */ ~EDIP() = default; static int Destroy(KIM::ModelDestroy *const model_destroy); static int Refresh(KIM::ModelRefresh *const model_refresh); static int WriteParameterizedModel( KIM::ModelWriteParameterizedModel const *const model_write_parameterized_model); static int Compute( KIM::ModelCompute const *const model_compute, KIM::ModelComputeArguments const *const model_compute_arguments); static int ComputeArgumentsCreate( KIM::ModelCompute const *const model_compute, KIM::ModelComputeArgumentsCreate *const model_compute_arguments_createate); static int ComputeArgumentsDestroy( KIM::ModelCompute const *const model_compute, KIM::ModelComputeArgumentsDestroy *const model_compute_arguments_destroy); private: std::unique_ptr edip_implementation_; }; #endif // EDIP_HPP