Vijay... a Node _IS_ a Point (in the polymorphic sense) in libMesh...
meaning that you can just do:
x = somenode(0);
y = somenode(1);
z = somenode(2);
Derek
On Jan 29, 2008 2:45 PM, Vijay M <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got a question that is along the same lines of Parallel mesh
> question asked few days back. So Roy, this question might be for you.
>
> I was initially trying to use the PETSc function
> "VecGetOwnershipRange" to find the local nodes and loop over them to
> set it but then find out after few hours of debugging that the
> partitioner not necessarily assigns the dofs continuously and hence I
> was setting wrong values based on dof-number.
>
> Now, I am trying to initialize my solution (xsoln) by setting only the
> local node values to an exact solution by looping over the current
> local nodes. But for this, I then need the node's x, y, z
> co-ordinates. The class document says that _coords is a protected
> member and hence I'm not sure how to get this. Here's a sample code on
> what I'm trying to do.
>
>
> Real value = 0.0 ;
>
> const MeshBase& mesh = equation_system.get_mesh();
>
> MeshBase::const_node_iterator node_it =
> mesh.local_nodes_begin();
> const MeshBase::const_node_iterator node_end = mesh.local_nodes_end();
>
> for ( ; node_it != node_end; ++node_it)
> {
> const Node* mynode = *node_it;
>
> // Get current degree of freedom number
> const unsigned int dofnum = mynode->dof_number(0,0,0);
>
> // Does a method like the following exist in the class
> library ?
> // mynode.get_coords(x, y, z) ;
>
> // Find the exact solution
> value = ExactSolution(dim, x, y, z, time) ;
>
> // Update the solution
> xsoln.set(dofnum,value);
>
> }
>
> Any help would be appreciated. Thanks !
>
> Vijay
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users