cmf_moldim: Returns dimensions of molecule

Description Usage Arguments Examples

Description

Returns dimensions of molecule

Usage

1

Arguments

mol

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
cmf_moldim <- function(mol) {
  moldim <- list()
  natoms <- length(mol$atoms)
  if (natoms > 0) {
    atom <- mol$atoms[[1]]
    moldim$xmin <- atom$x
    moldim$xmax <- atom$x
    moldim$ymin <- atom$y
    moldim$ymax <- atom$y
    moldim$zmin <- atom$z
    moldim$zmax <- atom$z
    if (natoms > 1) {
      for (iatom in 2:natoms) {
        atom <- mol$atoms[[iatom]]
        if (atom$x < moldim$xmin) moldim$xmin <- atom$x
        if (atom$x > moldim$xmax) moldim$xmax <- atom$x
        if (atom$y < moldim$ymin) moldim$ymin <- atom$y
        if (atom$y > moldim$ymax) moldim$ymax <- atom$y
        if (atom$z < moldim$zmin) moldim$zmin <- atom$z
        if (atom$z > moldim$zmax) moldim$zmax <- atom$z
      }
    }
  }
  moldim
}

conmolfields documentation built on May 2, 2019, 4:18 p.m.