Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Yujie <recrusader@gm...>  20080223 01:46:29
Attachments:
Message as HTML

Dear Roy: I check the mail list and find the following question and your answer, which is in "Re: [Libmeshusers] variables and vectors in equation systems?" > The easiest way that I could think of setting up independent > variables is to add another System to the EquationSystems, > deactivate this System so that it is not solved, and add the > independent variables to this System. That's the best general method I can come up with too. A nonsolution function defined on an unstructured finite element space will need the same sort of DoF mapping structure that your solution variables need, and currently the only way to set that up is to add your function as a solution variable somewhere or to reuse the mapping of a real solution variable. If you want to reuse the mapping of most or all the solution variables in a system (as time solvers do, for example) then the most efficient way to get that is add_vector(). 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 nonsolution 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? 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. Regards, Yujie 
From: Roy Stogner <roystgnr@ic...>  20080225 18:44:37

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 same. > 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 variables. > 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 nonsolution 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.  Roy 
From: Yujie <recrusader@gm...>  20080225 19:12:21
Attachments:
Message as HTML

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 nonsolution variables(one or several). If one uses two Systems for them, one for solution variables, the other for nonsolution variables. Only one mesh is for them. Assuming firstorder 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 nonsolution variables (x, y) on node 1 of the mesh in System 2, how to know they are relevant to node 1? thanks a lot. Regards, Yujie On 2/25/08, Roy Stogner <roystgnr@...> 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 > same. > > > > 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 > variables. > > > > 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 nonsolution 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. >  > > Roy > 
From: Roy Stogner <roystgnr@ic...>  20080225 19:19:06

On Mon, 25 Feb 2008, Yujie wrote: > 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 nonsolution variables(one or > several). If one uses two Systems for them, one for solution > variables, the other for nonsolution variables. Only one mesh is for > them. Assuming firstorder 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 nonsolution variables (x, y) on node 1 of the mesh in System 2, > how to know they are relevant to node 1? That's what the DofMap class is for; give an Elem object (and possibly a variable number) to DofMap::dof_indices() and it will fill a vector with the global DoF index numbers for that variable(s) on that element. Alternatively, if you only want to use Lagrange shape functions, you can use the DofObject class methods to directly find the indices on a Node.  Roy 
Sign up for the SourceForge newsletter:
No, thanks