seams-core v2.14.3
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
Pore geometry

Fractional density, cylindrical pore profiles, and host-guest contacts. More...

Functions

SEAMS_API seams_status seams_density_fractional (seams_system *sys, int type, int bins, int axis, const double *direction, size_t direction_len, double origin, const double *masses, size_t masses_len, double *coordinate, double *number_density, double *mass_density, double *bin_volume, size_t cap, size_t *n_out)
 Number and mass density along a cell axis or a Cartesian direction.
SEAMS_API seams_status seams_pore_frame (seams_system *sys, int framework_type, int axis, const double *direction, size_t direction_len, const double *centre_frac, size_t centre_len, double *axis_out, double *centre_out, double *centre_frac_out, int *axis_index)
 Pore axis and centre, supplied or taken from the framework.
SEAMS_API seams_status seams_pore_profiles (seams_system *sys, int type, int radial_bins, int azimuthal_bins, int axial_bins, double r_max, int axis, const double *direction, size_t direction_len, const double *centre_frac, size_t centre_len, int framework_type, double origin, const double *masses, size_t masses_len, double *radius, double *radial_number, double *radial_mass, double *radial_volume, size_t radial_cap, size_t *n_radial, double *theta, double *azimuthal_number, double *azimuthal_mass, double *azimuthal_volume, size_t azimuthal_cap, size_t *n_azimuthal, double *axial, double *axial_number, double *axial_mass, double *axial_volume, size_t axial_cap, size_t *n_axial)
 Radial, azimuthal, and axial densities about a pore axis.
SEAMS_API seams_status seams_host_guest (seams_system *sys, int guest_type, int framework_type, double cutoff, int *guest_index, int *nearest_index, int *nearest_type, double *nearest_distance, size_t guest_cap, size_t *n_guest, int *framework_types, size_t type_cap, size_t *n_types, int *contact_counts, size_t contact_cap)
 Nearest framework site and contact counts for each guest.

Detailed Description

Fractional density, cylindrical pore profiles, and host-guest contacts.

Slab and shell volumes use the triclinic cell, det(H). A fractional bin along a cell edge has volume V/n. An arbitrary direction bins the projection of the reduced cell, and each bin volume is the measure of that slice. Number density is atoms per cubic Angstrom. Mass density is the caller's mass unit per cubic Angstrom, or mass 1 when masses is NULL. A mass given in amu is therefore amu per cubic Angstrom, and multiplying by 1.66054 converts that density to grams per cubic centimetre. The library does not apply the factor.

Function Documentation

◆ seams_density_fractional()

SEAMS_API seams_status seams_density_fractional ( seams_system * sys,
int type,
int bins,
int axis,
const double * direction,
size_t direction_len,
double origin,
const double * masses,
size_t masses_len,
double * coordinate,
double * number_density,
double * mass_density,
double * bin_volume,
size_t cap,
size_t * n_out )

Number and mass density along a cell axis or a Cartesian direction.

coordinate is the bin centre in the shifted fractional coordinate, on [0, 1). Bin 0 starts at origin. origin is wrapped into [0, 1). A non-NULL direction is three Cartesian components and replaces axis. Pass NULL output columns to query the bin count.

Parameters
sysFrame handle.
typeSpecies filter. Zero keeps every atom.
binsPositive bin count.
axis0, 1, or 2. Ignored when direction is not NULL.
directionThree Cartesian components, or NULL for a cell axis.
direction_len3 when direction is not NULL. Ignored otherwise.
originFractional origin. Any finite value is wrapped into [0, 1).
massesOne mass per stored atom, or NULL for mass 1.
masses_lenLength of masses. Must equal the atom count when masses is not NULL.
coordinateBin centres, or NULL to skip.
number_densityNumber density, or NULL to skip.
mass_densityMass density in the caller's mass units per cubic Angstrom, or NULL to skip. An amu mass gives amu per cubic Angstrom; times 1.66054 that is grams per cubic centimetre.
bin_volumeBin volume in cubic Angstrom, or NULL to skip.
capCapacity of each non-NULL column.
n_outReceives the bin count.
Returns
SEAMS_OK, or SEAMS_ERR_NULL, SEAMS_ERR_STATE, SEAMS_ERR_RANGE, SEAMS_ERR_BOX, SEAMS_ERR_ARG, SEAMS_ERR_NOMEM, SEAMS_ERR_INTERNAL.
Handle access
Non-const only because the call clears the handle's error slot on entry, so seams_handle_error() reports this call. It reads the frame and keeps no scratch on the handle.
Ownership
The caller owns every buffer. The library copies nothing and keeps no pointer after the call returns.
Thread safety
Exclusive use of sys.
Example
size_t n = 0;
seams_density_fractional(sys, 0, 4, 2, NULL, 0, 0.0, NULL, 0,
NULL, NULL, NULL, NULL, 0, &n);
SEAMS_API seams_status seams_density_fractional(seams_system *sys, int type, int bins, int axis, const double *direction, size_t direction_len, double origin, const double *masses, size_t masses_len, double *coordinate, double *number_density, double *mass_density, double *bin_volume, size_t cap, size_t *n_out)
Number and mass density along a cell axis or a Cartesian direction.

◆ seams_host_guest()

SEAMS_API seams_status seams_host_guest ( seams_system * sys,
int guest_type,
int framework_type,
double cutoff,
int * guest_index,
int * nearest_index,
int * nearest_type,
double * nearest_distance,
size_t guest_cap,
size_t * n_guest,
int * framework_types,
size_t type_cap,
size_t * n_types,
int * contact_counts,
size_t contact_cap )

Nearest framework site and contact counts for each guest.

A lattice coefficient at or above 2^52, or a cell edge past the Euclidean range of binary64, returns SEAMS_ERR_RANGE. The fractional wrap is not substituted.

guest_type must be positive. framework_type 0 keeps every atom of another type. framework_type equal to guest_type is an error. nearest_distance is negative when a guest has no framework atom. A contact is a framework atom at or inside cutoff under the triclinic minimum image. contact_counts is row-major, one row per guest and one column per framework type, types sorted. Pass NULL columns to query the guest and type counts.

Parameters
sysFrame handle.
guest_typePositive guest species.
framework_typeFramework species. Zero keeps every other type. A value equal to guest_type is rejected.
cutoffContact distance in Angstrom. Zero counts only a site at the same point. Negative is rejected.
guest_indexGuest indices, or NULL to skip.
nearest_indexNearest framework index, or -1. NULL skips the column.
nearest_typeType of that site, or NULL to skip.
nearest_distanceDistance in Angstrom, or NULL to skip.
guest_capCapacity of each non-NULL guest column.
n_guestReceives the guest count.
framework_typesSorted framework types, or NULL to skip.
type_capCapacity of framework_types when that pointer is not NULL.
n_typesReceives the framework type count.
contact_countsRow-major counts, or NULL to skip.
contact_capCapacity of contact_counts. Must hold n_guest * n_types when contact_counts is not NULL.
Returns
SEAMS_OK, or SEAMS_ERR_NULL, SEAMS_ERR_STATE, SEAMS_ERR_RANGE, SEAMS_ERR_BOX, SEAMS_ERR_ARG, SEAMS_ERR_NOMEM, SEAMS_ERR_INTERNAL.
Handle access
Non-const only because the call clears the handle's error slot on entry, so seams_handle_error() reports this call. It reads the frame and keeps no scratch on the handle.
Ownership
The caller owns every column. The library keeps no pointer.
Thread safety
Exclusive use of sys.
Example
size_t ng = 0, nt = 0;
seams_host_guest(sys, 1, 0, 3.5, NULL, NULL, NULL, NULL, 0, &ng,
NULL, 0, &nt, NULL, 0);
SEAMS_API seams_status seams_host_guest(seams_system *sys, int guest_type, int framework_type, double cutoff, int *guest_index, int *nearest_index, int *nearest_type, double *nearest_distance, size_t guest_cap, size_t *n_guest, int *framework_types, size_t type_cap, size_t *n_types, int *contact_counts, size_t contact_cap)
Nearest framework site and contact counts for each guest.

◆ seams_pore_frame()

SEAMS_API seams_status seams_pore_frame ( seams_system * sys,
int framework_type,
int axis,
const double * direction,
size_t direction_len,
const double * centre_frac,
size_t centre_len,
double * axis_out,
double * centre_out,
double * centre_frac_out,
int * axis_index )

Pore axis and centre, supplied or taken from the framework.

axis 0, 1, or 2 selects that cell edge. axis -1 with direction NULL selects the longest cell edge. Any other negative axis is rejected. A non-NULL direction must be parallel to a cell edge. centre_frac NULL places the centre at the periodic centroid of the framework atoms in the perpendicular plane. framework_type 0 uses every atom for that centroid.

Parameters
sysFrame handle.
framework_typeSpecies used to place an automatic centre. Zero keeps every atom.
axis0, 1, 2, or -1 for the longest edge when direction is NULL. Any other negative value is rejected.
directionThree Cartesian components parallel to a cell edge, or NULL.
direction_len3 when direction is not NULL. Ignored otherwise.
centre_fracThree fractional coordinates, or NULL to detect the centre.
centre_len3 when centre_frac is not NULL. Ignored otherwise.
axis_outReceives the unit Cartesian axis. Three doubles.
centre_outReceives the Cartesian centre. Three doubles.
centre_frac_outReceives the fractional centre. Three doubles.
axis_indexReceives 0, 1, or 2.
Returns
SEAMS_OK, or SEAMS_ERR_NULL, SEAMS_ERR_STATE, SEAMS_ERR_RANGE, SEAMS_ERR_BOX, SEAMS_ERR_ARG, SEAMS_ERR_NOMEM, SEAMS_ERR_INTERNAL.
Handle access
Non-const only because the call clears the handle's error slot on entry, so seams_handle_error() reports this call. It reads the frame and keeps no scratch on the handle.
Ownership
The caller owns the three output arrays. Each holds three doubles. The library keeps no pointer.
Thread safety
Exclusive use of sys.
Example
double axis[3], centre[3], frac[3];
int index = -1;
seams_pore_frame(sys, 0, -1, NULL, 0, NULL, 0, axis, centre, frac, &index);
SEAMS_API seams_status seams_pore_frame(seams_system *sys, int framework_type, int axis, const double *direction, size_t direction_len, const double *centre_frac, size_t centre_len, double *axis_out, double *centre_out, double *centre_frac_out, int *axis_index)
Pore axis and centre, supplied or taken from the framework.

◆ seams_pore_profiles()

SEAMS_API seams_status seams_pore_profiles ( seams_system * sys,
int type,
int radial_bins,
int azimuthal_bins,
int axial_bins,
double r_max,
int axis,
const double * direction,
size_t direction_len,
const double * centre_frac,
size_t centre_len,
int framework_type,
double origin,
const double * masses,
size_t masses_len,
double * radius,
double * radial_number,
double * radial_mass,
double * radial_volume,
size_t radial_cap,
size_t * n_radial,
double * theta,
double * azimuthal_number,
double * azimuthal_mass,
double * azimuthal_volume,
size_t azimuthal_cap,
size_t * n_azimuthal,
double * axial,
double * axial_number,
double * axial_mass,
double * axial_volume,
size_t axial_cap,
size_t * n_axial )

Radial, azimuthal, and axial densities about a pore axis.

The axis is a cell edge, as in seams_pore_frame(). r_max 0 covers the perpendicular face. Radial bins run from 0 to r_max. The radial coordinate is the distance to the nearest periodic image of the pore axis. Within the inscribed radius of the centred face that image is the face origin. Beyond the inscribed radius a corner point can be closer to a neighbouring image, and the coordinate follows that image. The radial shell is the annulus inside the Voronoi cell of the perpendicular lattice. A circle-edge crossing that lands on a vertex stays on that edge. Azimuthal bins cover [-pi, pi) in the centred face, and each sector is clipped to that face. Azimuth zero points along the perpendicular projection of cell edge (axis + 1) mod 3, with the component parallel to the pore axis removed. The angle increases towards the pore axis crossed with that direction. The axial coordinate is the fractional cell coordinate, shifted by origin. A shell volume is that area times the edge length. Mass density is the caller's mass unit per cubic Angstrom. An amu mass gives amu per cubic Angstrom, and times 1.66054 that is grams per cubic centimetre. Pass NULL columns to query the three bin counts.

Parameters
sysFrame handle.
typeSpecies filter. Zero keeps every atom.
radial_binsPositive radial bin count.
azimuthal_binsPositive azimuthal bin count.
axial_binsPositive axial bin count.
r_maxOuter radius in Angstrom. Zero covers the face.
axis0, 1, 2, or -1 when direction is NULL. Any other negative value is rejected.
directionThree Cartesian components parallel to a cell edge, or NULL.
direction_len3 when direction is not NULL. Ignored otherwise.
centre_fracThree fractional coordinates, or NULL to detect the centre.
centre_len3 when centre_frac is not NULL. Ignored otherwise.
framework_typeSpecies for an automatic centre. Zero keeps every atom.
originFractional axial origin, wrapped into [0, 1).
massesOne mass per stored atom, or NULL for mass 1.
masses_lenLength of masses. Must equal the atom count when masses is not NULL.
radiusRadial bin centres, or NULL to skip.
radial_numberRadial number density, or NULL to skip.
radial_massRadial mass density in the caller's mass units per cubic Angstrom, or NULL to skip. An amu mass gives amu per cubic Angstrom; times 1.66054 that is grams per cubic centimetre.
radial_volumeRadial shell volume, or NULL to skip.
radial_capCapacity of each non-NULL radial column.
n_radialReceives the radial bin count.
thetaAzimuthal bin centres in radians, or NULL to skip.
azimuthal_numberAzimuthal number density, or NULL to skip.
azimuthal_massAzimuthal mass density in the caller's mass units per cubic Angstrom, or NULL to skip. An amu mass gives amu per cubic Angstrom; times 1.66054 that is grams per cubic centimetre.
azimuthal_volumeAzimuthal sector volume, or NULL to skip.
azimuthal_capCapacity of each non-NULL azimuthal column.
n_azimuthalReceives the azimuthal bin count.
axialAxial bin centres, or NULL to skip.
axial_numberAxial number density, or NULL to skip.
axial_massAxial mass density in the caller's mass units per cubic Angstrom, or NULL to skip. An amu mass gives amu per cubic Angstrom; times 1.66054 that is grams per cubic centimetre.
axial_volumeAxial slab volume, or NULL to skip.
axial_capCapacity of each non-NULL axial column.
n_axialReceives the axial bin count.
Returns
SEAMS_OK, or SEAMS_ERR_NULL, SEAMS_ERR_STATE, SEAMS_ERR_RANGE, SEAMS_ERR_BOX, SEAMS_ERR_ARG, SEAMS_ERR_NOMEM, SEAMS_ERR_INTERNAL.
Handle access
Non-const only because the call clears the handle's error slot on entry, so seams_handle_error() reports this call. It reads the frame and keeps no scratch on the handle.
Ownership
The caller owns every column. The library keeps no pointer.
Thread safety
Exclusive use of sys.
Example
size_t nr = 0, nt = 0, ns = 0;
seams_pore_profiles(sys, 0, 4, 4, 4, 0.0, 2, NULL, 0, NULL, 0, 0, 0.0, NULL, 0,
NULL, NULL, NULL, NULL, 0, &nr,
NULL, NULL, NULL, NULL, 0, &nt,
NULL, NULL, NULL, NULL, 0, &ns);
SEAMS_API seams_status seams_pore_profiles(seams_system *sys, int type, int radial_bins, int azimuthal_bins, int axial_bins, double r_max, int axis, const double *direction, size_t direction_len, const double *centre_frac, size_t centre_len, int framework_type, double origin, const double *masses, size_t masses_len, double *radius, double *radial_number, double *radial_mass, double *radial_volume, size_t radial_cap, size_t *n_radial, double *theta, double *azimuthal_number, double *azimuthal_mass, double *azimuthal_volume, size_t azimuthal_cap, size_t *n_azimuthal, double *axial, double *axial_number, double *axial_mass, double *axial_volume, size_t axial_cap, size_t *n_axial)
Radial, azimuthal, and axial densities about a pore axis.