Gromacs  2025-dev-20240522-e0c89b3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
boxutilities.cpp File Reference
#include "gmxpre.h"
#include "gromacs/pbcutil/boxutilities.h"
#include <algorithm>
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/math/vectypes.h"
+ Include dependency graph for boxutilities.cpp:


Implements routines in boxutilities.h.

Utility functions for handling boxes.


void do_box_rel (int ndim, const matrix deform, matrix box_rel, matrix b, bool bInit)
 Change box components to preserve the relative box shape. More...
bool gmx::anonymous_namespace{boxutilities.cpp}::boxElementEqual (real element1, real element2)
 Whether two box elements are equal (with a tolerance).
bool gmx::boxesAreEqual (const matrix box1, const matrix box2)
 Returns whether two boxes are of equal size and shape (within reasonable tolerance).
bool gmx::boxIsZero (const matrix box)
 Returns whether a box is only initialised to zero or not.

Function Documentation

void do_box_rel ( int  ndim,
const matrix  deform,
matrix  box_rel,
matrix  b,
bool  bInit 

Change box components to preserve the relative box shape.

Typically used with bInit set to false, in which case it changes box components to b[XX][XX]*box_rel to preserve the relative box shape. If bInit is true, then the values in b are used to set those in box_rel so that subsquent calls can use that box_rel to adjust b to maintain a consistent box.