apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator Class Reference

Provides stochastic Langevin temperature control. More...

Inheritance diagram for apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator:
apocharmm.cuda_integrator.CudaIntegrator

Public Member Functions

None __init__ (self, float time_step)
 Constructs a Python-owned Langevin thermostat integrator.
 
None setReferenceTemperature (self, float temperature)
 Sets the thermostat reference temperature.
 
None setThermostatFriction (self, float friction)
 Sets the thermostat friction coefficient.
 
None setThermostatRngSeed (self, int seed)
 Sets the thermostat RNG seed.
 
None resetAverageTemperature (self)
 Resets both running-temperature values and their sample count.
 
float getReferenceTemperature (self)
 Returns the reference temperature.
 
float getThermostatFriction (self)
 Returns the thermostat friction coefficient.
 
int getThermostatRngSeed (self)
 Returns the thermostat RNG seed.
 
float getAverageTemperature (self)
 Returns the three-point running-average temperature.
 
float getInstantaneousTemperature (self)
 Returns the instantaneous three-point temperature.
 
- Public Member Functions inherited from apocharmm.cuda_integrator.CudaIntegrator
ctypes.c_void_p integrator_handle (self)
 Returns the borrowed C base-integrator pointer.
 
None close (self)
 Closes the concrete handle and invalidates the base view.
 
None setTimeStep (self, float time_step)
 Sets the public integrator time step.
 
None setCharmmContext (self, CharmmContext context)
 Attaches a context and initializes concrete native state.
 
None subscribe (self, Subscriber subscriber)
 Subscribes one output wrapper.
 
None unsubscribe (self, Subscriber subscriber)
 Removes one subscriber from native and Python scheduling state.
 
None propagate (self, int num_steps)
 Propagates dynamics and scheduled subscribers.
 
None initializeFromRestartFile (self, FilePath path)
 Initializes concrete state from a restart file.
 

Detailed Description

Provides stochastic Langevin temperature control.

The wrapper owns a concrete thermostat C handle. Native state includes one Philox generator per context atom and two kinetic and temperature estimators.

See also
cuda_integrators

Constructor & Destructor Documentation

◆ __init__()

None apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.__init__ (   self,
float  time_step 
)

Constructs a Python-owned Langevin thermostat integrator.

Parameters
[in]time_stepValue converted to C double, interpreted as a finite positive time step in picoseconds.
Exceptions
TypeErrorIf C scalar conversion fails.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR.
RuntimeErrorIf a successful native call produces a NULL concrete or base-view handle.

Reimplemented from apocharmm.cuda_integrator.CudaIntegrator.

Member Function Documentation

◆ getAverageTemperature()

float apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.getAverageTemperature (   self)

Returns the three-point running-average temperature.

Returns
A new Python float containing native estimator element 0 in kelvin.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorWith native status APO_STATUS_CUDA_ERROR for transfer failure, APO_STATUS_RUNTIME_ERROR for an invalid native array shape, or another documented native status.

◆ getInstantaneousTemperature()

float apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.getInstantaneousTemperature (   self)

Returns the instantaneous three-point temperature.

Returns
A new Python float in kelvin, derived from kinetic-energy element 0.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorWith native status APO_STATUS_NOT_INITIALIZED before context attachment, APO_STATUS_CUDA_ERROR for transfer failure, or APO_STATUS_RUNTIME_ERROR for an invalid native array shape.

◆ getReferenceTemperature()

float apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.getReferenceTemperature (   self)

Returns the reference temperature.

Returns
A new Python float in kelvin.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf native validation or output fails.

◆ getThermostatFriction()

float apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.getThermostatFriction (   self)

Returns the thermostat friction coefficient.

Returns
A new Python float in inverse picoseconds.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf native validation or output fails.

◆ getThermostatRngSeed()

int apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.getThermostatRngSeed (   self)

Returns the thermostat RNG seed.

Returns
A new non-negative Python int in the uint64 range.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf native validation or output fails.

◆ resetAverageTemperature()

None apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.resetAverageTemperature (   self)

Resets both running-temperature values and their sample count.

Returns
None.
Exceptions
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf native validation or device reset fails.

◆ setReferenceTemperature()

None apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.setReferenceTemperature (   self,
float  temperature 
)

Sets the thermostat reference temperature.

Parameters
[in]temperatureValue converted to C double, in kelvin. It must be finite and non-negative.
Returns
None.
Exceptions
TypeErrorIf conversion fails.
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf native validation or execution fails.

◆ setThermostatFriction()

None apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.setThermostatFriction (   self,
float  friction 
)

Sets the thermostat friction coefficient.

Parameters
[in]frictionValue converted to C double, in inverse picoseconds. It must be finite and non-negative.
Returns
None.
Exceptions
TypeErrorIf conversion fails.
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR.
Note
Before the first propagation request, changing friction after context attachment reruns native concrete initialization.

◆ setThermostatRngSeed()

None apocharmm.cuda_langevin_thermostat_integrator.CudaLangevinThermostatIntegrator.setThermostatRngSeed (   self,
int  seed 
)

Sets the thermostat RNG seed.

Parameters
[in]seedPython integer in [0, 2**64 - 1]. The value is converted to ctypes.c_uint64.
Returns
None.
Exceptions
TypeErrorIf comparison or unsigned conversion rejects the object.
ValueErrorIf the integer is outside the uint64 range.
RuntimeErrorIf the wrapper is closed.
ApoCharmmErrorIf attached-context RNG allocation or initialization fails.
Postcondition
The current native sequence position is preserved.