Closed Emilyeyang closed 5 years ago
the function takes double *x, not double x as an input.
double *x is a 3d array that stores the x,y,z positions of a point, x, in world space.
i.e x[0] = x, x[1] = y, x[2] = z.
Thank you for that explanation. I have two more questions:
Yes, but my question is volume() is not imported to the QudraticLinear.h , can we just import that to QudraticLinear.h by ourself? Also, I have the same question for dphi, in order to call that function, we need x, but there is no x in QudraticLinear.h, then how can I call this function?
Please refrain from posting answers and obvious hints about assignment questions on the GitHub issues.
The constructor for QuadratureLinearElasticityA4 has access to the vertices that make up the tetrahedron via the V and F arrays. i.e vertex 1 = V.row(F[0]), vertex 2 = V.row(F[1]) and so on. You can compute geometric quantities the you need in the constructor and reuse them later.
Recall that the Quadrature function is integrating a function of a certain form. Think about where in the element you can sample dphi to get the correct value of the gradients.
The function *double phi(double x) { ... } returns the value of the linear shape function $\lambda_{VERTEX}$, evaluated at $\mathbf{x}$.
In the given document, for example, \lambda_1=\frac{(y_2-y_3)(x-x_3)+(x_3-x_2)(y-y_3)}{\det(T)}=\frac{(y_2-y_3)(x-x_3)+(x_3-x_2)(y-y_3)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}\, this means, we need all the (x,y,z) values of 4 points in order to calculate lambda. But we only have one value x as an input. what does this x represent?