1 /* ----------------------------------------------------------------------
2     This is the
3 
4     ██╗     ██╗ ██████╗  ██████╗  ██████╗ ██╗  ██╗████████╗███████╗
5     ██║     ██║██╔════╝ ██╔════╝ ██╔════╝ ██║  ██║╚══██╔══╝██╔════╝
6     ██║     ██║██║  ███╗██║  ███╗██║  ███╗███████║   ██║   ███████╗
7     ██║     ██║██║   ██║██║   ██║██║   ██║██╔══██║   ██║   ╚════██║
8     ███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║  ██║   ██║   ███████║
9     ╚══════╝╚═╝ ╚═════╝  ╚═════╝  ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝®
10 
11     DEM simulation engine, released by
12     DCS Computing Gmbh, Linz, Austria
13     http://www.dcs-computing.com, office@dcs-computing.com
14 
15     LIGGGHTS® is part of CFDEM®project:
16     http://www.liggghts.com | http://www.cfdem.com
17 
18     Core developer and main author:
19     Christoph Kloss, christoph.kloss@dcs-computing.com
20 
21     LIGGGHTS® is open-source, distributed under the terms of the GNU Public
22     License, version 2 or later. It is distributed in the hope that it will
23     be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
24     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have
25     received a copy of the GNU General Public License along with LIGGGHTS®.
26     If not, see http://www.gnu.org/licenses . See also top-level README
27     and LICENSE files.
28 
29     LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH,
30     the producer of the LIGGGHTS® software and the CFDEM®coupling software
31     See http://www.cfdem.com/terms-trademark-policy for details.
32 
33 -------------------------------------------------------------------------
34     Contributing author and copyright for this file:
35     This file is from LAMMPS, but has been modified. Copyright for
36     modification:
37 
38     Copyright 2012-     DCS Computing GmbH, Linz
39     Copyright 2009-2012 JKU Linz
40 
41     Copyright of original file:
42     LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
43     http://lammps.sandia.gov, Sandia National Laboratories
44     Steve Plimpton, sjplimp@sandia.gov
45 
46     Copyright (2003) Sandia Corporation.  Under the terms of Contract
47     DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
48     certain rights in this software.  This software is distributed under
49     the GNU General Public License.
50 ------------------------------------------------------------------------- */
51 
52 // Pointers class contains ptrs to master copy of
53 //   fundamental LAMMPS class ptrs stored in lammps.h
54 // every LAMMPS class inherits from Pointers to access lammps.h ptrs
55 // these variables are auto-initialized by Pointer class constructor
56 // *& variables are really pointers to the pointers in lammps.h
57 // & enables them to be accessed directly in any class, e.g. atom->x
58 
59 #ifndef LMP_POINTERS_H
60 #define LMP_POINTERS_H
61 
62 #include "lmptype.h"
63 #include <mpi.h>
64 #include "lammps.h"
65 
66 namespace LAMMPS_NS {
67 
68 // universal defines inside namespace
69 
70 #define FLERR __FILE__,__LINE__
71 
72 #define MIN(A,B) ((A) < (B) ? (A) : (B))
73 #define MAX(A,B) ((A) > (B) ? (A) : (B))
74 #define UNUSED(P) (void)P
75 
76 class Pointers {
77  public:
Pointers(LAMMPS * ptr)78   Pointers(LAMMPS *ptr) :
79     lmp(ptr),
80     memory(ptr->memory),
81     error(ptr->error),
82     universe(ptr->universe),
83     input(ptr->input),
84     atom(ptr->atom),
85     update(ptr->update),
86     neighbor(ptr->neighbor),
87     comm(ptr->comm),
88     domain(ptr->domain),
89     force(ptr->force),
90     modify(ptr->modify),
91     group(ptr->group),
92     output(ptr->output),
93     timer(ptr->timer),
94     world(ptr->world),
95     infile(ptr->infile),
96     screen(ptr->screen),
97     logfile(ptr->logfile),
98     thermofile(ptr->thermofile) {}
~Pointers()99   virtual ~Pointers() {}
100 
101  protected:
102   LAMMPS *lmp;
103   Memory *&memory;
104   Error *&error;
105   Universe *&universe;
106   Input *&input;
107 
108   Atom *&atom;
109   Update *&update;
110   Neighbor *&neighbor;
111   Comm *&comm;
112   Domain *&domain;
113   Force *&force;
114   Modify *&modify;
115   Group *&group;
116   Output *&output;
117   Timer *&timer;
118 
119   MPI_Comm &world;
120   FILE *&infile;
121   FILE *&screen;
122   FILE *&logfile;
123   FILE *&thermofile;
124 };
125 
126 }
127 
128 #endif
129