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
4c5e01a1
Commit
4c5e01a1
authored
Dec 06, 2013
by
peastman
Browse files
Merge pull request #230 from peastman/master
Major simplification to constraint handling in reference platform
parents
6caf992a
4d25f4e7
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
73 deletions
+25
-73
platforms/reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
...reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
+4
-12
platforms/reference/src/SimTKReference/ReferenceStochasticDynamics.cpp
...erence/src/SimTKReference/ReferenceStochasticDynamics.cpp
+2
-2
platforms/reference/src/SimTKReference/ReferenceVariableStochasticDynamics.cpp
...rc/SimTKReference/ReferenceVariableStochasticDynamics.cpp
+2
-2
platforms/reference/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
...ce/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
+2
-2
platforms/reference/src/SimTKReference/ReferenceVerletDynamics.cpp
.../reference/src/SimTKReference/ReferenceVerletDynamics.cpp
+2
-2
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
...s/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
+11
-49
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.h
...ins/drude/platforms/reference/src/ReferenceDrudeKernels.h
+2
-4
No files found.
platforms/reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
View file @
4c5e01a1
...
@@ -35,19 +35,11 @@ using namespace OpenMM;
...
@@ -35,19 +35,11 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
ReferenceSETTLEAlgorithm
::
ReferenceSETTLEAlgorithm
(
const
vector
<
int
>&
atom1
,
const
vector
<
int
>&
atom2
,
const
vector
<
int
>&
atom3
,
ReferenceSETTLEAlgorithm
::
ReferenceSETTLEAlgorithm
(
const
vector
<
int
>&
atom1
,
const
vector
<
int
>&
atom2
,
const
vector
<
int
>&
atom3
,
const
vector
<
RealOpenMM
>&
distance1
,
const
vector
<
RealOpenMM
>&
distance2
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
)
:
const
vector
<
RealOpenMM
>&
distance1
,
const
vector
<
RealOpenMM
>&
distance2
,
vector
<
RealOpenMM
>&
masses
)
:
atom1
(
atom1
),
atom2
(
atom2
),
atom3
(
atom3
),
distance1
(
distance1
),
distance2
(
distance2
),
masses
(
masses
)
,
tolerance
(
tolerance
)
{
atom1
(
atom1
),
atom2
(
atom2
),
atom3
(
atom3
),
distance1
(
distance1
),
distance2
(
distance2
),
masses
(
masses
)
{
}
}
RealOpenMM
ReferenceSETTLEAlgorithm
::
getTolerance
()
const
{
void
ReferenceSETTLEAlgorithm
::
apply
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
{
return
tolerance
;
}
void
ReferenceSETTLEAlgorithm
::
setTolerance
(
RealOpenMM
tolerance
)
{
this
->
tolerance
=
tolerance
;
}
void
ReferenceSETTLEAlgorithm
::
apply
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
xp0
=
atomCoordinatesP
[
atom1
[
index
]]
-
apos0
;
RealVec
xp0
=
atomCoordinatesP
[
atom1
[
index
]]
-
apos0
;
...
@@ -190,7 +182,7 @@ void ReferenceSETTLEAlgorithm::apply(vector<OpenMM::RealVec>& atomCoordinates, v
...
@@ -190,7 +182,7 @@ void ReferenceSETTLEAlgorithm::apply(vector<OpenMM::RealVec>& atomCoordinates, v
}
}
}
}
void
ReferenceSETTLEAlgorithm
::
applyToVelocities
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
void
ReferenceSETTLEAlgorithm
::
applyToVelocities
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos1
=
atomCoordinates
[
atom2
[
index
]];
RealVec
apos1
=
atomCoordinates
[
atom2
[
index
]];
...
...
platforms/reference/src/SimTKReference/ReferenceStochasticDynamics.cpp
View file @
4c5e01a1
...
@@ -200,7 +200,7 @@ void ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, vector<RealVec
...
@@ -200,7 +200,7 @@ void ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, vector<RealVec
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceStochasticDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceStochasticDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
)
{
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -235,7 +235,7 @@ void ReferenceStochasticDynamics::update(const OpenMM::System& system, vector<Re
...
@@ -235,7 +235,7 @@ void ReferenceStochasticDynamics::update(const OpenMM::System& system, vector<Re
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
,
tolerance
);
// copy xPrime -> atomCoordinates
// copy xPrime -> atomCoordinates
...
...
platforms/reference/src/SimTKReference/ReferenceVariableStochasticDynamics.cpp
View file @
4c5e01a1
...
@@ -260,7 +260,7 @@ void ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, vector
...
@@ -260,7 +260,7 @@ void ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, vector
void
ReferenceVariableStochasticDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceVariableStochasticDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
)
{
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
,
RealOpenMM
tolerance
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -279,7 +279,7 @@ void ReferenceVariableStochasticDynamics::update(const OpenMM::System& system, v
...
@@ -279,7 +279,7 @@ void ReferenceVariableStochasticDynamics::update(const OpenMM::System& system, v
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
,
tolerance
);
// copy xPrime -> atomCoordinates
// copy xPrime -> atomCoordinates
...
...
platforms/reference/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
View file @
4c5e01a1
...
@@ -104,7 +104,7 @@ void ReferenceVariableVerletDynamics::setAccuracy( RealOpenMM accuracy ) {
...
@@ -104,7 +104,7 @@ void ReferenceVariableVerletDynamics::setAccuracy( RealOpenMM accuracy ) {
void
ReferenceVariableVerletDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceVariableVerletDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
)
{
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
,
RealOpenMM
tolerance
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -155,7 +155,7 @@ void ReferenceVariableVerletDynamics::update(const OpenMM::System& system, vecto
...
@@ -155,7 +155,7 @@ void ReferenceVariableVerletDynamics::update(const OpenMM::System& system, vecto
}
}
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
,
tolerance
);
// Update the positions and velocities.
// Update the positions and velocities.
...
...
platforms/reference/src/SimTKReference/ReferenceVerletDynamics.cpp
View file @
4c5e01a1
...
@@ -95,7 +95,7 @@ ReferenceVerletDynamics::~ReferenceVerletDynamics( ){
...
@@ -95,7 +95,7 @@ ReferenceVerletDynamics::~ReferenceVerletDynamics( ){
void
ReferenceVerletDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceVerletDynamics
::
update
(
const
OpenMM
::
System
&
system
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
)
{
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -131,7 +131,7 @@ void ReferenceVerletDynamics::update(const OpenMM::System& system, vector<RealVe
...
@@ -131,7 +131,7 @@ void ReferenceVerletDynamics::update(const OpenMM::System& system, vector<RealVe
}
}
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
,
tolerance
);
// Update the positions and velocities.
// Update the positions and velocities.
...
...
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
View file @
4c5e01a1
...
@@ -56,7 +56,12 @@ static vector<RealVec>& extractForces(ContextImpl& context) {
...
@@ -56,7 +56,12 @@ static vector<RealVec>& extractForces(ContextImpl& context) {
return
*
((
vector
<
RealVec
>*
)
data
->
forces
);
return
*
((
vector
<
RealVec
>*
)
data
->
forces
);
}
}
static
double
computeShiftedKineticEnergy
(
ContextImpl
&
context
,
vector
<
double
>&
inverseMasses
,
double
timeShift
,
ReferenceConstraintAlgorithm
*
constraints
)
{
static
ReferenceConstraints
&
extractConstraints
(
ContextImpl
&
context
)
{
ReferencePlatform
::
PlatformData
*
data
=
reinterpret_cast
<
ReferencePlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
return
*
(
ReferenceConstraints
*
)
data
->
constraints
;
}
static
double
computeShiftedKineticEnergy
(
ContextImpl
&
context
,
vector
<
double
>&
inverseMasses
,
double
timeShift
)
{
const
System
&
system
=
context
.
getSystem
();
const
System
&
system
=
context
.
getSystem
();
int
numParticles
=
system
.
getNumParticles
();
int
numParticles
=
system
.
getNumParticles
();
vector
<
RealVec
>&
posData
=
extractPositions
(
context
);
vector
<
RealVec
>&
posData
=
extractPositions
(
context
);
...
@@ -75,10 +80,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
...
@@ -75,10 +80,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
// Apply constraints to them.
// Apply constraints to them.
if
(
constraints
!=
NULL
)
{
extractConstraints
(
context
).
applyToVelocities
(
posData
,
shiftedVel
,
inverseMasses
,
1e-4
);
constraints
->
setTolerance
(
1e-4
);
constraints
->
applyToVelocities
(
posData
,
shiftedVel
,
inverseMasses
);
}
// Compute the kinetic energy.
// Compute the kinetic energy.
...
@@ -224,8 +226,6 @@ void ReferenceCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context
...
@@ -224,8 +226,6 @@ void ReferenceCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context
}
}
ReferenceIntegrateDrudeLangevinStepKernel
::~
ReferenceIntegrateDrudeLangevinStepKernel
()
{
ReferenceIntegrateDrudeLangevinStepKernel
::~
ReferenceIntegrateDrudeLangevinStepKernel
()
{
if
(
constraints
!=
NULL
)
delete
constraints
;
}
}
void
ReferenceIntegrateDrudeLangevinStepKernel
::
initialize
(
const
System
&
system
,
const
DrudeLangevinIntegrator
&
integrator
,
const
DrudeForce
&
force
)
{
void
ReferenceIntegrateDrudeLangevinStepKernel
::
initialize
(
const
System
&
system
,
const
DrudeLangevinIntegrator
&
integrator
,
const
DrudeForce
&
force
)
{
...
@@ -254,23 +254,6 @@ void ReferenceIntegrateDrudeLangevinStepKernel::initialize(const System& system,
...
@@ -254,23 +254,6 @@ void ReferenceIntegrateDrudeLangevinStepKernel::initialize(const System& system,
pairInvReducedMass
.
push_back
((
m1
+
m2
)
/
(
m1
*
m2
));
pairInvReducedMass
.
push_back
((
m1
+
m2
)
/
(
m1
*
m2
));
}
}
normalParticles
.
insert
(
normalParticles
.
begin
(),
particles
.
begin
(),
particles
.
end
());
normalParticles
.
insert
(
normalParticles
.
begin
(),
particles
.
begin
(),
particles
.
end
());
// Prepare constraints.
if
(
system
.
getNumConstraints
()
>
0
)
{
vector
<
pair
<
int
,
int
>
>
constraintIndices
;
vector
<
RealOpenMM
>
constraintDistances
;
for
(
int
i
=
0
;
i
<
system
.
getNumConstraints
();
++
i
)
{
int
particle1
,
particle2
;
double
distance
;
system
.
getConstraintParameters
(
i
,
particle1
,
particle2
,
distance
);
if
(
system
.
getParticleMass
(
particle1
)
!=
0
||
system
.
getParticleMass
(
particle2
)
!=
0
)
{
constraintIndices
.
push_back
(
make_pair
(
particle1
,
particle2
));
constraintDistances
.
push_back
(
distance
);
}
}
constraints
=
new
ReferenceConstraints
(
system
,
(
RealOpenMM
)
integrator
.
getConstraintTolerance
());
}
}
}
void
ReferenceIntegrateDrudeLangevinStepKernel
::
execute
(
ContextImpl
&
context
,
const
DrudeLangevinIntegrator
&
integrator
)
{
void
ReferenceIntegrateDrudeLangevinStepKernel
::
execute
(
ContextImpl
&
context
,
const
DrudeLangevinIntegrator
&
integrator
)
{
...
@@ -330,8 +313,7 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
...
@@ -330,8 +313,7 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
// Apply constraints.
// Apply constraints.
if
(
constraints
!=
NULL
)
extractConstraints
(
context
).
apply
(
pos
,
xPrime
,
particleInvMass
,
integrator
.
getConstraintTolerance
());
constraints
->
apply
(
pos
,
xPrime
,
particleInvMass
);
// Record the constrained positions and velocities.
// Record the constrained positions and velocities.
...
@@ -348,12 +330,10 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
...
@@ -348,12 +330,10 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
}
}
double
ReferenceIntegrateDrudeLangevinStepKernel
::
computeKineticEnergy
(
ContextImpl
&
context
,
const
DrudeLangevinIntegrator
&
integrator
)
{
double
ReferenceIntegrateDrudeLangevinStepKernel
::
computeKineticEnergy
(
ContextImpl
&
context
,
const
DrudeLangevinIntegrator
&
integrator
)
{
return
computeShiftedKineticEnergy
(
context
,
particleInvMass
,
0.5
*
integrator
.
getStepSize
()
,
constraints
);
return
computeShiftedKineticEnergy
(
context
,
particleInvMass
,
0.5
*
integrator
.
getStepSize
());
}
}
ReferenceIntegrateDrudeSCFStepKernel
::~
ReferenceIntegrateDrudeSCFStepKernel
()
{
ReferenceIntegrateDrudeSCFStepKernel
::~
ReferenceIntegrateDrudeSCFStepKernel
()
{
if
(
constraints
!=
NULL
)
delete
constraints
;
if
(
minimizerPos
!=
NULL
)
if
(
minimizerPos
!=
NULL
)
lbfgs_free
(
minimizerPos
);
lbfgs_free
(
minimizerPos
);
}
}
...
@@ -377,23 +357,6 @@ void ReferenceIntegrateDrudeSCFStepKernel::initialize(const System& system, cons
...
@@ -377,23 +357,6 @@ void ReferenceIntegrateDrudeSCFStepKernel::initialize(const System& system, cons
particleInvMass
.
push_back
(
mass
==
0.0
?
0.0
:
1.0
/
mass
);
particleInvMass
.
push_back
(
mass
==
0.0
?
0.0
:
1.0
/
mass
);
}
}
// Prepare constraints.
if
(
system
.
getNumConstraints
()
>
0
)
{
vector
<
pair
<
int
,
int
>
>
constraintIndices
;
vector
<
RealOpenMM
>
constraintDistances
;
for
(
int
i
=
0
;
i
<
system
.
getNumConstraints
();
++
i
)
{
int
particle1
,
particle2
;
double
distance
;
system
.
getConstraintParameters
(
i
,
particle1
,
particle2
,
distance
);
if
(
system
.
getParticleMass
(
particle1
)
!=
0
||
system
.
getParticleMass
(
particle2
)
!=
0
)
{
constraintIndices
.
push_back
(
make_pair
(
particle1
,
particle2
));
constraintDistances
.
push_back
(
distance
);
}
}
constraints
=
new
ReferenceConstraints
(
system
,
(
RealOpenMM
)
integrator
.
getConstraintTolerance
());
}
// Initialize the energy minimizer.
// Initialize the energy minimizer.
minimizerPos
=
lbfgs_malloc
(
drudeParticles
.
size
()
*
3
);
minimizerPos
=
lbfgs_malloc
(
drudeParticles
.
size
()
*
3
);
...
@@ -424,8 +387,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
...
@@ -424,8 +387,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
// Apply constraints.
// Apply constraints.
if
(
constraints
!=
NULL
)
extractConstraints
(
context
).
apply
(
pos
,
xPrime
,
particleInvMass
,
integrator
.
getConstraintTolerance
());
constraints
->
apply
(
pos
,
xPrime
,
particleInvMass
);
// Record the constrained positions and velocities.
// Record the constrained positions and velocities.
...
@@ -446,7 +408,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
...
@@ -446,7 +408,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
}
}
double
ReferenceIntegrateDrudeSCFStepKernel
::
computeKineticEnergy
(
ContextImpl
&
context
,
const
DrudeSCFIntegrator
&
integrator
)
{
double
ReferenceIntegrateDrudeSCFStepKernel
::
computeKineticEnergy
(
ContextImpl
&
context
,
const
DrudeSCFIntegrator
&
integrator
)
{
return
computeShiftedKineticEnergy
(
context
,
particleInvMass
,
0.5
*
integrator
.
getStepSize
()
,
constraints
);
return
computeShiftedKineticEnergy
(
context
,
particleInvMass
,
0.5
*
integrator
.
getStepSize
());
}
}
struct
MinimizerData
{
struct
MinimizerData
{
...
...
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.h
View file @
4c5e01a1
...
@@ -86,7 +86,7 @@ private:
...
@@ -86,7 +86,7 @@ private:
class
ReferenceIntegrateDrudeLangevinStepKernel
:
public
IntegrateDrudeLangevinStepKernel
{
class
ReferenceIntegrateDrudeLangevinStepKernel
:
public
IntegrateDrudeLangevinStepKernel
{
public:
public:
ReferenceIntegrateDrudeLangevinStepKernel
(
std
::
string
name
,
const
Platform
&
platform
,
ReferencePlatform
::
PlatformData
&
data
)
:
ReferenceIntegrateDrudeLangevinStepKernel
(
std
::
string
name
,
const
Platform
&
platform
,
ReferencePlatform
::
PlatformData
&
data
)
:
IntegrateDrudeLangevinStepKernel
(
name
,
platform
),
data
(
data
)
,
constraints
(
NULL
)
{
IntegrateDrudeLangevinStepKernel
(
name
,
platform
),
data
(
data
)
{
}
}
~
ReferenceIntegrateDrudeLangevinStepKernel
();
~
ReferenceIntegrateDrudeLangevinStepKernel
();
/**
/**
...
@@ -118,7 +118,6 @@ private:
...
@@ -118,7 +118,6 @@ private:
std
::
vector
<
double
>
particleInvMass
;
std
::
vector
<
double
>
particleInvMass
;
std
::
vector
<
double
>
pairInvTotalMass
;
std
::
vector
<
double
>
pairInvTotalMass
;
std
::
vector
<
double
>
pairInvReducedMass
;
std
::
vector
<
double
>
pairInvReducedMass
;
ReferenceConstraintAlgorithm
*
constraints
;
};
};
/**
/**
...
@@ -127,7 +126,7 @@ private:
...
@@ -127,7 +126,7 @@ private:
class
ReferenceIntegrateDrudeSCFStepKernel
:
public
IntegrateDrudeSCFStepKernel
{
class
ReferenceIntegrateDrudeSCFStepKernel
:
public
IntegrateDrudeSCFStepKernel
{
public:
public:
ReferenceIntegrateDrudeSCFStepKernel
(
std
::
string
name
,
const
Platform
&
platform
,
ReferencePlatform
::
PlatformData
&
data
)
:
ReferenceIntegrateDrudeSCFStepKernel
(
std
::
string
name
,
const
Platform
&
platform
,
ReferencePlatform
::
PlatformData
&
data
)
:
IntegrateDrudeSCFStepKernel
(
name
,
platform
),
data
(
data
),
constraints
(
NULL
),
minimizerPos
(
NULL
)
{
IntegrateDrudeSCFStepKernel
(
name
,
platform
),
data
(
data
),
minimizerPos
(
NULL
)
{
}
}
~
ReferenceIntegrateDrudeSCFStepKernel
();
~
ReferenceIntegrateDrudeSCFStepKernel
();
/**
/**
...
@@ -157,7 +156,6 @@ private:
...
@@ -157,7 +156,6 @@ private:
ReferencePlatform
::
PlatformData
&
data
;
ReferencePlatform
::
PlatformData
&
data
;
std
::
vector
<
int
>
drudeParticles
;
std
::
vector
<
int
>
drudeParticles
;
std
::
vector
<
double
>
particleInvMass
;
std
::
vector
<
double
>
particleInvMass
;
ReferenceConstraintAlgorithm
*
constraints
;
lbfgsfloatval_t
*
minimizerPos
;
lbfgsfloatval_t
*
minimizerPos
;
lbfgs_parameter_t
minimizerParams
;
lbfgs_parameter_t
minimizerParams
;
};
};
...
...
Prev
1
2
Next
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