Pham, I have a question that when assembling the right hand side with the formula > as: > F_i = - \int_Omega \varphi_i(x) Js(x) dx at quadrature point x > located on the source edge, and F_i = 0 everywhere else. > I actually take the integral over the cell rather than the edge, isn't it? > And there are 4 cells in 3D and 2 cells in 2D which contains the edge. > Should I assemble the right hand side by the following procedure ? > 1. find the cell containing the source edge > 2. find the dof in the cell represent for the edge. > 3. Loop over the cell quadrature points: > if the quadrature point are on the edge then compute: > F_i += - Omega \varphi_i(x) Js(x) JxW(x) > if it not: > F_i += 0 > The right hand side for other dofs that do not represent for source edge > are set to be 0. >
Yes, this looks like the standard way but I am not sure what you mean by "the dof in the cell represent(ative) for the edge". In general, just put Js(x) in and assemble on all the cells. Of course, you can skip zero contributions. > As the shape functions are scaled by a factor of inverse edge length, not > only the cell right hand side but also the cell matrix will change when > refining the mesh. > I don't know if both of them change, the solution would change with them? > That should not be the case. Matrix and right-hand side should change consistently such that the solution is scaled correctly. > I thought about when refining the mesh, for example, the initial mesh has > the source edge with 2 vertices are (0,0,0) and (0,0,1), > and the refined mesh has 2 source edges with vertices are (0,0,0), > (0,0,0.5) and (0,0,0.5), (0,0,1), respectively. > The results get by function > VectorTools::point_value(dof_handler,solution,point,values); > are not the same for the 2 mesh with my codes. > How do you obtain "values"? The entries need to be scaled accordingly to the scaling of the shape functions for representing the same function. If "values" is the solution of some (discretized) linear system, the difference in the result of VectorTools::point_value should be small after mesh refinement. Best, Daniel -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
