-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a498b9b
commit 8c6c5bf
Showing
707 changed files
with
50,435 additions
and
1,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dev
updated
40 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* @file | ||
* @brief Default module that is always loaded by Core | ||
* @copyright This code is licensed under the 3-clause BSD license.\n | ||
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.\n | ||
* See LICENSE.txt for details. | ||
*/ | ||
#include "MrccModule.h" | ||
#include <Core/DerivedModule.h> | ||
#include <Utils/ExternalQC/MRCC/MrccCCCalculator.h> | ||
#include <Utils/ExternalQC/MRCC/MrccDFTCalculator.h> | ||
#include <Utils/ExternalQC/MRCC/MrccHFCalculator.h> | ||
#include <Utils/ExternalQC/MRCC/MrccMP2Calculator.h> | ||
|
||
namespace Scine { | ||
namespace Utils { | ||
|
||
using MrccInterfaceModelMap = | ||
boost::mpl::map<boost::mpl::pair<Scine::Core::Calculator, boost::mpl::vector<ExternalQC::MrccHFCalculator, ExternalQC::MrccDFTCalculator, | ||
ExternalQC::MrccMP2Calculator, ExternalQC::MrccCCCalculator>>>; | ||
|
||
std::string MrccModule::name() const noexcept { | ||
return "MRCC"; | ||
} | ||
|
||
bool MrccModule::mrccFound() { | ||
return std::getenv(ExternalQC::MrccCalculator::binaryEnvVariable) != nullptr; | ||
} | ||
|
||
boost::any MrccModule::get(const std::string& interface, const std::string& model) const { | ||
boost::any resolved = Scine::Core::DerivedModule::resolve<MrccInterfaceModelMap>(interface, model); | ||
// Throw an exception if we could not match an interface or model | ||
if (resolved.empty()) { | ||
throw Scine::Core::ClassNotImplementedError(); | ||
} | ||
return resolved; | ||
} | ||
|
||
bool MrccModule::has(const std::string& interface, const std::string& model) const noexcept { | ||
return Scine::Core::DerivedModule::has<MrccInterfaceModelMap>(interface, model) && mrccFound(); | ||
} | ||
|
||
std::vector<std::string> MrccModule::announceInterfaces() const noexcept { | ||
return Scine::Core::DerivedModule::announceInterfaces<MrccInterfaceModelMap>(); | ||
} | ||
|
||
std::vector<std::string> MrccModule::announceModels(const std::string& interface) const noexcept { | ||
auto models = Scine::Core::DerivedModule::announceModels<MrccInterfaceModelMap>(interface); | ||
|
||
if (interface == Scine::Core::Calculator::interface && !mrccFound()) { | ||
auto mrccModels = {ExternalQC::MrccHFCalculator::model, ExternalQC::MrccDFTCalculator::model, | ||
ExternalQC::MrccMP2Calculator::model, ExternalQC::MrccCCCalculator::model}; | ||
for (const auto& mrccModel : mrccModels) { | ||
models.erase(std::remove(std::begin(models), std::end(models), mrccModel), std::end(models)); | ||
} | ||
} | ||
return models; | ||
} | ||
|
||
std::shared_ptr<Scine::Core::Module> MrccModule::make() { | ||
return std::make_shared<MrccModule>(); | ||
} | ||
|
||
} // namespace Utils | ||
} // namespace Scine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @file | ||
* @brief Default module that is always loaded by Core | ||
* @copyright This code is licensed under the 3-clause BSD license.\n | ||
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.\n | ||
* See LICENSE.txt for details. | ||
*/ | ||
|
||
#ifndef UTILS_MRCCMODULE_H | ||
#define UTILS_MRCCMODULE_H | ||
|
||
#include "Core/Module.h" | ||
|
||
namespace Scine { | ||
namespace Utils { | ||
/** | ||
* @class | ||
* @brief MRCC module provided by OSUtils. | ||
*/ | ||
class MrccModule : public Core::Module { | ||
public: | ||
std::string name() const noexcept final; | ||
|
||
boost::any get(const std::string& interface, const std::string& model) const final; | ||
|
||
bool has(const std::string& interface, const std::string& model) const noexcept final; | ||
|
||
std::vector<std::string> announceInterfaces() const noexcept final; | ||
|
||
std::vector<std::string> announceModels(const std::string& interface) const noexcept final; | ||
|
||
static std::shared_ptr<Core::Module> make(); | ||
|
||
static bool mrccFound(); | ||
}; | ||
|
||
// Shared library entry point creating pointers to all contained modules | ||
std::vector<std::shared_ptr<Core::Module>> moduleFactory(); | ||
|
||
} // namespace Utils | ||
} // namespace Scine | ||
|
||
#endif // UTILS_MRCCMODULE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.