# [−]Struct lumol::sim::output::CustomOutput

pub struct CustomOutput { /* fields omitted */ }

The CustomOutput writes data into a file from an user-provided template.

The template string can contain mathematical expressions, using some physical properties of the system. These mathematical expressions must be enclosed in braces ({}). Here are some examples:

• A constant string is reproduced as it is: some data;
• Anything in braces is replaced by the corresponding values: {pressure} {volume};
• Mathematical operators are allowed in braces: {pressure / volume}. You can use +, -, /, *, ^ for exponentiation and parentheses;
• Some properties are arrays of atomic properties {x[0] + y[20]};
• Finally, all the properties are given in the internal units. One can specify another unit: x[0] / nm.

Here is a list of all accepted properties:

• Atomic properties: x, y and z for cartesian coordinates, vx, vy and vz for cartesian components of the velocity , mass for the atomic mass, charge for the atomic charge.
• Physical properties: pressure, volume, temperature, natoms, stress tensor components: stress.xx, stress.yy, stress.zz, stress.xy, stress.xz, stress.yz, simulation step.
• Unit Cell properties: cell.a, cell.b, cell.c are the unit cell vector lengths; cell.alpha, cell.beta and cell.gamma are the unit cell angles.

## Implementations

### impl CustomOutput

#### pub fn new<P>(    filename: P,     template: &str) -> Result<CustomOutput, CustomOutputError> where    P: AsRef<Path>,

Create a new CustomOutput writing to the file at filename using the given template. The template is only partially validated at this stage.

## Blanket Implementations

### impl<T> Pointable for T

#### type Init = T

The type for initializers.

### impl<T, U> TryFrom<U> for T where    U: Into<T>, [src]

#### type Error = Infallible

The type returned in the event of a conversion error.

### impl<T, U> TryInto<U> for T where    U: TryFrom<T>, [src]

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.