Dear Roy:

Thank you for your reply. In fact, the basic problem is how to know the relationship between the solution variables (one or several) and the non-solution variables(one or several). If one uses two Systems for them, one for solution variables, the other for non-solution variables. Only one mesh is for them. Assuming first-order Lagrange shape function is used, how to establish the relationship using the nodes on the mesh or other information? For example, there are three solution variables (u, v, p) on node 1 of the mesh in System 1, there are two non-solution variables (x, y) on node 1 of the mesh in System 2, how to know they are relevant to node 1? 

thanks a lot.


On 2/25/08, Roy Stogner <> wrote:

On Mon, 25 Feb 2008, Yujie wrote:

> Could you give me some hints to the email I have sent last week?

Yeah; sorry I let it get buried but it's been a busy week.

> In addition, even if you use another System, how to guarantee the
> Dof in one System is the same with that of the other, especially
> numbering?

If you use the same finite element spaces you should get the same
numbering, but don't count on that.  Use the DoFMap in each system to
get the indexing of each variable, and then they don't have to be the

> If there are several solution variables in the System, the
> nonsolution variable is only relevant to the nodes on the mesh, what
> is there are different Dofs between them, how to deal with it?

See ex13; there are multiple variables there, and to get their values
you can use the DofMap to get the local indices, use an appropriate FE
objct to get the shape functions, then do the sums at each quadrature
point.  If the variables are in separate systems, all that changes is
that you have to use the DofMap in each system to get its own

> You agree that the best method is to add another system to the
> EquationSystems. You also consider that it is ok to use add_vector()
> to add a vector for the non-solution variable.  My problem is how to
> distribute the vector you add corresponding to DoF distribution on
> processors of the cluster when you add the vector?

Assuming both Systems are in the same EquationSystems object, they'll
be using the same Mesh with the same partitioning.  The library will
handle parallel redistribution for you.

> Any functions in libmesh help keep this vector, such as initializing
> the distribution of this vector, updating this vector along with the
> change of Dof after refining mesh, and so on? thanks a lot.

EquationSystems::init() should handle the original distribution of the
vector, and EquationSystems::reinit() should do everything you need
after a mesh refinement.