problem about The move mesh func

30 views
Skip to first unread message

huyanzhuo

unread,
Sep 26, 2019, 10:09:16 AM9/26/19
to deal.II User Group
i use The move mesh function, the code is as follows, just like in step-42
    template < int dim >
    void example<dim>::move_mesh(const TrilinosWrappers::MPI::Vector &state_change) const
    {
      pcout<<"moving the mesh ..." <<std::endl;
      std::vector<bool> vertex_touched(triangulation.n_vertices(), false);

      for (typename DoFHandler<dim>::active_cell_iterator cell =dof_handler.begin_active();cell != dof_handler.end(); ++cell)
        if (cell->is_locally_owned())                                                       
          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)         
            {
              if(vertex_touched[cell->vertex_index(v)] == false)
              {
                vertex_touched[cell->vertex_index(v)] = true;

                Point<dim> vertex_displacement;
                for (unsigned int d = 0; d < dim; ++d)                                 
                  vertex_displacement[d] = state_change(cell->vertex_dof_index(v, d));
                cell->vertex(v) += vertex_displacement;
              }
            }
    }

before i use this function ,i use the constraints matrix to distribute the vector like this
TrilinosWrappers::MPI::BlockVector move_vector(system_state);
move_vector = system_state;
all_constraints.distribute(move_vector);        
move_mesh(move_vector.block(0));

but the final result still have a departure on the hanging point as follows

example.png


Bruno Turcksin

unread,
Sep 26, 2019, 10:16:42 AM9/26/19
to deal.II User Group

huyanzhuo

unread,
Sep 26, 2019, 11:02:31 AM9/26/19
to deal.II User Group
thanks a lot

在 2019年9月26日星期四 UTC+8下午10:16:42,Bruno Turcksin写道:
Reply all
Reply to author
Forward
0 new messages