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 (if not contributing author is listed, this file has been contributed
36 by the core developer)
37
38 Copyright 2012- DCS Computing GmbH, Linz
39 Copyright 2009-2012 JKU Linz
40 ------------------------------------------------------------------------- */
41
42 #ifndef LMP_MULTISPHERE_PARALLEL_I_H
43 #define LMP_MULTISPHERE_PARALLEL_I_H
44
45 /* ---------------------------------------------------------------------- */
46
pack_exchange_rigid(int i,double * buf)47 inline int MultisphereParallel::pack_exchange_rigid(int i, double *buf)
48 {
49
50 int m = 1;
51 double xbound[3];
52 bool dummy = false;
53
54 // calculate xbound in global coo sys
55 MathExtraLiggghts::local_coosys_to_cartesian
56 (
57 xbound,xcm_to_xbound_(i),
58 ex_space_(i),ey_space_(i),ez_space_(i)
59 );
60
61 vectorAdd3D(xcm_(i),xbound,xbound);
62
63 // have to pack xbound first because exchange() tests against first 3 values in buffer
64 vectorToBuf3D(xbound,buf,m);
65
66 m += customValues_.pushElemToBuffer(i,&(buf[m]),OPERATION_COMM_EXCHANGE,dummy,dummy,dummy);
67
68 buf[0] = m;
69
70 return m;
71 }
72
73 /* ---------------------------------------------------------------------- */
74
unpack_exchange_rigid(double * buf)75 inline int MultisphereParallel::unpack_exchange_rigid(double *buf)
76 {
77 double xbound[3];
78 bool dummy = false;
79 int m = 0;
80
81 int nvalues = buf[m++];
82
83 bufToVector3D(xbound,buf,m);
84 m += customValues_.popElemFromBuffer(&(buf[m]),OPERATION_COMM_EXCHANGE,dummy,dummy,dummy);
85
86 nbody_++;
87
88 return nvalues;
89 }
90
91 #endif
92