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
c9bb9746
Commit
c9bb9746
authored
Nov 08, 2011
by
Mark Friedrichs
Browse files
Minor edits
parent
b3dbaeaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
19 deletions
+128
-19
platforms/reference/src/gbsa/CpuGBVI.cpp
platforms/reference/src/gbsa/CpuGBVI.cpp
+67
-0
platforms/reference/src/gbsa/CpuGBVI.h
platforms/reference/src/gbsa/CpuGBVI.h
+21
-0
platforms/reference/src/gbsa/CpuObc.cpp
platforms/reference/src/gbsa/CpuObc.cpp
+40
-19
No files found.
platforms/reference/src/gbsa/CpuGBVI.cpp
View file @
c9bb9746
...
@@ -723,6 +723,8 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
...
@@ -723,6 +723,8 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
}
}
}
}
//printGbvi( atomCoordinates, partialCharges, bornRadii, bornForces, forces, "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)
RealOpenMM
conversion
=
static_cast
<
RealOpenMM
>
(
gbviParameters
->
getTau
());
RealOpenMM
conversion
=
static_cast
<
RealOpenMM
>
(
gbviParameters
->
getTau
());
...
@@ -734,6 +736,71 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
...
@@ -734,6 +736,71 @@ void CpuGBVI::computeBornForces( std::vector<RealVec>& atomCoordinates, const Re
}
}
/**---------------------------------------------------------------------------------------
Print GB/VI parameters, radii, forces, ...
@param atomCoordinates atomic coordinates
@param partialCharges partial charges
@param bornRadii Born radii (may be empty)
@param bornForces Born forces (may be empty)
@param forces forces (may be empty)
@param idString id string (who is calling)
@param log log file
--------------------------------------------------------------------------------------- */
void
CpuGBVI
::
printGbvi
(
const
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
const
RealOpenMMVector
&
partialCharges
,
const
RealOpenMMVector
&
bornRadii
,
const
RealOpenMMVector
&
bornForces
,
const
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
const
std
::
string
&
idString
,
FILE
*
log
){
// ---------------------------------------------------------------------------------------
const
GBVIParameters
*
gbviParameters
=
getGBVIParameters
();
const
int
numberOfAtoms
=
gbviParameters
->
getNumberOfAtoms
();
const
RealOpenMMVector
&
atomicRadii
=
gbviParameters
->
getAtomicRadii
();
const
RealOpenMMVector
&
gammaParameters
=
gbviParameters
->
getGammaParameters
();
// ---------------------------------------------------------------------------------------
// constants
const
RealOpenMM
preFactor
=
2.0
*
gbviParameters
->
getElectricConstant
();
// ---------------------------------------------------------------------------------------
const
RealOpenMMVector
&
scaledRadii
=
gbviParameters
->
getScaledRadii
();
const
RealOpenMMVector
&
switchDeriviative
=
getSwitchDeriviative
();
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
gbviParameters
->
getTau
());
(
void
)
fprintf
(
log
,
"Reference Gbvi %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
" tau %15.7e
\n
"
,
tau
);
(
void
)
fprintf
(
log
,
" scaleMethod %d (QuinticEnum=%d)
\n
"
,
_gbviParameters
->
getBornRadiusScalingMethod
(),
GBVIParameters
::
QuinticSpline
);
(
void
)
fprintf
(
log
,
" preFactor %15.7e)
\n
"
,
preFactor
);
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
,
atomicRadii
[
atomI
],
scaledRadii
[
atomI
],
switchDeriviative
[
atomI
],
tau
*
gammaParameters
[
atomI
],
partialCharges
[
atomI
]
);
if
(
bornRadii
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" bR=%15.7e"
,
bornRadii
[
atomI
]
);
}
if
(
bornForces
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" tau*bF=%15.7e"
,
tau
*
bornForces
[
atomI
]
);
}
(
void
)
fprintf
(
log
,
"
\n
"
);
}
return
;
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Use double precision
Use double precision
...
...
platforms/reference/src/gbsa/CpuGBVI.h
View file @
c9bb9746
...
@@ -288,6 +288,27 @@ class CpuGBVI {
...
@@ -288,6 +288,27 @@ class CpuGBVI {
void
computeBornRadiiUsingQuinticSpline
(
RealOpenMM
atomicRadius3
,
RealOpenMM
bornSum
,
void
computeBornRadiiUsingQuinticSpline
(
RealOpenMM
atomicRadius3
,
RealOpenMM
bornSum
,
GBVIParameters
*
gbviParameters
,
GBVIParameters
*
gbviParameters
,
RealOpenMM
*
bornRadius
,
RealOpenMM
*
switchDeriviative
);
RealOpenMM
*
bornRadius
,
RealOpenMM
*
switchDeriviative
);
/**---------------------------------------------------------------------------------------
Print GB/VI parameters, radii, forces, ...
@param atomCoordinates atomic coordinates
@param partialCharges partial charges
@param bornRadii Born radii (may be empty)
@param bornForces Born forces (may be empty)
@param forces forces (may be empty)
@param idString id string (who is calling)
@param log log file
--------------------------------------------------------------------------------------- */
void
printGbvi
(
const
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
const
RealOpenMMVector
&
partialCharges
,
const
RealOpenMMVector
&
bornRadii
,
const
RealOpenMMVector
&
bornForces
,
const
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
const
std
::
string
&
idString
,
FILE
*
log
);
};
};
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
...
platforms/reference/src/gbsa/CpuObc.cpp
View file @
c9bb9746
...
@@ -534,29 +534,50 @@ void CpuObc::printObc( const std::vector<OpenMM::RealVec>& atomCoordinates,
...
@@ -534,29 +534,50 @@ void CpuObc::printObc( const std::vector<OpenMM::RealVec>& atomCoordinates,
const
RealOpenMM
betaObc
=
obcParameters
->
getBetaObc
();
const
RealOpenMM
betaObc
=
obcParameters
->
getBetaObc
();
const
RealOpenMM
gammaObc
=
obcParameters
->
getGammaObc
();
const
RealOpenMM
gammaObc
=
obcParameters
->
getGammaObc
();
const
int
comparisonFormat
=
1
;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
(
void
)
fprintf
(
log
,
"Reference Obc %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
"Reference Obc %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
" preFactor %15.7e
\n
"
,
preFactor
);
if
(
comparisonFormat
){
(
void
)
fprintf
(
log
,
" alpha %15.7e
\n
"
,
alphaObc
);
(
void
)
fprintf
(
log
,
"Reference Obc %s atoms=%d Chain/Radii/Force
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
" beta %15.7e
\n
"
,
betaObc
);
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
(
void
)
fprintf
(
log
,
" gamma %15.7e
\n
"
,
gammaObc
);
(
void
)
fprintf
(
log
,
"%6d "
,
atomI
);
if
(
obcChain
.
size
()
>
atomI
){
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
(
void
)
fprintf
(
log
,
" %15.7e"
,
obcChain
[
atomI
]
);
(
void
)
fprintf
(
log
,
"%6d r=%15.7e q=%6.3f"
,
atomI
,
}
atomicRadii
[
atomI
],
partialCharges
[
atomI
]
);
if
(
bornRadii
.
size
()
>
atomI
){
if
(
obcChain
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" %15.7e"
,
bornRadii
[
atomI
]
);
(
void
)
fprintf
(
log
,
" bChn=%15.7e"
,
obcChain
[
atomI
]
);
}
}
if
(
bornForces
.
size
()
>
atomI
){
if
(
bornRadii
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" %15.7e"
,
bornForces
[
atomI
]
);
(
void
)
fprintf
(
log
,
" bR=%15.7e"
,
bornRadii
[
atomI
]
);
}
}
(
void
)
fprintf
(
log
,
" %15.7e %6.3f"
,
atomicRadii
[
atomI
],
partialCharges
[
atomI
]
);
if
(
bornForces
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
" bF=%15.7e"
,
bornForces
[
atomI
]
);
}
}
}
else
{
(
void
)
fprintf
(
log
,
"
\n
"
);
(
void
)
fprintf
(
log
,
"Reference Obc %s atoms=%d
\n
"
,
idString
.
c_str
(),
numberOfAtoms
);
(
void
)
fprintf
(
log
,
" preFactor %15.7e
\n
"
,
preFactor
);
(
void
)
fprintf
(
log
,
" alpha %15.7e
\n
"
,
alphaObc
);
(
void
)
fprintf
(
log
,
" beta %15.7e
\n
"
,
betaObc
);
(
void
)
fprintf
(
log
,
" gamma %15.7e
\n
"
,
gammaObc
);
for
(
int
atomI
=
0
;
atomI
<
numberOfAtoms
;
atomI
++
){
(
void
)
fprintf
(
log
,
"%6d r=%15.7e q=%6.3f"
,
atomI
,
atomicRadii
[
atomI
],
partialCharges
[
atomI
]
);
if
(
obcChain
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" bChn=%15.7e"
,
obcChain
[
atomI
]
);
}
if
(
bornRadii
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" bR=%15.7e"
,
bornRadii
[
atomI
]
);
}
if
(
bornForces
.
size
()
>
atomI
){
(
void
)
fprintf
(
log
,
" bF=%15.7e"
,
bornForces
[
atomI
]
);
}
(
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