dilevin / DGPCompFab

This repository stores the the assignments and lecture notes for the University of Toronto Graduate Course Computational Design and Fabrication
7 stars 4 forks source link

what is the x in the phi function? #19

Closed Emilyeyang closed 5 years ago

Emilyeyang commented 5 years ago

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?

dilevin commented 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.

Emilyeyang commented 5 years ago

Thank you for that explanation. I have two more questions:

  1. What does qdofs and qdotdofs represent?
  2. How can we integral over volume when we are calculating the stiffness matrix?
dilevin commented 5 years ago
  1. q's are the 3D displacements of each node in the tetrahedra
  2. You are integrating the the stiffness matrix over the tetrahedra. The stiffness matrix is made of up derivatives of a linear function. You should be able to find an very easy way to integrate a function of this form.
Emilyeyang commented 5 years ago

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?

dilevin commented 5 years ago

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.