RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
Atom Struct Referenceexport
module atom

Represents an atom in the simulation system. More...

Public Member Functions

 Atom () noexcept=default
 Default constructor for the Atom struct.
 
 Atom (double3 position, double charge, double scalingVDW, double scalingCoulomb, std::uint32_t moleculeId, std::uint16_t type, std::uint8_t componentId, std::uint8_t groupId, std::uint8_t isFractional)
 Constructs an Atom with specified parameters.
 
 Atom (double3 position, double charge, double lambda, std::uint32_t moleculeId, std::uint16_t type, std::uint8_t componentId, std::uint8_t groupId, std::uint8_t isFractional)
 Constructs an Atom with lambda-dependent scaling.
 
void setScaling (double lambda)
 Sets the scaling factors based on lambda.
 
void setScalingFullyOn ()
 Fully activates scaling factors.
 
void setScalingFullyOff ()
 Fully deactivates scaling factors.
 
void setScalingToInteger ()
 Sets scaling factors to integer values.
 
std::string repr () const
 Returns a string representation of the Atom.
 

Public Attributes

double3 position
 The position of the atom in 3D space.
 
double3 velocity {}
 The velocity of the atom.
 
double3 gradient {}
 The gradient acting on the atom.
 
double charge
 The electric charge of the atom.
 
double scalingVDW {1.0}
 Scaling factor for van der Waals interactions.
 
double scalingCoulomb {1.0}
 Scaling factor for Coulomb interactions.
 
std::uint32_t moleculeId {0}
 Identifier for the molecule this atom belongs to.
 
std::uint16_t type {0}
 Type identifier of the atom.
 
std::uint8_t componentId {0}
 Component identifier within the system.
 
std::uint8_t groupId: 4
 Group identifier, defaults to false.
 
std::uint8_t isFractional: 4
 Fractional or not, defaults to false.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const Atom &atom)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, Atom &atom)
 
void to_json (nlohmann::json &, const Atom &)
 
void from_json (const nlohmann::json &, Atom &)
 

Detailed Description

Represents an atom in the simulation system.

The Atom struct encapsulates the properties and behaviors of an individual atom within the simulation. It includes positional data, velocity, gradient, charge, scaling factors for van der Waals and Coulomb interactions, and identifiers for molecule, type, component, and group associations. The struct provides constructors for initializing atoms and methods to adjust scaling parameters dynamically. Atom class type should have exactly a size of 128 bytes (4 times double4).

Constructor & Destructor Documentation

◆ Atom() [1/3]

Atom::Atom ( )
defaultnoexcept

Default constructor for the Atom struct.

Initializes an Atom object with default values.

◆ Atom() [2/3]

Atom::Atom ( double3  position,
double  charge,
double  scalingVDW,
double  scalingCoulomb,
std::uint32_t  moleculeId,
std::uint16_t  type,
std::uint8_t  componentId,
std::uint8_t  groupId,
std::uint8_t  isFractional 
)
inline

Constructs an Atom with specified parameters.

Initializes an Atom with the provided position, charge, scaling factors, molecule ID, type, component ID, and group ID.

Parameters
positionThe initial position of the atom.
chargeThe electric charge of the atom.
scalingVDWScaling factor for van der Waals interactions.
scalingCoulombScaling factor for Coulomb interactions.
moleculeIdIdentifier for the molecule.
typeType identifier of the atom.
componentIdComponent identifier within the system.
groupIdGroup identifier, defaults to false.

◆ Atom() [3/3]

Atom::Atom ( double3  position,
double  charge,
double  lambda,
std::uint32_t  moleculeId,
std::uint16_t  type,
std::uint8_t  componentId,
std::uint8_t  groupId,
std::uint8_t  isFractional 
)
inline

Constructs an Atom with lambda-dependent scaling.

Initializes an Atom with position, charge, and scaling factors determined by the provided lambda value. Also sets molecule ID, type, component ID, and group ID.

Parameters
positionThe initial position of the atom.
chargeThe electric charge of the atom.
lambdaThe scaling parameter for interactions.
moleculeIdIdentifier for the molecule.
typeType identifier of the atom.
componentIdComponent identifier within the system.
groupIdGroup identifier, defaults to false.

Member Function Documentation

◆ repr()

std::string Atom::repr ( ) const
inline

Returns a string representation of the Atom.

Generates a string that includes the position coordinates and identifiers associated with the atom.

Returns
A string representing the Atom.

◆ setScaling()

void Atom::setScaling ( double  lambda)
inline

Sets the scaling factors based on lambda.

Adjusts the scaling factors for van der Waals and Coulomb interactions linearly based on the provided lambda value. Scaling for van der Waals is active from 0 to 0.5, and Coulomb scaling is active from 0.5 to 1.0.

Parameters
lambdaThe scaling parameter.

◆ setScalingFullyOff()

void Atom::setScalingFullyOff ( )
inline

Fully deactivates scaling factors.

Sets both van der Waals and Coulomb scaling factors to 0.0, fully deactivating the interactions.

◆ setScalingFullyOn()

void Atom::setScalingFullyOn ( )
inline

Fully activates scaling factors.

Sets both van der Waals and Coulomb scaling factors to 1.0, fully activating the interactions.

◆ setScalingToInteger()

void Atom::setScalingToInteger ( )
inline

Sets scaling factors to integer values.

Sets both van der Waals and Coulomb scaling factors to 1.0 and resets the group ID to 0.


The documentation for this struct was generated from the following file: