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
f0cfae42
Commit
f0cfae42
authored
Nov 09, 2011
by
Mark Friedrichs
Browse files
Added diagnostic method to GBVI
parent
65f9d47e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
15 deletions
+44
-15
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+7
-0
platforms/reference/src/gbsa/CpuGBVI.cpp
platforms/reference/src/gbsa/CpuGBVI.cpp
+37
-15
No files found.
platforms/reference/src/ReferenceKernels.cpp
View file @
f0cfae42
...
@@ -859,11 +859,14 @@ ReferenceCalcGBVIForceKernel::~ReferenceCalcGBVIForceKernel() {
...
@@ -859,11 +859,14 @@ ReferenceCalcGBVIForceKernel::~ReferenceCalcGBVIForceKernel() {
}
}
void
ReferenceCalcGBVIForceKernel
::
initialize
(
const
System
&
system
,
const
GBVIForce
&
force
,
const
std
::
vector
<
double
>
&
inputScaledRadii
)
{
void
ReferenceCalcGBVIForceKernel
::
initialize
(
const
System
&
system
,
const
GBVIForce
&
force
,
const
std
::
vector
<
double
>
&
inputScaledRadii
)
{
int
numParticles
=
system
.
getNumParticles
();
int
numParticles
=
system
.
getNumParticles
();
charges
.
resize
(
numParticles
);
charges
.
resize
(
numParticles
);
vector
<
RealOpenMM
>
atomicRadii
(
numParticles
);
vector
<
RealOpenMM
>
atomicRadii
(
numParticles
);
vector
<
RealOpenMM
>
scaledRadii
(
numParticles
);
vector
<
RealOpenMM
>
scaledRadii
(
numParticles
);
vector
<
RealOpenMM
>
gammas
(
numParticles
);
vector
<
RealOpenMM
>
gammas
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
double
charge
,
radius
,
gamma
;
double
charge
,
radius
,
gamma
;
force
.
getParticleParameters
(
i
,
charge
,
radius
,
gamma
);
force
.
getParticleParameters
(
i
,
charge
,
radius
,
gamma
);
...
@@ -872,15 +875,19 @@ void ReferenceCalcGBVIForceKernel::initialize(const System& system, const GBVIFo
...
@@ -872,15 +875,19 @@ void ReferenceCalcGBVIForceKernel::initialize(const System& system, const GBVIFo
gammas
[
i
]
=
static_cast
<
RealOpenMM
>
(
gamma
);
gammas
[
i
]
=
static_cast
<
RealOpenMM
>
(
gamma
);
scaledRadii
[
i
]
=
static_cast
<
RealOpenMM
>
(
inputScaledRadii
[
i
]);
scaledRadii
[
i
]
=
static_cast
<
RealOpenMM
>
(
inputScaledRadii
[
i
]);
}
}
GBVIParameters
*
gBVIParameters
=
new
GBVIParameters
(
numParticles
);
GBVIParameters
*
gBVIParameters
=
new
GBVIParameters
(
numParticles
);
gBVIParameters
->
setAtomicRadii
(
atomicRadii
);
gBVIParameters
->
setAtomicRadii
(
atomicRadii
);
gBVIParameters
->
setGammaParameters
(
gammas
);
gBVIParameters
->
setGammaParameters
(
gammas
);
gBVIParameters
->
setScaledRadii
(
scaledRadii
);
gBVIParameters
->
setScaledRadii
(
scaledRadii
);
gBVIParameters
->
setSolventDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSolventDielectric
()));
gBVIParameters
->
setSolventDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSolventDielectric
()));
gBVIParameters
->
setSoluteDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSoluteDielectric
()));
gBVIParameters
->
setSoluteDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSoluteDielectric
()));
gBVIParameters
->
setBornRadiusScalingMethod
(
force
.
getBornRadiusScalingMethod
());
gBVIParameters
->
setBornRadiusScalingMethod
(
force
.
getBornRadiusScalingMethod
());
gBVIParameters
->
setQuinticUpperBornRadiusLimit
(
static_cast
<
RealOpenMM
>
(
force
.
getQuinticUpperBornRadiusLimit
()));
gBVIParameters
->
setQuinticUpperBornRadiusLimit
(
static_cast
<
RealOpenMM
>
(
force
.
getQuinticUpperBornRadiusLimit
()));
gBVIParameters
->
setQuinticLowerLimitFactor
(
static_cast
<
RealOpenMM
>
(
force
.
getQuinticLowerLimitFactor
()));
gBVIParameters
->
setQuinticLowerLimitFactor
(
static_cast
<
RealOpenMM
>
(
force
.
getQuinticLowerLimitFactor
()));
if
(
force
.
getNonbondedMethod
()
!=
GBVIForce
::
NoCutoff
)
if
(
force
.
getNonbondedMethod
()
!=
GBVIForce
::
NoCutoff
)
gBVIParameters
->
setUseCutoff
(
static_cast
<
RealOpenMM
>
(
force
.
getCutoffDistance
()));
gBVIParameters
->
setUseCutoff
(
static_cast
<
RealOpenMM
>
(
force
.
getCutoffDistance
()));
isPeriodic
=
(
force
.
getNonbondedMethod
()
==
GBVIForce
::
CutoffPeriodic
);
isPeriodic
=
(
force
.
getNonbondedMethod
()
==
GBVIForce
::
CutoffPeriodic
);
...
...
platforms/reference/src/gbsa/CpuGBVI.cpp
View file @
f0cfae42
...
@@ -724,7 +724,7 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
...
@@ -724,7 +724,7 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
}
}
}
}
//printGbvi( atomCoordinates, partialCharges, bornRadii, bornForces, forces, "Post loop2", stderr );
//printGbvi( atomCoordinates, partialCharges, bornRadii, bornForces, forces, "
GBVI:
Post loop2", stderr );
// convert from cal to Joule & apply prefactor tau = (1/diel_solute - 1/diel_solvent)
// convert from cal to Joule & apply prefactor tau = (1/diel_solute - 1/diel_solvent)
...
@@ -776,12 +776,33 @@ void CpuGBVI::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordinates, co
...
@@ -776,12 +776,33 @@ void CpuGBVI::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordinates, co
const
RealOpenMMVector
&
switchDeriviative
=
getSwitchDeriviative
();
const
RealOpenMMVector
&
switchDeriviative
=
getSwitchDeriviative
();
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
gbviParameters
->
getTau
());
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
gbviParameters
->
getTau
());
int
useComparisonFormat
=
1
;
(
void
)
fprintf
(
log
,
"Reference Gbvi %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
"Reference Gbvi %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
" tau %15.7e
\n
"
,
tau
);
(
void
)
fprintf
(
log
,
" tau %15.7e
\n
"
,
tau
);
(
void
)
fprintf
(
log
,
" scaleMethod %d (QuinticEnum=%d)
\n
"
,
(
void
)
fprintf
(
log
,
" scaleMethod %d (QuinticEnum=%d)
\n
"
,
_gbviParameters
->
getBornRadiusScalingMethod
(),
GBVIParameters
::
QuinticSpline
);
_gbviParameters
->
getBornRadiusScalingMethod
(),
GBVIParameters
::
QuinticSpline
);
(
void
)
fprintf
(
log
,
" preFactor %15.7e)
\n
"
,
preFactor
);
(
void
)
fprintf
(
log
,
" preFactor %15.7e)
\n
"
,
preFactor
);
if
(
useComparisonFormat
){
(
void
)
fprintf
(
log
,
" br bF swd r scR tau*gamma q)
\n
"
);
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
(
void
)
fprintf
(
log
,
"%6d "
,
atomI
);
if
(
bornRadii
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
"%15.7e "
,
bornRadii
[
atomI
]
);
}
if
(
bornForces
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
"%15.7e "
,
tau
*
bornForces
[
atomI
]
);
}
(
void
)
fprintf
(
log
,
" %15.7e %15.7e %15.7e %15.7e %15.7e"
,
switchDeriviative
[
atomI
],
atomicRadii
[
atomI
],
scaledRadii
[
atomI
],
tau
*
gammaParameters
[
atomI
],
partialCharges
[
atomI
]
);
(
void
)
fprintf
(
log
,
"
\n
"
);
}
}
else
{
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
(
void
)
fprintf
(
log
,
"%6d r=%15.7e rSc=%15.7e swd=%15.7e tau*gam=%15.7e q=%15.7e"
,
atomI
,
(
void
)
fprintf
(
log
,
"%6d r=%15.7e rSc=%15.7e swd=%15.7e tau*gam=%15.7e q=%15.7e"
,
atomI
,
atomicRadii
[
atomI
],
atomicRadii
[
atomI
],
...
@@ -797,6 +818,7 @@ void CpuGBVI::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordinates, co
...
@@ -797,6 +818,7 @@ void CpuGBVI::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordinates, co
}
}
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
"
\n
"
);
}
}
}
return
;
return
;
...
...
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