/*---------------------------diags.h-------------------------------
  This file defines data structures used throughout the tbtools
  package. This software was written by Stephen Jordan.
  -----------------------------------------------------------------*/

#ifndef _DIAGS_H
#define _DIAGS_H

/*Diags is short for diagnostics.  This structure keeps track of important
  statistics about the molecular dynamics run.  It is also used to collect
  data from the run. To get max_f, calculate looks at the forces on all of
  the atoms in the final relaxed structure of a given stage and stores the
  one with the largest absolute value in max_f.  Thus the size of max_f is
  an inverse indication of the quality of relaxation of the final
  structure. The element tb_energy is the total Tersoff-Brenner energy of
  the final structure.  The array obj_energy contaings the energies
  associated with all of the forcers (LJ_Plane, LJ_Ball, etc.). The element
  maxiter is the total number of iterations used   in whatever stage is
  being described by the diags structure.  The element cm gives the
  coordinates of the center of mass of the relaxed structure, and the
  tip_force gives the net force of the tip forcer on the final relaxed
  structure.  Which forcer is considered the tip is defined in the defs
  structure. The array s_max_f contains the largest force generated by each
  forcer. All units are in Angstroms, eV, and Seconds.*/

 
typedef struct {
  double s_max_f[64];
  double obj_energy[64];
  double max_f;
  double tb_energy;
  int iter;
  double cm[3];
  double tip_force[3];
}diags;

#include "defs.h"  //for defs
#include <stdio.h> //for FILE

void logdiags(const diags *dia, const defs *d);

void datalog(diags *dia, defs *d, int stage);
#endif

