In fact, I have tried both methods but did not get the correct result using projection:

  * Interpolate the boundary data: It works quite well for adaptivity with
    both 2 and 3 dimensions. Though expecting extra error will be introduced,
    I observed that it is actually comparable to the case with projected
    boundary data (I do the experiment through global refinement).

Yes, in practice there is little difference between the accuracy obtained from using boundary value interpolation and projection. Because the former is computationally cheaper, that's what everyone uses.

If it works for you, why not go with it?


  * Project the boundary data:  I tried to project the boundary data by
    commenting out the project_boundary_values and adding attached code in
    step-51:

     if (task_data.trace_reconstruct == false)
       {
         ...
         cell->get_dof_indices(task_data.dof_indices);
my code
      }else{
        ...
      }

where face_mass is the size of fe.dofs_per_cell x fe.dofs_per_cell matrix, and both dirichlet_rhs and proj_dirichlet_rhs are fe.dofs_per_cell vector. I just solve the linear system on the boundary faces, assign the projected data to the cell_vector, and zero out the off-diagonal terms. In this procedure, I assume constraints can handle hanging nodes properly. Whatever values I assign to the corresponding row will be replaced by some algebraic function that will be used to maintain the continuity via data from end support points.

The code can run but the linear solver for solving trace unknowns requires a significant iteration number (will explode if using global refinement option). In addition, the L2 error norm is too high compared to the original setting. Hence, I may do something wrong. Could you give me some suggestions or comments on it?

You'll have to debug it, I'm afraid :-) Make sure it is correct first, for example by imposing boundary conditions equal to 1.0 and ensuring that what you get on each cell/face is correct. You can test this on a cube with only one cell first, then refine once, etc. In your code, I don't understand why you need to multiply
  scratch.proj_dirichlet_rhs(ii) * task_data.cell_matrix(ii,ii);
when assigning to cell_vector. Is that because you want to set the corresponding entries in the rhs as boundary values? If so, is the cell_matrix already correctly computed?

If I understand your approach correctly, then you are doing a local projection on each face, one face after the other. You will then overwrite the already computed values of DoFs on a face that are shared with a previously visited face. That's ok, but it's not the same as a global projection, of course. I suspect that this will not be more accurate than interpolation of boundary values.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/b9f3fcba-e8d9-411a-0b42-88b0b462af06%40colostate.edu.

Reply via email to