I'm trying to write a code in deal.II to solve a moving boundary problem, where
> the boundary moves according to the velocity field $\mathbf{v}$. After solving > at each timestep, I want to interpolate the "old_solution" onto the new grid. > However, I am unsure about how to go about this. I can move the mesh as in
> step-18, but this does not include interpolation of the solution?  I was
> thinking of using FEFieldFunction, but triangulation2 needs to be entirely
> included within triangulation1, but if the boundary is moving, this may
> not be  the case.

You are trying to implement something for which I gather you don't yet quite know what it is. You first need to figure out what it is that you really want, and then you will also know how to implement it. Specifically:
- In the step-18 way, we assume that the quantities that we move from
  the old to the new mesh indeed "advect" with the mesh. For example,
  if you imagine a solid where in every point you have a quantity that's
  attached to the solid (e.g., crystal defect density; chemical
  composition; imprinted stress) then these are things that need to
  deform with the mesh if the mesh deforms with the body.
- If you were to use the FEFieldFunction route, then you assume that the
  quantity that you had on the old mesh remains where it is while the
  body and associated mesh move. This would be the case if what you want
  to transfer is a quantity that does not move along with the material.
  Examples would be the intensity of an external X-ray beam going
  through tissue, etc. In such a case, you want to interpolate the
  value of this external field from the old mesh to the new mesh using
  exactly the same coordinate values (and not advected coordinates). In
  this case you will also have to figure out what the values should be
  at points that are now part of the domain but that previously weren't.

Does this taxonomy help?


I tried using something like

------------------------------------------------------------------------------------------------------------------------------------------

BlockVector<double>  x_sol = solution;
SolutionTransfer<dim, BlockVector<double>  >  solution_transfer(dof_handler);

for (typename DoFHandler<dim>::active_cell_iterator
           cell = dof_handler.begin_active ();
         cell != dof_handler.end(); ++cell)
     {
       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] = 
time_step*solution(cell->vertex_dof_index(v,d));
            }
            cell->vertex(v) += vertex_displacement;
          }
       }
     }

solution_transfer.interpolate(x_sol, solution);


--------------------------------------------------------------------------------------------------------------------

but even if I redistributed dofs etc, I still get the error

void dealii::SolutionTransfer<dim, VECTOR, DH>::interpolate(const VECTOR&, VECTOR&) const 
[with int dim = 2, VECTOR = dealii::BlockVector<double>, DH = dealii::DoFHandler<2>]
The violated condition was:
     in.size()==n_dofs_old
The name and call sequence of the exception was:
     ExcDimensionMismatch(in.size(), n_dofs_old)
Additional Information:
Dimension 3202 not equal to 0

which I don't really understand, as my "n_dofs_old" should have size 3202
> as well, as the mesh is just moved! May be I have missed something quite simple.

I think you are missing a call to one of the SolutionTransfer::prepare_* functions.

Best
 W.

------------------------------------------------------------------------
Wolfgang Bangerth               email:            [email protected]
                                www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to