Thanks for your reply, professor. I have constructed the stiffness matrix as step-18 does, but the difficulty is the mass matrix. I use these to construct mass matrix:
1) cell_mass_matrix(i, j) += rho * fe_values.shape_value(i, q_point) * fe_values.shape_value(j, q_point) * fe_values.JxW(q_point); 2) cell_mass_matrix(i, j) += (mass_phi_i * mass_phi_j) * fe_values.JxW(q_point) * rho; where mass_phi_i: const Tensor<2, dim> mass_phi_i =get_mass_matrix(fe_values, i, q_point); (using this function) template <int dim> inline Tensor<2, dim> get_mass_matrix(const FEValues<dim> &fe_values, const unsigned int shape_func_i, const unsigned int shape_func_j, const unsigned int q_point) { Tensor<2, dim> tmp; for (unsigned int t = 0; t < dim; ++t) for (unsigned int k = 0; k < dim; ++k) { tmp[t][k] = fe_values.shape_value_component(shape_func_i, q_point, t)* fe_values.shape_value_component(shape_func_j, q_point, k); } return tmp; } 2) cell_mass_matrix(i, j) += (mass_phi_i * mass_phi_j) * fe_values.JxW(q_point) * rho; where mass_phi_i: const SymmetricTensor <2, dim> mass_phi_i =get_mass_matrix(fe_values, i, q_point); (using this function) template <int dim> inline SymmetricTensor<2, dim> get_mass_matrix (const FEValues<dim> &fe_values, const unsigned int shape_func, const unsigned int q_point) { SymmetricTensor<2, dim> tmp; for (unsigned int i = 0; i < dim; ++i) tmp[i][i] = fe_values.shape_value_component(shape_func, q_point, i) * fe_values.shape_value_component(shape_func, q_point, i); for (unsigned int i = 0; i < dim; ++i) for (unsigned int j = i + 1; j < dim; ++j) tmp[i][j] = fe_values.shape_value_component(shape_func, q_point, i) * fe_values.shape_value_component(shape_func, q_point, j); return tmp; } Either of them is not right. Le mardi 29 mars 2022 à 22:20:30 UTC+8, Wolfgang Bangerth a écrit : > On 3/28/22 21:09, Léonhard YU wrote: > > I am constructing a code to solve the eigen problem of a solid > structure,. > > I use the step-36 as a sample, but I don't know how to write a new one > for 3D > > solid structure with tensil modulus E = 2.0e11, poisson ratio = 0.3 and > > density = 7.85e3. > > If you have any other samples or ideas, please help me. > > Leonhard: > what have you tried already? Have you looked at the elasticity tutorial > programs and how they construct (i) finite element spaces and (ii) the > stiffness matrix? If you understand that, you will also understand how to > solve the eigenproblem. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > www: http://www.math.colostate.edu/~bangerth/ > > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/84535b74-6a3a-4b85-be17-fce5476fab1en%40googlegroups.com.