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

Represents a framework in the simulation system. More...

Collaboration diagram for Framework:

Public Types

enum class  UseChargesFrom : std::size_t { PseudoAtoms = 0 , CIF_File = 1 , ChargeEquilibration }
 Enumeration for specifying the source of atomic charges. More...
 

Public Member Functions

 Framework ()
 Default constructor for the Framework struct.
 
 Framework (std::size_t currentComponent, const ForceField &forceField, const std::string &componentName, std::optional< const std::string > fileName, std::optional< int3 > numberOfUnitCells, Framework::UseChargesFrom useChargesFrom) noexcept(false)
 Constructs a Framework from a file with specified parameters.
 
 Framework (std::size_t componentId, const ForceField &forceField, std::string componentName, SimulationBox simulationBox, std::size_t spaceGroupHallNumber, std::vector< Atom > definedAtoms, int3 numberOfUnitCells) noexcept(false)
 Constructs a Framework programmatically with specified parameters.
 
void readFramework (const ForceField &forceField, const std::string &fileName)
 Reads framework data from a file.
 
void expandDefinedAtomsToUnitCell ()
 Expands defined atoms to fill the unit cell using symmetry operations.
 
void makeSuperCell ()
 Constructs the supercell by replicating the unit cell atoms.
 
std::vector< AtommakeSuperCell (int3 numberOfCells) const
 
std::vector< double3 > fractionalAtomPositionsUnitCell () const
 
std::vector< double2 > atomUnitCellLennardJonesPotentialParameters (const ForceField &forceField) const
 
std::optional< double > computeLargestNonOverlappingFreeRadius (const ForceField &forceField, double3 probe_position, double well_depth_factor) const
 
bool computeVanDerWaalsRadiusOverlap (const ForceField &forceField, double3 probe_position) const
 
bool computeOverlap (const ForceField &forceField, double3 probe_position, double well_depth_factor, std::size_t probe_type, std::make_signed_t< std::size_t > skip) const
 
std::string printStatus (const ForceField &forceField) const
 Generates a string representation of the framework status.
 
std::string printBreakthroughStatus () const
 Generates a string representation of the breakthrough status.
 
nlohmann::json jsonStatus () const
 Generates a JSON representation of the framework status.
 
std::string repr () const
 Returns a string representation of the Framework.
 

Public Attributes

std::uint64_t versionNumber {1}
 Version number for serialization purposes.
 
SimulationBox simulationBox
 Simulation box defining the unit cell dimensions.
 
std::size_t spaceGroupHallNumber {1}
 Space group number according to the Hall notation.
 
int3 numberOfUnitCells {1, 1, 1}
 Number of unit cells in each dimension for the supercell.
 
std::size_t frameworkId {0}
 Identifier for the framework.
 
std::string name {}
 Name of the framework component.
 
std::optional< std::string > filenameData {}
 Optional file name containing framework data.
 
std::string filename {}
 File name of the framework.
 
std::size_t numberOfComponents {1}
 
bool rigid {true}
 Flag indicating if the framework is rigid.
 
double mass {0.0}
 Total mass of the framework.
 
double unitCellMass {0.0}
 Mass of the unit cell.
 
UseChargesFrom useChargesFrom {UseChargesFrom::PseudoAtoms}
 Source of atomic charges.
 
double netCharge {0.0}
 Net charge of the framework.
 
double smallestCharge {0.0}
 Smallest atomic charge in the framework.
 
double largestCharge {0.0}
 Largest atomic charge in the framework.
 
std::vector< AtomdefinedAtoms {}
 Fractional Atoms defining the unit cell before symmetry operations.
 
std::vector< AtomunitCellAtoms
 Fractional atoms in the unit cell after applying symmetry operations.
 
std::vector< Atomatoms {}
 All Cartesian atoms in the framework after constructing the supercell.
 
std::vector< std::size_t > chiralCenters {}
 Indices of chiral centers in the framework.
 
std::vector< BondPotentialbonds {}
 Bonds within the framework.
 
std::vector< std::pair< std::size_t, std::size_t > > bondDipoles {}
 Pairs of atoms forming bond dipoles.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t > > bends {}
 Triplets of atoms forming angle bends.
 
std::vector< std::pair< std::size_t, std::size_t > > UreyBradley {}
 Pairs of atoms for Urey-Bradley interactions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > inversionBends {}
 Quartets of atoms for inversion bends.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > Torsion {}
 Quartets of atoms forming torsions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > ImproperTorsions {}
 Quartets of atoms forming improper torsions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t > > bondBonds {}
 Triplets of atoms for bond-bond interactions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t > > stretchBends {}
 Triplets of atoms for stretch-bend interactions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > bendBends {}
 Quartets of atoms for bend-bend interactions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > stretchTorsions {}
 Quartets of atoms for stretch-torsion interactions.
 
std::vector< std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > > bendTorsions {}
 Quartets of atoms for bend-torsion interactions.
 
std::vector< std::pair< std::size_t, std::size_t > > intraVDW {}
 Pairs of atoms for intramolecular van der Waals interactions.
 
std::vector< std::pair< std::size_t, std::size_t > > intraCoulomb {}
 Pairs of atoms for intramolecular Coulomb interactions.
 
std::vector< std::pair< std::size_t, std::size_t > > excludedIntraCoulomb {}
 Pairs of atoms excluded from intramolecular Coulomb interactions.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const Framework &c)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, Framework &c)
 

Detailed Description

Represents a framework in the simulation system.

The Framework struct encapsulates the properties and behaviors of a framework (e.g., a solid lattice or crystalline structure) within the simulation. It includes information about the simulation box, atoms within the framework, and various structural and force field parameters. The struct provides constructors for initializing frameworks from files or programmatically, and methods to process and output framework data.

Member Enumeration Documentation

◆ UseChargesFrom

enum class Framework::UseChargesFrom : std::size_t
strong

Enumeration for specifying the source of atomic charges.

UseChargesFrom defines the source from which atomic charges should be obtained. Options include using charges from pseudo-atoms, the CIF file, or by performing charge equilibration calculations.

Enumerator
PseudoAtoms 

Use charges from pseudo-atoms defined in the force field.

CIF_File 

Use charges specified in the CIF file.

ChargeEquilibration 

Compute charges using charge equilibration methods.

Constructor & Destructor Documentation

◆ Framework() [1/3]

Framework::Framework ( )

Default constructor for the Framework struct.

Initializes an empty Framework object with default values.

◆ Framework() [2/3]

Framework::Framework ( std::size_t  currentComponent,
const ForceField forceField,
const std::string &  componentName,
std::optional< const std::string >  fileName,
std::optional< int3 >  numberOfUnitCells,
Framework::UseChargesFrom  useChargesFrom 
)

Constructs a Framework from a file with specified parameters.

Initializes a Framework using data from a specified file, setting up the simulation box, atoms, and other properties based on the provided force field and unit cell information.

Parameters
currentComponentIdentifier for the current framework component.
forceFieldReference to the force field containing pseudo-atom definitions.
componentNameName of the framework component.
fileNameOptional file name containing framework data (e.g., a CIF file).
numberOfUnitCellsNumber of unit cells in each dimension to construct the supercell.
useChargesFromSource of atomic charges (pseudo-atoms, CIF file, or charge equilibration).

◆ Framework() [3/3]

Framework::Framework ( std::size_t  componentId,
const ForceField forceField,
std::string  componentName,
SimulationBox  simulationBox,
std::size_t  spaceGroupHallNumber,
std::vector< Atom definedAtoms,
int3  numberOfUnitCells 
)

Constructs a Framework programmatically with specified parameters.

Initializes a Framework using provided simulation box, space group number, defined atoms, and unit cell information, allowing for programmatic creation of frameworks without file input.

Parameters
componentIdIdentifier for the framework component.
forceFieldReference to the force field containing pseudo-atom definitions.
componentNameName of the framework component.
simulationBoxSimulation box defining the unit cell dimensions.
spaceGroupHallNumberSpace group number according to the Hall notation.
definedAtomsVector of atoms defining the positions and types within the unit cell.
numberOfUnitCellsNumber of unit cells in each dimension to construct the supercell.

Member Function Documentation

◆ expandDefinedAtomsToUnitCell()

void Framework::expandDefinedAtomsToUnitCell ( )

Expands defined atoms to fill the unit cell using symmetry operations.

Applies space group symmetry operations to the defined atoms to generate all atoms within the unit cell.

◆ jsonStatus()

nlohmann::json Framework::jsonStatus ( ) const

Generates a JSON representation of the framework status.

Creates a JSON object containing detailed information about the framework, suitable for serialization or logging.

Returns
A JSON object representing the framework status.

◆ makeSuperCell()

void Framework::makeSuperCell ( )

Constructs the supercell by replicating the unit cell atoms.

Generates the full framework structure by replicating the unit cell atoms according to the specified number of unit cells in each dimension.

◆ printBreakthroughStatus()

std::string Framework::printBreakthroughStatus ( ) const

Generates a string representation of the breakthrough status.

Returns
A string representing the breakthrough status.

◆ printStatus()

std::string Framework::printStatus ( const ForceField forceField) const

Generates a string representation of the framework status.

Creates a formatted string containing detailed information about the framework, including atom types, positions, charges, and bond information.

Parameters
forceFieldReference to the force field containing pseudo-atom definitions.
Returns
A string representing the framework status.

◆ readFramework()

void Framework::readFramework ( const ForceField forceField,
const std::string &  fileName 
)

Reads framework data from a file.

Reads the framework structure, including atoms and simulation box, from the specified file, applying symmetry operations and setting up the framework for simulation.

Parameters
forceFieldReference to the force field containing pseudo-atom definitions.
fileNameFile name containing the framework data (e.g., a CIF file).

◆ repr()

std::string Framework::repr ( ) const

Returns a string representation of the Framework.

Generates a string that includes the framework's ID, name, number of atoms, net charge, mass, and other relevant information.

Returns
A string representing the Framework.

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