STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::structure::MeshParameters Class Reference

Encode the critical dimensions of a regular, rectilinear mesh. The locations of mesh points as well as spacings are stored as fixed-precision integers to ensure consistency and high performance on architectures with deficient 64-bit floating point arithmetic. More...

#include <mesh_parameters.h>

Public Member Functions

template<typename T3>
T3 getMeshOriginAsTuple () const
 Get the Cartesian origin of the mesh as a tuple of floating-point numbers.
 
UnitCellType getMeshCellType () const
 Get the type of mesh cell to understand whether the cell vectors are orthogonal to one another.
 
BoundaryCondition getBoundaryConditions () const
 Get the type of boundary conditions under which the mesh operates.
 
Interpolant getStencilKind () const
 Get the type of stencil to use in producing tricubic coefficients for each mesh element.
 
template<typename Tcoord>
std::vector< Tcoord > getMeshTransform () const
 Get the entire element space matrix in any format. Real formats will have units of inverse Angstroms.
 
template<typename Tcoord>
std::vector< Tcoord > getMeshInverseTransform () const
 Get the inverse element transformation matrix in real-number format, with units of inverse Angstroms.
 
std::vector< int95_tgetMeshInverseTransformAsFP () const
 Get the inverse element transformation matrix in (authoritative) fixed-precision format.
 
int getScalingBits () const
 Get the number of bits after the decimal in this mesh's fixed-precision coordinate representations.
 
double getScalingFactor () const
 Get the scaling factor for this mesh's fixed-precision format.
 
double getInverseScalingFactor () const
 Get the inverse scaling factor for this mesh's fixed-precision format.
 
double getMaximumSpan () const
 Get the maximum distance between any two vertices of the mesh element.
 
std::string printDimensions () const
 Produce a description of the mesh element's dimensions suitable for printing.
 
MeshParamKit data () const
 Obtain the abstract for this object.
 
const MeshParametersgetSelfPointer () const
 Get a pointer to the object itself.
 
void setScalingBits (int scale_bits_in)
 Set the scaling bits. This will also update the scaling factors.
 
void defineElement (const std::vector< double > &element_vectors)
 Define the basic element coordinates using three vectors in three-dimensional space.
 
void setBoundaryCondition (BoundaryCondition boundary_in)
 Set the boundary conditions in which the mesh shall operate.
 
void setStencilKind (Interpolant stencil_kind_in)
 Set the type of stencil to be used in determining the interpolants for each mesh element.
 
 MeshParameters (int na_in, int nb_in, int nc_in, double origin_x_in, double origin_y_in, double origin_z_in, const std::vector< double > &element_vectors, int scale_bits_in=default_mesh_scaling_bits, Interpolant stencil_kind_in=Interpolant::SMOOTHNESS)
 The constructor takes formal arguments for all member variables. Variants support triclinic and orthorhombic meshes.
 
 MeshParameters (int na_in, int nb_in, int nc_in, double origin_x_in, double origin_y_in, double origin_z_in, double element_x, double element_y, double element_z, int scale_bits_in=default_mesh_scaling_bits, Interpolant stencil_kind_in=Interpolant::SMOOTHNESS)
 
 MeshParameters (int na_in, int nb_in, int nc_in, double origin_x_in, double origin_y_in, double origin_z_in, double element_width, int scale_bits_in=default_mesh_scaling_bits, Interpolant stencil_kind_in=Interpolant::SMOOTHNESS)
 
 MeshParameters (const MeshParameters &original)=default
 With no const members or pointers, the default copy and move constructors as well as copy and move assignment operators are valid.
 
 MeshParameters (MeshParameters &&original)=default
 
MeshParametersoperator= (const MeshParameters &other)=default
 
MeshParametersoperator= (MeshParameters &&other)=default
 
int getAxisElementCount (UnitCellAxis dim) const
 Get the number of points along one of the mesh axes.
 
int getAxisElementCount (CartesianDimension dim) const
 
template<typename Tcoord>
std::vector< Tcoord > getMeshOrigin () const
 Get the Cartesian origin of the mesh in floating-point numbers.
 
double getMeshOrigin (CartesianDimension dim) const
 
std::vector< int95_tgetMeshOriginAsFP () const
 Get the Cartesian origin of the mesh in fixed-precision numbers.
 
int95_t getMeshOriginAsFP (CartesianDimension dim) const
 
template<typename Tcoord>
std::vector< Tcoord > getMeshElementVector (UnitCellAxis dim) const
 Get the element vector along one of the unit cell axes in floating-point numbers.
 
template<typename Tcoord>
std::vector< Tcoord > getMeshElementVector (CartesianDimension dim) const
 
template<typename T3>
T3 getMeshElementVectorAsTuple (UnitCellAxis dim) const
 Get the element vector along one of the unit cell axes as a tuple of floating-point numbers.
 
template<typename T3>
T3 getMeshElementVectorAsTuple (CartesianDimension dim) const
 
std::vector< int95_tgetMeshElementVectorAsFP (UnitCellAxis dim) const
 Get the element vector along one of the unit cell axes in fixed precision.
 
std::vector< int95_tgetMeshElementVectorAsFP (CartesianDimension dim) const
 
std::vector< int95_tgetAxisCoordinates (UnitCellAxis mesh_axis, CartesianDimension cart_axis) const
 Get a vector of fixed-precision format coordinates of the line of grid points starting at the origin and proceeding along one of the mesh axes. One additional point is provided to put an upper bound on the final element in whatever dimension. There are nine possible outputs: Cartesian X, Y, or Z coordinates of the mesh's "a", "b", or "c" vectors.
 
void setMeshDimension (int n_in, UnitCellAxis mesh_axis)
 Set the number of mesh elements along the "a", "b", or "c" axes.
 
void setMeshDimension (const std::vector< int > &n_in)
 
void setOrigin (double v, CartesianDimension cart_axis)
 Set the origin's Cartesian X, Y, or Z coordinates.
 
void setOrigin (int95_t v, CartesianDimension cart_axis)
 
void setOrigin (const std::vector< double > &v)
 
void setOrigin (const std::vector< int95_t > &v)
 

Detailed Description

Encode the critical dimensions of a regular, rectilinear mesh. The locations of mesh points as well as spacings are stored as fixed-precision integers to ensure consistency and high performance on architectures with deficient 64-bit floating point arithmetic.

Member Function Documentation

◆ getAxisCoordinates()

std::vector< int95_t > stormm::structure::MeshParameters::getAxisCoordinates ( UnitCellAxis mesh_axis,
CartesianDimension cart_axis ) const

Get a vector of fixed-precision format coordinates of the line of grid points starting at the origin and proceeding along one of the mesh axes. One additional point is provided to put an upper bound on the final element in whatever dimension. There are nine possible outputs: Cartesian X, Y, or Z coordinates of the mesh's "a", "b", or "c" vectors.

Parameters
mesh_axisThe mesh axis of interest
cart_axisThe Cartesian axis of interest

◆ getAxisElementCount()

int stormm::structure::MeshParameters::getAxisElementCount ( UnitCellAxis dim) const

Get the number of points along one of the mesh axes.

Overloaded:

  • Accept a unit cell axis ('a', 'b', or 'c')
  • Accept a Cartesian dimension ('x', 'y', or 'z'), with x ~ a, y ~ b, z ~ c. This variant is specific to orthorhombic unit cells, but will be accepted in general cases for convenience.
Parameters
dimThe dimension of interest

◆ getMeshElementVector()

template<typename Tcoord>
std::vector< Tcoord > stormm::structure::MeshParameters::getMeshElementVector ( UnitCellAxis dim) const

Get the element vector along one of the unit cell axes in floating-point numbers.

Overloaded:

  • Accept a unit cell axis ('a', 'b', or 'c')
  • Accept a Cartesian dimension ('x', 'y', or 'z'), with x ~ a, y ~ b, z ~ c. This variant is specific to orthorhombic unit cells, but will be accepted in general cases for convenience.
Parameters
dimThe axis of interest

◆ getMeshElementVectorAsFP()

std::vector< int95_t > stormm::structure::MeshParameters::getMeshElementVectorAsFP ( UnitCellAxis dim) const

Get the element vector along one of the unit cell axes in fixed precision.

Overloaded:

  • Accept a unit cell axis ('a', 'b', or 'c')
  • Accept a Cartesian dimension ('x', 'y', or 'z'), with x ~ a, y ~ b, z ~ c. This variant is specific to orthorhombic unit cells, but will be accepted in general cases for convenience.
Parameters
dimThe axis of interest

◆ getMeshElementVectorAsTuple()

template<typename T3>
T3 stormm::structure::MeshParameters::getMeshElementVectorAsTuple ( UnitCellAxis dim) const

Get the element vector along one of the unit cell axes as a tuple of floating-point numbers.

Overloaded:

  • Accept a unit cell axis ('a', 'b', or 'c')
  • Accept a Cartesian dimension ('x', 'y', or 'z'), with x ~ a, y ~ b, z ~ c. This variant is specific to orthorhombic unit cells, but will be accepted in general cases for convenience.
Parameters
dimThe axis of interest

◆ getMeshOrigin()

template<typename Tcoord>
std::vector< Tcoord > stormm::structure::MeshParameters::getMeshOrigin ( ) const

Get the Cartesian origin of the mesh in floating-point numbers.

Overloaded:

  • Get a three-element vector of all three Cartesian coordinates
  • Get a particular Cartesian coordinate of the origin
Parameters
dimThe specific Cartesian axis of interest

◆ getMeshOriginAsFP()

std::vector< int95_t > stormm::structure::MeshParameters::getMeshOriginAsFP ( ) const

Get the Cartesian origin of the mesh in fixed-precision numbers.

Overloaded:

  • Get a three-element vector of all three Cartesian coordinates
  • Get a particular Cartesian coordinate of the origin
Parameters
dimThe specific Cartesian axis of interest

◆ setBoundaryCondition()

void stormm::structure::MeshParameters::setBoundaryCondition ( BoundaryCondition boundary_in)

Set the boundary conditions in which the mesh shall operate.

Parameters
boundary_inThe choice of boundary condition

◆ setMeshDimension()

void stormm::structure::MeshParameters::setMeshDimension ( int n_in,
UnitCellAxis mesh_axis )

Set the number of mesh elements along the "a", "b", or "c" axes.

Overloaded::

  • Set one dimension or all three
Parameters
n_inThe dimension or dimensions to set
mesh_axisThe mesh axis to define

◆ setOrigin()

void stormm::structure::MeshParameters::setOrigin ( double v,
CartesianDimension cart_axis )

Set the origin's Cartesian X, Y, or Z coordinates.

Overloaded::

  • Provide a real-valued number in Angstroms
  • Provide a fixed-precision value
  • Set one coordinate or all three
Parameters
vThe origin coordinate
cart_axisThe axis to set the origin along

◆ setScalingBits()

void stormm::structure::MeshParameters::setScalingBits ( int scale_bits_in)

Set the scaling bits. This will also update the scaling factors.

Parameters
scale_bits_inThe number of bis after the decimal

◆ setStencilKind()

void stormm::structure::MeshParameters::setStencilKind ( Interpolant stencil_kind_in)

Set the type of stencil to be used in determining the interpolants for each mesh element.

Parameters
stencil_kind_inThe choice of stencil

The documentation for this class was generated from the following files: