On Tue, 24 Apr 2007, Tim Kröger wrote:
> On Tue, 24 Apr 2007, Roy Stogner wrote:
>
>> On Tue, 24 Apr 2007, Tim Kröger wrote:
>>
>>> for (unsigned int l=0; l<n_dofs; l++)
>>> {
>>> system.solution->set(dof_indices_v[l],
>>> (*system.current_local_solution)(dof_indices_u[l]));
>>> }
>>
>> That might work for the elements like you're using. I wouldn't trust
>> it until I dug into the code and made sure the local shape functions
>> were identical and identically ordered, though. It's certain to break
>> on quads or hexes.
>
> I tried it out and found that it doesn't work. v is discontinuous
> afterwards.
Yes, I suppose you're right. The Lagrange shape functions are
(1-xi-eta), xi, eta; the monomial shapes are 1, xi, eta.
>> The safest thing in general would be a local L2 projection,
>
> I don't think I need any projection since the u space is contained in the v
> space.
A projection doesn't necessarily have to imply a reduction in
dimensionality. Doing the code as an L2 projection would simply
ensure that it worked correctly for arbitrary nested spaces.
> It would suffice to do the following: For each dof of v, find the
> corresponding local coordinates, then find the values of the ansatz functions
> for u at these points, multiply and sum up.
>
> Unfortunately, I have no idea how to do this. Do you have any hint where to
> find an example code that does a similar thing?
No - partly because we don't have the facilities for it. You'd need
the functions sigma_i which satisfy sigma_i(shape_j) == (i == j), and
we don't actually have those functions in code anywhere. They're
straightforward for the Lagrange elements, but you need them for the
monomials. And for the monomials, the degree of freedom functionals
*aren't* local coordinates. Even for the p=1 case they're linear
combinations of coordinate values.
If you're only going to use linear elements, your best bet is probably
to work out the local transformations by hand and just plug them into
a loop like you've got above. It won't be as simple as vdof_i =
udof_i, but it'll be close.
> Currenty, I don't plan to increase p. However, I would like to work the
> thing on hex cells.
You'll have to add a new FE class (named TENSORMONOMIAL? POLYNOMIAL?
QMONOMIAL?) to do that if you want the spaces nested. The
discontinuous MONOMIAL class uses a P1 basis even on non-simplices;
the LAGRANGE elements use Q1.
---
Roy |