Hi all,

This is a follow-up about moving mesh operation in libMesh.
If I write out the original mesh first, then change the nodal coordinates
by loop over each node, finally write out the new moved mesh to a local
file. I found that both the original mesh and the moved mesh are in one
file. What I expected is that I can output the updated mesh at each step,
but now it seems that all are output together at each step. Did I did
something wrong, or anything I lost?

The following codes simply update the nodal coordinates by 5 along the x
direction:

MeshBase::node_iterator       nd     = _surface_mesh.active_nodes_begin();
const MeshBase::node_iterator end_nd = _surface_mesh.active_nodes_end();
  for ( ; nd != end_nd; ++nd)
  {
    Node* node = *nd;
    const dof_id_type n_id = node->id();

    for(unsigned int i=0; i<3; ++i)
    {
      Real ttt = 0.;
      if (i==0) ttt = 5.;
      (*node)(i) = (*node)(i) + ttt;
    }

Thank you in advance.

Xujun




On Mon, Oct 19, 2015 at 6:34 PM, John Peterson <jwpeter...@gmail.com> wrote:

>
>
> On Mon, Oct 19, 2015 at 5:08 PM, Xujun Zhao <xzha...@gmail.com> wrote:
>
>> Hi all,
>>
>> I have a problem for particulate flow. If have already calculate the
>> velocity on each node of the particle, and I want to move mesh according
>> to
>> the computed displacement at each time step, then how can achieve it? Can
>> I
>> just simply loop over each node and change their values or there is a
>> better way to do it?
>>
>
> Yes, you can just move the nodes directly, assuming that makes sense with
> the rest of your PDE formulation...
>
> --
> John
>
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to