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

Provides deterministic Nose-Hoover temperature control. More...

Inheritance diagram for apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator:
apocharmm.cuda_integrator.CudaIntegrator

Public Member Functions

None __init__ (self, float time_step)
 Constructs a Python-owned Nose-Hoover integrator.
 
None setReferenceTemperature (self, float temperature)
 Sets the Nose-Hoover reference temperature.
 
None setNoseHooverPistonMass (self, float mass)
 Sets the scalar Nose-Hoover coupling mass.
 
None useOldTemperature (self, bool flag=True)
 Selects the native on-step temperature estimator.
 
None resetAverageTemperature (self)
 Resets both running-temperature values and their sample count.
 
float getReferenceTemperature (self)
 Returns the reference temperature.
 
float getNoseHooverPistonMass (self)
 Returns the scalar Nose-Hoover coupling mass.
 
float getAverageTemperature (self)
 Returns one native running-average temperature.
 
float getInstantaneousTemperature (self)
 Returns the native selected instantaneous 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 deterministic Nose-Hoover temperature control.

The wrapper owns a concrete Nose-Hoover C handle and inherits context, restart, subscription, propagation, and closure behavior from CudaIntegrator.

See also
cuda_integrators

Constructor & Destructor Documentation

◆ __init__()

None apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.__init__ (   self,
float  time_step 
)

Constructs a Python-owned Nose-Hoover integrator.

Parameters
[in]time_stepValue accepted by ctypes.c_double, interpreted as a finite positive time step in picoseconds.
Exceptions
TypeErrorIf conversion to a C double fails.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR if construction fails.
RuntimeErrorIf native construction or base-view conversion reports success but produces a NULL handle.
Postcondition
The wrapper owns the concrete handle and stores a borrowed base view.

Reimplemented from apocharmm.cuda_integrator.CudaIntegrator.

Member Function Documentation

◆ getAverageTemperature()

float apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.getAverageTemperature (   self)

Returns one native running-average temperature.

Returns
A new Python float in kelvin.
Exceptions
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR.
Warning
Current C ABI behavior returns estimator element 0 when old-temperature mode is enabled and element 1 when it is disabled, opposite the native instantaneous-temperature selector.

◆ getInstantaneousTemperature()

float apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.getInstantaneousTemperature (   self)

Returns the native selected instantaneous temperature.

Returns
A new Python float in kelvin. Native selection uses element 1 when old-temperature mode is enabled and element 0 otherwise.
Exceptions
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorWith native status APO_STATUS_NOT_INITIALIZED before context attachment, APO_STATUS_CUDA_ERROR for transfer failure, or another documented native status.

◆ getNoseHooverPistonMass()

float apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.getNoseHooverPistonMass (   self)

Returns the scalar Nose-Hoover coupling mass.

Returns
A new Python float in the native coupling-mass convention.
Exceptions
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorIf the native handle or output operation fails.

◆ getReferenceTemperature()

float apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.getReferenceTemperature (   self)

Returns the reference temperature.

Returns
A new Python float in kelvin.
Exceptions
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorIf the native handle or output operation fails.

◆ resetAverageTemperature()

None apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.resetAverageTemperature (   self)

Resets both running-temperature values and their sample count.

Returns
None.
Exceptions
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR.

◆ setNoseHooverPistonMass()

None apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.setNoseHooverPistonMass (   self,
float  mass 
)

Sets the scalar Nose-Hoover coupling mass.

Parameters
[in]massValue converted to C double. It must be finite and non-negative. The exact dimensional convention is not established by the repository.
Returns
None.
Exceptions
TypeErrorIf C scalar conversion fails.
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT, APO_STATUS_CUDA_ERROR, or APO_STATUS_RUNTIME_ERROR.
Warning
Zero is accepted, but active propagation divides by the mass.

◆ setReferenceTemperature()

None apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.setReferenceTemperature (   self,
float  temperature 
)

Sets the Nose-Hoover reference temperature.

Parameters
[in]temperatureValue converted to C double, in kelvin. It must be finite and non-negative.
Returns
None.
Exceptions
TypeErrorIf C scalar conversion fails.
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorWith native status APO_STATUS_INVALID_ARGUMENT for an invalid value or APO_STATUS_RUNTIME_ERROR for another native failure.

◆ useOldTemperature()

None apocharmm.cuda_nose_hoover_integrator.CudaNoseHooverIntegrator.useOldTemperature (   self,
bool   flag = True 
)

Selects the native on-step temperature estimator.

Parameters
[in]flagValue converted with ctypes.c_bool. A truthy value selects kinetic-energy element 1 for native feedback and instantaneous temperature.
Returns
None.
Exceptions
TypeErrorIf C boolean conversion rejects the value.
RuntimeErrorIf the wrapper has been closed.
ApoCharmmErrorIf the native handle is rejected.