util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package util contains some methods that can be used by every other package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header(r *bufio.Reader, w io.Writer, readSlice func(r *bufio.Reader, w io.Writer) []byte) (atoms int, box [3]float64, err error)

Header corresponds to the lines specific to a Lammps trajectory file. It contains the size of the box and the number of atoms. This method returns the number of atoms, the size of the box, the size of the box divided by two.

func HeaderBox

func HeaderBox(r *bufio.Reader, w io.Writer, readSlice func(r *bufio.Reader, w io.Writer) []byte) (box [3]float64, err error)

HeaderBox returns the box size.

func HeaderWOutAtoms

func HeaderWOutAtoms(r *bufio.Reader, w io.Writer, readSlice func(r *bufio.Reader, w io.Writer) []byte) (box [3]float64, err error)

HeaderWOutAtoms returns the size of the box, the size of the box divided by two. It is like HeaderBox but without the number of atoms.

func Pow

func Pow(x float64, n int) float64

Pow returns x**y, the base-x exponential of y.

func ReadCfgNonCvg

func ReadCfgNonCvg(r *bufio.Reader, x int) error

ReadCfgNonCvg reads x non converged configurations. These non configurations will be automatically "discarded" and won't be taken into account. It is a very fast method.

func Write

func Write(path string, structure interface{}) (*os.File, error)

Write writes the output file according to a specific scheme. It writes the date, parses the structure in a TOML format and writes it. This method returns the file for further writing. It must be closed at the end of the calculation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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