diff --git a/include/simde/dynamics/dynamics.hpp b/include/simde/dynamics/dynamics.hpp new file mode 100644 index 00000000..92c94e61 --- /dev/null +++ b/include/simde/dynamics/dynamics.hpp @@ -0,0 +1,24 @@ +/* + * Copyright 2024 NWChemEx + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** @file dynamics.hpp + * + * Convenience header for including all of the property types associated with + * molecular dynamics. + */ +#pragma once + +#include diff --git a/include/simde/dynamics/time_step.hpp b/include/simde/dynamics/time_step.hpp new file mode 100644 index 00000000..86f70f12 --- /dev/null +++ b/include/simde/dynamics/time_step.hpp @@ -0,0 +1,48 @@ +/* + * Copyright 2024 NWChemEx + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include + +namespace simde { + +DECLARE_PROPERTY_TYPE(TimeStep); + +PROPERTY_TYPE_INPUTS(TimeStep) { + using chem_system_t = const chemist::ChemicalSystem&; + auto rv = + pluginplay::declare_input().add_field("Chemical System"); + + rv["Chemical System"].set_description("The system at the current time"); + + return rv; +} + +PROPERTY_TYPE_RESULTS(TimeStep) { + using chemical_system_t = chemist::ChemicalSystem; + using momentum_t = chemist::PointSet; + + auto rv = pluginplay::declare_result() + .add_field("New Chemical System") + .template add_field("Momentum"); + rv["New Chemical System"].set_description( + "The system at the next time step"); + rv["Momentum"].set_description("The momentum of the system"); + return rv; +} + +} // namespace simde diff --git a/include/simde/simde.hpp b/include/simde/simde.hpp index 6414cc02..2bdca32e 100644 --- a/include/simde/simde.hpp +++ b/include/simde/simde.hpp @@ -17,5 +17,7 @@ #pragma once #include #include +#include +#include #include #include diff --git a/src/python/dynamics/export_dynamics.hpp b/src/python/dynamics/export_dynamics.hpp new file mode 100644 index 00000000..2c50f8dc --- /dev/null +++ b/src/python/dynamics/export_dynamics.hpp @@ -0,0 +1,28 @@ +/* + * Copyright 2024 NWChemEx + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "../export_simde.hpp" +#include +#include + +namespace simde { + +inline void export_dynamics(python_module_reference m) { + EXPORT_PROPERTY_TYPE(TimeStep, m); +} + +} // namespace simde diff --git a/src/python/module.cpp b/src/python/module.cpp index 148a80aa..8a8aaf3e 100644 --- a/src/python/module.cpp +++ b/src/python/module.cpp @@ -16,6 +16,7 @@ #include "basis_set/export_basis_set.hpp" #include "chemical_system/export_chemical_system.hpp" +#include "dynamics/export_dynamics.hpp" #include "energy/export_energy.hpp" #include "export_simde.hpp" @@ -25,6 +26,7 @@ PYBIND11_MODULE(simde, m) { m.doc() = "PySimDE: Python bindings for the Simulation development environment"; export_chemical_system(m); + export_dynamics(m); export_basis_set(m); export_energy(m); } diff --git a/tests/cxx/unit_tests/dynamics/dynamics.cpp b/tests/cxx/unit_tests/dynamics/dynamics.cpp new file mode 100644 index 00000000..82350bf0 --- /dev/null +++ b/tests/cxx/unit_tests/dynamics/dynamics.cpp @@ -0,0 +1,25 @@ +/* + * Copyright 2024 NWChemEx + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "../test_property_type.hpp" +#include + +using namespace simde; + +TEST_CASE("Dynamics") { + test_property_type({"Chemical System"}, + {"New Chemical System", "Momentum"}); +} diff --git a/tests/python/unit_tests/dynamics/__init__.py b/tests/python/unit_tests/dynamics/__init__.py new file mode 100644 index 00000000..20901bc6 --- /dev/null +++ b/tests/python/unit_tests/dynamics/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 NWChemEx +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/python/unit_tests/dynamics/test_dynamics.py b/tests/python/unit_tests/dynamics/test_dynamics.py new file mode 100644 index 00000000..b8b53322 --- /dev/null +++ b/tests/python/unit_tests/dynamics/test_dynamics.py @@ -0,0 +1,24 @@ +# Copyright 2024 NWChemEx +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import simde +from test_property_type import BaseTestPropertyType + + +class TestTimeStep(BaseTestPropertyType): + + def setUp(self): + self.pt = simde.TimeStep() + self.input_labels = ['Chemical System'] + self.result_labels = ['New Chemical System', 'Momentum']