/*
    DFT++ is a density functional package developed by the research group
    of Professor Tomas Arias

    Copyright 1996-2003 Sohrab Ismail-Beigi

    This file is part of DFT++.

    DFT++ is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    DFT++ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with DFT++; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    Please see the file CREDITS for a list of authors.

    For academic users, we request that publications using results obtained with
    this software reference

    "New algebraic formulation of density functional calculation," by Sohrab Ismail-Beigi
    and T.A. Arias, Computer Physics Communications 128:1-2, 1-45 (June 2000).

    and, if using the wavelet basis, further reference

    "Multiresolution analysis of electronic structure: semicardinal and wavelet bases,"
    T.A. Arias, Reviews of Modern Physics 71:1, 267-311 (January 1999).

    and 

    "Robust ab initio calculation of condensed matter: transparent convergence through
    semicardinal multiresolution analysis,'' I.P. Daykov, T.A. Arias, and
    Torkel D. Engeness, Physical Review Letters, 90:21, 216402 (May 2003).

    For your convenience, preprints of the above articles may be obtained from
    http://arXiv.org/abs/cond-mat/9909130, 9805262, and 0204411, respectively.
*/

/*-----------------------  Everything  ----------------------------------*
 *                                                                       *
 * One big structure that containts everthing we need to run a           *
 * a calculation (or do setup).  Used to make passing all the damned     *
 * arguments to functions easier.                                        *
 *                                                                       *
 *-----------------------------------------------------------------------*/

#ifndef DFT_EVERYTHING_H
#define DFT_EVERYTHING_H

class Everything
{
public:

  // The lattice vectors describing the periodic system
  // the scaling from the input file specified by `latt-scale'
  // is included.
  Lattice    lattice;

  // Parameters and flags controlling the electronic minimization
  Control    cntrl;

  // Parameters for the basis.
  BasisSpec  basis_spec;

  // Ionic information
  Ioninfo    ioninfo;

  // Symmetries of the lattice, crystal basis and k points
  Symmetries symm;

  // Ion dynamics information
  // IonDyninfo iondyninfo;

  // Static parameters for the electrons
  Elecinfo   elecinfo;

  // Dynamic variables describing the electrons
  Elecvars   elecvars;

  // Container for the energies
  Energies   energies;



  // Constructor:  all objects own constructors will do everything
  // They need.  We just have to worry about IonDyninfo.
  // IonDyninfo contains a pointer to an Ioninfo that it needs...
  Everything()
    { //iondyninfo.ioninfo = &ioninfo;
    }


  // Each structure's setup routines
  
  // Do all setups in the right order
  void setup()
    {
      ioninfo.setup(*this); 
      lattice.setup(*this); 
      basis_spec.setup(*this);

      // do a basis setup call, which happens before we know about k points etc. used to initialize elecvars.basis
      elecvars.basis.setup_template(basis_spec);
      symm.setup(*this,elecvars.basis); 
      //iondyninfo.setup(*this); 

      // inside elecvars.setup, there are basis setup calls, which depend on k points,ie elecvars.states[i].basis
      elecvars.setup(*this); /* Bases for wavefunctions get
			      * set up inside here
			      */
    }
};


#endif // DFT_EVERYTHING_H
