Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
eec14ddb
Commit
eec14ddb
authored
Sep 11, 2019
by
peastman
Browse files
Minor code cleanup to reference platform
parent
ed569c1d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
56 deletions
+47
-56
docs-source/developerguide/developer.rst
docs-source/developerguide/developer.rst
+2
-11
platforms/cpu/src/CpuKernels.cpp
platforms/cpu/src/CpuKernels.cpp
+7
-7
platforms/reference/include/ReferencePlatform.h
platforms/reference/include/ReferencePlatform.h
+11
-8
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+7
-7
platforms/reference/src/ReferencePlatform.cpp
platforms/reference/src/ReferencePlatform.cpp
+8
-11
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
...amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
+5
-5
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
...s/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
+4
-4
plugins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
...ins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
+3
-3
No files found.
docs-source/developerguide/developer.rst
View file @
eec14ddb
...
@@ -319,17 +319,8 @@ other Platforms.
...
@@ -319,17 +319,8 @@ other Platforms.
When using the reference Platform, the “platform-specific data” stored in
When using the reference Platform, the “platform-specific data” stored in
ContextImpl is of type ReferencePlatform::PlatformData, which is declared in
ContextImpl is of type ReferencePlatform::PlatformData, which is declared in
ReferencePlatform.h. Several of the fields in this class are declared as void*
ReferencePlatform.h. It has fields for storing positions, velocities, box
to avoid having to include SimTKOpenMMRealType.h in ReferencePlatform.h. If you
vectors, and other types of data.
look in ReferenceKernels.cpp, you will find code for extracting the correct
values of these fields. For example:
::
static vector<Vec3>& extractPositions(ContextImpl& context) {
ReferencePlatform::PlatformData* data =
reinterpret_cast<ReferencePlatform::PlatformData*>(context.getPlatformData());
return *((vector<Vec3>*) data->positions);
}
The PlatformData’s vector of forces contains one element for each particle. At
The PlatformData’s vector of forces contains one element for each particle. At
the start of each force evaluation, all elements of it are set to zero. Each
the start of each force evaluation, all elements of it are set to zero. Each
...
...
platforms/cpu/src/CpuKernels.cpp
View file @
eec14ddb
...
@@ -58,37 +58,37 @@ using namespace std;
...
@@ -58,37 +58,37 @@ using namespace std;
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
positions
)
;
return
*
data
->
positions
;
}
}
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
velocities
)
;
return
*
data
->
velocities
;
}
}
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
forces
)
;
return
*
data
->
forces
;
}
}
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
Vec3
*
)
data
->
periodicBoxSize
;
return
*
data
->
periodicBoxSize
;
}
}
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
(
Vec3
*
)
data
->
periodicBoxVectors
;
return
data
->
periodicBoxVectors
;
}
}
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
ReferenceConstraints
*
)
data
->
constraints
;
return
*
data
->
constraints
;
}
}
static
map
<
string
,
double
>&
extractEnergyParameterDerivatives
(
ContextImpl
&
context
)
{
static
map
<
string
,
double
>&
extractEnergyParameterDerivatives
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
map
<
string
,
double
>*
)
data
->
energyParameterDerivatives
)
;
return
*
data
->
energyParameterDerivatives
;
}
}
/**
/**
...
...
platforms/reference/include/ReferencePlatform.h
View file @
eec14ddb
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
9
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -35,6 +35,9 @@
...
@@ -35,6 +35,9 @@
#include "openmm/Platform.h"
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "openmm/System.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExport.h"
#include "ReferenceConstraints.h"
#include <map>
#include <vector>
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -62,13 +65,13 @@ public:
...
@@ -62,13 +65,13 @@ public:
~
PlatformData
();
~
PlatformData
();
int
numParticles
,
stepCount
;
int
numParticles
,
stepCount
;
double
time
;
double
time
;
void
*
positions
;
std
::
vector
<
Vec3
>
*
positions
;
void
*
velocities
;
std
::
vector
<
Vec3
>
*
velocities
;
void
*
forces
;
std
::
vector
<
Vec3
>
*
forces
;
void
*
periodicBoxSize
;
Vec3
*
periodicBoxSize
;
void
*
periodicBoxVectors
;
Vec3
*
periodicBoxVectors
;
void
*
constraints
;
ReferenceConstraints
*
constraints
;
void
*
energyParameterDerivatives
;
std
::
map
<
std
::
string
,
double
>
*
energyParameterDerivatives
;
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
eec14ddb
...
@@ -91,37 +91,37 @@ using namespace std;
...
@@ -91,37 +91,37 @@ using namespace std;
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
positions
)
;
return
*
data
->
positions
;
}
}
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
velocities
)
;
return
*
data
->
velocities
;
}
}
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
forces
)
;
return
*
data
->
forces
;
}
}
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
Vec3
*
)
data
->
periodicBoxSize
;
return
*
data
->
periodicBoxSize
;
}
}
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
(
Vec3
*
)
data
->
periodicBoxVectors
;
return
data
->
periodicBoxVectors
;
}
}
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
ReferenceConstraints
*
)
data
->
constraints
;
return
*
data
->
constraints
;
}
}
static
map
<
string
,
double
>&
extractEnergyParameterDerivatives
(
ContextImpl
&
context
)
{
static
map
<
string
,
double
>&
extractEnergyParameterDerivatives
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
map
<
string
,
double
>*
)
data
->
energyParameterDerivatives
)
;
return
*
data
->
energyParameterDerivatives
;
}
}
/**
/**
...
...
platforms/reference/src/ReferencePlatform.cpp
View file @
eec14ddb
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
9
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -30,14 +30,11 @@
...
@@ -30,14 +30,11 @@
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "ReferencePlatform.h"
#include "ReferencePlatform.h"
#include "ReferenceConstraints.h"
#include "ReferenceKernelFactory.h"
#include "ReferenceKernelFactory.h"
#include "ReferenceKernels.h"
#include "ReferenceKernels.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "openmm/Vec3.h"
#include "openmm/Vec3.h"
#include <map>
#include <vector>
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
...
@@ -107,11 +104,11 @@ ReferencePlatform::PlatformData::PlatformData(const System& system) : time(0.0),
...
@@ -107,11 +104,11 @@ ReferencePlatform::PlatformData::PlatformData(const System& system) : time(0.0),
}
}
ReferencePlatform
::
PlatformData
::~
PlatformData
()
{
ReferencePlatform
::
PlatformData
::~
PlatformData
()
{
delete
(
vector
<
Vec3
>*
)
positions
;
delete
positions
;
delete
(
vector
<
Vec3
>*
)
velocities
;
delete
velocities
;
delete
(
vector
<
Vec3
>*
)
forces
;
delete
forces
;
delete
(
Vec3
*
)
periodicBoxSize
;
delete
periodicBoxSize
;
delete
[]
(
Vec3
*
)
periodicBoxVectors
;
delete
[]
periodicBoxVectors
;
delete
(
ReferenceConstraints
*
)
constraints
;
delete
constraints
;
delete
(
map
<
string
,
double
>*
)
energyParameterDerivatives
;
delete
energyParameterDerivatives
;
}
}
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
View file @
eec14ddb
...
@@ -58,27 +58,27 @@ using namespace std;
...
@@ -58,27 +58,27 @@ using namespace std;
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
positions
)
;
return
*
data
->
positions
;
}
}
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
velocities
)
;
return
*
data
->
velocities
;
}
}
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
forces
)
;
return
*
data
->
forces
;
}
}
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
static
Vec3
&
extractBoxSize
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
Vec3
*
)
data
->
periodicBoxSize
;
return
*
data
->
periodicBoxSize
;
}
}
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
static
Vec3
*
extractBoxVectors
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
(
Vec3
*
)
data
->
periodicBoxVectors
;
return
data
->
periodicBoxVectors
;
}
}
// ***************************************************************************
// ***************************************************************************
...
...
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
View file @
eec14ddb
...
@@ -43,22 +43,22 @@ using namespace std;
...
@@ -43,22 +43,22 @@ using namespace std;
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
positions
)
;
return
*
data
->
positions
;
}
}
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
velocities
)
;
return
*
data
->
velocities
;
}
}
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
forces
)
;
return
*
data
->
forces
;
}
}
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
ReferenceConstraints
*
)
data
->
constraints
;
return
*
data
->
constraints
;
}
}
static
double
computeShiftedKineticEnergy
(
ContextImpl
&
context
,
vector
<
double
>&
inverseMasses
,
double
timeShift
)
{
static
double
computeShiftedKineticEnergy
(
ContextImpl
&
context
,
vector
<
double
>&
inverseMasses
,
double
timeShift
)
{
...
...
plugins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
View file @
eec14ddb
...
@@ -39,17 +39,17 @@ using namespace std;
...
@@ -39,17 +39,17 @@ using namespace std;
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractPositions
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
positions
)
;
return
*
data
->
positions
;
}
}
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractVelocities
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
velocities
)
;
return
*
data
->
velocities
;
}
}
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
static
vector
<
Vec3
>&
extractForces
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
((
vector
<
Vec3
>*
)
data
->
forces
)
;
return
*
data
->
forces
;
}
}
ReferenceIntegrateRPMDStepKernel
::~
ReferenceIntegrateRPMDStepKernel
()
{
ReferenceIntegrateRPMDStepKernel
::~
ReferenceIntegrateRPMDStepKernel
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment