voro

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConeBlock

func ConeBlock(ref, test *VPlane, ati, atj *v3.Matrix, cutoff float64, angles []float64, testname ...string) bool

Test if the path between ati and the ref plane is blocked by the test plane it will scan cones at increasing angles from the ati-atj vector(from 0 to angles[0] degrees, where angles[0] should be <90) in angle[1] steps. This is a brute-force, very slow and clumsy system. But hey, I'm a chemist. I'll change it when a) there is a pure Go 3D-Voronoi library or b) I find the time to study computational geometry.

Types

type AngleScan

type AngleScan struct {
	VdwFactor float64
	Offset    float64
	Angles    []float64 //last angle, step between angles, in degrees. A full scan would be 0 to 90
	Cutoff    float64   //distance cutoff, if the vectors at the given angle are farther than this, the angle is ignored.
	Test      bool      //for debugging
}

AngleScan contains options to perform angle scans to see if there is an angle in which 2 atoms are in direct contact (i.e. if part of the plane bisecting them is part of the Voronoi polihedra for the system).

func DefaultAngleScan

func DefaultAngleScan() *AngleScan

DefaultAngleScan returns the default setting for an AngleScan

type VPSlice

type VPSlice []*VPlane

VPSlice contains a slice to pointers to VPlane.

func GetPlanes

func GetPlanes(atoms *v3.Matrix, mol chem.Atomer, cutoff float64, noHs ...bool) VPSlice

get all planes between all possible pairs of atoms which are not farther away from each other than cutoff

func (VPSlice) AtomPlanes

func (P VPSlice) AtomPlanes(i int) VPSlice

AtomPlanes returns all the planes that bisect the atom with index i, and any other atom.

func (VPSlice) Contact

func (P VPSlice) Contact(coords *v3.Matrix, i, j int, anglest ...*AngleScan) bool

Determines whether vectors i and j from coords are in contact, by checking that no plane is closer to i than the plane bisecting the ij vector, along some direction with an angle smaller than 90 degrees from the direction along the ij vector. This function is safe for concurrent use.

func (VPSlice) PairPlane

func (P VPSlice) PairPlane(i, j int) *VPlane

PairPlane returns the plane bisecting the atoms with indexes i and j.

func (VPSlice) VdwContact

func (P VPSlice) VdwContact(coords *v3.Matrix, mol chem.Atomer, i, j int, scan ...*AngleScan) bool

Determines whether 2 atoms are in contact, using the sum of their vdW radii (multiplied by an optional factor, 1.2 by default), as a cutoff.

type VPlane

type VPlane struct {
	Atoms      []int   //indexes of the 2 atoms.
	Distance   float64 //The plane is equidistant from both atoms, so there is only one distance
	Normal     *v3.Matrix
	Offset     *v3.Matrix
	NotContact bool //true if this plane is a confirmed non-contact
}

The plane bisecting 2 atoms With all the info we might want from it.

func PlaneBetweenAtoms

func PlaneBetweenAtoms(at1, at2 *v3.Matrix, i, j int) *VPlane

func (*VPlane) DistanceInterVector

func (V *VPlane) DistanceInterVector(o, d *v3.Matrix) float64

DistanceInterVector obtains the distance from a point o to the plane in the direction of d. It returns -1 if the vector never intersects the plane.

func (*VPlane) OtherAtom

func (V *VPlane) OtherAtom(i int) int

OtherAtom, given the index of one of the atoms bisected by the plane,returns the index of the other atom.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL