template class rgpot::registry

Overview

Static registry for instance tracking and statistics. More…

#include <PotHelpers.hpp>
 
template <typename T>
class registry {
public:
    // fields
 
    static std::atomic<size_t> count;
    static std::atomic<size_t> forceCalls;
    static T* head;
    T* prev;
    T* next;
 
    // methods
 
    static void incrementForceCalls();
 
protected:
    // construction
 
    ~registry();
};

Detailed Documentation

Static registry for instance tracking and statistics.

The registry uses a linked list to track all active instances of a derived potential class.

Fields

static std::atomic<size_t> count

Total number of active instances.

Statistics counters are atomic: force evaluations run concurrently from NEB image / dimer endpoint threads. The instance linked list is NOT concurrency-safe — construct and destroy potentials from one thread (setup paths), only evaluate them concurrently.

static std::atomic<size_t> forceCalls

Global counter for force evaluations.

static T* head

Pointer to the head of the linked list.

T* prev

Pointer to the previous instance in the list.

T* next

Pointer to the next instance in the list.

Construction

~registry()

Destructor.

Methods

static void incrementForceCalls()

Increments the force call counter.

Returns:

Void.