You are right that the variable and element order are related, but sadly
the relationship is a little more complicated that what you described...
In general, the Elem::order() defines the "natural" order of the
element. This is the order implied by a Lagrange nodal basis that
employs all the nodes of the element. This is the basis that is used
for geometrical operations, like mapping the physical element to a
reference element for shape function evaluation, computing the element
Jacobian, etc... Right now Elem::order() is hardcoded for each element
type to be what you would expect:
Quad4::order() is FIRST,
Quad8::order() is SECOND,
Quad9::order() is SECOND, etc...
If we had a Quad16 bicubic element its order would be THIRD.
Since this is the order that is used in the geometric mapping a 2D mesh
composed of Quad9's and Tri6's can represent quadratic boundaries
exactly since the elements may have secondorder curved edges.
(Note that hardcoding Elem::order() in this case may be inefficient:
if the sides are straight with equispaced nodes then there is no need to
compute a secondorder map. In the future fullorder mapping may only
be applied to elements touching the boundary of the domain.)
On the other hand, the approximation order is exactly that: the
polynomial degree used in approximating an unknown. This is where the
element order and approximation order get a bit confusing...
 For Lagrange finite elements (the default) you have *at most* one DOF
per node, so here your approximation order must be <= the element
order. For example:
o You *could* do firstorder approximation on a Quad9, there will
just not be any DOFs at the edge or center node.
o You *cannot* do secondorder approximation on a Quad4.
 For Hierarchic finite elements there may be multiple DOFs per node,
so in this case your approximation order may be higher than the
element order. Another example:
o You *can* do thirdorder approximation on a Quad9. In this
case there will be 1 DOF per corner node, 2 DOFs per edge
node, and 4 DOFs at the center node
 For DG finite elements you can have any approximation order on
any element order.
As for the other questions:
A mesh should contain elements of the same order. A mix of Quad8,
Quad9, and Tri6's is valid, but a mix of Tri3's and Quad9's is not. (In
the former case all edges have a middle node, in the latter only some
would.)
You can add variables of whatever order you want, provided you observe
the previous "rules." Sometimes, however, the equations you are solving
actually limit the choice of variable approximation. See for example,
uh, example 11. There we solve the Stokes equations for a lowspeed
incompressible fluid. We use second order approximation for the
Cartesian velocity components, but only first order for the pressure.
In the case of the Stokes equations using equalorder interpolation for
the velocity and pressure can actually produce a mathematically unstable
approximation.
If you are curious about similar restrictions for the class of problems
you are interested in I recommend checking the finite element literature
related to such applications... If there is no endless babble about
approximation space compatibility, LBB, infsup, etc... then
equalorder approximation is probably safe.
Let me know if you have any more questions,
Ben
PS: A longterm goal is to add socalled prefinement support, in which
case the approximation order can actually vary from element to element.
Manav Bhatia wrote:
> Hi
> I needed some help in understanding the order of the
> variable that we add to a system and that of the
> elements.
> As I would guess, the former has to be less than or
> equal to the latter. But I can not understand the
> following:
>  what would happen if the mesh has elements of mixed
> order, say first and second, and then we add a
> variable of order first?
>  what would happen if we have to variables in the
> same system of the same order?
>  are there any specific guidelines about choosing
> the variable's order in such mixed cases?
>
> Thanks in advance.
>
> Regards
> Manav
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail  50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
>
>
> 
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Libmeshusers mailing list
> Libmeshusers@...
> https://lists.sourceforge.net/lists/listinfo/libmeshusers
