Hi all,

I am trying to assemble the RHS for a linear system (coming from a DG 
discretization). That RHS contains a term that looks like

\int_{\Gamma_I} [[ f ]] { \nabla z } ds (f is known and z are the test 
functions, so jump * average of gradient)

where Gamma_I is the union of all the interior edges in my triangulation. I've 
done assemblies of local matrices for terms of this type, but this is the 1st 
time I attempt this with a RHS. Here is how I go about it, using the MeshWorker 
framework. I have already stored the information about f (values) in a 
NamedData 
object that the assembler uses (a la step-39):

template <int dim>
void MyAssembler<dim>::face(DoFInfo& dinfo1, DoFInfo& dinfo2,
        CellInfo& info1, CellInfo& info2)

std::vector<double>& f_values = info1.values[0][0];
std::vector<double>& f_neighbor_values = info2.values[0][0];

Vector<double>& local_vector    = dinfo1.vector(0).block(0);
Vector<double>& neighbor_vector = dinfo2.vector(0).block(0);

for (point = 0; point < n_quad_pts; ...)
  for (i = 0; i < fe_v.dofs_per_cell; ...)
{
     local_vector(i) += 0.5 * f_values[point] * normals[point] *    
 fe_v.shape_grad(i,point) * JxW[point];
   neighbor_vector(i) += 0.5 * f_neighbor_values[point] * normals[point]) * 
fe_v_neighbor.shape_grad(i,point) * JxW[point];
   local_vector(i) -= 0.5 * f_values[point] * normals[point]) 
                      * fe_v.shape_grad(i,point) * JxW[point];
   neighbor_vector(i) -= 0.5 * f_neighbor_values[point] * normals[point] * 
fe_v_neighbor.shape_value(i,point) * JxW[point];
}

So basically I add the contribution containing fe_v_neighbor.shape_grad() to 
the 
neighbor_vector and the rest to the local vector. Is this a good approach, or 
should I just sum everything in the local_vector?

Thanks!
 -- Mihai

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to