Debian Codegraph @

tools/physicalModeling/mesh2faust/vega/libraries/include/trilinearInterpolation.h

raw symbols SCIP
1 /*************************************************************************
2 * *
3 * Vega FEM Simulation Library Version 3.1 *
4 * *
5 * "distance field" library , Copyright (C) 2007 CMU, 2016 USC *
6 * All rights reserved. *
7 * *
8 * Code author: Jernej Barbic *
9 * http://www.jernejbarbic.com/code *
10 * *
11 * Research: Jernej Barbic, Hongyi Xu, Doug L. James *
12 * *
13 * Funding: National Science Foundation, Link Foundation, *
14 * Zumberge Research and Innovation Fund at USC *
15 * *
16 * This library is free software; you can redistribute it and/or *
17 * modify it under the terms of the BSD-style license that is *
18 * included with this library in the file LICENSE.txt *
19 * *
20 * This library is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file *
23 * LICENSE.TXT for more details. *
24 * *
25 *************************************************************************/
26
27 /*
28 Trilinear interpolation.
29 */
30
31 #define TRILINEAR_INTERPOLATION(wx,wy,wz,v000,v100,v110,v010,v001,v101,v111,v011) \
32 ( (wx) * (wy) * (wz) * (v111) + \
33 (wx) * (wy) * (1-(wz)) * (v110) + \
34 (wx) * (1-(wy)) * (wz) * (v101) + \
35 (wx) * (1-(wy)) * (1-(wz)) * (v100) + \
36 (1-(wx)) * (wy) * (wz) * (v011) + \
37 (1-(wx)) * (wy) * (1-(wz)) * (v010) + \
38 (1-(wx)) * (1-(wy)) * (wz) * (v001) + \
39 (1-(wx)) * (1-(wy)) * (1-(wz)) * (v000))
40
41 #define GRADIENT_COMPONENT_X(wx,wy,wz,v000,v100,v110,v010,v001,v101,v111,v011) \
42 (((wy) * (wz) * (v111) + \
43 (wy) * (1-(wz)) * (v110) + \
44 (1-(wy)) * (wz) * (v101) + \
45 (1-(wy)) * (1-(wz)) * (v100) + \
46 (-1) * (wy) * (wz) * (v011) + \
47 (-1) * (wy) * (1-(wz)) * (v010) + \
48 (-1) * (1-(wy)) * (wz) * (v001) + \
49 (-1) * (1-(wy)) * (1-(wz)) * (v000) ) / gridX)
50
51 #define GRADIENT_COMPONENT_Y(wx,wy,wz,v000,v100,v110,v010,v001,v101,v111,v011) \
52 (((wx) * (wz) * (v111) + \
53 (wx) * (1-(wz)) * (v110) + \
54 (wx) * (-1) * (wz) * (v101) + \
55 (wx) * (-1) * (1-(wz)) * (v100) + \
56 (1-(wx)) * (wz) * (v011) + \
57 (1-(wx)) * (1-(wz)) * (v010) + \
58 (1-(wx)) * (-1) * (wz) * (v001) + \
59 (1-(wx)) * (-1) * (1-(wz)) * (v000)) / gridY)
60
61 #define GRADIENT_COMPONENT_Z(wx,wy,wz,v000,v100,v110,v010,v001,v101,v111,v011) \
62 (((wx) * (wy) * (v111) + \
63 (wx) * (wy) * (-1) * (v110) + \
64 (wx) * (1-(wy)) * (v101) + \
65 (wx) * (1-(wy)) * (-1) * (v100) + \
66 (1-(wx)) * (wy) * (v011) + \
67 (1-(wx)) * (wy) * (-1) * (v010) + \
68 (1-(wx)) * (1-(wy)) * (v001) + \
69 (1-(wx)) * (1-(wy)) * (-1) * (v000)) / gridZ)
70