Some Notes to v 3.8.0

richti83's picture
Submitted by richti83 on Fri, 12/08/2017 - 20:27

I want to point to some little puzzles in the 3.8.0 release:
in https://www.cfdem.com/media/DEM/docu/fix_particletemplate_superquadric.html

fix pts1 all particletemplate/superquadric 123457 atom_type 1 density constant 2500 shape constant 0.0015 0.0025 0.0035 blockiness 4.0 4.0

should be

fix pts1 all particletemplate/superquadric 123457 atom_type 1 density constant 2500 shape constant 0.0015 0.0025 0.0035 blockiness constant 4.0 4.0

In
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/math_ext...
line 723 "double invf"
MSVC (2015) doesn't like

#define e(a,b) m[ ((j+b)%4)*4 + ((i+a)%4) ]
double inv =
+ e(+1,-1)*e(+0,+0)*e(-1,+1)
+ e(+1,+1)*e(+0,-1)*e(-1,+0)
+ e(-1,-1)*e(+1,+0)*e(+0,+1)
- e(-1,-1)*e(+0,+0)*e(+1,+1)
- e(-1,+1)*e(+0,-1)*e(+1,+0)
- e(+1,-1)*e(-1,+0)*e(+0,+1);

so I expanded manually to

double inv = m[((j - 1) % 4) * 4 + ((i + 1) % 4)] * m[((j + 0) % 4) * 4 + ((i + 0) % 4)] * m[((j + 1) % 4) * 4 + ((i - 1) % 4)]
+ m[((j + 1) % 4) * 4 + ((i + 1) % 4)] * m[((j - 1) % 4) * 4 + ((i + 0) % 4)] * m[((j + 0) % 4) * 4 + ((i - 1) % 4)]
+ m[((j - 1) % 4) * 4 + ((i - 1) % 4)] * m[((j + 0) % 4) * 4 + ((i + 1) % 4)] * m[((j + 1) % 4) * 4 + ((i + 0) % 4)]
- m[((j - 1) % 4) * 4 + ((i - 1) % 4)] * m[((j + 0) % 4) * 4 + ((i + 0) % 4)] * m[((j + 1) % 4) * 4 + ((i + 1) % 4)]
- m[((j + 1) % 4) * 4 + ((i - 1) % 4)] * m[((j - 1) % 4) * 4 + ((i + 0) % 4)] * m[((j + 0) % 4) * 4 + ((i + 1) % 4)]
- m[((j - 1) % 4) * 4 + ((i + 1) % 4)] * m[((j + 0) % 4) * 4 + ((i - 1) % 4)] * m[((j + 1) % 4) * 4 + ((i + 0) % 4)];

In the hope to get the same results (not sure).

Best,
Christian.

medvedeg | Tue, 01/30/2018 - 11:50

Hi Christian,

thanks for info! This will be corrected of cource in future release.

Alexander Podlozhnyuk