1 /* -*- c++ -*- ----------------------------------------------------------
2    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3    https://www.lammps.org/, Sandia National Laboratories
4    Steve Plimpton, sjplimp@sandia.gov
5 
6    Copyright (2003) Sandia Corporation.  Under the terms of Contract
7    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
8    certain rights in this software.  This software is distributed under
9    the GNU General Public License.
10 
11    See the README file in the top-level LAMMPS directory.
12 ------------------------------------------------------------------------- */
13 
14 #ifdef REGION_CLASS
15 // clang-format off
16 RegionStyle(prism,RegPrism);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_REGION_PRISM_H
21 #define LMP_REGION_PRISM_H
22 
23 #include "region.h"
24 
25 namespace LAMMPS_NS {
26 
27 class RegPrism : public Region {
28   friend class CreateBox;
29 
30  public:
31   RegPrism(class LAMMPS *, int, char **);
32   ~RegPrism();
33   int inside(double, double, double);
34   int surface_interior(double *, double);
35   int surface_exterior(double *, double);
36 
37  private:
38   double xlo, xhi, ylo, yhi, zlo, zhi;
39   double xy, xz, yz;
40   double h[3][3], hinv[3][3];
41   int dimension;
42   double a[3], b[3], c[3];    // edge vectors of region
43   double clo[3], chi[3];      // opposite corners of prism
44   double face[6][3];          // unit normals of 6 prism faces
45   double corners[8][3];       // 8 corner pts of prism
46   int tri[12][3];             // 3 corner pts of 12 triangles (2 per face)
47 
48   void find_nearest(double *, double &, double &, double &);
49   int inside_tri(double *, double *, double *, double *, double *);
50   double closest(double *, double *, double *, double);
51 };
52 
53 }    // namespace LAMMPS_NS
54 
55 #endif
56 #endif
57 
58 /* ERROR/WARNING messages:
59 
60 E: Cannot use region INF or EDGE when box does not exist
61 
62 Regions that extend to the box boundaries can only be used after the
63 create_box command has been used.
64 
65 E: Illegal ... command
66 
67 Self-explanatory.  Check the input script syntax and compare to the
68 documentation for the command.  You can use -echo screen as a
69 command-line option when running LAMMPS to see the offending line.
70 
71 */
72