SerializationProxyRegistration.cpp 11.8 KB
Newer Older
1
2
3
/* -------------------------------------------------------------------------- *
 *                                   OpenMM                                   *
 * -------------------------------------------------------------------------- *
Evan Pretti's avatar
Evan Pretti committed
4
5
 * This is part of the OpenMM molecular simulation toolkit.                   *
 * See https://openmm.org/development.                                        *
6
 *                                                                            *
7
 * Portions copyright (c) 2010-2025 Stanford University and the Authors.      *
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Authors: Peter Eastman                                                     *
 * Contributors:                                                              *
 *                                                                            *
 * Permission is hereby granted, free of charge, to any person obtaining a    *
 * copy of this software and associated documentation files (the "Software"), *
 * to deal in the Software without restriction, including without limitation  *
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,   *
 * and/or sell copies of the Software, and to permit persons to whom the      *
 * Software is furnished to do so, subject to the following conditions:       *
 *                                                                            *
 * The above copyright notice and this permission notice shall be included in *
 * all copies or substantial portions of the Software.                        *
 *                                                                            *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *
 * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,    *
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR      *
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE  *
 * USE OR OTHER DEALINGS IN THE SOFTWARE.                                     *
 * -------------------------------------------------------------------------- */

30
#include "openmm/AndersenThermostat.h"
31
#include "openmm/ATMForce.h"
32
#include "openmm/BrownianIntegrator.h"
33
34
#include "openmm/CMAPTorsionForce.h"
#include "openmm/CMMotionRemover.h"
35
#include "openmm/CompoundIntegrator.h"
36
#include "openmm/ConstantPotentialForce.h"
37
38
#include "openmm/CustomAngleForce.h"
#include "openmm/CustomBondForce.h"
39
#include "openmm/CustomCentroidBondForce.h"
40
#include "openmm/CustomCompoundBondForce.h"
41
#include "openmm/CustomCVForce.h"
42
#include "openmm/CustomExternalForce.h"
43
44
#include "openmm/CustomGBForce.h"
#include "openmm/CustomHbondForce.h"
45
#include "openmm/CustomIntegrator.h"
46
#include "openmm/CustomManyParticleForce.h"
47
#include "openmm/CustomNonbondedForce.h"
48
#include "openmm/CustomTorsionForce.h"
49
#include "openmm/CustomVolumeForce.h"
Peter Eastman's avatar
Peter Eastman committed
50
#include "openmm/DPDIntegrator.h"
51
#include "openmm/GayBerneForce.h"
52
#include "openmm/GBSAOBCForce.h"
53
#include "openmm/HarmonicAngleForce.h"
54
#include "openmm/HarmonicBondForce.h"
55
#include "openmm/LangevinIntegrator.h"
56
#include "openmm/LangevinMiddleIntegrator.h"
Evan Pretti's avatar
Evan Pretti committed
57
#include "openmm/LCPOForce.h"
58
#include "openmm/MonteCarloAnisotropicBarostat.h"
59
#include "openmm/MonteCarloBarostat.h"
60
#include "openmm/MonteCarloFlexibleBarostat.h"
61
#include "openmm/MonteCarloMembraneBarostat.h"
62
#include "openmm/NonbondedForce.h"
63
#include "openmm/NoseHooverIntegrator.h"
64
#include "openmm/OrientationRestraintForce.h"
65
#include "openmm/PeriodicTorsionForce.h"
66
#include "openmm/QTBIntegrator.h"
67
#include "openmm/RBTorsionForce.h"
68
#include "openmm/RGForce.h"
69
#include "openmm/RMSDForce.h"
70
#include "openmm/System.h"
71
#include "openmm/TabulatedFunction.h"
72
73
74
75
#include "openmm/VariableLangevinIntegrator.h"
#include "openmm/VariableVerletIntegrator.h"
#include "openmm/VerletIntegrator.h"

76
#include "openmm/serialization/SerializationProxy.h"
77
#include "openmm/serialization/BrownianIntegratorProxy.h"
78
#include "openmm/serialization/AndersenThermostatProxy.h"
79
#include "openmm/serialization/ATMForceProxy.h"
80
81
#include "openmm/serialization/CMAPTorsionForceProxy.h"
#include "openmm/serialization/CMMotionRemoverProxy.h"
82
#include "openmm/serialization/CompoundIntegratorProxy.h"
83
#include "openmm/serialization/ConstantPotentialForceProxy.h"
84
85
#include "openmm/serialization/CustomAngleForceProxy.h"
#include "openmm/serialization/CustomBondForceProxy.h"
86
#include "openmm/serialization/CustomCentroidBondForceProxy.h"
87
#include "openmm/serialization/CustomCompoundBondForceProxy.h"
88
#include "openmm/serialization/CustomCVForceProxy.h"
89
#include "openmm/serialization/CustomExternalForceProxy.h"
90
91
#include "openmm/serialization/CustomGBForceProxy.h"
#include "openmm/serialization/CustomHbondForceProxy.h"
92
#include "openmm/serialization/CustomIntegratorProxy.h"
93
#include "openmm/serialization/CustomManyParticleForceProxy.h"
94
#include "openmm/serialization/CustomNonbondedForceProxy.h"
95
#include "openmm/serialization/CustomTorsionForceProxy.h"
96
#include "openmm/serialization/CustomVolumeForceProxy.h"
Peter Eastman's avatar
Peter Eastman committed
97
#include "openmm/serialization/DPDIntegratorProxy.h"
98
#include "openmm/serialization/GayBerneForceProxy.h"
99
#include "openmm/serialization/GBSAOBCForceProxy.h"
100
101
#include "openmm/serialization/HarmonicAngleForceProxy.h"
#include "openmm/serialization/HarmonicBondForceProxy.h"
102
#include "openmm/serialization/LangevinIntegratorProxy.h"
103
#include "openmm/serialization/LangevinMiddleIntegratorProxy.h"
Evan Pretti's avatar
Evan Pretti committed
104
#include "openmm/serialization/LCPOForceProxy.h"
105
#include "openmm/serialization/MonteCarloAnisotropicBarostatProxy.h"
106
#include "openmm/serialization/MonteCarloBarostatProxy.h"
107
#include "openmm/serialization/MonteCarloFlexibleBarostatProxy.h"
108
#include "openmm/serialization/MonteCarloMembraneBarostatProxy.h"
109
#include "openmm/serialization/NonbondedForceProxy.h"
110
#include "openmm/serialization/NoseHooverIntegratorProxy.h"
111
#include "openmm/serialization/OrientationRestraintForceProxy.h"
112
#include "openmm/serialization/PeriodicTorsionForceProxy.h"
113
#include "openmm/serialization/QTBIntegratorProxy.h"
114
#include "openmm/serialization/RBTorsionForceProxy.h"
115
#include "openmm/serialization/RGForceProxy.h"
116
#include "openmm/serialization/RMSDForceProxy.h"
117
#include "openmm/serialization/StateProxy.h"
118
119
#include "openmm/serialization/SystemProxy.h"
#include "openmm/serialization/TabulatedFunctionProxies.h"
120
121
122
#include "openmm/serialization/VariableLangevinIntegratorProxy.h"
#include "openmm/serialization/VariableVerletIntegratorProxy.h"
#include "openmm/serialization/VerletIntegratorProxy.h"
123
124
125

#if defined(WIN32)
    #include <windows.h>
126
    extern "C" void registerSerializationProxies();
127
128
129
130
131
132
133
134
135
136
137
138
    BOOL WINAPI DllMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {
        if (ul_reason_for_call == DLL_PROCESS_ATTACH)
            registerSerializationProxies();
        return TRUE;
    }
#else
    extern "C" void __attribute__((constructor)) registerSerializationProxies();
#endif

using namespace OpenMM;

extern "C" void registerSerializationProxies() {
139
    SerializationProxy::registerProxy(typeid(AndersenThermostat), new AndersenThermostatProxy());
140
    SerializationProxy::registerProxy(typeid(ATMForce), new ATMForceProxy());
141
    SerializationProxy::registerProxy(typeid(BrownianIntegrator), new BrownianIntegratorProxy());
142
143
    SerializationProxy::registerProxy(typeid(CMAPTorsionForce), new CMAPTorsionForceProxy());
    SerializationProxy::registerProxy(typeid(CMMotionRemover), new CMMotionRemoverProxy());
144
    SerializationProxy::registerProxy(typeid(CompoundIntegrator), new CompoundIntegratorProxy());
145
    SerializationProxy::registerProxy(typeid(ConstantPotentialForce), new ConstantPotentialForceProxy());
146
147
148
    SerializationProxy::registerProxy(typeid(Continuous1DFunction), new Continuous1DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Continuous2DFunction), new Continuous2DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Continuous3DFunction), new Continuous3DFunctionProxy());
149
150
    SerializationProxy::registerProxy(typeid(CustomAngleForce), new CustomAngleForceProxy());
    SerializationProxy::registerProxy(typeid(CustomBondForce), new CustomBondForceProxy());
151
    SerializationProxy::registerProxy(typeid(CustomCentroidBondForce), new CustomCentroidBondForceProxy());
152
    SerializationProxy::registerProxy(typeid(CustomCompoundBondForce), new CustomCompoundBondForceProxy());
153
    SerializationProxy::registerProxy(typeid(CustomCVForce), new CustomCVForceProxy());
154
    SerializationProxy::registerProxy(typeid(CustomExternalForce), new CustomExternalForceProxy());
155
156
    SerializationProxy::registerProxy(typeid(CustomGBForce), new CustomGBForceProxy());
    SerializationProxy::registerProxy(typeid(CustomHbondForce), new CustomHbondForceProxy());
157
    SerializationProxy::registerProxy(typeid(CustomIntegrator), new CustomIntegratorProxy());
158
    SerializationProxy::registerProxy(typeid(CustomManyParticleForce), new CustomManyParticleForceProxy());
159
    SerializationProxy::registerProxy(typeid(CustomNonbondedForce), new CustomNonbondedForceProxy());
160
    SerializationProxy::registerProxy(typeid(CustomTorsionForce), new CustomTorsionForceProxy());
161
    SerializationProxy::registerProxy(typeid(CustomVolumeForce), new CustomVolumeForceProxy());
162
163
164
    SerializationProxy::registerProxy(typeid(Discrete1DFunction), new Discrete1DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Discrete2DFunction), new Discrete2DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Discrete3DFunction), new Discrete3DFunctionProxy());
Peter Eastman's avatar
Peter Eastman committed
165
    SerializationProxy::registerProxy(typeid(DPDIntegrator), new DPDIntegratorProxy());
166
    SerializationProxy::registerProxy(typeid(GayBerneForce), new GayBerneForceProxy());
167
    SerializationProxy::registerProxy(typeid(GBSAOBCForce), new GBSAOBCForceProxy());
168
169
    SerializationProxy::registerProxy(typeid(HarmonicAngleForce), new HarmonicAngleForceProxy());
    SerializationProxy::registerProxy(typeid(HarmonicBondForce), new HarmonicBondForceProxy());
170
    SerializationProxy::registerProxy(typeid(LangevinIntegrator), new LangevinIntegratorProxy());
171
    SerializationProxy::registerProxy(typeid(LangevinMiddleIntegrator), new LangevinMiddleIntegratorProxy());
Evan Pretti's avatar
Evan Pretti committed
172
    SerializationProxy::registerProxy(typeid(LCPOForce), new LCPOForceProxy());
173
    SerializationProxy::registerProxy(typeid(MonteCarloAnisotropicBarostat), new MonteCarloAnisotropicBarostatProxy());
174
    SerializationProxy::registerProxy(typeid(MonteCarloBarostat), new MonteCarloBarostatProxy());
175
    SerializationProxy::registerProxy(typeid(MonteCarloFlexibleBarostat), new MonteCarloFlexibleBarostatProxy());
176
    SerializationProxy::registerProxy(typeid(MonteCarloMembraneBarostat), new MonteCarloMembraneBarostatProxy());
177
    SerializationProxy::registerProxy(typeid(NonbondedForce), new NonbondedForceProxy());
178
    SerializationProxy::registerProxy(typeid(NoseHooverIntegrator), new NoseHooverIntegratorProxy());
179
    SerializationProxy::registerProxy(typeid(OrientationRestraintForce), new OrientationRestraintForceProxy());
180
    SerializationProxy::registerProxy(typeid(PeriodicTorsionForce), new PeriodicTorsionForceProxy());
181
    SerializationProxy::registerProxy(typeid(QTBIntegrator), new QTBIntegratorProxy());
182
183
    SerializationProxy::registerProxy(typeid(RBTorsionForce), new RBTorsionForceProxy());
    SerializationProxy::registerProxy(typeid(RGForce), new RGForceProxy());
184
    SerializationProxy::registerProxy(typeid(RMSDForce), new RMSDForceProxy());
185
    SerializationProxy::registerProxy(typeid(System), new SystemProxy());
186
    SerializationProxy::registerProxy(typeid(State), new StateProxy());
187
188
189
    SerializationProxy::registerProxy(typeid(VariableLangevinIntegrator), new VariableLangevinIntegratorProxy());
    SerializationProxy::registerProxy(typeid(VariableVerletIntegrator), new VariableVerletIntegratorProxy());
    SerializationProxy::registerProxy(typeid(VerletIntegrator), new VerletIntegratorProxy());
190
}