Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
  2. for (unsigned int i=0; i<dofs_per_cell; ++i)
  3. {
  4. const Tensor<2,dim> phi_i_grad
  5. = fe_values[displacements].gradient (i,q_point);
  6. const double phi_i_div
  7. = fe_values[displacements].divergence (i,q_point);
  8.  
  9. for (unsigned int j=0; j<dofs_per_cell; ++j)
  10. {
  11. const Tensor<2,dim> phi_j_grad
  12. = fe_values[displacements].gradient (j,q_point);
  13. const double phi_j_div
  14. = fe_values[displacements].divergence (j,q_point);
  15.  
  16. cell_matrix(i,j)
  17. += (lambda_values[q_point] *
  18. phi_i_div * phi_j_div
  19. +
  20. mu_values[q_point] *
  21. double_contract(phi_i_grad, phi_j_grad)
  22. +
  23. mu_values[q_point] *
  24. double_contract(phi_i_grad, transpose(phi_j_grad))
  25. ) *
  26. fe_values.JxW(q_point);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement