Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions include/simde/dynamics/dynamics.hpp
Original file line number Diff line number Diff line change
@@ -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 <simde/dynamics/time_step.hpp>
48 changes: 48 additions & 0 deletions include/simde/dynamics/time_step.hpp
Original file line number Diff line number Diff line change
@@ -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 <chemist/chemist.hpp>
#include <pluginplay/pluginplay.hpp>

namespace simde {

DECLARE_PROPERTY_TYPE(TimeStep);

PROPERTY_TYPE_INPUTS(TimeStep) {
using chem_system_t = const chemist::ChemicalSystem&;
auto rv =
pluginplay::declare_input().add_field<chem_system_t>("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<double>;

auto rv = pluginplay::declare_result()
.add_field<chemical_system_t>("New Chemical System")
.template add_field<momentum_t>("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
2 changes: 2 additions & 0 deletions include/simde/simde.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
#pragma once
#include <simde/basis_set/basis_set.hpp>
#include <simde/chemical_system/chemical_system.hpp>
#include <simde/derivative/derivative.hpp>
#include <simde/dynamics/dynamics.hpp>
#include <simde/energy/energy.hpp>
#include <simde/types.hpp>
28 changes: 28 additions & 0 deletions src/python/dynamics/export_dynamics.hpp
Original file line number Diff line number Diff line change
@@ -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 <pluginplay/pluginplay.hpp>
#include <simde/dynamics/time_step.hpp>

namespace simde {

inline void export_dynamics(python_module_reference m) {
EXPORT_PROPERTY_TYPE(TimeStep, m);
}

} // namespace simde
2 changes: 2 additions & 0 deletions src/python/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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);
}
Expand Down
25 changes: 25 additions & 0 deletions tests/cxx/unit_tests/dynamics/dynamics.cpp
Original file line number Diff line number Diff line change
@@ -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 <simde/dynamics/time_step.hpp>

using namespace simde;

TEST_CASE("Dynamics") {
test_property_type<TimeStep>({"Chemical System"},
{"New Chemical System", "Momentum"});
}
13 changes: 13 additions & 0 deletions tests/python/unit_tests/dynamics/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions tests/python/unit_tests/dynamics/test_dynamics.py
Original file line number Diff line number Diff line change
@@ -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']