Inherits _ApoObject.
Public Member Functions | |
| None | __init__ (self, ForceManager|CharmmPsf force_manager_or_psf, CharmmParameters|None parameters=None) |
| Constructs a Python CharmmContext wrapper. | |
| None | setPrm (self, CharmmParameters parameters) |
| Sets the CHARMM parameter set. | |
| None | setPsf (self, CharmmPsf psf) |
| Sets the PSF and imports its atom charges and masses. | |
| None | setForceManager (self, ForceManager force_manager) |
| Sets the ForceManager associated with the context. | |
| None | setCoordinatesCharges (self, Sequence[Sequence[float]] coordinates_charges) |
| Sets coordinates and charges from nested Python rows. | |
| None | setCoordinates (self, CharmmCrd|Sequence[Sequence[float]] coordinates) |
| Sets coordinates from a CharmmCrd or nested Python rows. | |
| None | setCharges (self, Sequence[float] charges) |
| Sets per-atom charges while preserving coordinates. | |
| None | setVelocitiesInverseMasses (self, Sequence[Sequence[float]] velocities_inverse_masses) |
| Sets velocities and inverse masses from nested rows. | |
| None | setVelocities (self, Sequence[Sequence[float]] velocities) |
| Sets velocity components while preserving inverse masses. | |
| None | setVelocitiesFromCHARMMVelocityFile (self, FilePath path) |
| Loads velocities from a CHARMM velocity file. | |
| None | setMasses (self, Sequence[float] masses) |
| Sets masses and stores native inverse masses. | |
| None | setTemperature (self, float temperature) |
| Sets the stored target temperature. | |
| None | setPeriodicBoundaryCondition (self, PeriodicBoundaryCondition|int pbc) |
| Sets the periodic boundary condition. | |
| None | setBoxDimensions (self, Sequence[float] box_dimensions) |
| Sets orthorhombic box dimensions. | |
| None | setRandomSeed (self, int seed) |
| Sets the random seed used for velocity assignment. | |
| None | useHolonomicConstraints (self, bool flag) |
| Selects constrained degree-of-freedom accounting. | |
| None | setKappa (self, float kappa) |
| Sets the Ewald splitting parameter. | |
| None | setCutoff (self, float cutoff) |
| Sets the direct-space cutoff. | |
| None | setCtonnb (self, float ctonnb) |
Sets the nonbonded distance exposed as ctonnb. | |
| None | setCtofnb (self, float ctofnb) |
Sets the nonbonded distance exposed as ctofnb. | |
| None | setFFTGrid (self, Sequence[int] grid) |
| Sets the three-dimensional PME FFT grid. | |
| None | setPmeSplineOrder (self, int order) |
| Sets the PME interpolation spline order. | |
| None | setVdwType (self, VdwType|int vdw_type) |
| Sets the van der Waals model identifier. | |
| int | getNumAtoms (self) |
| Returns the context atom count. | |
| int | getNumDegreesOfFreedom (self) |
| Returns the current degree-of-freedom count. | |
| list[list[float]] | getCoordinatesCharges (self) |
| Returns a Python copy of coordinates and charges. | |
| list[list[float]] | getVelocityMass (self) |
| Returns a Python copy of velocities and inverse masses. | |
| PeriodicBoundaryCondition | getPeriodicBoundaryCondition (self) |
| Returns the periodic boundary condition. | |
| tuple[float, float, float] | getBoxDimensions (self) |
| Returns the three stored box dimensions. | |
| int | getRandomSeed (self) |
| Returns the stored random seed. | |
| float | getVolume (self) |
| Returns the orthorhombic box volume. | |
| float | getKappa (self) |
| Returns the stored Ewald splitting parameter. | |
| float | getCutoff (self) |
| Returns the stored direct-space cutoff. | |
| float | getCtonnb (self) |
Returns the distance exposed as ctonnb. | |
| float | getCtofnb (self) |
Returns the distance exposed as ctofnb. | |
| tuple[int, int, int] | getFFTGrid (self) |
| Returns the stored PME FFT grid. | |
| int | getPmeSplineOrder (self) |
| Returns the stored PME interpolation spline order. | |
| VdwType | getVdwType (self) |
| Returns the stored van der Waals model identifier. | |
| ForceManager | getForceManager (self) |
| Returns a Python wrapper for the associated ForceManager. | |
| None | assignVelocitiesAtTemperature (self, float temperature) |
| Assigns sampled velocities at a temperature. | |
| float | computeTemperature (self) |
| Computes the instantaneous kinetic temperature. | |
| None | calculatePotentialEnergy (self, bool print_energy=False) |
| Computes forces, potential energy, and virial. | |
Represents mutable molecular state for apoCHARMM calculations.
Construct the wrapper from a ForceManager, or from a CharmmPsf together with CharmmParameters. The wrapper owns its C handle and retains Python references to collaborators whose native objects participate in the context.
Array setters copy Python values into temporary C buffers. Array getters return new Python lists or tuples; they do not expose native storage.
close() releases the owned context handle and is idempotent. The wrapper supports the context-manager protocol. Using a method that accesses self.handle after closure raises RuntimeError. Native nonzero statuses are raised as ApoCharmmError.
The wrapper and its native object provide no internal thread synchronization.
| None apocharmm.charmm_context.CharmmContext.__init__ | ( | self, | |
| ForceManager | CharmmPsf | force_manager_or_psf, | ||
| CharmmParameters | None | parameters = None |
||
| ) |
Constructs a Python CharmmContext wrapper.
Pass either a live ForceManager and leave parameters as None, or pass a live CharmmPsf together with a live CharmmParameters. Collaborator wrappers are retained to preserve their Python and native lifetimes.
| [in] | force_manager_or_psf | ForceManager or CharmmPsf selecting the construction path. |
| [in] | parameters | CharmmParameters required with CharmmPsf, or None with ForceManager. |
| TypeError | If the argument combination does not match either supported construction path. |
| RuntimeError | If a supplied wrapper is closed, or native construction reports success but produces a NULL handle. |
| ApoCharmmError | If native validation, GPU setup, allocation, or force-manager initialization fails. |
| None apocharmm.charmm_context.CharmmContext.assignVelocitiesAtTemperature | ( | self, | |
| float | temperature | ||
| ) |
Assigns sampled velocities at a temperature.
The native context samples independent Cartesian Gaussian components using its stored seed. It does not remove center-of-mass motion or rescale the sampled result.
| [in] | temperature | Python int or float accepted by ctypes.c_double, in kelvin. The value must be finite and non-negative. |
| TypeError | If temperature cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, native temperature validation fails, or the velocity transfer fails. |
| None apocharmm.charmm_context.CharmmContext.calculatePotentialEnergy | ( | self, | |
| bool | print_energy = False |
||
| ) |
Computes forces, potential energy, and virial.
The Python wrapper always passes reset=False. When print_energy is truthy, the native context writes a CHARMM-style energy table to standard output.
| [in] | print_energy | Boolean selecting native energy-table output. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the force manager is not initialized, composite-manager printing is unsupported, or native force or CUDA work fails. |
| float apocharmm.charmm_context.CharmmContext.computeTemperature | ( | self | ) |
Computes the instantaneous kinetic temperature.
The native calculation evaluates kinetic energy on the GPU and divides by 0.5 * ndegf * k_B.
float in kelvin.| RuntimeError | If this context is closed. |
| ApoCharmmError | If atom, velocity, or degree-of-freedom state is incomplete, or native CUDA work fails. |
| tuple[float, float, float] apocharmm.charmm_context.CharmmContext.getBoxDimensions | ( | self | ) |
Returns the three stored box dimensions.
(x, y, z) tuple of lengths in angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If native output validation fails. |
| list[list[float]] apocharmm.charmm_context.CharmmContext.getCoordinatesCharges | ( | self | ) |
Returns a Python copy of coordinates and charges.
Native device storage is transferred to host before copying. The result contains one [x, y, z, charge] list per atom. Coordinates use angstroms and charges use elementary-charge units.
list[list[float]] with shape (N, 4).| RuntimeError | If this context is closed. |
| ApoCharmmError | If atom-count retrieval, output validation, or the native device-to-host transfer fails. |
| float apocharmm.charmm_context.CharmmContext.getCtofnb | ( | self | ) |
Returns the distance exposed as ctofnb.
float in angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| float apocharmm.charmm_context.CharmmContext.getCtonnb | ( | self | ) |
Returns the distance exposed as ctonnb.
float in angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| float apocharmm.charmm_context.CharmmContext.getCutoff | ( | self | ) |
Returns the stored direct-space cutoff.
float in angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| tuple[int, int, int] apocharmm.charmm_context.CharmmContext.getFFTGrid | ( | self | ) |
Returns the stored PME FFT grid.
(nfftx, nffty, nfftz) tuple of dimensionless grid sizes.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached, the native grid does not contain exactly three values, or output validation fails. |
| ForceManager apocharmm.charmm_context.CharmmContext.getForceManager | ( | self | ) |
Returns a Python wrapper for the associated ForceManager.
When construction or setForceManager() retained a wrapper, that same Python object is returned. Otherwise, the C ABI creates a newly owned force-manager handle sharing the native manager; the wrapper takes ownership of that handle and is cached by this context.
Closing the returned ForceManager releases only its C handle. The native context continues to retain its native manager.
ForceManager wrapper.| RuntimeError | If the context must access its native handle after closure. |
| ApoCharmmError | If the native context has no force manager or C handle creation fails. |
| float apocharmm.charmm_context.CharmmContext.getKappa | ( | self | ) |
Returns the stored Ewald splitting parameter.
float in inverse angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| int apocharmm.charmm_context.CharmmContext.getNumAtoms | ( | self | ) |
Returns the context atom count.
int containing the dimensionless atom count.| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native getter fails. |
| int apocharmm.charmm_context.CharmmContext.getNumDegreesOfFreedom | ( | self | ) |
Returns the current degree-of-freedom count.
int containing the dimensionless count.| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native getter fails. |
| PeriodicBoundaryCondition apocharmm.charmm_context.CharmmContext.getPeriodicBoundaryCondition | ( | self | ) |
Returns the periodic boundary condition.
PeriodicBoundaryCondition mapped from the native value.| RuntimeError | If this context is closed. |
| ApoCharmmError | If the C ABI getter fails. |
| ValueError | If a successful C ABI call returns an integer not represented by PeriodicBoundaryCondition. |
| int apocharmm.charmm_context.CharmmContext.getPmeSplineOrder | ( | self | ) |
Returns the stored PME interpolation spline order.
int containing the dimensionless order.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| int apocharmm.charmm_context.CharmmContext.getRandomSeed | ( | self | ) |
Returns the stored random seed.
int in the unsigned 64-bit range.| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native getter fails. |
| VdwType apocharmm.charmm_context.CharmmContext.getVdwType | ( | self | ) |
Returns the stored van der Waals model identifier.
VdwType mapped from the native model code.| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or the native getter fails. |
| ValueError | If a successful native call returns an integer not represented by VdwType. |
| list[list[float]] apocharmm.charmm_context.CharmmContext.getVelocityMass | ( | self | ) |
Returns a Python copy of velocities and inverse masses.
Despite the method name, each fourth component is inverse mass, not mass. Rows are [vx, vy, vz, inverse_mass]; velocity uses angstroms per AKMA time unit and inverse mass uses reciprocal atomic mass units.
list[list[float]] with shape (N, 4).| RuntimeError | If this context is closed. |
| ApoCharmmError | If atom-count retrieval, output validation, or the native device-to-host transfer fails. |
| float apocharmm.charmm_context.CharmmContext.getVolume | ( | self | ) |
Returns the orthorhombic box volume.
float in cubic angstroms.| RuntimeError | If this context is closed. |
| ApoCharmmError | If valid positive box dimensions have not been set or the native getter otherwise fails. |
| None apocharmm.charmm_context.CharmmContext.setBoxDimensions | ( | self, | |
| Sequence[float] | box_dimensions | ||
| ) |
Sets orthorhombic box dimensions.
box_dimensions is converted to a temporary contiguous double buffer. It must contain exactly [x, y, z] lengths in angstroms.
| [in] | box_dimensions | Sequence of exactly three numeric values. |
| TypeError | If the input is not iterable or a value cannot be converted with float(). |
| ValueError | If scalar conversion raises ValueError. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the length is not three, a dimension is not positive, attached force configuration is invalid, or native initialization or neighbor-list work fails. |
| None apocharmm.charmm_context.CharmmContext.setCharges | ( | self, | |
| Sequence[float] | charges | ||
| ) |
Sets per-atom charges while preserving coordinates.
Each scalar is converted with float(), copied to a temporary C buffer, and then copied by the native context. Charges use elementary-charge units.
| [in] | charges | Sequence containing exactly one value per atom. |
| TypeError | If charges is not iterable or a value cannot be converted with float(). |
| ValueError | If scalar conversion raises ValueError. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the sequence length is wrong, or native transfer fails. |
| None apocharmm.charmm_context.CharmmContext.setCoordinates | ( | self, | |
| CharmmCrd | Sequence[Sequence[float]] | coordinates | ||
| ) |
Sets coordinates from a CharmmCrd or nested Python rows.
A CharmmCrd is borrowed for the native call and is not retained. Otherwise, coordinates must contain one [x, y, z] row per atom. Scalars are converted with float() and copied through a temporary C buffer. Coordinates use angstroms and existing charges are preserved.
| [in] | coordinates | Live CharmmCrd wrapper or sequence of three-value row sequences. |
| TypeError | If a row is not iterable, a scalar cannot be converted, or a closed CharmmCrd is accessed. |
| ValueError | If scalar conversion fails or a row does not contain exactly three values. |
| RuntimeError | If this context or a supplied CharmmCrd is closed. |
| ApoCharmmError | If the atom count is unset, the coordinate count is wrong, or native transfer or neighbor-list work fails. |
| None apocharmm.charmm_context.CharmmContext.setCoordinatesCharges | ( | self, | |
| Sequence[Sequence[float]] | coordinates_charges | ||
| ) |
Sets coordinates and charges from nested Python rows.
coordinates_charges must contain one row per atom and exactly four values per row in [x, y, z, charge] order. Coordinates use angstroms and charges use elementary-charge units. Every scalar is converted with float(), flattened into a temporary ctypes buffer, and copied by the native context.
| [in] | coordinates_charges | Sequence of fixed-width row sequences. |
| TypeError | If a row is not iterable or a scalar cannot be converted to float. |
| ValueError | If scalar conversion fails or a row does not contain exactly four values. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the row count is wrong, or native transfer or neighbor-list work fails. |
| None apocharmm.charmm_context.CharmmContext.setCtofnb | ( | self, | |
| float | ctofnb | ||
| ) |
Sets the nonbonded distance exposed as ctofnb.
| [in] | ctofnb | Python int or float accepted by ctypes.c_double, in angstroms. The native float-converted value must be finite and positive. |
| TypeError | If ctofnb cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or native validation fails. |
ron. Configure it before force-manager initialization. | None apocharmm.charmm_context.CharmmContext.setCtonnb | ( | self, | |
| float | ctonnb | ||
| ) |
Sets the nonbonded distance exposed as ctonnb.
| [in] | ctonnb | Python int or float accepted by ctypes.c_double, in angstroms. The native float-converted value must be finite and positive. |
| TypeError | If ctonnb cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or native validation fails. |
roff. Configure it before force-manager initialization. | None apocharmm.charmm_context.CharmmContext.setCutoff | ( | self, | |
| float | cutoff | ||
| ) |
Sets the direct-space cutoff.
| [in] | cutoff | Python int or float accepted by ctypes.c_double, in angstroms. The native float-converted value must be finite and positive. |
| TypeError | If cutoff cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or native validation fails. |
| None apocharmm.charmm_context.CharmmContext.setFFTGrid | ( | self, | |
| Sequence[int] | grid | ||
| ) |
Sets the three-dimensional PME FFT grid.
Each element is converted with int() and copied to a temporary C buffer. The sequence must contain exactly three positive dimensions in X, Y, Z order.
| [in] | grid | Sequence of three integer-convertible values. |
| TypeError | If grid is not iterable or an element cannot be converted with int(). |
| ValueError | If integer conversion fails. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the length is not three, a dimension is not positive, or no force manager is attached. |
| None apocharmm.charmm_context.CharmmContext.setForceManager | ( | self, | |
| ForceManager | force_manager | ||
| ) |
Sets the ForceManager associated with the context.
The wrapper retains force_manager after a successful native state reconciliation and clears retained PSF and parameter wrappers because the new manager becomes their native source.
| [in] | force_manager | Live ForceManager wrapper. |
| TypeError | If force_manager is not a ForceManager. |
| RuntimeError | If this context or force_manager is closed. |
| ApoCharmmError | If native state reconciliation or initialization fails. |
| None apocharmm.charmm_context.CharmmContext.setKappa | ( | self, | |
| float | kappa | ||
| ) |
Sets the Ewald splitting parameter.
| [in] | kappa | Python int or float accepted by ctypes.c_double, in inverse angstroms. The native float-converted value must be finite and non-negative. |
| TypeError | If kappa cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If no force manager is attached or native validation fails. |
| None apocharmm.charmm_context.CharmmContext.setMasses | ( | self, | |
| Sequence[float] | masses | ||
| ) |
Sets masses and stores native inverse masses.
Each scalar is converted with float() and interpreted as an atomic mass-unit value. The native context stores its reciprocal and preserves existing velocity components.
| [in] | masses | Sequence containing exactly one mass per atom. |
| TypeError | If masses is not iterable or a value cannot be converted to float. |
| ValueError | If scalar conversion raises ValueError. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the sequence length is wrong, or native transfer fails. |
| None apocharmm.charmm_context.CharmmContext.setPeriodicBoundaryCondition | ( | self, | |
| PeriodicBoundaryCondition | int | pbc | ||
| ) |
Sets the periodic boundary condition.
pbc is normalized through PeriodicBoundaryCondition before its integer value is passed to the C ABI.
| [in] | pbc | PeriodicBoundaryCondition or matching integer value 0, 1, or 2. |
| TypeError | If pbc cannot be interpreted by the enumeration. |
| ValueError | If the integer is not a declared enum value. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If native propagation, initialization, imaging, or neighbor-list rebuilding fails. |
| None apocharmm.charmm_context.CharmmContext.setPmeSplineOrder | ( | self, | |
| int | order | ||
| ) |
Sets the PME interpolation spline order.
| [in] | order | Python integer accepted by ctypes.c_int. The native value must be positive. |
| TypeError | If order cannot initialize ctypes.c_int. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If order is not positive or no force manager is attached. |
| None apocharmm.charmm_context.CharmmContext.setPrm | ( | self, | |
| CharmmParameters | parameters | ||
| ) |
Sets the CHARMM parameter set.
The wrapper requires a CharmmParameters, passes its borrowed handle to the C ABI, and retains the Python object after success.
| [in] | parameters | Live CharmmParameters wrapper. |
| TypeError | If parameters is not a CharmmParameters. |
| RuntimeError | If this context or parameters is closed. |
| ApoCharmmError | If native synchronization or initialization fails. |
Sets the PSF and imports its atom charges and masses.
The wrapper requires a CharmmPsf, passes its borrowed handle to the C ABI, and retains the Python object after success.
| [in] | psf | Live CharmmPsf wrapper. |
| TypeError | If psf is not a CharmmPsf. |
| RuntimeError | If this context or psf is closed. |
| ApoCharmmError | If the atom count conflicts, storage or transfer fails, or force-manager initialization fails. |
| None apocharmm.charmm_context.CharmmContext.setRandomSeed | ( | self, | |
| int | seed | ||
| ) |
Sets the random seed used for velocity assignment.
| [in] | seed | Python int in the inclusive range [0, 2**64 - 1]. |
| TypeError | If seed is not comparable with integers or cannot initialize ctypes.c_uint64. |
| ValueError | If seed is outside the unsigned 64-bit range. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native context rejects the update. |
| None apocharmm.charmm_context.CharmmContext.setTemperature | ( | self, | |
| float | temperature | ||
| ) |
Sets the stored target temperature.
This method does not generate or rescale velocities.
| [in] | temperature | Python int or float accepted by ctypes.c_double, in kelvin. The native value must be finite and non-negative. |
| TypeError | If temperature cannot initialize ctypes.c_double. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native value is non-finite or negative. |
Sets the van der Waals model identifier.
The argument is normalized through VdwType. Native CharmmContext accepts values VdwType.VSH through VdwType.DBEXP.
| [in] | vdw_type | VdwType or matching integer value. |
| TypeError | If vdw_type cannot be interpreted by the enum. |
| ValueError | If it is not a declared Python enum value. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the normalized value is VdwType.NONE, no force manager is attached, or native validation fails. |
| None apocharmm.charmm_context.CharmmContext.setVelocities | ( | self, | |
| Sequence[Sequence[float]] | velocities | ||
| ) |
Sets velocity components while preserving inverse masses.
Every row must be [vx, vy, vz] in angstroms per AKMA time unit. Scalars are converted with float() and copied through a temporary C buffer.
| [in] | velocities | Sequence containing one three-value row per atom. |
| TypeError | If a row is not iterable or a scalar cannot be converted to float. |
| ValueError | If scalar conversion fails or a row does not contain exactly three values. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the row count is wrong, or native transfer fails. |
| None apocharmm.charmm_context.CharmmContext.setVelocitiesFromCHARMMVelocityFile | ( | self, | |
| FilePath | path | ||
| ) |
Loads velocities from a CHARMM velocity file.
path is encoded with os.fsencode() through encode_path() and is borrowed by the C ABI for the duration of the call. The native parser requires a matching atom count and one parseable velocity record per atom.
| [in] | path | str, bytes, or os.PathLike path accepted by os.fsencode(). |
| TypeError | If path cannot be encoded as a filesystem path. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the path is empty, the file cannot be opened or parsed, the atom count differs, or native transfer fails. |
| None apocharmm.charmm_context.CharmmContext.setVelocitiesInverseMasses | ( | self, | |
| Sequence[Sequence[float]] | velocities_inverse_masses | ||
| ) |
Sets velocities and inverse masses from nested rows.
Every row must be [vx, vy, vz, inverse_mass]. Velocity components use angstroms per AKMA time unit and inverse mass uses reciprocal atomic mass units. Scalars are converted with float() and copied through a temporary C buffer.
| [in] | velocities_inverse_masses | Sequence of four-value rows. |
| TypeError | If a row is not iterable or a scalar cannot be converted to float. |
| ValueError | If scalar conversion fails or a row does not contain exactly four values. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the atom count is unset, the row count is wrong, or native transfer fails. |
| None apocharmm.charmm_context.CharmmContext.useHolonomicConstraints | ( | self, | |
| bool | flag | ||
| ) |
Selects constrained degree-of-freedom accounting.
The value is converted with ctypes.c_bool. The native context recomputes its degree-of-freedom count but does not execute a constraint solver.
| [in] | flag | Boolean selection. |
| RuntimeError | If this context is closed. |
| ApoCharmmError | If the native context has no PSF or no force manager. |