From: Kirk, Benjamin \(JSC-EG\) <benjamin.kirk-1@na...> - 2006-06-06 13:29:09
For Lagrange elements the following should work:
var0 =3D system.current_solution(node->dof_number(0,0,0));=20
var1 =3D system.current_solution(node->dof_number(0,1,0));=20
var2 =3D system.current_solution(node->dof_number(0,2,0));=20
See http://libmesh.sourceforge.net/doxygen/classDofObject.html. The
trick is that the node is a DofObject so it knows the global indices for
the DOFs it owns.
Roy is right, the assumption that the node number is related to the DOF
number is in general not correct. =20
[mailto:libmesh-users-bounces@...] On Behalf Of Roy
Sent: Tuesday, June 06, 2006 12:25 AM
To: John Peterson
Cc: libmesh-users@...; David Knezevic
Subject: Re: [Libmesh-users] Finding solution at a node
On Mon, 5 Jun 2006, John Peterson wrote:
> David Knezevic writes:
> > var1 =3D system.current_solution(node->id());
> > var2 =3D system.current_solution(2*node->id());
> > var3 =3D system.current_solution(3*node->id());
> > This is just a guess, maybe I'm way off...?
> Something like this would probably work for Lagrange elements.
> See src/mesh/gmv_io.C line 469....
> Although I can't see any obvious problems, I'd still double-check=20
> everything and be careful :)
I see one obvious problem - the vector "v" being handled in that
function is not a standard libMesh coefficient vector, it's something
that's been processed. It looks like it's created in
EquationSystems::build_solution_vector(), which loops over elements and
uses FEInterface::nodal_soln() on each.
I'd forgotten nodal_soln() exists, but I think I recall upgrading some
of the non-Lagrange elements to support it correctly. David, you might
want to give that a look.
Libmesh-users mailing list
Get latest updates about Open Source Projects, Conferences and News.