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     Christoph Kloss (DCS Computing GmbH, Linz)
36     Christoph Kloss (JKU Linz)
37     Richard Berger (JKU Linz)
38 
39     Copyright 2012-     DCS Computing GmbH, Linz
40     Copyright 2009-2015 JKU Linz
41 ------------------------------------------------------------------------- */
42 
43 #ifndef LMP_PARTICLE_TO_INSERT_H
44 #define LMP_PARTICLE_TO_INSERT_H
45 
46 #include "memory.h"
47 #include "pointers.h"
48 #include "region_neighbor_list.h"
49 
50 using namespace LAMMPS_NS;
51 
52 namespace LAMMPS_NS {
53     class ParticleToInsert : protected Pointers
54     {
55      public:
56 
57         ParticleToInsert(LAMMPS* lmp, int ns = 1, class FixPropertyAtom *_fix_release = NULL);
58 
59         virtual ~ParticleToInsert();
60 
61         // insertion properties
62         int nparticles;
63         int groupbit;
64         int atom_type;
65         double density_ins;
66         double volume_ins;
67         double area_ins;
68         double mass_ins;
69         double r_bound_ins;
70 
71         int distorder;
72 
73         // per-sphere radius, position
74         // if atom_type_vector exists, each sphere has different type
75         double *radius_ins;
76         double **x_ins;
77         bool atom_type_vector_flag;
78         int *atom_type_vector;
79 
80         // center of bounding sphere
81 
82         double x_bound_ins[3];
83 
84         // velocity and omega at insertion
85 
86         double v_ins[3];
87         double omega_ins[3];
88 
89         // a custom id for the history writing
90         // in fix insert/stream/predefined
91         int id_ins;
92         class FixPropertyAtom * const fix_release;
93 
94         // value of a fix property/atoms at insertion
95         class FixPropertyAtom **fix_property;
96         int n_fix_property;
97         int *fix_property_nentry;
98         double **fix_property_value;
99 
100         virtual int insert();
101         virtual int check_near_set_x_v_omega(double *x,double *v, double *omega, double *quat, RegionNeighborList<interpolate_no> & neighList);
102         virtual int check_near_set_x_v_omega_ms(double *x,double *v, double *omega, double *quat, RegionNeighborList<interpolate_no> & neighList);
103         //virtual int check_near_set_x_v_omega(double *x,double *v, double *omega, double *quat, double **xnear, int &nnear);
104         //virtual int check_near_set_x_v_omega_ms(double *x,double *v, double *omega, double *quat, double **xnear, int &nnear);
105 
106         virtual int set_x_v_omega(double *,double *,double *,double *);
107 
108         virtual void scale_pti(double r_scale);
109 
setFixTemplate(FixPropertyAtom * fix_template)110         void setFixTemplate(FixPropertyAtom* fix_template)
111         { fix_template_ = fix_template; }
112 
113     private:
114 
115         // Fix property atom that identifies the template
116         FixPropertyAtom *fix_template_;
117     };
118 
119 }
120 
121 #endif
122