On 12/17/20 8:56 PM, Corbin Foucart wrote:
> I have a problem with direction-dependent diffusion (that is, the diffusivity
> \nu depends on the derivative direction but not spatial location) such that
> the horizontal diffusivity and vertical diffusivity are different, leading to
> a Laplacian as follows:
>
>
> I am discretizing the problem with a mixed method, which defines the auxiliary
> variable L = ∇u such that
>
>
> So in my weak form, I end up with terms like the following:
> (please excuse the abuse of index notation with repeated j three times).
> phi_ij here refers to each scalar basis function in the tensor-valued finite
> element space.
>
> It seems using the deal.ii FEValuesExtractors, I can access the divergence of
> each tensor-valued basis function, but I need to multiply each term in the
> divergence with the appropriate value of \nu by component.
>
> I suppose I could ask for the gradient of each phi and do the sum manually,but
> I was wondering if there's a way to do it directly. Is there a standard way of
> doing this in deal.ii?
You (hopefully) don't ever need to take the divergence of nu*(grad u) but
instead will want to integrate by parts. This is going to give you the
bilinear form
(nabla phi_i, nu nabla phi_j)
When you assemble this, you typically do
fe_values.shape_grad(i,q) * fe_values.shape_grad(j,q)
where both objects are of type Tensor<1,dim> (i.e., vectors). In your case,
you want to do
SymmetricTensor<2,dim> nu; // fill with whatever values you need
and then do
fe_values.shape_grad(i,q) * nu * fe_values.shape_grad(j,q)
step-20 does something similar (though for a different bilinear form).
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/