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
51475608
Commit
51475608
authored
Mar 16, 2011
by
Peter Eastman
Browse files
Deleted lots of obsolete code
parent
398f0609
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
8 additions
and
6139 deletions
+8
-6139
platforms/reference/src/SimTKReference/ReferenceConstraint.h
platforms/reference/src/SimTKReference/ReferenceConstraint.h
+0
-5
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.cpp
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.cpp
+0
-12
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.h
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.h
+0
-135
platforms/reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.cpp
.../reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.cpp
+0
-528
platforms/reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.h
...ms/reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.h
+0
-253
platforms/reference/src/SimTKUtilities/SimTKOpenMMLog.h
platforms/reference/src/SimTKUtilities/SimTKOpenMMLog.h
+1
-1
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
+1
-1
platforms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.cpp
...rms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.cpp
+6
-1073
platforms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.h
...forms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.h
+0
-383
platforms/reference/src/SimTKUtilities/SimTKOpenMMWindowLinux.h
...rms/reference/src/SimTKUtilities/SimTKOpenMMWindowLinux.h
+0
-36
platforms/reference/src/SimTKUtilities/SimTKlapack.h
platforms/reference/src/SimTKUtilities/SimTKlapack.h
+0
-3006
platforms/reference/src/SimTKUtilities/TwoDimArraySimTk.h
platforms/reference/src/SimTKUtilities/TwoDimArraySimTk.h
+0
-203
platforms/reference/src/gbsa/CpuImplicitSolvent.cpp
platforms/reference/src/gbsa/CpuImplicitSolvent.cpp
+0
-330
platforms/reference/src/gbsa/CpuImplicitSolvent.h
platforms/reference/src/gbsa/CpuImplicitSolvent.h
+0
-133
platforms/reference/src/gbsa/SimTKOpenMMWindowLinux.h
platforms/reference/src/gbsa/SimTKOpenMMWindowLinux.h
+0
-36
platforms/reference/src/gbsa/cpuObcInterface.cpp
platforms/reference/src/gbsa/cpuObcInterface.cpp
+0
-4
No files found.
platforms/reference/src/SimTKReference/ReferenceConstraint.h
View file @
51475608
...
@@ -137,11 +137,6 @@ class ReferenceShakeConstraint : public ReferenceConstraint {
...
@@ -137,11 +137,6 @@ class ReferenceShakeConstraint : public ReferenceConstraint {
int
getLightAtomIndex
(
void
);
int
getLightAtomIndex
(
void
);
};
};
typedef
std
::
vector
<
ReferenceShakeConstraint
*>
ShakeVector
;
typedef
ShakeVector
::
iterator
ShakeVectorI
;
typedef
std
::
map
<
int
,
ShakeVector
*>
IntShakeMap
;
typedef
IntShakeMap
::
iterator
IntShakeMapI
;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
#endif // __ReferenceShakeConstraint_H__
#endif // __ReferenceShakeConstraint_H__
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.cpp
View file @
51475608
...
@@ -36,15 +36,3 @@ const int SimTKOpenMMCommon::DefaultReturn = 0;
...
@@ -36,15 +36,3 @@ const int SimTKOpenMMCommon::DefaultReturn = 0;
const
int
SimTKOpenMMCommon
::
ErrorReturn
=
-
1
;
const
int
SimTKOpenMMCommon
::
ErrorReturn
=
-
1
;
const
RealOpenMM
SimTKOpenMMCommon
::
BigCutoffValue
=
1.0e+05
;
const
RealOpenMM
SimTKOpenMMCommon
::
BigCutoffValue
=
1.0e+05
;
// units
const
int
SimTKOpenMMCommon
::
MdUnits
=
1
;
const
int
SimTKOpenMMCommon
::
KcalAngUnits
=
2
;
// specify RealOpenMM number format
const
int
SimTKOpenMMCommon
::
HighStringStreamNumberWidth
=
20
;
const
int
SimTKOpenMMCommon
::
HighStringStreamNumberPrecision
=
12
;
const
RealOpenMM
SimTKOpenMMCommon
::
DegreeToRadians
=
(
RealOpenMM
)
0.017453292
;
platforms/reference/src/SimTKUtilities/SimTKOpenMMCommon.h
View file @
51475608
...
@@ -30,76 +30,18 @@
...
@@ -30,76 +30,18 @@
// STL includes
// STL includes
#include <vector>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <string>
// generic c includes
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
#include "RealVec.h"
#include "RealVec.h"
#include "SimTKOpenMMWindowLinux.h"
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
typedef
std
::
vector
<
int
>
IntVector
;
typedef
IntVector
::
iterator
IntVectorI
;
typedef
IntVector
::
const_iterator
IntVectorCI
;
typedef
IntVector
::
reverse_iterator
IntVectorRI
;
typedef
IntVector
::
const_reverse_iterator
IntVectorCRI
;
typedef
std
::
map
<
int
,
int
>
IntIntMap
;
typedef
IntIntMap
::
iterator
IntIntMapI
;
typedef
IntIntMap
::
const_iterator
IntIntMapCI
;
typedef
std
::
set
<
int
>
IntSet
;
typedef
IntSet
::
iterator
IntSetI
;
typedef
IntSet
::
const_iterator
IntSetCI
;
typedef
std
::
vector
<
IntSet
>
IntSetVector
;
typedef
IntSetVector
::
iterator
IntSetVectorI
;
typedef
IntSetVector
::
const_iterator
IntSetVectorCI
;
typedef
std
::
multiset
<
int
>
IntMultiSet
;
typedef
IntMultiSet
::
iterator
IntMultiSetI
;
typedef
IntMultiSet
::
const_iterator
IntMultiSetCI
;
typedef
std
::
vector
<
std
::
string
>
StringVector
;
typedef
StringVector
::
iterator
StringVectorI
;
typedef
StringVector
::
const_iterator
StringVectorCI
;
typedef
std
::
map
<
std
::
string
,
std
::
string
>
StringStringMap
;
typedef
StringStringMap
::
iterator
StringStringMapI
;
typedef
StringStringMap
::
const_iterator
StringStringMapCI
;
typedef
std
::
vector
<
RealOpenMM
>
RealOpenMMVector
;
typedef
std
::
vector
<
RealOpenMM
>
RealOpenMMVector
;
typedef
RealOpenMMVector
::
iterator
RealOpenMMVectorI
;
typedef
RealOpenMMVector
::
iterator
RealOpenMMVectorI
;
typedef
RealOpenMMVector
::
const_iterator
RealOpenMMVectorCI
;
typedef
RealOpenMMVector
::
const_iterator
RealOpenMMVectorCI
;
typedef
std
::
vector
<
RealOpenMM
*>
RealOpenMMPtrVector
;
typedef
RealOpenMMPtrVector
::
iterator
RealOpenMMPtrVectorI
;
typedef
RealOpenMMPtrVector
::
const_iterator
RealOpenMMPtrVectorCI
;
typedef
std
::
vector
<
RealOpenMM
**>
RealOpenMMPtrPtrVector
;
typedef
RealOpenMMPtrPtrVector
::
iterator
RealOpenMMPtrPtrVectorI
;
typedef
RealOpenMMPtrPtrVector
::
const_iterator
RealOpenMMPtrPtrVectorCI
;
typedef
std
::
map
<
std
::
string
,
RealOpenMM
>
StringRealOpenMMMap
;
typedef
StringRealOpenMMMap
::
iterator
StringRealOpenMMMapI
;
typedef
StringRealOpenMMMap
::
const_iterator
StringRealOpenMMMapCI
;
typedef
std
::
map
<
std
::
string
,
int
>
StringIntMap
;
typedef
StringIntMap
::
iterator
StringIntMapI
;
typedef
StringIntMap
::
const_iterator
StringIntMapCI
;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
class
SimTKOpenMMCommon
{
class
SimTKOpenMMCommon
{
...
@@ -118,83 +60,6 @@ class SimTKOpenMMCommon {
...
@@ -118,83 +60,6 @@ class SimTKOpenMMCommon {
static
const
int
DefaultReturn
;
static
const
int
DefaultReturn
;
static
const
int
ErrorReturn
;
static
const
int
ErrorReturn
;
// units
static
const
int
MdUnits
;
static
const
int
KcalAngUnits
;
// specify RealOpenMM number format
static
const
int
HighStringStreamNumberWidth
;
static
const
int
HighStringStreamNumberPrecision
;
static
const
RealOpenMM
DegreeToRadians
;
/**---------------------------------------------------------------------------------------
Get string w/ minimum desired width
@param inputString input string
@param desiredSize minimum desired size of output string
@param spacer string to append to inputString to get desired width (" ")
@return DefaultReturn
--------------------------------------------------------------------------------------- */
static
std
::
string
getSpacedString
(
const
std
::
string
&
,
int
desiredSize
=
25
,
const
std
::
string
&
spacer
=
" "
);
};
};
// ---------------------------------------------------------------------------------------
// StringComparisonForMap: used to compare strings in STL maps w/ strings as keys
#ifndef StringComparisonForMapPtrBlcok
#define StringComparisonForMapPtrBlcok
// above define should be removed once CommonTk is removed
class
StringComparisonForMapPtr
:
public
std
::
binary_function
<
std
::
string
*
,
std
::
string
*
,
bool
>
{
public:
bool
operator
()(
const
std
::
string
*
str1
,
const
std
::
string
*
str2
)
const
{
return
strcmp
(
str1
->
c_str
(),
str2
->
c_str
()
)
<
0
;
}
};
class
StringComparisonForMap
:
public
std
::
binary_function
<
const
std
::
string
&
,
const
std
::
string
&
,
bool
>
{
public:
bool
operator
()(
const
std
::
string
&
str1
,
const
std
::
string
&
str2
)
const
{
return
strcmp
(
str1
.
c_str
(),
str2
.
c_str
()
)
<
0
;
}
};
#endif
// ---------------------------------------------------------------------------------------
// Used to compare integers for sorting, ...
int
numericCompareI
(
const
void
*
point1
,
const
void
*
point2
);
// ---------------------------------------------------------------------------------------
// string-string map and iterator definitions
typedef
std
::
map
<
std
::
string
,
std
::
string
,
StringComparisonForMap
>
StringMap
;
typedef
StringMap
::
iterator
StringMapI
;
typedef
StringMap
::
const_iterator
StringMapCI
;
// string set and iterator definitions
typedef
std
::
set
<
std
::
string
,
StringComparisonForMap
>
StringSet
;
typedef
StringSet
::
iterator
StringSetI
;
typedef
StringSet
::
const_iterator
StringSetCI
;
// ---------------------------------------------------------------------------------------
#endif // __SimTKOpenMMCommon_H__
#endif // __SimTKOpenMMCommon_H__
platforms/reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.cpp
deleted
100644 → 0
View file @
398f0609
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKUtilities/SimTKOpenMMGpuUtilities.h
deleted
100755 → 0
View file @
398f0609
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* 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.
*/
#ifndef __SimTKOpenMMGpuUtilities_H_
#define __SimTKOpenMMGpuUtilities_H_
// ---------------------------------------------------------------------------------------
// reserve the option to change between Real and double
#include "SimTKOpenMMRealType.h"
#include "SimTKOpenMMCommon.h"
// ---------------------------------------------------------------------------------------
// class of shared, static utility methods
#include <stdio.h>
#include <string.h>
#include <string>
#include <stdlib.h>
#include <sstream>
// #include <string>
// ---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Class of static methods to be shared
Most methods are standalone 'utility' methods
--------------------------------------------------------------------------------------- */
class
SimTKOpenMMGpuUtilities
{
public:
// dummy constructor/destructor
SimTKOpenMMGpuUtilities
(){};
~
SimTKOpenMMGpuUtilities
(){};
/**---------------------------------------------------------------------------------------
Helper method to repack RealOpenMM arrays (Simbios)
@param numberOfEntries entries/sub-array
@param subarraySize number of subarrays
@param array array
Input array = [subArray_1 subArray_2 subArray_3 ... subArray_Stacked] \n
where each subArray_i is 1 x numberOfEntries
Output array = [ subArray_1_1 subArray_2_1 subArray_3_1 ... subArray_Stacked_1 \n
subArray_1_2 subArray_2_2 subArray_3_2 ... subArray_Stacked_2 \n
subArray_1_3 subArray_2_3 subArray_3_3 ... subArray_Stacked_3 \n
... \n
subArray_1_N subArray_2_N subArray_3_N ... subArray_Stacked_N ] \n
where N = numberOfEntries
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
repackArray1
(
int
numberOfEntries
,
int
subarraySize
,
RealOpenMM
*
array
);
/**---------------------------------------------------------------------------------------
Copy an array into a packed (e.g., RealOpenMM4 array) (Simbios)
Example copy Born radii into last slot of force array
@param numberOfEntries entries/sub-array (no. atoms)
@param subarraySize number of subarrays (4 for RealOpenMM4)
@param fullArray full array (force array in example)
@param copySlot index of slot to copied into (3 in example, since want Born radius in .w slot)
@param arrayToCopy array to copy (Born array)
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
copySubArray
(
int
numberOfEntries
,
int
subarraySize
,
RealOpenMM
*
fullArray
,
int
copySlot
,
RealOpenMM
*
arrayToCopy
);
/**---------------------------------------------------------------------------------------
Helper method to repack RealOpenMM arrays (Simbios)
@param numberOfEntries entries/sub-array
@param subarraySize number of subarrays
@param array array
Input array = [subArray_1 subArray_2 subArray_3 ... subArray_N] \n
where each subArray_i is vector of length M=numberOfEntries \n
Output array = [ subArray_1_1 subArray_2_1 subArray_3_1 ... subArray_N_1 \n
subArray_1_2 subArray_2_2 subArray_3_2 ... subArray_N_2 \n
subArray_1_3 subArray_2_3 subArray_3_3 ... subArray_N_3 \n
... \n
subArray_1_M subArray_2_M subArray_3_M ... subArray_M ] \n
where N = numberOfEntries \n
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
repackArray
(
int
numberOfEntries
,
int
subarraySize
,
RealOpenMM
*
array
);
/**---------------------------------------------------------------------------------------
Helper method to repack RealOpenMM arrays (Simbios)
@param numberOfEntries entries/sub-array
@param subarraySize number of subarrays
@param array repacked output array
@param inputArrays inputArrays[subarraySize][numberOfEntries]
Output array = [ inputArrays[0][0] inputArrays[1][0] inputArrays[2][0] inputArrays[3][0] \n
inputArrays[0][1] inputArrays[1][1] inputArrays[2][1] inputArrays[3][1] \n
inputArrays[0][2] inputArrays[1][2] inputArrays[2][2] inputArrays[3][2] \n
... \n
inputArrays[0][numberOfEntries] ... inputArrays[subarraySize-1][numberOfEntries] \n
] \n
where N = numberOfEntries \n
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
repackArrayOfArrays
(
int
numberOfEntries
,
int
subarraySize
,
RealOpenMM
*
array
,
RealOpenMM
**
inputArrays
);
/**---------------------------------------------------------------------------------------
Collapse 2D array into packed single array (Simbios)
Example forces[3][N] -> array of size N containing RealOpenMM3 values
@param numberOfEntries entries (no. atoms)
@param iUnroll iUnroll
@param jUnroll jUnroll
@param arrays arrays to be merged (dimension is [iUnroll][numberOfEntries/iUnroll]
@param mergeArray output array (if null, then allocated)
@param log logging file descriptor
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
RealOpenMM
*
collapseArrays
(
int
numberOfEntries
,
int
iUnroll
,
int
jUnroll
,
RealOpenMM
**
arrays
,
RealOpenMM
*
mergeArray
,
FILE
*
log
);
/**---------------------------------------------------------------------------------------
Merge 2 arrays based on sentinel value (Simbios)
Overflow array, if present, signals which entries had nonsentinel in both arrays
Example \n
array1 = { 1, 2, 3, s, s, s, 4, 5, s } \n
array2 = { s, s, 6, 8, 9, 3, s, 7, s } \n
merge array = { 1, 2, 3, 8, 9, 3, 4, 5, s } \n
overflow array = { s, s, 6, s, s, s, s, 7, s } \n
@param numberOfEntries entries (no. atoms)
@param sentinelValue sentinel value
@param array1 first array
@param array2 second array
@param mergeArray output merge array
@param overflowArray output overflow array (if null, then ignored)
@param log logging file descriptor
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
mergeArraysBasedSentinelValue
(
int
numberOfEntries
,
RealOpenMM
sentinelValue
,
RealOpenMM
*
array1
,
RealOpenMM
*
array2
,
RealOpenMM
*
mergeArray
,
RealOpenMM
*
overflowArray
,
FILE
*
log
);
/**---------------------------------------------------------------------------------------
Helper method to store values from CPU loop in position seen in GPU output (Simbios)
--------------------------------------------------------------------------------------- */
static
int
storeInGpuFormat
(
int
atomI
,
int
atomJ
,
int
debugAtomJ
,
int
jUnroll
,
int
numberOfStreams
,
RealOpenMM
**
debugStreams
,
RealOpenMM
*
RealOpenMMValues
[
2
],
RealOpenMM
unsetDebugValue
,
bool
useUpper
,
FILE
*
log
);
/**---------------------------------------------------------------------------------------
Helper method to compare cpu and gpu computed arrays
@param numberOfAtoms entries (no. atoms)
@param chunkSize chunk size (usually 3 or 4)
@param cpuArray cpuArray[0-(chunkSize-1)][0,entries-1]
@param gpuArray gpuArray[chunkSize*entries]
@param tolerance check if relative difference is greater
than this tolerance
@param compareColumn array of size [chunkSize] signalling whether
column i is to be compared; it may be NULL
@param absoluteMin error if abs(cpu) + abs(gpu) > absoluteMin
set negative to ignore this condition
@param printOn if not set, then no printing
@param header id header -- optional
@param log logging file descriptor
@return number of failed entries
--------------------------------------------------------------------------------------- */
static
int
compareCpuGpuArrays
(
int
numberOfAtoms
,
int
chunkSize
,
RealOpenMM
**
cpuArray
,
RealOpenMM
*
gpuArray
,
RealOpenMM
tolerance
,
int
*
compareColumn
,
RealOpenMM
absoluteMin
,
int
printOn
,
const
char
*
header
,
FILE
*
log
);
// ---------------------------------------------------------------------------------------
};
// ---------------------------------------------------------------------------------------
#endif // __SimTKOpenMMGpuUtilities_H__
platforms/reference/src/SimTKUtilities/SimTKOpenMMLog.h
View file @
51475608
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#ifndef __SimTKOpenMMLog_H__
#ifndef __SimTKOpenMMLog_H__
#define __SimTKOpenMMLog_H__
#define __SimTKOpenMMLog_H__
#include <stdio
.h
>
#include <
c
stdio>
#include <sstream>
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMCommon.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExport.h"
...
...
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
View file @
51475608
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#ifndef __RealSimTk_H__
#ifndef __RealSimTk_H__
#define __RealSimTk_H__
#define __RealSimTk_H__
#include <math
.h
>
#include <
c
math>
// Set RealOpenMMType to 2 for double precision, 1 for float
// Set RealOpenMMType to 2 for double precision, 1 for float
...
...
platforms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.cpp
View file @
51475608
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKUtilities/SimTKOpenMMUtilities.h
View file @
51475608
...
@@ -31,19 +31,7 @@
...
@@ -31,19 +31,7 @@
#include "sfmt/SFMT.h"
#include "sfmt/SFMT.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExport.h"
#include <stdio.h>
#include <string.h>
#include <string>
#include <string>
#include <stdlib.h>
#include <sstream>
// template is used to check if a string is integer, real, ...
template
<
class
T
>
bool
checkString
(
T
&
t
,
const
std
::
string
&
s
,
std
::
ios_base
&
(
*
f
)(
std
::
ios_base
&
)
){
std
::
istringstream
iss
(
s
);
return
!
(
iss
>>
f
>>
t
).
fail
();
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -64,10 +52,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -64,10 +52,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
public:
public:
// file flag enums
enum
FileFlags
{
OpenDebugFile
,
WriteDebugFile
,
CloseDebugFile
};
// dummy constructor/destructor
// dummy constructor/destructor
SimTKOpenMMUtilities
(){};
SimTKOpenMMUtilities
(){};
...
@@ -110,95 +94,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -110,95 +94,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
static
int
getDistanceSquaredFromSpecifiedPoint
(
RealOpenMM
**
atomCoordinates
,
RealOpenMM
*
point
,
static
int
getDistanceSquaredFromSpecifiedPoint
(
RealOpenMM
**
atomCoordinates
,
RealOpenMM
*
point
,
int
numberOfAtoms
,
RealOpenMM
*
distances
,
int
numberOfAtoms
,
RealOpenMM
*
distances
,
FILE
*
log
);
FILE
*
log
);
/**---------------------------------------------------------------------------------------
Helper method to allocate RealOpenMM arrays (Simbios)
@param bufferIndex buffer index
@param allocatedSz array of allocated sizes
@param bufferArray array of allocated RealOpenMM arrays
@param requestedSize requested size
@param dataAction action flag: -1 = free memory \n
1 = zero memory
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
allocateRealOpenMMBufferArray
(
int
bufferIndex
,
int
*
allocatedSz
,
RealOpenMM
**
bufferArray
,
int
requestedSize
,
int
dataAction
);
/**---------------------------------------------------------------------------------------
Print atom coordinates, ...
@param numberAtoms numberAtoms
@param atomCoordinates atomCoordinates (may be NULL)
@param numberOf1Darrays number of 1-d arrays (may be 0)
@param oneDArrays 1-d arrays
@param idString id string to be printed if set
@param log print messages to log file
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
printCoordinateAnd1DArrays
(
int
numberAtoms
,
RealOpenMM
**
atomCoordinates
,
int
numberOf1Darrays
,
RealOpenMM
**
oneDArrays
,
const
char
*
idString
,
FILE
*
log
);
/**---------------------------------------------------------------------------------------
Free array of strings
@param arraySz atom index
@param arrayOfStrings array of strings
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
freeArrayOfStrings
(
int
arraySz
,
char
**
arrayOfStrings
);
/**---------------------------------------------------------------------------------------
Tab string in place
@param string string to tab; assume string is of at least length=tab + 1
@param tab tab length
--------------------------------------------------------------------------------------- */
static
int
tabStringInPlace
(
char
*
string
,
int
tab
);
/**---------------------------------------------------------------------------------------
Write debug fields (Simbios)
@param numberOfFields number of fields to print
@param fields fields
@param numberOfStringFields number of string fields to print
@param stringFields string fields
@param comment comment (optinal -- ignored if NULL)
@param debugFileName output debug file name
@param action 0 open file and @return w/o printing
1 open file and print
2 close file (no print)
@param debugFile debug file reference
@param log if set, then print error messages to log file
@return debugFile unless file is closed
stringFields printed after RealOpenMM fields
--------------------------------------------------------------------------------------- */
static
FILE
*
writeDebugFile
(
int
numberOfFields
,
const
RealOpenMM
*
fields
,
int
numberOfStringFields
,
const
StringVector
&
stringFields
,
const
char
*
comment
,
const
char
*
debugFileName
,
int
action
,
FILE
*
debugFile
,
FILE
*
log
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -292,40 +187,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -292,40 +187,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
static
int
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
static
int
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
RealOpenMM
**
array2D
,
RealOpenMM
initialValue
);
RealOpenMM
**
array2D
,
RealOpenMM
initialValue
);
/**---------------------------------------------------------------------------------------
Malloc memory of size bytesToAllocate and zero
@param bytesToAllocate bytes to allocate
@return ptr to allocated memory; NULL if bytesToAllocate <= 0
--------------------------------------------------------------------------------------- */
static
char
*
allocateAndZero
(
unsigned
int
bytesToAllocate
);
/**---------------------------------------------------------------------------------------
Normalize 3-vector -- helper method
@param vector vector to normalize
--------------------------------------------------------------------------------------- */
static
void
normalizeVector3
(
RealOpenMM
*
vector
);
/**---------------------------------------------------------------------------------------
Remove 3-vector -- helper method
@param vectorToRemove vector to remove
@param vector vector to from which 'vectorToRemove' is to be removed \n
vector is normalized after the component is subtracted out
--------------------------------------------------------------------------------------- */
static
void
removeVector3
(
RealOpenMM
*
vectorToRemove
,
RealOpenMM
*
vector
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Compute cross product of two 3-vectors and place in 3rd vector -- helper method
Compute cross product of two 3-vectors and place in 3rd vector -- helper method
...
@@ -341,250 +202,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -341,250 +202,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
crossProductVector3
(
RealOpenMM
*
vectorX
,
RealOpenMM
*
vectorY
,
RealOpenMM
*
vectorZ
);
static
void
crossProductVector3
(
RealOpenMM
*
vectorX
,
RealOpenMM
*
vectorY
,
RealOpenMM
*
vectorZ
);
/**---------------------------------------------------------------------------------------
Compute matrix product of 3x3 matrix and 3-vector and place in 3rd vector -- helper method
@param vectorZ = matrixX . vectorY
@param matrixX matrixX
@param vectorY y-vector
@param vectorZ z-vector
@return vector is vectorZ
--------------------------------------------------------------------------------------- */
static
void
matrixProductVector3
(
RealOpenMM
*
matrixX
,
RealOpenMM
*
vectorY
,
RealOpenMM
*
vectorZ
);
/**---------------------------------------------------------------------------------------
Compute cross product between two 3x3 matrices
@param vectorZ = matrixX . matrixY
@param matrixX matrixX
@param matrixY matrixY
@param vectorZ z-vector
@return vector is vectorZ
--------------------------------------------------------------------------------------- */
static
void
matrixCrossProductMatrix3
(
RealOpenMM
*
matrixX
,
RealOpenMM
*
matrixY
,
RealOpenMM
*
vectorZ
);
/* ---------------------------------------------------------------------------------------
Centralized malloc/new
@param name ptr name
@param fileName file name
@param line file line no.
@param file line size in bytes to be allocated
@return ptr to allocated object
--------------------------------------------------------------------------------------- */
static
void
*
Xmalloc
(
const
char
*
name
,
const
char
*
fileName
,
int
line
,
unsigned
int
size
);
/* ---------------------------------------------------------------------------------------
Centralized free/delete
@param name ptr name
@param fileName file name
@param line file line no.
@param ptr ptr to be freed
--------------------------------------------------------------------------------------- */
static
void
Xfree
(
const
char
*
name
,
const
char
*
fileName
,
int
line
,
void
*
ptr
);
/* ---------------------------------------------------------------------------------------
Format array of reals
@param message input string stream
@param realArray array of RealOpenMMs
@param numberOfFields number of fields (optional - defaults to 3)
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
formatRealStringStream
(
std
::
stringstream
&
message
,
const
RealOpenMM
*
realArray
,
int
numberOfFields
=
3
,
RealOpenMM
factor
=
(
RealOpenMM
)
1.0
f
);
/**---------------------------------------------------------------------------------------
Tokenize a string (static method) (Simbios)
@param lineBuffer string to tokenize
@param tokenArray upon return vectory of tokens
@param delimiter token delimter
@return number of args
--------------------------------------------------------------------------------------- */
static
int
tokenizeString
(
char
*
lineBuffer
,
StringVector
&
tokenArray
,
const
std
::
string
delimiter
=
"
\t\n
"
);
/**---------------------------------------------------------------------------------------
Tokenize a string (static method) (Simbios)
@param line string to tokenize
@param tokenVector upon return vector of tokens
@param delimiter token delimter
@param clearTokenVector if true, clear tokenVector
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
tokenizeString
(
const
std
::
string
&
line
,
StringVector
&
tokenVector
,
const
std
::
string
&
delimiter
,
int
clearTokenVector
);
/**---------------------------------------------------------------------------------------
Local version of strncasecmp (missing in Windows) (static method) (Simbios)
@param string1 first string
@param string2 second string
@param matchLength match length
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
localStrncasecmp
(
const
char
*
string1
,
const
char
*
string2
,
int
matchLength
);
/**---------------------------------------------------------------------------------------
Check that string is valid integer
@param stringToCheck string to check
@return true if string is a valid integer
--------------------------------------------------------------------------------------- */
static
bool
isValidInteger
(
std
::
string
stringToCheck
);
/**---------------------------------------------------------------------------------------
Check that string is valid RealOpenMM
@param stringToCheck string to check
@return true if string is a valid RealOpenMM
--------------------------------------------------------------------------------------- */
static
bool
isValidRealOpenMM
(
std
::
string
stringToCheck
);
/**---------------------------------------------------------------------------------------
Read file into string vector (Simbios)
@param fileName file name
@param fileContents string vector containing file contents upon return
one string per line
@return SimTKOpenMMCommon::DefaultReturn unless file could not be opened
--------------------------------------------------------------------------------------- */
static
int
readFileIntoStringVector
(
const
std
::
string
&
fileName
,
StringVector
&
fileContents
);
/**---------------------------------------------------------------------------------------
Read file into string vector (Simbios)
@param charArray character array
@param arrayLength array length
@param arrayContents string vector containing array contents upon return
one string per line
@return SimTKOpenMMCommon::DefaultReturn unless file could not be opened
--------------------------------------------------------------------------------------- */
static
int
readCharacterArrayIntoStringVector
(
const
char
*
charArray
,
int
arrayLength
,
StringVector
&
fileContents
);
/**---------------------------------------------------------------------------------------
Replacement of sorts for strtok() (static method) (Simbios)
Used to parse parameter file lines
Should be moved to Utilities file
@param lineBuffer string to tokenize
@param delimiter token delimter
@return number of args; if return value equals maxTokens, then more tokens than allocated
--------------------------------------------------------------------------------------- */
static
char
*
strsep
(
char
**
lineBuffer
,
const
char
*
delimiter
);
/**---------------------------------------------------------------------------------------
Write file (helper method) (Simbios)
@param lineVector line entries for file
@param inputFileName inputFileName
@return SimTKOpenMMCommon::ErrorReturn if error -- else SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
writeFile
(
const
StringVector
&
lineVector
,
const
std
::
string
&
fileName
);
/**---------------------------------------------------------------------------------------
Get statistics on an array
@param numberOfEntries number of entries in array
@param array array
@param average average of array on output
@param stdDev std dev of array on output
@param minValue min value in array on output
@param minIndex index of min value in array on output
@param maxValue max value in array on output
@param maxIndex index of max value in array on output
if numberOfEntries <= 0, return 0 for all RealOpenMM values and -1 for index values
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
getArrayStatistics
(
int
numberOfEntries
,
const
RealOpenMM
*
array
,
RealOpenMM
*
average
,
RealOpenMM
*
stdDev
,
RealOpenMM
*
minValue
,
int
*
minIndex
,
RealOpenMM
*
maxValue
,
int
*
maxIndex
);
/**---------------------------------------------------------------------------------------
Get one 2D array to another
@param dimension1 first dimension
@param dimension2 second dimension
@param arrayToAdd array to add [dimension1][dimension2]
@param sumArray summed array to add [dimension1][dimension2]
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
static
int
addTwoDimArray
(
int
dimension1
,
int
dimension2
,
RealOpenMM
**
arrayToAdd
,
RealOpenMM
**
sumArray
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKUtilities/SimTKOpenMMWindowLinux.h
deleted
100755 → 0
View file @
398f0609
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* 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.
*/
#ifndef __SimTKOpenMMWindowLinux_H_
#define __SimTKOpenMMWindowLinux_H__
#ifdef WIN32
#define FOPEN fopen_s
#else
#define FOPEN fopen
#endif
#endif // __SimTKOpenMMWindowLinux_H__
platforms/reference/src/SimTKUtilities/SimTKlapack.h
deleted
100755 → 0
View file @
398f0609
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKUtilities/TwoDimArraySimTk.h
deleted
100755 → 0
View file @
398f0609
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* 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.
*/
#ifndef __TwoDimArraySimTk_H_
#define __TwoDimArraySimTk_H_
// ---------------------------------------------------------------------------------------
//#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMUtilities.h"
/**---------------------------------------------------------------------------------------
Class for 2D arrays
--------------------------------------------------------------------------------------- */
template
<
typename
T
>
class
TwoDimArraySimTk
{
private:
int
_rowSize
;
int
_columnSize
;
T
**
_2Darray
;
T
*
_2DMemoryBlock
;
std
::
string
_name
;
public:
TwoDimArraySimTk
(
int
rowSize
,
int
columnSize
);
~
TwoDimArraySimTk
();
/**---------------------------------------------------------------------------------------
Get 2D array
@return ptr to array
--------------------------------------------------------------------------------------- */
T
**
get2DArray
(
void
)
const
{
return
_2Darray
;
};
/**---------------------------------------------------------------------------------------
Get print string
@return std::string
--------------------------------------------------------------------------------------- */
std
::
string
getPrintString
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Get name
@return array name
--------------------------------------------------------------------------------------- */
std
::
string
getName
(
void
)
const
{
return
_name
;
};
/**---------------------------------------------------------------------------------------
Set name
@param array name
--------------------------------------------------------------------------------------- */
void
setName
(
std
::
string
name
){
_name
=
name
;
};
};
/**---------------------------------------------------------------------------------------
TwoDimArraySimTk constructor
@param rowSize row dimension
@param columnSize column dimension
--------------------------------------------------------------------------------------- */
template
<
typename
T
>
TwoDimArraySimTk
<
T
>::
TwoDimArraySimTk
(
int
rowSize
,
int
columnSize
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nTwoDimArraySimTk<T>::TwoDimArraySimTk";
// ---------------------------------------------------------------------------------------
_name
=
"NotSet"
;
_rowSize
=
rowSize
;
_columnSize
=
columnSize
;
#ifdef useXMalloc
_2Darray
=
(
T
**
)
SimTKOpenMMUtilities
::
Xmalloc
(
"TwoDimArraySimTk"
,
__FILE__
,
__LINE__
,
rowSize
*
sizeof
(
T
*
)
);
_2DMemoryBlock
=
(
T
*
)
SimTKOpenMMUtilities
::
Xmalloc
(
"block"
,
__FILE__
,
__LINE__
,
columnSize
*
rowSize
*
sizeof
(
T
)
);
#else
_2Darray
=
(
T
**
)
SimTKOpenMMUtilities
::
Xmalloc
(
"TwoDimArraySimTk"
,
__FILE__
,
__LINE__
,
rowSize
*
sizeof
(
T
*
)
);
_2DMemoryBlock
=
(
T
*
)
SimTKOpenMMUtilities
::
Xmalloc
(
"block"
,
__FILE__
,
__LINE__
,
columnSize
*
rowSize
*
sizeof
(
T
)
);
#endif
T
*
blockPtr
=
_2DMemoryBlock
;
for
(
int
ii
=
0
;
ii
<
rowSize
;
ii
++
){
_2Darray
[
ii
]
=
blockPtr
;
blockPtr
+=
columnSize
;
}
memset
(
_2DMemoryBlock
,
0
,
columnSize
*
rowSize
*
sizeof
(
T
)
);
// (void) fprintf( stdout, "\nTwoDimArraySimTk %s ", getPrintString().c_str() );
// (void) fflush( stdout );
}
/**---------------------------------------------------------------------------------------
TwoDimArraySimTk destructor
array[i][j]
@param rowSize row dimension
@param columnSize column dimension
--------------------------------------------------------------------------------------- */
template
<
typename
T
>
TwoDimArraySimTk
<
T
>::~
TwoDimArraySimTk
(
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nTwoDimArraySimTk<T>::~TwoDimArraySimTk";
// ---------------------------------------------------------------------------------------
if
(
_2DMemoryBlock
){
SimTKOpenMMUtilities
::
Xfree
(
"2DMemoryBlock"
,
__FILE__
,
__LINE__
,
_2DMemoryBlock
);
}
if
(
_2Darray
){
SimTKOpenMMUtilities
::
Xfree
(
"2Darray"
,
__FILE__
,
__LINE__
,
_2Darray
);
}
}
/**---------------------------------------------------------------------------------------
TwoDimArraySimTk print string
@return id string
--------------------------------------------------------------------------------------- */
template
<
typename
T
>
std
::
string
TwoDimArraySimTk
<
T
>::
getPrintString
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nTwoDimArraySimTk<T>::getPrintString";
// ---------------------------------------------------------------------------------------
std
::
stringstream
message
;
message
<<
_name
<<
" [ "
<<
_rowSize
<<
", "
<<
_columnSize
<<
" ] sizeT="
<<
sizeof
(
T
);
message
<<
" array="
<<
(
unsigned
int
)
_2Darray
<<
" block="
<<
(
unsigned
int
)
_2DMemoryBlock
;
// message << " array=" << (void *) _2Darray << " block=" << (void*) _2DMemoryBlock;
return
message
.
str
();
}
/**---------------------------------------------------------------------------------------
Typdefs to make code more readable
--------------------------------------------------------------------------------------- */
typedef
TwoDimArraySimTk
<
Real
>
TwoDimRealArraySimTk
;
typedef
std
::
vector
<
TwoDimRealArraySimTk
*>
TwoDimRealArraySimTkVector
;
typedef
std
::
vector
<
TwoDimRealArraySimTk
*>::
iterator
TwoDimRealArraySimTkVectorI
;
#endif // __TwoDimArraySimTk_H_
platforms/reference/src/gbsa/CpuImplicitSolvent.cpp
View file @
51475608
...
@@ -42,19 +42,6 @@ using namespace std;
...
@@ -42,19 +42,6 @@ using namespace std;
CpuImplicitSolvent
*
CpuImplicitSolvent
::
_cpuImplicitSolvent
=
NULL
;
CpuImplicitSolvent
*
CpuImplicitSolvent
::
_cpuImplicitSolvent
=
NULL
;
// info file related-stuff
std
::
string
CpuImplicitSolvent
::
_defaultInfoFileName
=
std
::
string
(
"CpuImplicitSolventInfo"
);
// key for info file: base file name
const
std
::
string
CpuImplicitSolvent
::
CpuImplicitSolventBaseFileName
=
std
::
string
(
"CpuImplicitSolventBaseFileName"
);
// key for info file: file generation frequency
const
std
::
string
CpuImplicitSolvent
::
CpuImplicitSolventFileGenerationFrequency
=
std
::
string
(
"CpuImplicitSolventFileGenerationFrequency"
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
CpuImplicitSolvent constructor
CpuImplicitSolvent constructor
...
@@ -115,9 +102,6 @@ void CpuImplicitSolvent::_initializeDataMembers( void ){
...
@@ -115,9 +102,6 @@ void CpuImplicitSolvent::_initializeDataMembers( void ){
_forceCallIndex
=
0
;
_forceCallIndex
=
0
;
_implicitSolventEnergy
=
(
RealOpenMM
)
0.0
;
_implicitSolventEnergy
=
(
RealOpenMM
)
0.0
;
_baseFileName
=
SimTKOpenMMCommon
::
NotSet
;
_outputFileFrequency
=
1
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -740,243 +724,6 @@ int CpuImplicitSolvent::computeAceNonPolarForce( const ImplicitSolventParameters
...
@@ -740,243 +724,6 @@ int CpuImplicitSolvent::computeAceNonPolarForce( const ImplicitSolventParameters
}
}
/**---------------------------------------------------------------------------------------
Get BaseFileName
@return baseFileName
--------------------------------------------------------------------------------------- */
const
std
::
string
&
CpuImplicitSolvent
::
getBaseFileName
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nCpuImplicitSolvent::getBaseFileName";
// ---------------------------------------------------------------------------------------
return
_baseFileName
;
}
/**---------------------------------------------------------------------------------------
Set BaseFileName
@param input baseFileName
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
int
CpuImplicitSolvent
::
setBaseFileName
(
const
std
::
string
&
baseFileName
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nCpuImplicitSolvent::setBaseFileName";
// ---------------------------------------------------------------------------------------
_baseFileName
=
baseFileName
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
/**---------------------------------------------------------------------------------------
Set OutputFileFrequency
@param input outputFileFrequency
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
int
CpuImplicitSolvent
::
setOutputFileFrequency
(
int
outputFileFrequency
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nCpuImplicitSolvent::setOutputFileFrequency";
// ---------------------------------------------------------------------------------------
_outputFileFrequency
=
outputFileFrequency
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
/**---------------------------------------------------------------------------------------
Get OutputFileFrequency
@return output file frequency
--------------------------------------------------------------------------------------- */
int
CpuImplicitSolvent
::
getOutputFileFrequency
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nCpuImplicitSolvent::getOutputFileFrequency";
// ---------------------------------------------------------------------------------------
return
_outputFileFrequency
;
}
/**---------------------------------------------------------------------------------------
Read info file
@param infoFileName file name to read
@return SimTKOpenMMCommon::DefaultReturn if ok; else SimTKOpenMMCommon::ErrorReturn; if major
problem, program will exit
--------------------------------------------------------------------------------------- */
int
CpuImplicitSolvent
::
readInfoFile
(
const
std
::
string
infoFileName
){
// ---------------------------------------------------------------------------------------
const
int
bufferSize
=
2048
;
char
buffer
[
bufferSize
];
static
const
std
::
string
methodName
=
"
\n
CpuImplicitSolvent::readInfoFile"
;
// ---------------------------------------------------------------------------------------
FILE
*
infoFile
=
NULL
;
#ifdef _MSC_VER
fopen_s
(
&
infoFile
,
infoFileName
.
c_str
(),
"r"
);
#else
infoFile
=
fopen
(
infoFileName
.
c_str
(),
"r"
);
#endif
if
(
infoFile
==
NULL
){
#ifdef _MSC_VER
fopen_s
(
&
infoFile
,
_defaultInfoFileName
.
c_str
(),
"r"
);
#else
infoFile
=
fopen
(
_defaultInfoFileName
.
c_str
(),
"r"
);
#endif
if
(
infoFile
==
NULL
){
std
::
stringstream
message
;
message
<<
methodName
<<
" fopen failed on info file=<"
<<
_defaultInfoFileName
<<
"> and file=<"
<<
infoFileName
<<
">"
;
SimTKOpenMMLog
::
printMessage
(
message
);
return
SimTKOpenMMCommon
::
ErrorReturn
;
}
else
{
std
::
stringstream
message
;
message
<<
methodName
<<
" opened info file=<"
<<
_defaultInfoFileName
<<
">."
;
SimTKOpenMMLog
::
printMessage
(
message
);
}
}
else
{
std
::
stringstream
message
;
message
<<
methodName
<<
" opened info file=<"
<<
infoFileName
<<
">."
;
SimTKOpenMMLog
::
printMessage
(
message
);
}
/* Sample file:
*/
int
errors
=
0
;
while
(
fgets
(
buffer
,
bufferSize
,
infoFile
)
){
std
::
stringstream
message
;
std
::
string
fileName
=
std
::
string
(
);
size_t
bufferLen
=
strlen
(
buffer
);
if
(
bufferLen
>
0
){
buffer
[
bufferLen
-
1
]
=
'\0'
;
}
message
<<
"
\n
<"
<<
buffer
<<
">"
;
//fprintf( amoebaLog->getLogFile(), "\nreadInfoFile <%s>", buffer );
//fflush( amoebaLog->getLogFile() );
StringVector
tokens
;
SimTKOpenMMUtilities
::
tokenizeString
(
buffer
,
tokens
);
bool
done
=
false
;
for
(
StringVectorI
ii
=
tokens
.
begin
();
ii
!=
tokens
.
end
()
&&
!
done
;
ii
++
){
std
::
string
token
=
*
ii
;
size_t
tokenLength
=
token
.
length
();
bool
recognized
=
false
;
// skip comments and blank lines
if
(
tokenLength
<
2
||
!
token
.
compare
(
"#"
)
){
done
=
true
;
recognized
=
true
;
// base file name
}
else
if
(
!
token
.
compare
(
CpuImplicitSolvent
::
CpuImplicitSolventBaseFileName
)
){
recognized
=
true
;
setBaseFileName
(
*
(
++
ii
)
);
// file frequency
}
else
if
(
!
token
.
compare
(
CpuImplicitSolvent
::
CpuImplicitSolventFileGenerationFrequency
)
){
recognized
=
true
;
std
::
string
value
=
*
(
++
ii
);
if
(
SimTKOpenMMUtilities
::
isValidInteger
(
value
)
){
setOutputFileFrequency
(
atoi
(
value
.
c_str
()
)
);
}
else
{
message
<<
"
\n
Token=<"
<<
token
<<
"> is not a valid integer for key="
<<
CpuImplicitSolvent
::
CpuImplicitSolventFileGenerationFrequency
;
}
// keys used by objects other than 'CpuImplicitSolvent'
}
else
{
/*
recognized = true;
std::string key = *ii;
ii++;
if( ii != tokens.end() ){
_inputArguments[key] = *ii;
} else {
_inputArguments[key] = CpuImplicitSolventCommon::Comment;
}
*/
}
if
(
!
recognized
){
message
<<
"
\n
Token=<"
<<
token
<<
"> not recognized."
;
}
}
SimTKOpenMMLog
::
printMessage
(
message
);
}
(
void
)
fclose
(
infoFile
);
// report if errors
if
(
errors
){
std
::
stringstream
message
;
message
<<
"
\n
Errors -- aborting.
\n
"
;
SimTKOpenMMLog
::
printMessage
(
message
);
exit
(
-
1
);
}
else
{
std
::
stringstream
message
;
message
<<
"
\n
No errors detected parsing info file "
<<
infoFileName
<<
"
\n
"
;
/*
message << "\nNumber of hash arguments=" << _amoebaInputArguments.size() << " <key,value> pairs listed below:\n";
for( StringStringMapCI ii = _amoebaInputArguments.begin(); ii != _amoebaInputArguments.end(); ii++ ){
message << "\n <" << (*ii).first << ">=<" << (*ii).second << ">";
}
*/
message
<<
"
\n\n
"
;
SimTKOpenMMLog
::
printMessage
(
message
);
}
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Get string w/ state
Get string w/ state
...
@@ -1014,80 +761,3 @@ std::string CpuImplicitSolvent::getStateString( const char* title ) const {
...
@@ -1014,80 +761,3 @@ std::string CpuImplicitSolvent::getStateString( const char* title ) const {
return
message
.
str
();
return
message
.
str
();
}
}
/* ---------------------------------------------------------------------------------------
Override C++ new w/ Gromac's smalloc/sfree (Simbios)
@param size bytes to allocate
@return ptr to allocated memory
--------------------------------------------------------------------------------------- */
/*
void* CpuImplicitSolvent::operator new( size_t size ){
void *ptr;
smalloc(ptr, (int) size);
// (void) fprintf( stdout, "\nCpuImplicitSolvent new called -- size=%u", size );
// (void) fflush( stdout );
return ptr;
} */
/* ---------------------------------------------------------------------------------------
Override C++ delete w/ Gromac's sfree (Simbios)
@param ptr ptr to block to free
--------------------------------------------------------------------------------------- */
/*
void CpuImplicitSolvent::operator delete( void *ptr ){
// (void) fprintf( stdout, "\nCpuImplicitSolvent delete called." );
// (void) fflush( stdout );
sfree( ptr );
} */
/* ---------------------------------------------------------------------------------------
Override C++ new w/ Gromac's smalloc/sfree (Simbios)
@param size bytes to allocate
@return ptr to allocated memory
--------------------------------------------------------------------------------------- */
/*
void* CpuImplicitSolvent::operator new[]( size_t size ){
void *ptr;
smalloc(ptr, (int) size);
// (void) fprintf( stdout, "\nCpuImplicitSolvent new[] called -- size=%u", size );
// (void) fflush( stdout );
return ptr;
} */
/* ---------------------------------------------------------------------------------------
Override C++ delete w/ Gromac's sfree (Simbios)
@param ptr ptr to block to free
--------------------------------------------------------------------------------------- */
/*
void CpuImplicitSolvent::operator delete[]( void *ptr ){
// (void) fprintf( stdout, "\nCpuImplicitSolvent delete[] called." );
// (void) fflush( stdout );
sfree( ptr );
}
*/
platforms/reference/src/gbsa/CpuImplicitSolvent.h
View file @
51475608
...
@@ -32,27 +32,8 @@
...
@@ -32,27 +32,8 @@
class
OPENMM_EXPORT
CpuImplicitSolvent
{
class
OPENMM_EXPORT
CpuImplicitSolvent
{
public:
// fields in info file
const
static
std
::
string
CpuImplicitSolventBaseFileName
;
const
static
std
::
string
CpuImplicitSolventFileGenerationFrequency
;
private:
private:
// default info file name
static
std
::
string
_defaultInfoFileName
;
// base file name
std
::
string
_baseFileName
;
// frequency to output diagnostic files
int
_outputFileFrequency
;
// used for direct calls
// used for direct calls
static
CpuImplicitSolvent
*
_cpuImplicitSolvent
;
static
CpuImplicitSolvent
*
_cpuImplicitSolvent
;
...
@@ -155,14 +136,6 @@ class OPENMM_EXPORT CpuImplicitSolvent {
...
@@ -155,14 +136,6 @@ class OPENMM_EXPORT CpuImplicitSolvent {
virtual
~
CpuImplicitSolvent
(
);
virtual
~
CpuImplicitSolvent
(
);
// override of new/delete -- used when run in PS3 framework(?)
// static void* operator new( size_t size );
// static void operator delete( void *p );
// static void* operator new[]( size_t size );
// static void operator delete[]( void *p );
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Delete static _cpuImplicitSolvent object if set
Delete static _cpuImplicitSolvent object if set
...
@@ -419,112 +392,6 @@ class OPENMM_EXPORT CpuImplicitSolvent {
...
@@ -419,112 +392,6 @@ class OPENMM_EXPORT CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
std
::
string
getStateString
(
const
char
*
title
)
const
;
std
::
string
getStateString
(
const
char
*
title
)
const
;
/**---------------------------------------------------------------------------------------
Get BaseFileName
@return baseFileName
--------------------------------------------------------------------------------------- */
const
std
::
string
&
getBaseFileName
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Set BaseFileName
@param input baseFileName
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
int
setBaseFileName
(
const
std
::
string
&
baseFileName
);
/**---------------------------------------------------------------------------------------
Get OutputFileFrequency
@return outputFileFrequency
--------------------------------------------------------------------------------------- */
int
getOutputFileFrequency
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Set OutputFileFrequency
@param input outputFileFrequency
@return SimTKOpenMMCommon::DefaultReturn
--------------------------------------------------------------------------------------- */
int
setOutputFileFrequency
(
int
outputFileFrequency
);
/**---------------------------------------------------------------------------------------
Read info file
@param infoFileName file name to read
@return CpuImplicitSolventCommon::DefaultReturn if ok; else CpuImplicitSolventCommon::ErrorReturn; if major
problem, program will exit
--------------------------------------------------------------------------------------- */
int
readInfoFile
(
const
std
::
string
infoFileName
);
/**---------------------------------------------------------------------------------------
Get output file name (helper method) (Simbios)
fileName = (inputFileName || getBaseFileName()) . getForceCallIndex() . suffix
if inputFileName is NULL, then use getBaseFileName() as base file name
if getForceCallIndex() > 0, insert '.getForceCallIndex()'
append suffix, if not NULL
@param inputFileName inputFileName
@param suffix file suffix
@return file name
--------------------------------------------------------------------------------------- */
std
::
string
getOutputFileName
(
const
std
::
string
*
inputFileName
,
const
std
::
string
*
suffix
)
const
;
/**---------------------------------------------------------------------------------------
Write Tinker xyz file (Simbios)
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param atomNames atom names
@param header header
@param xyzFileName output file name
@param bondsArray bond array -- used to print 1-2 bonds
@return 0 unless error detected
Currently no attempt is made to get the atom name/type to accurately
reflect the Tinker names/types. Rather method is used to output atoms
in Gromacs order and then reorder those in a corresponding xyz file
w/ the correct atom names/types so that they match the Gromacs order
This makes it easier to compare results between Gromacs and Tinker
--------------------------------------------------------------------------------------- */
/*
static int writeXyzFile( int numberOfAtoms, const std::vector<OpenMM::RealVec>& atomCoordinates,
const char** atomNames,
const std::string& header, const std::string& xyzFileName,
const implicitSolventBonds** bondsArray ); */
};
};
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
...
platforms/reference/src/gbsa/SimTKOpenMMWindowLinux.h
deleted
100755 → 0
View file @
398f0609
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* 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.
*/
#ifndef __SimTKOpenMMWindowLinux_H_
#define __SimTKOpenMMWindowLinux_H__
#ifdef WIN32
#define FOPEN fopen_s
#else
#define FOPEN fopen
#endif
#endif // __SimTKOpenMMWindowLinux_H__
platforms/reference/src/gbsa/cpuObcInterface.cpp
View file @
51475608
...
@@ -105,10 +105,6 @@ cpuSetObcParameters( int numberOfAtoms, RealOpenMM* atomicRadii, RealOpenMM* obc
...
@@ -105,10 +105,6 @@ cpuSetObcParameters( int numberOfAtoms, RealOpenMM* atomicRadii, RealOpenMM* obc
CpuImplicitSolvent
::
setCpuImplicitSolvent
(
cpuObc
);
CpuImplicitSolvent
::
setCpuImplicitSolvent
(
cpuObc
);
// set base file name, ...
//cpuObc->readInfoFile( "CpuImplicitSolventInfo" );
// include/do not include ACE approximation (nonpolar solvation)
// include/do not include ACE approximation (nonpolar solvation)
cpuObc
->
setIncludeAceApproximation
(
includeAceApproximation
);
cpuObc
->
setIncludeAceApproximation
(
includeAceApproximation
);
...
...
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