15 #include "../../config/config.hpp"
16 #include "../../general/backends.hpp"
17 #include "../../general/globals.hpp"
18 #include "../../linalg/dtensor.hpp"
25 const double *X,
int iel_ho,
int kx,
int ky,
double vx[4],
double vy[4])
28 const int nd1d = ORDER + 1;
29 const int nvert_per_el = nd1d*nd1d;
31 const int v0 = kx + nd1d*ky;
32 const int v1 = kx + 1 + nd1d*ky;
33 const int v2 = kx + 1 + nd1d*(ky + 1);
34 const int v3 = kx + nd1d*(ky + 1);
36 const int e0 = dim*(v0 + nvert_per_el*iel_ho);
37 const int e1 = dim*(v1 + nvert_per_el*iel_ho);
38 const int e2 = dim*(v2 + nvert_per_el*iel_ho);
39 const int e3 = dim*(v3 + nvert_per_el*iel_ho);
57 const double *X,
int iel_ho,
int kx,
int ky,
int kz,
58 double vx[8],
double vy[8],
double vz[8])
61 const int nd1d = ORDER + 1;
62 const int nvert_per_el = nd1d*nd1d*nd1d;
64 const int v0 = kx + nd1d*(ky + nd1d*kz);
65 const int v1 = kx + 1 + nd1d*(ky + nd1d*kz);
66 const int v2 = kx + 1 + nd1d*(ky + 1 + nd1d*kz);
67 const int v3 = kx + nd1d*(ky + 1 + nd1d*kz);
68 const int v4 = kx + nd1d*(ky + nd1d*(kz + 1));
69 const int v5 = kx + 1 + nd1d*(ky + nd1d*(kz + 1));
70 const int v6 = kx + 1 + nd1d*(ky + 1 + nd1d*(kz + 1));
71 const int v7 = kx + nd1d*(ky + 1 + nd1d*(kz + 1));
73 const int e0 = dim*(v0 + nvert_per_el*iel_ho);
74 const int e1 = dim*(v1 + nvert_per_el*iel_ho);
75 const int e2 = dim*(v2 + nvert_per_el*iel_ho);
76 const int e3 = dim*(v3 + nvert_per_el*iel_ho);
77 const int e4 = dim*(v4 + nvert_per_el*iel_ho);
78 const int e5 = dim*(v5 + nvert_per_el*iel_ho);
79 const int e6 = dim*(v6 + nvert_per_el*iel_ho);
80 const int e7 = dim*(v7 + nvert_per_el*iel_ho);
116 const double x,
const double y,
const double vx[4],
const double vy[4],
119 J(0,0) = -(1-y)*vx[0] + (1-y)*vx[1] + y*vx[2] - y*vx[3];
120 J(0,1) = -(1-x)*vx[0] - x*vx[1] + x*vx[2] + (1-x)*vx[3];
122 J(1,0) = -(1-y)*vy[0] + (1-y)*vy[1] + y*vy[2] - y*vy[3];
123 J(1,1) = -(1-x)*vy[0] - x*vy[1] + x*vy[2] + (1-x)*vy[3];
127 const double x,
const double y,
const double z,
128 const double vx[8],
const double vy[8],
const double vz[8],
133 J(0,0) = -(1-y)*(1-z)*vx[0]
134 + (1-y)*(1-z)*vx[1] + y*(1-z)*vx[2] - y*(1-z)*vx[3]
135 - (1-y)*z*vx[4] + (1-y)*z*vx[5] + y*z*vx[6] - y*z*vx[7];
137 J(0,1) = -(1-x)*(1-z)*vx[0]
138 - x*(1-z)*vx[1] + x*(1-z)*vx[2] + (1-x)*(1-z)*vx[3]
139 - (1-x)*z*vx[4] - x*z*vx[5] + x*z*vx[6] + (1-x)*z*vx[7];
141 J(0,2) = -(1-x)*(1-y)*vx[0] - x*(1-y)*vx[1]
142 - x*y*vx[2] - (1-x)*y*vx[3] + (1-x)*(1-y)*vx[4]
143 + x*(1-y)*vx[5] + x*y*vx[6] + (1-x)*y*vx[7];
145 J(1,0) = -(1-y)*(1-z)*vy[0] + (1-y)*(1-z)*vy[1]
146 + y*(1-z)*vy[2] - y*(1-z)*vy[3] - (1-y)*z*vy[4]
147 + (1-y)*z*vy[5] + y*z*vy[6] - y*z*vy[7];
149 J(1,1) = -(1-x)*(1-z)*vy[0] - x*(1-z)*vy[1]
150 + x*(1-z)*vy[2] + (1-x)*(1-z)*vy[3]- (1-x)*z*vy[4] -
151 x*z*vy[5] + x*z*vy[6] + (1-x)*z*vy[7];
153 J(1,2) = -(1-x)*(1-y)*vy[0] - x*(1-y)*vy[1]
154 - x*y*vy[2] - (1-x)*y*vy[3] + (1-x)*(1-y)*vy[4]
155 + x*(1-y)*vy[5] + x*y*vy[6] + (1-x)*y*vy[7];
157 J(2,0) = -(1-y)*(1-z)*vz[0] + (1-y)*(1-z)*vz[1]
158 + y*(1-z)*vz[2] - y*(1-z)*vz[3]- (1-y)*z*vz[4] +
159 (1-y)*z*vz[5] + y*z*vz[6] - y*z*vz[7];
161 J(2,1) = -(1-x)*(1-z)*vz[0] - x*(1-z)*vz[1]
162 + x*(1-z)*vz[2] + (1-x)*(1-z)*vz[3] - (1-x)*z*vz[4]
163 - x*z*vz[5] + x*z*vz[6] + (1-x)*z*vz[7];
165 J(2,2) = -(1-x)*(1-y)*vz[0] - x*(1-y)*vz[1]
166 - x*y*vz[2] - (1-x)*y*vz[3] + (1-x)*(1-y)*vz[4]
167 + x*(1-y)*vz[5] + x*y*vz[6] + (1-x)*y*vz[7];
172 A(0,0) = (J(1,1) * J(2,2)) - (J(1,2) * J(2,1));
173 A(0,1) = (J(2,1) * J(0,2)) - (J(0,1) * J(2,2));
174 A(0,2) = (J(0,1) * J(1,2)) - (J(1,1) * J(0,2));
175 A(1,0) = (J(2,0) * J(1,2)) - (J(1,0) * J(2,2));
176 A(1,1) = (J(0,0) * J(2,2)) - (J(0,2) * J(2,0));
177 A(1,2) = (J(1,0) * J(0,2)) - (J(0,0) * J(1,2));
178 A(2,0) = (J(1,0) * J(2,1)) - (J(2,0) * J(1,1));
179 A(2,1) = (J(2,0) * J(0,1)) - (J(0,0) * J(2,1));
180 A(2,2) = (J(0,0) * J(1,1)) - (J(0,1) * J(1,0));
185 return J(0,0)*J(1,1) - J(1,0)*J(0,1);
190 return J(0,0) * (J(1,1) * J(2,2) - J(2,1) * J(1,2)) -
191 J(1,0) * (J(0,1) * J(2,2) - J(2,1) * J(0,2)) +
192 J(2,0) * (J(0,1) * J(1,2) - J(1,1) * J(0,2));
MFEM_HOST_DEVICE void LORVertexCoordinates3D(const double *X, int iel_ho, int kx, int ky, int kz, double vx[8], double vy[8], double vz[8])
MFEM_HOST_DEVICE double Det3D(DeviceMatrix &J)
MFEM_HOST_DEVICE double Det2D(DeviceMatrix &J)
MFEM_HOST_DEVICE void Jacobian3D(const double x, const double y, const double z, const double vx[8], const double vy[8], const double vz[8], DeviceMatrix &J)
A basic generic Tensor class, appropriate for use on the GPU.
MFEM_HOST_DEVICE void Jacobian2D(const double x, const double y, const double vx[4], const double vy[4], DeviceMatrix &J)
MFEM_HOST_DEVICE void LORVertexCoordinates2D(const double *X, int iel_ho, int kx, int ky, double vx[4], double vy[4])
MFEM_HOST_DEVICE void Adjugate3D(const DeviceMatrix &J, DeviceMatrix &A)