mirror of
https://github.com/Electrostatics/apbs.git
synced 2026-06-04 12:44:23 +08:00
merged
This commit is contained in:
121
.build.sh
121
.build.sh
@@ -1,43 +1,92 @@
|
||||
#!/bin/bash
|
||||
|
||||
#export CC=clang
|
||||
#export CXX=clang
|
||||
#export CMAKE_C_COMPILER=clang
|
||||
#export CMAKE_CXX_COMPILER=clang
|
||||
#export CMAKE_C_LINK_EXECUTABLE=clang
|
||||
#export CMAKE_CXX_LINK_EXECUTABLE=clang
|
||||
export BUILD_DIR=build
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
#export CMAKE_C_COMPILER=$CC
|
||||
#export CMAKE_CXX_COMPILER=$CXX
|
||||
#export CMAKE_C_LINK_EXECUTABLE=$CC
|
||||
#export CMAKE_CXX_LINK_EXECUTABLE=$CXX
|
||||
|
||||
export SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
export COVERAGE="-g -O0 -fprofile-arcs -ftest-coverage"
|
||||
export COVERAGE=""
|
||||
export BUILD_DIR="$SRC_DIR/build"
|
||||
export INSTALL_DIR=$HOME/apbs
|
||||
export PATH=$INSTALL_DIR:$PATH
|
||||
export RELEASE_TYPE=Debug
|
||||
export RELEASE_TYPE=Release
|
||||
rm -rf $INSTALL_DIR || exit 1
|
||||
mkdir -p $INSTALL_DIR || exit 1
|
||||
rm -rf $BUILD_DIR || exit 1
|
||||
mkdir $BUILD_DIR || exit 1
|
||||
cd $BUILD_DIR || exit 1
|
||||
#cmake -S .. -B $BUILD_DIR --trace-source=../CMakeLists.txt --trace-expand \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE_TYPE \
|
||||
-DENABLE_GEOFLOW=ON \
|
||||
-DENABLE_BEM=ON \
|
||||
-DENABLE_FETK=ON \
|
||||
-DENABLE_OPENMP=ON \
|
||||
-DENABLE_PBAM=ON \
|
||||
-DENABLE_PBSAM=ON \
|
||||
-DENABLE_PYTHON=ON \
|
||||
-DENABLE_TESTS=ON \
|
||||
-DENABLE_TINKER=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_DOC=OFF \
|
||||
.. || exit 1
|
||||
# -DCMAKE_C_FLAGS="-fPIC" \
|
||||
# -DCMAKE_C_FLAGS="--coverage" \
|
||||
# -DCMAKE_CXX_FLAGS="--coverage" \
|
||||
VERBOSE=1 make -j 1 || exit 1
|
||||
VERBOSE=1 make -j 1 install || exit 1
|
||||
export PATH="$INSTALL_DIR/bin:$PATH"
|
||||
ctest -C Release --output-on-failure # || exit 1
|
||||
|
||||
cpack -C Release -G ZIP || exit
|
||||
echo "==================================== WHERE AM I ==================================== "
|
||||
pwd
|
||||
echo "==================================== VERSIONS: ==================================== "
|
||||
echo "==================================== PYTHON VERSION"
|
||||
python -c "import sys; print(sys.version)"
|
||||
echo "==================================== CMAKE VERSION"
|
||||
cmake --version
|
||||
echo "==================================== C Compiler VERSION"
|
||||
$CMAKE_C_COMPILER --version
|
||||
echo "==================================== C++ Compiler VERSION"
|
||||
$CMAKE_CXX_COMPILER --version
|
||||
echo "==================================== SWIG VERSION"
|
||||
swig -version
|
||||
echo "==================================== Install Python requirements ==================================== "
|
||||
pip3 install -U pip
|
||||
pip3 install -U pytest
|
||||
pip3 install -U virtualenv
|
||||
pip3 install -U numpy
|
||||
pip3 install -r requirements.txt
|
||||
# Just build APBS for now
|
||||
echo "==================================== PWD FOR TOP DIR ==================================== "
|
||||
pwd
|
||||
echo "==================================== Get External SubModules ==================================== "
|
||||
git submodule init
|
||||
git submodule update
|
||||
echo "==================================== BUILD =============================================== "
|
||||
|
||||
rm -rf $BUILD_DIR || exit 1
|
||||
rm -rf $INSTALL_DIR || exit 1
|
||||
mkdir -p $BUILD_DIR || exit 1
|
||||
mkdir -p $INSTALL_DIR || exit 1
|
||||
# Build pybind11
|
||||
pushd $(pwd)/externals/pybind11
|
||||
[ -d build ] || mkdir -p build
|
||||
[ -d install ] || mkdir -p install
|
||||
pushd build
|
||||
cmake \
|
||||
-DDOWNLOAD_CATCH=ON \
|
||||
-DPYBIND11_TEST=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=$(python3 -c "import os,sys; print(os.path.realpath(sys.argv[1]))" ../install) \
|
||||
..
|
||||
make -j install
|
||||
popd
|
||||
export pybind11_DIR=$(python3 -c "import os,sys; print(os.path.realpath(sys.argv[1]))" ./install)
|
||||
popd
|
||||
cd $BUILD_DIR || exit 1
|
||||
#cmake -S .. -B $BUILD_DIR --trace-source=../CMakeLists.txt --trace-expand \
|
||||
cmake \
|
||||
-DBUILD_DOC=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${COVERAGE}" \
|
||||
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${COVERAGE}" \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
|
||||
-DENABLE_BEM=ON \
|
||||
-DENABLE_GEOFLOW=ON \
|
||||
-DENABLE_FETK=ON \
|
||||
-DENABLE_OPENMP=ON \
|
||||
-DENABLE_PBAM=ON \
|
||||
-DENABLE_PBSAM=ON \
|
||||
-DENABLE_PYTHON=OFF \
|
||||
-DENABLE_TESTS=ON \
|
||||
-DENABLE_TINKER=OFF \
|
||||
.. || exit 1
|
||||
|
||||
VERBOSE=1 make -j 1 || exit 1
|
||||
VERBOSE=1 make -j 1 install #|| exit 1
|
||||
export PATH="$INSTALL_DIR/bin:$PATH"
|
||||
# Run a single test if it fails using the following:
|
||||
# ctest -VV -R pbam_test
|
||||
ctest -C Release --output-on-failure #|| exit 1
|
||||
|
||||
cpack -C Release -G ZIP || exit 1
|
||||
unzip -l APBS*.zip
|
||||
|
||||
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@@ -10,6 +10,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: "!contains(github.event.head_commit.message, 'noci')"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# os: [ubuntu-latest]
|
||||
# os: [macOS-latest]
|
||||
@@ -34,33 +35,7 @@ jobs:
|
||||
apt-get: bison flex swig libreadline-dev
|
||||
- name: Build and Install
|
||||
run: |
|
||||
echo "==================================== WHERE AM I ==================================== "
|
||||
pwd
|
||||
echo "==================================== VERSIONS: ==================================== "
|
||||
echo "==================================== PYTHON VERSION"
|
||||
python -c "import sys; print(sys.version)"
|
||||
echo "==================================== CMAKE VERSION"
|
||||
cmake --version
|
||||
echo "==================================== Gcc VERSION"
|
||||
gcc --version
|
||||
echo "==================================== G++ VERSION"
|
||||
g++ --version
|
||||
echo "==================================== SWIG VERSION"
|
||||
swig -version
|
||||
echo "==================================== Install Python requirements ==================================== "
|
||||
pip3 install -U pip
|
||||
pip3 install -U pytest
|
||||
pip3 install -U virtualenv
|
||||
pip3 install -U numpy
|
||||
pip3 install -r requirements.txt
|
||||
# Just build APBS for now
|
||||
echo "==================================== PWD FOR TOP DIR ==================================== "
|
||||
pwd
|
||||
echo "==================================== Get External SubModules ==================================== "
|
||||
git submodule init
|
||||
git submodule update
|
||||
echo "==================================== BUILD =============================================== "
|
||||
./.build.sh
|
||||
env:
|
||||
# https://codecov.io/gh/Electrostatics/apbs-pdb2pqr
|
||||
# https://codecov.io/gh/Electrostatics/apbs
|
||||
CODECOV_TOKEN: "e3a1e24c-5598-4f47-9353-7fa0ac57f98e"
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -152,3 +152,6 @@ examples
|
||||
|
||||
# Output files
|
||||
*.out
|
||||
|
||||
# Personal notes
|
||||
NOTES.txt
|
||||
|
||||
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -11,6 +11,7 @@
|
||||
[submodule "externals/bem"]
|
||||
path = externals/bem
|
||||
url = https://github.com/Treecodes/TABI-PB.git
|
||||
[submodule "externals/pb_solvers"]
|
||||
path = externals/pb_solvers
|
||||
url = https://github.com/Electrostatics/pb_solvers
|
||||
[submodule "externals/pybind11"]
|
||||
path = externals/pybind11
|
||||
url = https://github.com/pybind/pybind11
|
||||
ignore = all
|
||||
|
||||
@@ -57,10 +57,13 @@ OPTION(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
||||
################################################################################
|
||||
message(STATUS "Setting project paths")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -fpermissive -fPIC")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W4")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:100000000")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -fpermissive -fPIC")
|
||||
endif()
|
||||
if(APPLE AND BUILD_SHARED_LIBS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -undefined dynamic_lookup")
|
||||
@@ -122,8 +125,7 @@ set(SYS_LIBPATHS /usr/lib64)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Debian/Ubuntu hack for #
|
||||
# https://github.com/Electrostatics/apbs-pdb2pqr/issues/364 #
|
||||
# Debian/Ubuntu hack #
|
||||
################################################################################
|
||||
if(EXISTS "/etc/debian_version" AND
|
||||
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
@@ -301,6 +303,13 @@ if(ENABLE_MPI)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
################################################################################
|
||||
# Handle the finite element solver dependencies #
|
||||
################################################################################
|
||||
option(ENABLE_FETK "Enable the finite element solver" OFF)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Deal with MALOC #
|
||||
# Note that we depend exclusively on the MALOC that is in our external FETK #
|
||||
@@ -316,16 +325,10 @@ if(NOT ENABLE_FETK)
|
||||
${EXTERNALS_PATH}/fetk/maloc/src/psh)
|
||||
list(APPEND APBS_LIB_DIRS ${EXTERNALS_PATH}/fetk/maloc/lib)
|
||||
list(APPEND APBS_LIBS maloc)
|
||||
endif()
|
||||
|
||||
|
||||
################################################################################
|
||||
# Handle the finite element solver dependencies #
|
||||
################################################################################
|
||||
option(ENABLE_FETK "Enable the finite element solver" OFF)
|
||||
|
||||
if(ENABLE_FETK)
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND MALOC_LIBS wsock32 WS2_32)
|
||||
endif()
|
||||
else()
|
||||
if(WIN32)
|
||||
message(FATAL_ERROR "FETK will not built on Windows because it uses autotools!")
|
||||
else()
|
||||
@@ -392,8 +395,7 @@ if(ENABLE_FETK)
|
||||
vf2c
|
||||
tetgen
|
||||
triangle
|
||||
readline
|
||||
termcap)
|
||||
readline)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(DIRECTORY ${install_dir}/lib/
|
||||
@@ -469,6 +471,9 @@ if(ENABLE_PBAM)
|
||||
ExternalProject_Get_Property(pbam binary_dir)
|
||||
add_definitions(-DENABLE_PBAM)
|
||||
list(APPEND APBS_LIB_DIRS "${binary_dir}/pbam/src")
|
||||
if (WIN32)
|
||||
list(APPEND APBS_LIB_DIRS "${binary_dir}/pbam/src/${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
list(APPEND APBS_LIBS PBAMLib)
|
||||
include_directories(${EXTERNALS_PATH}/pb_s_am/pbam/src)
|
||||
include_directories(${EXTERNALS_PATH}/pb_s_am/pb_shared/src)
|
||||
@@ -709,7 +714,7 @@ if(CYGWIN)
|
||||
endif()
|
||||
|
||||
if(NOT CYGWIN AND NOT MINGW AND WIN32)
|
||||
list(APPEND APBS_LIBS wsock32)
|
||||
list(APPEND APBS_LIBS wsock32 WS2_32)
|
||||
ADD_DEFINITIONS("/D _CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
|
||||
@@ -828,7 +833,7 @@ set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_MICRO_VERSION}")
|
||||
# NOTE: The following is tempting but does not work!
|
||||
# set(FULL_PACKAGE_NAME "${PACKAGE_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}")
|
||||
set(CPACK_PACKAGE_VENDOR "PNNL")
|
||||
set(CPACK_PACKAGE_CONTACT "APBS - https://github.com/Electrostatics/apbs-pdb2pqr")
|
||||
set(CPACK_PACKAGE_CONTACT "APBS - https://github.com/Electrostatics/apbs")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${APBS_VERSION}.${CMAKE_HOST_SYSTEM_NAME}")
|
||||
set(CPACK_STRIP_FILES True)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import List, Union
|
||||
from typing import Union
|
||||
import numpy as np
|
||||
from apbs.geometry import Coordinate
|
||||
|
||||
@@ -16,40 +16,87 @@ class Atom:
|
||||
name (str): Atom name from PDB/PDR file
|
||||
"""
|
||||
|
||||
def __init__(self, *vals: List[float]):
|
||||
if len(vals) > 0:
|
||||
self.position = Coordinate(*vals)
|
||||
else:
|
||||
self.position = Coordinate()
|
||||
self.radius: float = 0.0
|
||||
self.charge: float = 0.0
|
||||
self.partID: float = 0.0
|
||||
self.epsilon: float = 0.0
|
||||
self.id: int = 0
|
||||
self.res_name: str = ""
|
||||
self.name: str = ""
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
Arguments:
|
||||
|
||||
:param int id: A unique identifier for this Atom
|
||||
:param str field_name: Specifies the type of PQR entry and should either
|
||||
be ATOM or HETATM in order to be parsed by APBS.
|
||||
:param int atom_number: The atom index.
|
||||
:param str atom_name: The atom name.
|
||||
:param str residue_name: The residue name.
|
||||
:param str chain_id: An optional value which provides the chain ID of
|
||||
the atom. NOTE: that chain ID support is a new
|
||||
feature of APBS 0.5.0 and later versions.
|
||||
:param int residue_number: The residue index.
|
||||
:param str ins_code: An optional value which provides the PDB insertion code.
|
||||
:param float x: The X atomic coordinate in angstroms
|
||||
:param float y: The Y atomic coordinate in angstroms
|
||||
:param float z: The Z atomic coordinate in angstroms
|
||||
:param float charge: The atomic charge (in electrons).
|
||||
:param float radius: The atomic radius (in angstroms).
|
||||
|
||||
:Example:
|
||||
|
||||
atom = Atom(
|
||||
id=42,
|
||||
field_name=ATOM,
|
||||
atom_number=39,
|
||||
atom_name=O3PB,
|
||||
residue_name=ADP,
|
||||
chain_id=None,
|
||||
residue_number=1,
|
||||
ins_code=None,
|
||||
x=-16.362,
|
||||
y=-6.763,
|
||||
z=26.980,
|
||||
charge=-0.900,
|
||||
radius=1.700
|
||||
)
|
||||
"""
|
||||
|
||||
if len(args) > 0:
|
||||
self.position = Coordinate(args[0], args[1], args[2])
|
||||
|
||||
self.field_name: str = kwargs.get("field_name", None)
|
||||
self.atom_number: int = int(kwargs.get("atom_number", 0))
|
||||
self.atom_name: str = kwargs.get("atom_name", None)
|
||||
self.residue_name: str = kwargs.get("residue_name", None)
|
||||
self.chain_id: str = kwargs.get("chain_id", None)
|
||||
self.residue_number: int = int(kwargs.get("residue_number", 0))
|
||||
self.ins_code: str = kwargs.get("ins_code", None)
|
||||
if "x" in kwargs and "y" in kwargs and "z" in kwargs:
|
||||
self.position = Coordinate(
|
||||
float(kwargs.get("x")),
|
||||
float(kwargs.get("y")),
|
||||
float(kwargs.get("z")),
|
||||
)
|
||||
self.charge: float = float(kwargs.get("charge", 0.0))
|
||||
self.radius: float = float(kwargs.get("radius", 0.0))
|
||||
self.epsilon: float = float(kwargs.get("epsilon", 0.0))
|
||||
self.id: int = int(kwargs.get("id", 0))
|
||||
if "id" not in kwargs:
|
||||
raise ValueError("The Atom id must be set to non-zero value")
|
||||
|
||||
def __str__(self):
|
||||
return "Atom< name< %s >, %s, radius< %s >, charge< %s >>" % (
|
||||
self.name,
|
||||
self.position,
|
||||
self.radius,
|
||||
self.charge,
|
||||
)
|
||||
return f"Atom< name< {self.field_name} >, {self.position}, radius< {self.radius} >, charge< {self.charge} > >"
|
||||
|
||||
def __repr__(self):
|
||||
return "Atom< name< %s >, %s radius< %s >, charge< %s >>" % (
|
||||
self.name,
|
||||
self.position,
|
||||
self.radius,
|
||||
self.charge,
|
||||
)
|
||||
return f"Atom< name< {self.field_name} >, {self.position}, radius< {self.radius} >, charge< {self.charge} > >"
|
||||
|
||||
def euclidian_dist2(
|
||||
self, other: Union["Atom", Coordinate, np.ndarray]
|
||||
) -> float:
|
||||
"""
|
||||
Euclidian distance without the square root
|
||||
|
||||
:param other: Another Atom, Coordinate, or np.ndarray to calculate
|
||||
the euclidian distance from this Atom (without taking
|
||||
the square root)
|
||||
:type other: Atom, Coordinate, or np.ndarray
|
||||
:return: The euclidian distance between two X,Y,Z coordinates
|
||||
:rtype: float
|
||||
"""
|
||||
if isinstance(other, Atom):
|
||||
return np.sum((self.position._data - other.position._data) ** 2)
|
||||
@@ -60,9 +107,7 @@ class Atom:
|
||||
# https://numpy.org/doc/stable/reference/generated/numpy.dot.html
|
||||
return np.sum((self.position._data - other) ** 2)
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Incorrect data type passed into euclidian_dist2"
|
||||
)
|
||||
raise TypeError
|
||||
|
||||
@property
|
||||
def x(self) -> float:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import math
|
||||
import numpy as np
|
||||
import sys # noqa
|
||||
|
||||
from apbs.geometry import (
|
||||
@@ -15,9 +15,7 @@ from . import (
|
||||
|
||||
|
||||
class AtomComplexCalc:
|
||||
"""
|
||||
Port of Vacc
|
||||
"""
|
||||
"""Port of Vacc."""
|
||||
|
||||
def __init__(
|
||||
self, alist: AtomList, clist: CellList, surface_density: float
|
||||
@@ -34,8 +32,8 @@ class AtomComplexCalc:
|
||||
self.alist = alist
|
||||
self.surface_density = surface_density
|
||||
max_radius = alist.max_radius + clist.max_radius
|
||||
max_area = 4.0 * (max_radius ** 2) * math.pi
|
||||
nsphere = math.ceil(max_area * surface_density)
|
||||
max_area = 4.0 * (max_radius ** 2) * np.pi
|
||||
nsphere = np.ceil(max_area * surface_density)
|
||||
|
||||
# TODO: calculate reference shpere (see VaccSurf_refSphere)
|
||||
|
||||
@@ -43,7 +41,7 @@ class AtomComplexCalc:
|
||||
def stride(self) -> Coordinate:
|
||||
return self.clist.stride
|
||||
|
||||
def accessable_outside_inflated_venderwalls(
|
||||
def accessible_outside_inflated_vdw_radius(
|
||||
self, center: Coordinate, radius: float, atom_id_to_ignore: int
|
||||
) -> bool:
|
||||
"""
|
||||
@@ -58,8 +56,7 @@ class AtomComplexCalc:
|
||||
"""
|
||||
if radius > self.clist.max_radius:
|
||||
raise RuntimeError(
|
||||
"Got radius %f greater than max radius %f from"
|
||||
" cell list." % (radius, self.clist.max_radius)
|
||||
f"Got radius {radius} greater than max radius {self.clist.max_radius} from cell list."
|
||||
)
|
||||
|
||||
c = (center - self.lower_corner) / self.stride
|
||||
@@ -84,8 +81,11 @@ class AtomComplexCalc:
|
||||
"""Create a new surface from the points that do fall on the reference
|
||||
surface.
|
||||
|
||||
:param atom: Atom from which surface will be constructed.
|
||||
:param Atom atom: Atom from which surface will be constructed.
|
||||
:param Surface ref: The reference surface.
|
||||
:param float prad: The previous radius
|
||||
:return: Returns surface generated from the atom.
|
||||
:rtype: Surface
|
||||
|
||||
.. note:: Although this seems like a candidate for a static method, the
|
||||
`accessable_outside_inflated_venderwalls_rad` method of this class
|
||||
@@ -95,7 +95,7 @@ class AtomComplexCalc:
|
||||
|
||||
arad = atom.radius
|
||||
apos = atom.position
|
||||
atomID = atom.id
|
||||
atom_id = atom.id
|
||||
surf: Surface
|
||||
|
||||
if arad < Constants.very_small_eps:
|
||||
@@ -112,9 +112,7 @@ class AtomComplexCalc:
|
||||
pos.z = rad(ref.zs[i]) + apos.z
|
||||
|
||||
# need to implement
|
||||
if self.accessable_outside_inflated_venderwalls_rad(
|
||||
pos, prad, atomID
|
||||
):
|
||||
if self.accessible_outside_inflated_vdw_radius(pos, prad, atom_id):
|
||||
npoints += 1
|
||||
ref.is_on_surf[i] = True
|
||||
else:
|
||||
@@ -127,12 +125,7 @@ class AtomComplexCalc:
|
||||
surf.coords[-1].is_on_surf = True
|
||||
|
||||
surf.area = (
|
||||
4.0
|
||||
* math.pi
|
||||
* rad
|
||||
* rad
|
||||
* float(surf.npoints)
|
||||
/ float(ref.npoints)
|
||||
4.0 * np.pi * rad * rad * float(surf.npoints) / float(ref.npoints)
|
||||
)
|
||||
|
||||
return surf
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from math import inf
|
||||
import numpy as np
|
||||
from typing import List
|
||||
from . import Atom
|
||||
from apbs.geometry import Coordinate
|
||||
from typing import Tuple
|
||||
@@ -6,43 +7,53 @@ from typing import Tuple
|
||||
|
||||
class AtomList:
|
||||
"""
|
||||
Thin abstraction over a container of atoms
|
||||
Thin abstraction over a container of atoms.
|
||||
|
||||
Attributes:
|
||||
dp (dict): dict for dynamic programming of values that may not need to
|
||||
be re-calculated
|
||||
"""
|
||||
|
||||
def __init__(self, filename: str = None, atoms=None):
|
||||
def __init__(self, atoms: List = None):
|
||||
"""
|
||||
Construct a list of Atoms.
|
||||
|
||||
:param List atoms: A list of Atoms
|
||||
"""
|
||||
self._atoms: Tuple[Atom] = atoms if atoms is not None else []
|
||||
self.charge: float = None
|
||||
self.maxrad: float = None
|
||||
|
||||
self._center = Coordinate()
|
||||
self._mincrd = Coordinate()
|
||||
self._maxcrd = Coordinate()
|
||||
self._min_coord = Coordinate()
|
||||
self._max_coord = Coordinate()
|
||||
self._dp = dict()
|
||||
if filename is not None:
|
||||
self.read_pdb(filename)
|
||||
|
||||
def center(self) -> Coordinate:
|
||||
"""Molecule center
|
||||
note: not the median molecule, but the average of the max values int
|
||||
the x, y, and z coordinates
|
||||
|
||||
:return: The center Coordinate
|
||||
:rtype: Coordinate
|
||||
"""
|
||||
if "center" not in self._dp.keys():
|
||||
ma = self.maxcrd()
|
||||
mi = self.mincrd()
|
||||
ma = self.max_coord()
|
||||
mi = self.min_coord()
|
||||
self._dp["center"] = Coordinate(
|
||||
(ma.x + mi.x) * 0.5, (ma.y + mi.y) * 0.5, (ma.z + mi.z) * 0.5,
|
||||
(ma.x + mi.x) * 0.5,
|
||||
(ma.y + mi.y) * 0.5,
|
||||
(ma.z + mi.z) * 0.5,
|
||||
)
|
||||
return self._dp["center"]
|
||||
|
||||
def mincrd(self) -> Coordinate:
|
||||
def min_coord(self) -> Coordinate:
|
||||
"""Minimum coordinates
|
||||
:return: The minimum Coordinate
|
||||
:rtype: Coordinate
|
||||
"""
|
||||
if "min" not in self._dp.keys():
|
||||
x, y, z = inf, inf, inf
|
||||
x, y, z = np.inf, np.inf, np.inf
|
||||
for a in self._atoms:
|
||||
x = min(x, a.x)
|
||||
y = min(y, a.y)
|
||||
@@ -51,8 +62,10 @@ class AtomList:
|
||||
|
||||
return self._dp["min"]
|
||||
|
||||
def maxcrd(self) -> Coordinate:
|
||||
def max_coord(self) -> Coordinate:
|
||||
"""Maximum coordinates
|
||||
:return: The maximum Coordinate
|
||||
:rtype: Coordinate
|
||||
"""
|
||||
if "max" not in self._dp.keys():
|
||||
x, y, z = 0.0, 0.0, 0.0
|
||||
@@ -81,30 +94,3 @@ class AtomList:
|
||||
@property
|
||||
def atoms(self) -> Tuple[Atom]:
|
||||
return self._atoms
|
||||
|
||||
def read_pdb(self, fn: str):
|
||||
"""
|
||||
Read serialized atoms in the PBD format from a file
|
||||
"""
|
||||
with open(fn, "r") as f:
|
||||
lines = f.readlines()
|
||||
idx = 0
|
||||
for line in lines:
|
||||
fields = [
|
||||
idx.lower() for idx in line.strip().split(" ") if idx != ""
|
||||
]
|
||||
if fields[0] in ("atom", "hetatm"):
|
||||
a = Atom()
|
||||
a.name = fields[2].upper()
|
||||
a.res_name = fields[3].upper()
|
||||
a.position = Atom(
|
||||
float(fields[5]), float(fields[6]), float(fields[7]),
|
||||
)
|
||||
a.id = idx
|
||||
|
||||
if len(fields) == 10:
|
||||
a.charge = float(fields[8])
|
||||
a.radius = float(fields[9])
|
||||
|
||||
self._atoms.append(a)
|
||||
idx += 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import math
|
||||
import numpy as np
|
||||
from . import Surface, SurfacePoint
|
||||
|
||||
|
||||
@@ -16,32 +16,32 @@ class Sphere:
|
||||
s: Surface
|
||||
|
||||
frac = npoints / 4.0
|
||||
ntheta = math.ceil(math.sqrt(math.pi * frac))
|
||||
dtheta = math.pi / float(ntheta)
|
||||
ntheta = np.ceil(np.sqrt(np.pi * frac))
|
||||
dtheta = np.pi / float(ntheta)
|
||||
nphimax = 2 * ntheta
|
||||
|
||||
# Count number of points to be used
|
||||
nactual: int = 0
|
||||
for i in range(ntheta):
|
||||
theta = dtheta * float(i)
|
||||
sintheta = math.sin(theta)
|
||||
costheta = math.cos(theta)
|
||||
nphi = math.ceil(sintheta * nphimax)
|
||||
sintheta = np.sin(theta)
|
||||
costheta = np.cos(theta)
|
||||
nphi = np.ceil(sintheta * nphimax)
|
||||
nactual += nphi
|
||||
|
||||
s = Surface(1.0, nactual)
|
||||
nactual = 0
|
||||
for i in range(ntheta):
|
||||
theta = dtheta * float(i)
|
||||
sintheta = math.sin(theta)
|
||||
costheta = math.cos(theta)
|
||||
nphi = math.ceil(sintheta * nphimax)
|
||||
sintheta = np.sin(theta)
|
||||
costheta = np.cos(theta)
|
||||
nphi = np.ceil(sintheta * nphimax)
|
||||
if nphi != 0:
|
||||
dphi = 2 * math.pi / float(nphi)
|
||||
dphi = 2 * np.pi / float(nphi)
|
||||
for j in range(nphi):
|
||||
phi = dphi * float(j)
|
||||
sinphi = math.sin(phi)
|
||||
cosphi = math.cos(phi)
|
||||
sinphi = np.sin(phi)
|
||||
cosphi = np.cos(phi)
|
||||
s[nactual] = SurfacePoint(
|
||||
cosphi * sintheta,
|
||||
sinphi * sintheta,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from typing import List, Optional
|
||||
from apbs.geometry import Coordinate, Constants
|
||||
import math
|
||||
import numpy as np
|
||||
|
||||
|
||||
class CurvatureFlag:
|
||||
"""Enum class to replace curvature flags in original source
|
||||
"""
|
||||
"""Enum class to replace curvature flags in original source"""
|
||||
|
||||
ReducedMaximalCurvature = 0
|
||||
MeanCurvature = 1
|
||||
@@ -70,12 +69,12 @@ class Grid:
|
||||
)
|
||||
|
||||
hi = Coordinate(
|
||||
int(math.ceil(tmp.x)), int(math.ceil(tmp.y)), int(math.ceil(tmp.z))
|
||||
int(np.ceil(tmp.x)), int(np.ceil(tmp.y)), int(np.ceil(tmp.z))
|
||||
)
|
||||
lo = Coordinate(
|
||||
int(math.floor(tmp.x)),
|
||||
int(math.floor(tmp.y)),
|
||||
int(math.floor(tmp.z)),
|
||||
int(np.floor(tmp.x)),
|
||||
int(np.floor(tmp.y)),
|
||||
int(np.floor(tmp.z)),
|
||||
)
|
||||
|
||||
hi.x = (
|
||||
@@ -137,7 +136,7 @@ class Grid:
|
||||
|
||||
ret_value = sum(ret_value)
|
||||
|
||||
if ret_value == math.nan:
|
||||
if ret_value == np.nan:
|
||||
# TODO: Add a more descriptive error
|
||||
raise RuntimeError(
|
||||
"Value routine failed to converge with the following "
|
||||
@@ -169,24 +168,21 @@ class Grid:
|
||||
...
|
||||
|
||||
def integrate(self) -> float:
|
||||
"""Get the integral of the data
|
||||
"""
|
||||
"""Get the integral of the data"""
|
||||
...
|
||||
|
||||
def norml1(self) -> float:
|
||||
r"""Get the \f$L_1\f$ norm of the data. This returns the integral:
|
||||
\f[ \| u \|_{L_1} = \int_\Omega | u(x) | dx \f]
|
||||
\f[ \| u \|_{L_1} = \int_\Omega | u(x) | dx \f]
|
||||
"""
|
||||
...
|
||||
|
||||
def norml2(self) -> float:
|
||||
r"""Computes the \f$L_2\f$ norm of the data.
|
||||
"""
|
||||
r"""Computes the \f$L_2\f$ norm of the data."""
|
||||
...
|
||||
|
||||
def norml_inf(self) -> float:
|
||||
r"""Computes the \f$L_\infty\f$ norm of the data.
|
||||
"""
|
||||
r"""Computes the \f$L_\infty\f$ norm of the data."""
|
||||
...
|
||||
|
||||
def seminormH1(self) -> float:
|
||||
|
||||
@@ -22,4 +22,11 @@ class MultiGrid:
|
||||
def set_part(
|
||||
self, lower_corner: Coordinate, upper_corner: Coordinate
|
||||
) -> None:
|
||||
"""
|
||||
:param lower_corner: The X,Y,Z coordinates in angstroms
|
||||
:type lower_corner: Coordinate
|
||||
:param upper_corner: The X,Y,Z coordinates in angstroms
|
||||
:type upper_corner: Coordinate
|
||||
"""
|
||||
# TODO: This needs to be implemented
|
||||
pass
|
||||
|
||||
1
apbs/pqr/__init__.py
Normal file
1
apbs/pqr/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .reader import PQRReader # noqa F401
|
||||
89
apbs/pqr/reader.py
Normal file
89
apbs/pqr/reader.py
Normal file
@@ -0,0 +1,89 @@
|
||||
from pyparsing import Group, Literal, Word, ZeroOrMore, alphas, alphanums, nums
|
||||
from apbs.chemistry import Atom, AtomList
|
||||
|
||||
|
||||
class PQRReader:
|
||||
"""A grammar/parser for PQR formatted data and files."""
|
||||
|
||||
def __init__(self):
|
||||
"""Define the grammar for an ATOM/HETATM in PQR format."""
|
||||
identifier = Word(alphas, alphanums + "_")
|
||||
integer_val = Word(nums + "-")
|
||||
float_val = Word(nums + "-" + ".")
|
||||
keyword_val = Literal("ATOM") | Literal("HETATM")
|
||||
atom_value = Group(
|
||||
keyword_val("field_name")
|
||||
+ integer_val("atom_number")
|
||||
+ identifier("atom_name")
|
||||
+ identifier("residue_name")
|
||||
+ ZeroOrMore(identifier("chain_id"))
|
||||
+ integer_val("residue_number")
|
||||
+ ZeroOrMore(identifier("ins_code"))
|
||||
+ float_val("x")
|
||||
+ float_val("y")
|
||||
+ float_val("z")
|
||||
+ float_val("charge")
|
||||
+ float_val("radius")
|
||||
)
|
||||
self.atom = atom_value + ZeroOrMore(atom_value)
|
||||
|
||||
def loads(self, pqr_string: str) -> AtomList:
|
||||
"""
|
||||
Find instances of atoms ignoring other syntax.
|
||||
|
||||
:param str pqr_string: One or more ATOM/HETATM
|
||||
:return: the list of Atoms in the pqr_string
|
||||
:rtype: AtomList
|
||||
"""
|
||||
atoms = []
|
||||
idx: int = 1
|
||||
for item, _start, _stop in self.atom.scanString(pqr_string):
|
||||
for match in item:
|
||||
atom = Atom(
|
||||
field_name=match.field_name,
|
||||
atom_number=int(match.atom_number),
|
||||
atom_name=match.atom_name,
|
||||
residue_name=match.residue_name,
|
||||
chain_id=match.chain_id,
|
||||
residue_number=int(match.residue_number),
|
||||
ins_code=match.ins_code,
|
||||
x=float(match.x),
|
||||
y=float(match.y),
|
||||
z=float(match.z),
|
||||
charge=float(match.charge),
|
||||
radius=float(match.radius),
|
||||
id=int(idx),
|
||||
)
|
||||
atoms.append(atom)
|
||||
idx += 1
|
||||
return AtomList(atoms)
|
||||
|
||||
def load(self, filename: str) -> AtomList:
|
||||
"""
|
||||
Read Atoms from a file in PQR format
|
||||
|
||||
:param str filename: The path/filename to the PQR file
|
||||
:return: the list of Atoms in the pqr file
|
||||
:rtype: AtomList
|
||||
"""
|
||||
with open(filename, "r") as fp:
|
||||
data = fp.read().replace("\n", "")
|
||||
return self.loads(data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# execute only if run as a script
|
||||
sample = r"""
|
||||
REMARK This is just test data and values may have been modified for testing
|
||||
ATOM 5226 HD1 TYR 337 -24.642 -2.718 30.187 0.115 1.358
|
||||
ATOM 7 CD LYS D 1 44.946 37.289 9.712 -0.0608 1.9080
|
||||
ATOM 39 O3PB ADP 1 -16.362 -6.763 26.980 -0.900 1.700
|
||||
REMARK This is just a comment hiding in the data
|
||||
HETATM 39 O3PB ADP 1 -16.362 -6.763 26.980 -0.900 1.700
|
||||
ATOM 39 O3PB ADP 1 D -16.362 -6.763 26.980 -0.900 1.700
|
||||
"""
|
||||
|
||||
reader = PQRReader()
|
||||
atoms = []
|
||||
atoms = reader.loads(sample)
|
||||
print(atoms)
|
||||
@@ -6,11 +6,16 @@ import pytest
|
||||
|
||||
class TestAtom:
|
||||
def test_ctor(self):
|
||||
sut = Atom(0, 0, 0)
|
||||
sut = Atom(id=1, x=0, y=0, z=0)
|
||||
assert (sut.position._data == np.array((0, 0, 0))).all()
|
||||
|
||||
def test_atom_exception(self):
|
||||
"""test that exception is raised for invalid atoms"""
|
||||
with pytest.raises(ValueError):
|
||||
assert Atom(0, 0, 0)
|
||||
|
||||
def test_property_get(self):
|
||||
sut = Atom(1, 2, 3)
|
||||
sut = Atom(id=1, x=1, y=2, z=3)
|
||||
assert sut.x == 1
|
||||
assert sut.y == 2
|
||||
assert sut.z == 3
|
||||
@@ -25,8 +30,8 @@ class TestAtom:
|
||||
)
|
||||
def test_euclidian_distance_atom(self, params1, params2):
|
||||
expect = np.sum((np.array(params1) - np.array(params2)) ** 2)
|
||||
a = Atom(*params1)
|
||||
b = Atom(*params2)
|
||||
a = Atom(id=1, *params1)
|
||||
b = Atom(id=2, *params2)
|
||||
assert a.euclidian_dist2(b) == expect
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -39,7 +44,7 @@ class TestAtom:
|
||||
)
|
||||
def test_euclidian_distance_array(self, params1, params2):
|
||||
expect = np.sum((np.array(params1) - np.array(params2)) ** 2)
|
||||
a = Atom(*params1)
|
||||
a = Atom(id=1, *params1)
|
||||
assert a.euclidian_dist2(np.array(params2)) == expect
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -52,6 +57,6 @@ class TestAtom:
|
||||
)
|
||||
def test_euclidian_distance_array2(self, params1, params2):
|
||||
expect = np.sum((np.array(params1) - np.array(params2)) ** 2)
|
||||
a = Atom(*params1)
|
||||
a = Atom(id=1, *params1)
|
||||
b = Coordinate(*params2)
|
||||
assert a.euclidian_dist2(b) == expect
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
from apbs.geometry import Coordinate
|
||||
from apbs.chemistry import AtomList, CellList
|
||||
import pytest
|
||||
from apbs.chemistry import Atom, AtomList
|
||||
from apbs.pqr import PQRReader
|
||||
from pytest import approx, fixture
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def pdb_file(tmp_path):
|
||||
@fixture
|
||||
def get_atom_list(tmp_path) -> AtomList:
|
||||
"""Return the AtomList from the file generated."""
|
||||
|
||||
fp = tmp_path / "atom.pdb"
|
||||
fqpn = tmp_path / "atom.pdb"
|
||||
|
||||
with open(fp, "w") as f:
|
||||
with open(fqpn, "w") as f:
|
||||
f.write(
|
||||
"HETATM 1 C ALK 1 "
|
||||
"1.000 4.000 7.000 0.000 1.000\n"
|
||||
@@ -21,51 +23,51 @@ def pdb_file(tmp_path):
|
||||
"HETATM 1 C ALK 1 "
|
||||
"3.000 6.000 9.000 0.000 3.000\n"
|
||||
)
|
||||
return fp
|
||||
|
||||
reader = PQRReader()
|
||||
return reader.load(fqpn)
|
||||
|
||||
|
||||
class TestAtomList:
|
||||
def test_read_pdb(self, pdb_file: str):
|
||||
def test_atom_list(get_atom_list: AtomList):
|
||||
|
||||
sut = AtomList(pdb_file)
|
||||
assert len(sut._atoms) == 3
|
||||
sut = get_atom_list
|
||||
assert sut.count == 3
|
||||
|
||||
a = sut._atoms[0]
|
||||
assert a.name == "C"
|
||||
assert a.res_name == "ALK"
|
||||
assert a.position.x == 1.0
|
||||
assert a.position.y == 4.0
|
||||
assert a.position.z == 7.0
|
||||
assert a.charge == 0.0
|
||||
assert a.radius == 1.0
|
||||
a: Atom = sut._atoms[0]
|
||||
assert a.atom_name == "C"
|
||||
assert a.residue_name == "ALK"
|
||||
assert a.x == 1.0
|
||||
assert a.y == 4.0
|
||||
assert a.z == 7.0
|
||||
assert 0.0 == approx(a.charge)
|
||||
assert 1.0 == approx(a.radius)
|
||||
|
||||
def test_min(self, pdb_file: str):
|
||||
|
||||
sut = AtomList(pdb_file)
|
||||
def test_min(get_atom_list: AtomList):
|
||||
|
||||
lo: Coordinate = sut.mincrd()
|
||||
assert lo.x == 1.0
|
||||
assert lo.y == 4.0
|
||||
assert lo.z == 7.0
|
||||
sut = get_atom_list
|
||||
|
||||
def test_max(self, pdb_file: str):
|
||||
lo: Coordinate = sut.min_coord()
|
||||
assert lo.x == approx(1.0)
|
||||
assert lo.y == approx(4.0)
|
||||
assert lo.z == approx(7.0)
|
||||
|
||||
sut = AtomList(pdb_file)
|
||||
|
||||
hi: Coordinate = sut.maxcrd()
|
||||
assert hi.x == 3.0
|
||||
assert hi.y == 6.0
|
||||
assert hi.z == 9.0
|
||||
def test_max(get_atom_list: AtomList):
|
||||
|
||||
def test_center(self, pdb_file: str):
|
||||
sut = get_atom_list
|
||||
|
||||
sut = AtomList(pdb_file)
|
||||
hi: Coordinate = sut.max_coord()
|
||||
assert hi.x == 3.0
|
||||
assert hi.y == 6.0
|
||||
assert hi.z == 9.0
|
||||
|
||||
mi: Coordinate = sut.center()
|
||||
assert mi.x == 2.0
|
||||
assert mi.y == 5.0
|
||||
assert mi.z == 8.0
|
||||
|
||||
def test_max_radius(self, pdb_file: str):
|
||||
sut = CellList(pdb_file)
|
||||
assert sut.max_radius == 3.0
|
||||
def test_center(get_atom_list: AtomList):
|
||||
|
||||
sut = get_atom_list
|
||||
|
||||
mi: Coordinate = sut.center()
|
||||
assert mi.x == 2.0
|
||||
assert mi.y == 5.0
|
||||
assert mi.z == 8.0
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from apbs.chemistry import CellList
|
||||
from apbs.test.test_chemistry.test_atom_list import TestAtomList, pdb_file
|
||||
|
||||
# from apbs.test.test_chemistry.test_atom_list import TestAtomList
|
||||
import pytest
|
||||
|
||||
|
||||
class TestCellList(TestAtomList):
|
||||
@pytest.mark.skip(reason="Needs test")
|
||||
def test_cell_list_method(self):
|
||||
pass
|
||||
# class TestCellList(TestAtomList):
|
||||
# @pytest.mark.skip(reason="Needs test")
|
||||
# def test_cell_list_method(self):
|
||||
# pass
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from apbs.geometry import Sphere
|
||||
from apbs.geometry import Surface
|
||||
import pytest
|
||||
|
||||
|
||||
|
||||
1
apbs/test/test_pqr/__init__.py
Normal file
1
apbs/test/test_pqr/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from apbs.test.test_pqr.test_pqrreader import * # noqa F401
|
||||
31
apbs/test/test_pqr/test_pqrreader.py
Normal file
31
apbs/test/test_pqr/test_pqrreader.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import pathlib
|
||||
from apbs.chemistry.atom_list import AtomList
|
||||
from apbs.pqr import PQRReader
|
||||
|
||||
|
||||
class TestPQRReader:
|
||||
def test_ctor(self):
|
||||
sut = PQRReader()
|
||||
sample = r"""
|
||||
ATOM 5226 HD1 TYR 337 -24.642 -2.718 30.187 0.115 1.358
|
||||
ATOM 7 CD LYS D 1 44.946 37.289 9.712 -0.0608 1.9080
|
||||
REMARK This is just a comment hiding in the data
|
||||
HETATM 39 O3PB ADP 1 -16.362 -6.763 26.980 -0.900 1.700
|
||||
ATOM 39 O3PB ADP 1 D -16.362 -6.763 26.980 -0.900 1.700
|
||||
REMARK The next line is incorrect on purpose (e.g. ATAM instead of ATOM)
|
||||
ATAM 39 O3PB ADP 1 D -16.362 -6.763 26.980 -0.900 1.700
|
||||
"""
|
||||
atomlist: AtomList = sut.loads(sample)
|
||||
for idx in range(1):
|
||||
assert abs(atomlist.atoms[idx].x - -24.642) < 0.001
|
||||
assert int(atomlist.atoms[idx].x) == -24
|
||||
print(atomlist.atoms)
|
||||
|
||||
def test_load(self):
|
||||
sut = PQRReader()
|
||||
pqr_imput = (
|
||||
pathlib.Path(__file__).parent.parent.parent.parent.absolute()
|
||||
/ "examples/actin-dimer/mol1.pqr"
|
||||
)
|
||||
atomlist: AtomList = sut.load(pqr_imput)
|
||||
assert len(atomlist.atoms) == 5861
|
||||
122
appveyor.yml
122
appveyor.yml
@@ -9,11 +9,16 @@ image:
|
||||
|
||||
clone_folder: c:\projects\source
|
||||
|
||||
clone_depth: 5
|
||||
clone_depth: 2
|
||||
|
||||
environment:
|
||||
PYTHON: "C:\\Python37-x64"
|
||||
APPVEYOR_RDP_PASSWORD: "RedRum666!"
|
||||
|
||||
artifacts:
|
||||
- path: '**\APBS*.zip'
|
||||
name: APBS.zip
|
||||
|
||||
matrix:
|
||||
fast_finish: false
|
||||
|
||||
@@ -21,24 +26,31 @@ matrix:
|
||||
# - C:\ProgramData\chocolatey\bin -> appveyor.yml # swig.exe
|
||||
# - C:\ProgramData\chocolatey\lib -> appveyor.yml # supporting swig Lib files.
|
||||
|
||||
|
||||
# For interactive debugging using Remote Desktop, you need the init, on_finish, and APPVEYOR_RDP_PASSWORD
|
||||
# - https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
|
||||
|
||||
# init:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
# on_finish:
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
install:
|
||||
# Install non-python dependencies using chocolatey package manager
|
||||
# - choco install tools\windows\swig.4.0.0.nupkg --yes --limit-output
|
||||
- IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install --ignorechecksum -f -r -y swig --version=4.0.0
|
||||
|
||||
# - type C:\ProgramData\chocolatey\logs\chocolatey.log
|
||||
|
||||
# - type C:\ProgramData\chocolatey\logs\chocolatey.log
|
||||
- where /r C:\ProgramData\chocolatey swig.swg
|
||||
- SET SWIG_DIR=C:\ProgramData\chocolatey\lib\swig\tools\install
|
||||
- SET SWIG_EXECUTABLE=C:\ProgramData\chocolatey\lib\swig\tools\install\swig.exe
|
||||
|
||||
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;C:\\Program Files (x86)\\CMake\\bin;%PATH%;C:\\projects\\source\\build\\bin;C:\\ProgramData\\chocolatey\\lib\\swig\\tools\\install;C:\\ProgramData\\chocolatey\\bin;%PATH%"
|
||||
|
||||
# - swig -swiglib
|
||||
- "SET SWIG_DIR=C:\\ProgramData\\chocolatey\\lib\\swig\\tools\\install"
|
||||
- "SET SWIG_EXECUTABLE=C:\\ProgramData\\chocolatey\\lib\\swig\\tools\\install\\swig.exe"
|
||||
# Add SWIG, Python, and CMake to PATH
|
||||
- SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\Program Files (x86)\CMake\bin;C:\projects\source\build\bin;C:\ProgramData\chocolatey\lib\swig\tools\install;C:\ProgramData\chocolatey\bin;%PATH%
|
||||
- echo %PATH%
|
||||
|
||||
# Check that we have the expected version and architecture for Python
|
||||
- where /r C:\Python37-x64 python.exe
|
||||
- python --version
|
||||
|
||||
- python -m pip install --upgrade pip
|
||||
|
||||
# Install the build dependencies of the project. If some dependencies contain
|
||||
@@ -47,27 +59,91 @@ install:
|
||||
# target Python version and architecture
|
||||
- pip.exe install -r c:\projects\source\requirements.txt
|
||||
|
||||
|
||||
build_script:
|
||||
- cmd: >-
|
||||
# Setup Visual Studio Environment for compiling, linking, and logging
|
||||
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\vsdevcmd_start.bat"
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
|
||||
git submodule init
|
||||
# set
|
||||
# REM set VSDIR="C:\Program Files (x86)\Microsoft Visual Studio"
|
||||
# set VSDIR="C:\"
|
||||
# FOR /F "tokens=* USEBACKQ" %F IN (`where /r %VSDIR% vsdevcmd_start.bat`) DO (SET vsdevcmd="%F")
|
||||
# REM Should be something like C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\vsdevcmd_start.bat"
|
||||
# ECHO "VS DEV CMD BAT FILE = %vsdevcmd%"
|
||||
# call %vsdevcmd%
|
||||
# FOR /F "tokens=* USEBACKQ" %F IN (`where /r %VSDIR% vsvars64.bat`) DO (SET vsdevcmd="%F")
|
||||
# REM Should be something like "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
# ECHO "VS VARS FILE = %vsdevcmd%"
|
||||
# call %vsdevcmd%
|
||||
|
||||
git submodule update
|
||||
# Get the external projects configured
|
||||
- cd c:\projects\source
|
||||
- git submodule init
|
||||
- git submodule update
|
||||
|
||||
cd c:\projects\source
|
||||
- echo "*****************************************************************************"
|
||||
- echo PYBIND11_BUILD
|
||||
- echo "*****************************************************************************"
|
||||
- set pybind11_DIR=C:\projects\source\externals\pybind11\install
|
||||
- cd externals/pybind11
|
||||
- mkdir build
|
||||
- mkdir install
|
||||
- cd build
|
||||
|
||||
mkdir build
|
||||
- echo "*****************************************************************************"
|
||||
- echo PYBIND11_CONFIGURE
|
||||
- echo "*****************************************************************************"
|
||||
- cmake .. -DCMAKE_INSTALL_PREFIX=%pybind11_DIR% -DDOWNLOAD_CATCH=ON
|
||||
|
||||
cd build
|
||||
- echo "*****************************************************************************"
|
||||
- echo PYBIND11_MAKE_INSTALL
|
||||
- echo "*****************************************************************************"
|
||||
# cmake --build . --config Release --parallel 1 --target install -- /m:1 /v:diag /logger:%MSBuildLogger%
|
||||
- cmake --build . --config Release --parallel 1 --target install -- /m:1 /logger:%MSBuildLogger%
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DBUILD_TOOLS=ON -DCHECK_EPSILON=ON -DENABLE_BEM=ON -DENABLE_GEOFLOW=ON -DENABLE_INLINE=ON -DENABLE_PBAM=OFF -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_VERBOSE_DEBUG=ON -DGET_NanoShaper=ON -G "Visual Studio 16 2019" -A x64 c:\projects\source
|
||||
- set pybind11_DIR=C:\projects\source\externals\pybind11\install\share\cmake\pybind11
|
||||
- cd ..
|
||||
- cd c:\projects\source
|
||||
- mkdir build
|
||||
- cd build
|
||||
|
||||
cat c:\projects\source\build\CMakeFiles\CMakeError.log
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_CONFIG
|
||||
- echo "*****************************************************************************"
|
||||
- cmake --config Release -DPYBIND11_DIR=%pybind11_DIR% -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TESTING=ON -DBUILD_TOOLS=ON -DCHECK_EPSILON=ON -DENABLE_FETK=OFF -DENABLE_BEM=ON -DENABLE_GEOFLOW=ON -DENABLE_INLINE=ON -DENABLE_PBAM=ON -DENABLE_PYTHON=OFF -DENABLE_TESTS=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_VERBOSE_DEBUG=ON -DGET_NanoShaper=ON -G "Visual Studio 16 2019" -A x64 c:\projects\source
|
||||
|
||||
cmake --build . --config "Release"
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_CMAKE_OUTPUT
|
||||
- echo "*****************************************************************************"
|
||||
- if exist c:\projects\source\build\CMakeFiles\CMakeOutput.log type c:\projects\source\build\CMakeFiles\CMakeOutput.log
|
||||
|
||||
ctest -C Release --verbose --output-on-failure
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_CMAKE_ERROR
|
||||
- echo "*****************************************************************************"
|
||||
- if exist c:\projects\source\build\CMakeFiles\CMakeError.log type c:\projects\source\build\CMakeFiles\CMakeError.log
|
||||
|
||||
cpack -C Release -G ZIP
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_MAKE_INSTALL
|
||||
- echo "*****************************************************************************"
|
||||
- cmake --build . --config Release --parallel 1 --target install -- /m:1 /logger:%MSBuildLogger%
|
||||
|
||||
unzip -l APBS*.zip
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_TEST
|
||||
- echo "*****************************************************************************"
|
||||
- ctest -C Release --verbose --output-on-failure
|
||||
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_PACKAGE
|
||||
- echo "*****************************************************************************"
|
||||
- cpack -C Release -G ZIP
|
||||
- unzip -l APBS*.zip
|
||||
|
||||
- echo "*****************************************************************************"
|
||||
- echo APBS_DONE
|
||||
- echo "*****************************************************************************"
|
||||
|
||||
on_failure:
|
||||
- if exist c:\projects\source\build\CMakeFiles\CMakeOutput.log type c:\projects\source\build\CMakeFiles\CMakeOutput.log
|
||||
- if exist c:\projects\source\build\CMakeFiles\CMakeError.log type c:\projects\source\build\CMakeFiles\CMakeError.log
|
||||
|
||||
@@ -180,6 +180,14 @@ Building the code - advanced
|
||||
# NOTE: In case you need to debug the source code:
|
||||
# export RELEASE_TYPE=Debug
|
||||
export RELEASE_TYPE=Release
|
||||
# NOTE: If cmake or make fail, save yourself and make sure your remove
|
||||
# everything including the build directory. This code base uses
|
||||
# many older autoconf based projects that do not know how to save
|
||||
# state or recover from partial builds. If cmake or make fail, you
|
||||
# should figure out how to fix it and then remove everything and
|
||||
# try again.
|
||||
rmdir $APBS_BUILD_DIR
|
||||
mkdir -p $APBS_BUILD_DIR
|
||||
cd $APBS_BUILD_DIR
|
||||
# NOTE: In case you need to debug cmake, use verbose debug/trace mode:
|
||||
# cmake -S .. -B $BUILD_DIR --trace-source=../CMakeLists.txt --trace-expand \
|
||||
|
||||
@@ -17,13 +17,6 @@ Announcements
|
||||
|
||||
Announcements about updates to the APBS-PDB2PQR software and related news are available through our `mailing list <http://us11.campaign-archive1.com/home/?u=a5808042b2b3ea90ee3603cd8&id=28701e36f0>`_; please `register for updates <http://eepurl.com/by4eQr>`_.
|
||||
|
||||
-----------------
|
||||
Old mailing lists
|
||||
-----------------
|
||||
|
||||
We continue to monitor the `pdb2pqr-users <https://sourceforge.net/p/pdb2pqr/mailman/pdb2pqr-users/>`_ and `apbs-users <https://sourceforge.net/p/apbs/mailman/apbs-users/>`_ mailing lists.
|
||||
However, we are in the process of phasing out these mailing lists (due to high spam content) in favor of user support through `GitHub issues`_.
|
||||
|
||||
----------------------
|
||||
Contacting the authors
|
||||
----------------------
|
||||
|
||||
3
docs/requirements.txt
Normal file
3
docs/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
sphinx
|
||||
sphinx_rtd_theme
|
||||
sphinx_sitemap
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### 1D7H/DMSO BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# 1D7H/DMSO BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### 1D7H/DMSO BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# 1D7H/DMSO BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### 1D7I/DSS BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# 1D7I/DSS BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### 1D7I/DSS BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# 1D7I/DSS BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#########################################################################/smo
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 1.0 # Solute dielectric
|
||||
sdie 80.00 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 5 # NO. of Elements per A^2
|
||||
sdens 1.76 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 1.0 # Solute dielectric
|
||||
sdie 80.00 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 5 # NO. of Elements per A^2
|
||||
sdens 1.76 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 1.0 # Solute dielectric
|
||||
sdie 80.00 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 5 # NO. of Elements per A^2
|
||||
sdens 1.76 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -16,9 +16,6 @@ More details are available on the APBS website contributions section.
|
||||
|
||||
Input File| APBS Version| Result (kJ/mol)| Expected (kJ/mol)
|
||||
---|---|---|---
|
||||
[1d30.in](1d30.in)| **3.0**| **-21961.965**| **-21961.946**
|
||||
| | 1.5| -21961.983|
|
||||
[1d30_monomer1.in](1d30_monomer1.in)| **3.0**| **-26075.345**| **-26075.316**
|
||||
| | 1.5| -26075.357|
|
||||
[1d30_monomer2.in](1d30_monomer2.in)| **3.0**| **-762.105**| **-762.103**
|
||||
| | 1.5| -762.103|
|
||||
[1d30.in](1d30.in)| **3.0**| **-22113.098**| **-22113.098**
|
||||
[1d30_monomer1.in](1d30_monomer1.in)| **3.0**| **-26225.275**| **-26225.275**
|
||||
[1d30_monomer2.in](1d30_monomer2.in)| **3.0**| **-779.948**| **-779.948**
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 2.47 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 2.47 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 2.47 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 2.47 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh (1 - NanoShaper SES, 2 - NanoShaper Skin)
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -14,14 +14,14 @@ elec name comp_solv # Solvated complex
|
||||
pdie 20.0 # Solute dielectric
|
||||
sdie 78.54 # Solvent dielectric
|
||||
srad 1.4 # Solvent probe radius
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
sdens 10 # NO. of Elements per A^2
|
||||
temp 298.00 # Temperature
|
||||
|
||||
tree_order 3 # taylor expansion order
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh 2 # mesh (1 - NanoShaper SES, 2 - NanoShaper Skin)
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 0 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -19,9 +19,6 @@ http://www.poissonboltzmann.org/examples/Lysozyme_pKa_example/
|
||||
|
||||
File Input| APBS Version| Result (kJ/mol)| Expected (kJ/mol)
|
||||
---|---|---|---
|
||||
[ASH66.in](ASH66.in)| **3.0**| **-4.165**| **-4.165**
|
||||
| 1.5| -4.165|
|
||||
[2LTZ-ASH66.in](2LTZ-ASH66.in)| **3.0**| **-360.665**| **-360.665**
|
||||
| 1.5| -360.665|
|
||||
[2LTZ-noASH66.in](2LTZ-noASH66.in)| **3.0**| **-359.870**| **-359.870**
|
||||
| 1.5| -359.870|
|
||||
[ASH66.in](ASH66.in)| **3.0**| **-4.026**| **-4.026**
|
||||
[2LTZ-ASH66.in](2LTZ-ASH66.in)| **3.0**| **-369.020**| **-369.020**
|
||||
[2LTZ-noASH66.in](2LTZ-noASH66.in)| **3.0**| **-367.795**| **-367.795**
|
||||
|
||||
@@ -21,7 +21,7 @@ elec name comp_solv # Solvated complex
|
||||
tree_n0 500 # maxium particle per leaf
|
||||
mac 0.8 # multipole acceptance criterion
|
||||
|
||||
mesh skin # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
mesh ses # mesh options: ses, skin. Options ses and skin require nonoshaper.
|
||||
|
||||
outdata 1 # outdata (0 - dat file, 1 - dat and VTK file)
|
||||
end
|
||||
|
||||
@@ -6,12 +6,11 @@ TABI-PB to solve the PBE. BEMs have the characteristic that only the boundary of
|
||||
domain has to be discretized. This is particularly useful for problems in which the data
|
||||
of interest is at the boundary of the solution.
|
||||
|
||||
This directory contains five example .in files.
|
||||
This directory contains four example .in files.
|
||||
|
||||
Three examples calculate surface potentials for 1a63 in a 0.15 M salt solution:
|
||||
1. 1a63_msms.in uses MSMS to create a solvent excluded surface (SES) triangulation.
|
||||
2. 1a63_NanoShaper_SES.in uses NanoShaper to create an SES triangulation.
|
||||
3. 1a63_NanoShaper_Skin.in uses NanoShaper to create a Skin surface triangulation.
|
||||
Two examples calculate surface potentials for 1a63 in a 0.15 M salt solution:
|
||||
1. 1a63_NanoShaper_SES.in uses NanoShaper to create an SES triangulation.
|
||||
2. 1a63_NanoShaper_Skin.in uses NanoShaper to create a Skin surface triangulation.
|
||||
|
||||
Two examples calculate surface potentials for 451c in a 0.15 M salt solution:
|
||||
1. 451c_order1.in uses a 1st order Taylor series expansion for the treecode.
|
||||
@@ -22,7 +21,7 @@ More details on TABI-PB are available on the APBS website contributions section.
|
||||
|
||||
Input File| APBS Version| Result (kJ/mol) | Expected (kJ/mol)
|
||||
---|---|---|---
|
||||
[451c_order1.in](451c_order1.in)| **3.0**| **-4907.470**| -4907.443
|
||||
[451c_order1.in](451c_order1.in)| **3.0**| **-4907.441**| -4907.443
|
||||
| | 1.5| -4907.455|
|
||||
[451c_order5.in](451c_order5.in)| **3.0**| **-4920.112**| -4920.133
|
||||
| | 1.5| -4920.091|
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id: apbs.in 996 2006-11-27 19:21:40Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file syntax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id: apbs-mol-auto.in 1119 2007-07-23 13:52:03Z sobolevnrm $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY -- FE method
|
||||
### $Id: apbs-mol-fem.in 1026 2006-12-29 16:02:16Z sobolevnrm $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY -- FE method
|
||||
#############################################################################
|
||||
read
|
||||
mol pqr ion.pqr
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY -- FE method
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY -- FE method
|
||||
#############################################################################
|
||||
read
|
||||
mol pqr ion.pqr
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY -- FE method
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY -- FE method
|
||||
#############################################################################
|
||||
read
|
||||
mol pqr ion.pqr
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id: apbs-smol-parallel.in 1346 2009-02-10 21:11:14Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### HCA/ACETAZOLAMIDE BINDING
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# HCA/ACETAZOLAMIDE BINDING
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### HCA/ACETAZOLAMIDE BINDING
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# HCA/ACETAZOLAMIDE BINDING
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### TM SOLVATION ENERGY
|
||||
### : apbs.in 998 2006-11-28 21:24:40Z sobolevnrm $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# TM SOLVATION ENERGY
|
||||
#############################################################################
|
||||
# READ IN MOLECULES
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### TM SOLVATION ENERGY
|
||||
### : apbs.in 998 2006-11-28 21:24:40Z sobolevnrm $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# TM SOLVATION ENERGY
|
||||
#############################################################################
|
||||
# READ IN MOLECULES
|
||||
read
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#############################################################################
|
||||
### TM SOLVATION ENERGY
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# TM SOLVATION ENERGY
|
||||
#############################################################################
|
||||
# READ IN MOLECULES
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-ION PMF
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-ION PMF
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-ION PMF
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-ION PMF
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-PROTEIN BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-PROTEIN BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-PROTEIN BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-PROTEIN BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-PROTEIN BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-PROTEIN BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ION-PROTEIN BINDING ENERGY
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ION-PROTEIN BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POTENTIAL CALCULATION FROM PDB FILE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POTENTIAL CALCULATION FROM PDB FILE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POTENTIAL CALCULATION EXAMPLE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POTENTIAL CALCULATION EXAMPLE
|
||||
##########################################################################
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#########################################################################
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id: apbs-mol-parallel.in 1258 2008-04-10 17:50:16Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ACTIN DIMER BINDING ENERGY
|
||||
### $Id: apbs-mol-auto.in 1258 2008-04-10 17:50:16Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ACTIN DIMER BINDING ENERGY
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### PROTEIN KINASE INHIBITOR BINDING ENERGY -- MOLECULAR SURFACE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# PROTEIN KINASE INHIBITOR BINDING ENERGY -- MOLECULAR SURFACE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### PROTEIN KINASE INHIBITOR BINDING ENERGY -- MOLECULAR SURFACE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# PROTEIN KINASE INHIBITOR BINDING ENERGY -- MOLECULAR SURFACE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# POINT CHARGE POTENTIAL OF MEAN FORCE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
### $Id$
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
1
externals/pb_solvers
vendored
1
externals/pb_solvers
vendored
Submodule externals/pb_solvers deleted from 168a83ed57
1
externals/pybind11
vendored
Submodule
1
externals/pybind11
vendored
Submodule
Submodule externals/pybind11 added at fbc7563623
@@ -1,3 +1,2 @@
|
||||
sphinx>=3.1
|
||||
sphinx_rtd_theme
|
||||
sphinx_sitemap
|
||||
python-dev-tools
|
||||
pybind11
|
||||
|
||||
@@ -82,6 +82,14 @@ int main(
|
||||
char **argv /**< Argument strings */
|
||||
)
|
||||
{
|
||||
// Dump compile-time options
|
||||
for (int i=0; i<argc; i++) {
|
||||
if (strcmp(argv[i],"--config")==0) {
|
||||
dump_options();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// PCE: Adding below variables temporarily
|
||||
clock_t ts, te;
|
||||
// End PCE
|
||||
@@ -238,6 +246,7 @@ int main(
|
||||
for type are either \"xml\" or \"flat\".\n\
|
||||
--help Display this help information.\n\
|
||||
--version Display the current APBS version.\n\
|
||||
--config Display configuration options APBS was built with.\n\
|
||||
----------------------------------------------------------------------\n\n"};
|
||||
|
||||
/* ************** CHECK PARALLEL STATUS *************** */
|
||||
|
||||
@@ -748,7 +748,7 @@ VPUBLIC int Vgrid_readDX(Vgrid *thee,
|
||||
VJMPERR1(!strcmp(tok, "items"));
|
||||
/* Get # */
|
||||
VJMPERR2(1 == Vio_scanf(sock, "%s", tok));
|
||||
VJMPERR1(1 == sscanf(tok, "%lu", &itmp));
|
||||
VJMPERR1(1 == sscanf(tok, "%zu", &itmp));
|
||||
u = (size_t)thee->nx * thee->ny * thee->nz;
|
||||
VJMPERR1(u == itmp);
|
||||
/* Get "data" */
|
||||
|
||||
@@ -229,7 +229,7 @@ VPUBLIC void VbuildG_1(int *nxf, int *nyf, int *nzf,
|
||||
for(jj=2; jj<=*ny-1; jj++) {
|
||||
j = 2 * jj - 1;
|
||||
|
||||
for(ii=2; ii<=*nx-1; i++) {
|
||||
for(ii=2; ii<=*nx-1; ii++) {
|
||||
i = 2 * ii - 1;
|
||||
|
||||
// Index computations
|
||||
|
||||
139
src/routines.c
139
src/routines.c
@@ -5522,3 +5522,142 @@ VPUBLIC int solvePBSAM( Valist* molecules[NOSH_MAXMOL],
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Dump compile-time options
|
||||
*/
|
||||
VPUBLIC void dump_options()
|
||||
{
|
||||
puts("Apbs configuration:");
|
||||
|
||||
printf("PACKAGE_STRING:%s",PACKAGE_STRING);
|
||||
|
||||
printf("APBS_FAST:");
|
||||
#ifdef APBS_FAST
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("DEBUG:");
|
||||
#ifdef DEBUG
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("VERBOSE_DEBUG:");
|
||||
#ifdef VERBOSE_DEBUG
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("VAPBSQUIET:");
|
||||
#ifdef VAPBSQUIET
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_TIME_FUNC:");
|
||||
#ifdef HAVE_TIME_FUNC
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_RAND_FUNC:");
|
||||
#ifdef HAVE_RAND_FUNC
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_SRAND_FUNC:");
|
||||
#ifdef HAVE_SRAND_FUNC
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_LIBREADLINE:");
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("APBS_NOINLINE:");
|
||||
#ifdef APBS_NOINLINE
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_EMBED:");
|
||||
#ifdef HAVE_EMBED
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_ZLIB:");
|
||||
#ifdef HAVE_ZLIB
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("WITH_TINKER:");
|
||||
#ifdef WITH_TINKER
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("FETK_ENABLED:");
|
||||
#ifdef FETK_ENABLED
|
||||
printf("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_PUNC_H:");
|
||||
#ifdef HAVE_PUNC_H
|
||||
puts("1");
|
||||
#else
|
||||
printf("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_MCX_H:");
|
||||
#ifdef HAVE_MCX_H
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_MC_H:");
|
||||
#ifdef HAVE_MC_H
|
||||
printf("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_BIOM_H:");
|
||||
#ifdef HAVE_BIOM_H
|
||||
puts("1");
|
||||
#else
|
||||
printf("0");
|
||||
#endif
|
||||
|
||||
printf("HAVE_MPI_H:");
|
||||
#ifdef HAVE_MPI_H
|
||||
puts("1");
|
||||
#else
|
||||
puts("0");
|
||||
#endif
|
||||
|
||||
printf("FLOAT_EPSILON:%f\n",FLOAT_EPSILON);
|
||||
printf("DOUBLE_EPSILON:%f\n",DOUBLE_EPSILON);
|
||||
}
|
||||
|
||||
@@ -868,3 +868,9 @@ VEXTERNC int solvePBSAM(
|
||||
PBSAMparm *samparm
|
||||
);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Dump compile-time options to I/O
|
||||
* @ingroup Frontend
|
||||
*/
|
||||
VEXTERNC void dump_options();
|
||||
|
||||
@@ -82,21 +82,20 @@ imidazole : -1.030222099963E+01 5.417419E-01
|
||||
|
||||
[bem]
|
||||
input_dir : ../examples/bem
|
||||
451c_order1 : -1.172906546441e+03
|
||||
451c_order5 : -1.175936034727E+03
|
||||
451c_order1 : -4.907440990309e+03
|
||||
451c_order5 : -4.920116369298e+03
|
||||
|
||||
[bem-pKa]
|
||||
input_dir : ../examples/bem-pKa
|
||||
ASH66 : -9.954199102140E-01
|
||||
|
||||
# 2LZT-ASH66 : -8.620097356247E+01
|
||||
# 2LZT-noASH66 : -8.601110775968E+01
|
||||
ASH66 : -4.025681443841E+00
|
||||
2LZT-ASH66 : -3.690203872934E+02
|
||||
2LZT-noASH66 : -3.677953304674E+02
|
||||
|
||||
[bem-binding-energy]
|
||||
input_dir : ../examples/bem-binding-energy
|
||||
1d30 : -5.249027161163E+03
|
||||
1d30_monomer1 : -6.232145066905E+03
|
||||
1d30_monomer2 : -1.821470879387E+02
|
||||
1d30 : -2.211309768995E+04
|
||||
1d30_monomer1 : -2.622527466533E+04
|
||||
1d30_monomer2 : -7.799475420336E+02
|
||||
|
||||
|
||||
[pbam]
|
||||
|
||||
@@ -5,5 +5,6 @@ add_subdirectory(manip)
|
||||
|
||||
if(ENABLE_PYTHON)
|
||||
add_subdirectory(python)
|
||||
add_subdirectory(python-pybind)
|
||||
endif(ENABLE_PYTHON)
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
### $Id: apbs-mol.in 1346 2009-02-10 21:11:14Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# ELECTROSTATIC ENERGY FOR METHANOL -> METHOXIDE IONIZATION
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
@@ -138,4 +134,4 @@ print elecEnergy methoxide-solv - methoxide-ref end
|
||||
# Solvation energy difference
|
||||
print elecEnergy methoxide-solv - methoxide-ref - methanol-solv + methanol-ref end
|
||||
|
||||
quit
|
||||
quit
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#############################################################################
|
||||
### BORN ION SOLVATION ENERGY
|
||||
### $Id: apbs-mol-auto.in 1119 2007-07-23 13:52:03Z sobolevnrm $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### input file sytax.
|
||||
# BORN ION SOLVATION ENERGY
|
||||
#############################################################################
|
||||
|
||||
# READ IN MOLECULES
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
##########################################################################
|
||||
### PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
### $Id: apbs-smol-vdw.in 1346 2009-02-10 21:11:14Z sdg0919 $
|
||||
###
|
||||
### Please see APBS documentation (http://apbs.sourceforge.net/doc/) for
|
||||
### syntax help.
|
||||
# PROTEIN KINASE BINDING ENERGY -- VAN DER WAALS SURFACE
|
||||
##########################################################################
|
||||
|
||||
read
|
||||
|
||||
28
tools/python-pybind/CMakeLists.txt
Normal file
28
tools/python-pybind/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
find_package(pybind11 REQUIRED)
|
||||
add_library(apbs_pybind
|
||||
MODULE
|
||||
module.cpp
|
||||
bind_nosh.cpp
|
||||
bind_vatom.cpp
|
||||
bind_valist.cpp
|
||||
)
|
||||
|
||||
set_target_properties(apbs_pybind
|
||||
PROPERTIES
|
||||
PREFIX "${PYTHON_MODULE_PREFIX}"
|
||||
SUFFIX "${PYTHON_MODULE_EXTENSION}"
|
||||
OUTPUT_NAME "apbs"
|
||||
)
|
||||
|
||||
message(STATUS "LIBS ${APBS_LIBS}")
|
||||
message(STATUS "INTERNAL_LIBS ${APBS_INTERNAL_LIBS}")
|
||||
target_link_libraries(
|
||||
apbs_pybind
|
||||
PRIVATE
|
||||
pybind11::module
|
||||
${APBS_LIBS}
|
||||
${APBS_INTERNAL_LIBS}
|
||||
)
|
||||
|
||||
install(TARGETS apbs_pybind LIBRARY DESTINATION lib)
|
||||
22
tools/python-pybind/bind_constants.hpp
Normal file
22
tools/python-pybind/bind_constants.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file tools/python-pybind/bind_constants.hpp
|
||||
* @author Asher Mancinelli <asher.mancinelli@pnnl.gov>
|
||||
* @brief Contains bindings for exported constants.
|
||||
*
|
||||
* @note The constants exported here were simply the same ones exported by the
|
||||
* original SWIG python interface.
|
||||
*
|
||||
* @see tools/python/apbslib.c
|
||||
*/
|
||||
|
||||
inline void bind_constants(py::module& m)
|
||||
{
|
||||
m.attr("NPT_ENERGY") = py::int_(static_cast<int>(NPT_ENERGY));
|
||||
m.attr("NPT_FORCE") = py::int_(static_cast<int>(NPT_FORCE));
|
||||
m.attr("NPT_ELECENERGY") = py::int_(static_cast<int>(NPT_ELECENERGY));
|
||||
m.attr("NPT_ELECFORCE") = py::int_(static_cast<int>(NPT_ELECFORCE));
|
||||
m.attr("NPT_APOLENERGY") = py::int_(static_cast<int>(NPT_APOLENERGY));
|
||||
m.attr("NPT_APOLFORCE") = py::int_(static_cast<int>(NPT_APOLFORCE));
|
||||
}
|
||||
121
tools/python-pybind/bind_nosh.cpp
Normal file
121
tools/python-pybind/bind_nosh.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
#include "bind_nosh.hpp"
|
||||
#include "bind_valist.hpp"
|
||||
|
||||
int parseInputFromString(NOsh *nosh, std::string str)
|
||||
{
|
||||
int ret, bufsize;
|
||||
Vio *sock;
|
||||
|
||||
startVio();
|
||||
|
||||
VASSERT( bufsize <= VMAX_BUFSIZE );
|
||||
sock = Vio_ctor("BUFF","ASC",VNULL,"0","r");
|
||||
|
||||
Vio_bufTake(sock, const_cast<char*>(str.c_str()), str.size());
|
||||
|
||||
ret = NOsh_parseInput(nosh, sock);
|
||||
sock->VIObuffer = VNULL;
|
||||
Vio_dtor(&sock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void bind_nosh(py::module& m)
|
||||
{
|
||||
m.def("getPotentials", &getPotentials<double>);
|
||||
|
||||
py::enum_<NOsh_MolFormat>(m, "NOsh_MolFormat").export_values();
|
||||
py::enum_<NOsh_CalcType>(m, "NOsh_CalcType").export_values();
|
||||
py::enum_<NOsh_ParmFormat>(m, "NOsh_ParmFormat").export_values();
|
||||
py::enum_<NOsh_PrintType>(m, "NOsh_PrintType").export_values();
|
||||
|
||||
py::class_<NOsh_calc>(m, "NOsh_calc")
|
||||
.def(py::init(
|
||||
[] (NOsh_CalcType calcType)
|
||||
{
|
||||
return std::unique_ptr<NOsh_calc>(NOsh_calc_ctor(calcType));
|
||||
}))
|
||||
.def("NOsh_calc_mgparm_set",
|
||||
[] (NOsh_calc& nosh, MGparm& mgparm)
|
||||
{
|
||||
nosh.mgparm = &mgparm;
|
||||
})
|
||||
.def("__del__",
|
||||
[] (NOsh_calc* self)
|
||||
{
|
||||
NOsh_calc_dtor(&self);
|
||||
})
|
||||
.def_readwrite("mgparm", &NOsh_calc::mgparm)
|
||||
.def_readwrite("femparm", &NOsh_calc::femparm)
|
||||
.def_readwrite("bemparm", &NOsh_calc::bemparm)
|
||||
.def_readwrite("geoflowparm", &NOsh_calc::geoflowparm)
|
||||
.def_readwrite("pbamparm", &NOsh_calc::pbamparm)
|
||||
.def_readwrite("pbsamparm", &NOsh_calc::pbsamparm)
|
||||
.def_readwrite("pbeparm", &NOsh_calc::pbeparm)
|
||||
.def_readwrite("apolparm", &sNOsh_calc::apolparm)
|
||||
.def_readwrite("calctype", &sNOsh_calc::calctype);
|
||||
|
||||
py::class_<NOsh>(m, "NOsh")
|
||||
.def(py::init<>())
|
||||
.def("parseInputFromString",
|
||||
[] (NOsh& self, std::string str) -> int
|
||||
{
|
||||
int ret, bufsize;
|
||||
Vio *sock;
|
||||
|
||||
startVio();
|
||||
|
||||
VASSERT( bufsize <= VMAX_BUFSIZE );
|
||||
sock = Vio_ctor("BUFF","ASC",VNULL,"0","r");
|
||||
|
||||
Vio_bufTake(sock, const_cast<char*>(str.c_str()), str.size());
|
||||
|
||||
ret = NOsh_parseInput(&self, sock);
|
||||
sock->VIObuffer = VNULL;
|
||||
Vio_dtor(&sock);
|
||||
return ret;
|
||||
})
|
||||
.def("__del__",
|
||||
[] (NOsh* self)
|
||||
{
|
||||
NOsh_dtor(&self);
|
||||
})
|
||||
.def("getMolpath" , [] (NOsh& thee, int imol)
|
||||
{ return std::string(NOsh_getMolpath(&thee, imol)); })
|
||||
.def("getDielXpath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getDielXpath(&thee, imap)); })
|
||||
.def("getDielYpath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getDielYpath(&thee, imap)); })
|
||||
.def("getDielZpath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getDielZpath(&thee, imap)); })
|
||||
.def("getKappapath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getKappapath(&thee, imap)); })
|
||||
.def("getPotpath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getPotpath(&thee, imap)); })
|
||||
.def("getChargepath" , [] (NOsh& thee, int imap)
|
||||
{ return std::string(NOsh_getChargepath(&thee, imap)); })
|
||||
.def("elecname" , [] (NOsh& thee, int ielec)
|
||||
{ return std::string(NOsh_elecname(&thee, ielec)); })
|
||||
.def("getDielfmt" , &NOsh_getDielfmt)
|
||||
.def("getKappafmt" , &NOsh_getKappafmt)
|
||||
.def("getPotfmt" , &NOsh_getPotfmt)
|
||||
.def("getChargefmt" , &NOsh_getChargefmt)
|
||||
.def("elec2calc" , &NOsh_elec2calc)
|
||||
.def("apol2calc" , &NOsh_apol2calc)
|
||||
.def("printNarg" , &NOsh_printNarg)
|
||||
.def("printOp" , &NOsh_printOp)
|
||||
.def("printCalc" , &NOsh_printCalc)
|
||||
.def("getCalc" , &NOsh_getCalc)
|
||||
.def("printWhat" , &NOsh_printWhat)
|
||||
.def("parseInput" , &NOsh_parseInput)
|
||||
.def("parseInputFile", &NOsh_parseInputFile)
|
||||
// These two are wrappers to use std::vector for easier conversion
|
||||
// between python lists and C arrays
|
||||
.def("setupElecCalc" , [] (NOsh& thee, std::vector<Valist*> alist)
|
||||
{
|
||||
NOsh_setupElecCalc(&thee, alist.data());
|
||||
})
|
||||
.def("setupApolCalc" , [] (NOsh& thee, std::vector<Valist*> alist)
|
||||
{
|
||||
NOsh_setupApolCalc(&thee, alist.data());
|
||||
});
|
||||
}
|
||||
77
tools/python-pybind/bind_nosh.hpp
Normal file
77
tools/python-pybind/bind_nosh.hpp
Normal file
@@ -0,0 +1,77 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
namespace py = pybind11;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
extern "C"
|
||||
{
|
||||
#include "apbscfg.h"
|
||||
#include "routines.h"
|
||||
#include "generic/nosh.h"
|
||||
}
|
||||
|
||||
/**
|
||||
* @file tools/python-pybind/bind_nosh.hpp
|
||||
* @author Asher Mancinelli <asher.mancinelli@pnnl.gov>
|
||||
* @brief Contains bindings for nosh-related functions.
|
||||
*
|
||||
* @note keep all implementations in the impl unless templated.
|
||||
* @note contains bindings for nosh and all classes encapsulated by this struct
|
||||
* within the source.
|
||||
*
|
||||
* @see src/generic/nosh.h:195
|
||||
*/
|
||||
|
||||
/**
|
||||
* @todo request help documenting
|
||||
*/
|
||||
template<typename T>
|
||||
std::vector<T> getPotentials(NOsh *nosh, PBEparm *pbeparm, Vpmg *pmg, Valist *alist)
|
||||
{
|
||||
Vgrid *grid;
|
||||
Vatom *atom;
|
||||
int i, nx, ny, nz;
|
||||
double hx, hy, hzed, xcent, ycent, zcent, xmin, ymin, zmin;
|
||||
double value;
|
||||
double *position;
|
||||
std::vector<T> values;
|
||||
|
||||
nx = pmg->pmgp->nx;
|
||||
ny = pmg->pmgp->ny;
|
||||
nz = pmg->pmgp->nz;
|
||||
hx = pmg->pmgp->hx;
|
||||
hy = pmg->pmgp->hy;
|
||||
hzed = pmg->pmgp->hzed;
|
||||
xcent = pmg->pmgp->xcent;
|
||||
ycent = pmg->pmgp->ycent;
|
||||
zcent = pmg->pmgp->zcent;
|
||||
xmin = xcent - 0.5*(nx-1)*hx;
|
||||
ymin = ycent - 0.5*(ny-1)*hy;
|
||||
zmin = zcent - 0.5*(nz-1)*hzed;
|
||||
|
||||
Vpmg_fillArray(pmg, pmg->rwork, VDT_POT, 0.0, pbeparm->pbetype, pbeparm);
|
||||
grid = Vgrid_ctor(nx, ny, nz, hx, hy, hzed, xmin, ymin, zmin,
|
||||
pmg->rwork);
|
||||
for (i=0;i<Valist_getNumberAtoms(alist);i++){
|
||||
atom = Valist_getAtom(alist, i);
|
||||
position = Vatom_getPosition(atom);
|
||||
Vgrid_value(grid, position, &value);
|
||||
values[i] = value;
|
||||
}
|
||||
Vgrid_dtor(&grid);
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Perform binding to module
|
||||
*/
|
||||
void bind_nosh(py::module& m);
|
||||
97
tools/python-pybind/bind_valist.cpp
Normal file
97
tools/python-pybind/bind_valist.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
#include "bind_valist.hpp"
|
||||
|
||||
void Valist_load(Valist *self,
|
||||
int size,
|
||||
std::vector<double> x,
|
||||
std::vector<double> y,
|
||||
std::vector<double> z,
|
||||
std::vector<double> chg,
|
||||
std::vector<double> rad)
|
||||
{
|
||||
|
||||
int i, j;
|
||||
double pos[3];
|
||||
|
||||
Vatom *atom;
|
||||
|
||||
VASSERT(self != VNULL);
|
||||
|
||||
self->atoms = static_cast<Vatom*>(Vmem_malloc(self->vmem, size, sizeof(Vatom)));
|
||||
self->number = size;
|
||||
for (i = 0; i < size; i++) {
|
||||
pos[0] = x[i];
|
||||
pos[1] = y[i];
|
||||
pos[2] = z[i];
|
||||
Vatom_setCharge(&(self->atoms[i]), chg[i]);
|
||||
Vatom_setRadius(&(self->atoms[i]), rad[i]);
|
||||
Vatom_setPosition(&(self->atoms[i]), pos);
|
||||
Vatom_setAtomID(&(self->atoms[i]), i);
|
||||
}
|
||||
|
||||
self->center[0] = 0.0;
|
||||
self->center[1] = 0.0;
|
||||
self->center[2] = 0.0;
|
||||
self->maxrad = 0.0;
|
||||
self->charge = 0.0;
|
||||
|
||||
/* Reset stat variables */
|
||||
atom = &(self->atoms[0]);
|
||||
for (i = 0; i < 3; i++) {
|
||||
self->maxcrd[i] = self->mincrd[i] = atom->position[i];
|
||||
}
|
||||
self->maxrad = atom->radius;
|
||||
|
||||
for (i = 0; i < self->number; i++) {
|
||||
atom = &(self->atoms[i]);
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (atom->position[j] < self->mincrd[j])
|
||||
self->mincrd[j] = atom->position[j];
|
||||
if (atom->position[j] > self->maxcrd[j])
|
||||
self->maxcrd[j] = atom->position[j];
|
||||
}
|
||||
if (atom->radius > self->maxrad) self->maxrad = atom->radius;
|
||||
self->charge = self->charge + atom->charge;
|
||||
}
|
||||
|
||||
self->center[0] = 0.5 * (self->maxcrd[0] + self->mincrd[0]);
|
||||
self->center[1] = 0.5 * (self->maxcrd[1] + self->mincrd[1]);
|
||||
self->center[2] = 0.5 * (self->maxcrd[2] + self->mincrd[2]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Class to bind sValist to C++ STL types for better interfacing
|
||||
* with python.
|
||||
*/
|
||||
struct Valist_glue : public Valist
|
||||
{
|
||||
std::array<double, 3> center; /**< Molecule center (xmin - xmax)/2, etc.*/
|
||||
std::array<double, 3> mincrd; /**< Minimum coordinates */
|
||||
std::array<double, 3> maxcrd; /**< Maximum coordinates */
|
||||
std::vector<Vatom> vatoms; /**< Atom list */
|
||||
};
|
||||
|
||||
void bind_valist(py::module &m)
|
||||
{
|
||||
py::class_<Valist_glue>(m, "Valist")
|
||||
.def(py::init<>())
|
||||
.def("__del__", [](Valist* self) { Valist_dtor(&self); })
|
||||
.def("load", &Valist_load)
|
||||
.def("getAtomList" , &Valist_getAtomList)
|
||||
.def("getCenterX" , &Valist_getCenterX)
|
||||
.def("getCenterY" , &Valist_getCenterY)
|
||||
.def("getCenterZ" , &Valist_getCenterZ)
|
||||
.def("getNumberAtoms" , &Valist_getNumberAtoms)
|
||||
.def("getAtom" , &Valist_getAtom)
|
||||
.def("memChk" , &Valist_memChk)
|
||||
.def("readPQR" , &Valist_readPQR)
|
||||
.def("readPDB" , &Valist_readPDB)
|
||||
.def("readXML" , &Valist_readXML)
|
||||
.def_readwrite("number" , &Valist::number)
|
||||
.def_readwrite("center" , &Valist_glue::center)
|
||||
.def_readwrite("mincrd" , &Valist_glue::mincrd)
|
||||
.def_readwrite("maxcrd" , &Valist_glue::maxcrd)
|
||||
.def_readwrite("maxrad" , &Valist::maxrad)
|
||||
.def_readwrite("charge" , &Valist::charge)
|
||||
.def_readwrite("vatoms" , &Valist_glue::vatoms)
|
||||
.def_readwrite("vmem" , &Valist::vmem);
|
||||
}
|
||||
44
tools/python-pybind/bind_valist.hpp
Normal file
44
tools/python-pybind/bind_valist.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
namespace py = pybind11;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
extern "C"
|
||||
{
|
||||
#include "apbscfg.h"
|
||||
#include "generic/valist.h"
|
||||
}
|
||||
|
||||
/**
|
||||
* @file tools/python-pybind/bind_valist.hpp
|
||||
* @author Asher Mancinelli <asher.mancinelli@pnnl.gov>
|
||||
* @brief Contains bindings for Valist-related functions.
|
||||
*
|
||||
* @note keep all implementations in the impl unless templated.
|
||||
* @note contains bindings for nosh and all classes encapsulated by this struct
|
||||
* within the source.
|
||||
*
|
||||
* @see src/generic/valist.h:195
|
||||
*/
|
||||
|
||||
/**
|
||||
* @todo request documentation for this
|
||||
*/
|
||||
void Valist_load(Valist *self,
|
||||
int size,
|
||||
std::vector<double> x,
|
||||
std::vector<double> y,
|
||||
std::vector<double> z,
|
||||
std::vector<double> chg,
|
||||
std::vector<double> rad);
|
||||
|
||||
/**
|
||||
* @brief Perform binding to module
|
||||
*/
|
||||
void bind_valist(py::module& m);
|
||||
64
tools/python-pybind/bind_vatom.cpp
Normal file
64
tools/python-pybind/bind_vatom.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "bind_vatom.hpp"
|
||||
#include <cstdio>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/numpy.h>
|
||||
|
||||
void bind_vatom(py::module& m)
|
||||
{
|
||||
py::class_<sVatom>(m, "Vatom")
|
||||
.def(py::init<>())
|
||||
#ifdef WITH_TINKER
|
||||
.def("setInducedDipole" , &Vatom_setInducedDipole)
|
||||
.def("setNLInducedDipole", &Vatom_setNLInducedDipole)
|
||||
.def("setDipole" , &Vatom_setDipole)
|
||||
.def("setQuadrupole" , &Vatom_setQuadrupole)
|
||||
.def("getDipole" , &Vatom_getDipole)
|
||||
.def("getQuadrupole" , &Vatom_getQuadrupole)
|
||||
.def("getInducedDipole" , &Vatom_getInducedDipole)
|
||||
.def("getNLInducedDipole", &Vatom_getNLInducedDipole)
|
||||
.def_readwrite("dipole" , &sVatom::dipole) /**< Permanent dipole */
|
||||
.def_readwrite("quadrupole" , &sVatom::quadrupole) /**< Permanent quadrupole */
|
||||
.def_readwrite("inducedDipole" , &sVatom::inducedDipole) /**< Induced dipole */
|
||||
.def_readwrite("nlInducedDipole" , &sVatom::nlInducedDipole) /**< Non-local induced dipole */
|
||||
#endif
|
||||
.def("copyTo" , &Vatom_copyTo)
|
||||
.def("copyFrom" , &Vatom_copyFrom)
|
||||
.def_readwrite("radius" , &sVatom::radius)
|
||||
.def_readwrite("charge" , &sVatom::charge)
|
||||
.def_readwrite("partID" , &sVatom::partID)
|
||||
.def_readwrite("epsilon" , &sVatom::epsilon)
|
||||
.def_readwrite("id" , &sVatom::id)
|
||||
.def_property("position",
|
||||
[] (sVatom& self)
|
||||
{
|
||||
return std::vector<double>(self.position, self.position+3);
|
||||
},
|
||||
[] (sVatom& self, py::array_t<double> other)
|
||||
{
|
||||
py::buffer_info buf = other.request();
|
||||
assert(buf.ndim == 1 && "Vatom::position is 1D!");
|
||||
assert(other.size() == 3 && "Vatom::position has length 3!");
|
||||
auto* ptr = static_cast<double*>(buf.ptr);
|
||||
for(int i=0;i<3;i++) self.position[i] = ptr[i];
|
||||
})
|
||||
.def_property("atomName",
|
||||
&Vatom_getAtomName,
|
||||
[] (sVatom& self, std::string other)
|
||||
{
|
||||
for(int i=0;i<VMAX_RECLEN;i++)
|
||||
{
|
||||
if(other.c_str()[i]=='\0') break;
|
||||
self.atomName[i] = other.c_str()[i];
|
||||
}
|
||||
})
|
||||
.def_property("resName",
|
||||
&Vatom_getResName,
|
||||
[] (sVatom& self, std::string other)
|
||||
{
|
||||
for(int i=0;i<VMAX_RECLEN;i++)
|
||||
{
|
||||
if(other.c_str()[i]=='\0') break;
|
||||
self.resName[i] = other.c_str()[i];
|
||||
}
|
||||
});
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user