On Thu, Apr 6, 2017 at 1:18 AM, Giacomo Rosilho de Souza <
giacomo.rosilhodeso...@epfl.ch> wrote:

> Hi, thanks for the hints.
> At the end I did it with the Triangle library, its probably not very
> performing but I'm not interested on that at the moment. The main
> routines are the following
>      - save_mesh: it saves the current mesh (using
> Mesh::copy_nodes_and_elements) and creates a system with this mesh and
> the same variables of the system I'm currently using. I don't need any
> vector in practice.
>      - add_remove_node;  it takes the error estimators and adds/removes
> nodes to the the mesh accordingly to the error per element and the
> tolerance
>      - new_Delaunay_mesh: rebuilds the mesh from scratch, using the new
> node's set
>      - project_on_new_delaunay_mesh: this takes two vectors new_v and
> old_v. One with dofs on the new mesh and the other on the old mesh.
> Thanks to the system created in the save_mesh method I'm able to create
> a MeshFunction
>        and project the old vector onto the new mesh.
>      - Finally I've overloaded the
>          System::project_vector (const NumericVector<Number>& old_v,
> NumericVector<Number>& new_v, int is_adjoint) const;
>        method and replaced the line
>          Threads::parallel_for (active_local_elem_range,
> FEMProjector(*this, f, &g, setter, vars));
>        with
>          project_on_new_delaunay_mesh(old_vector,new_vector);
>
> The algorithm is:
>      - call save_mesh
>      - call add_remove_node
>      - call new_Delaunay_mesh
>      - call equation_systems.reinit(), which will call project_vector
> and project_on_new_delaunay_mesh.
>
> The most expensive part are the project_on_new_delaunay_mesh and
> new_Delaunay_mesh methods, save_mesh is negligible. If you're interested
> I could set up a running example and send it to you.
>

This sounds pretty interesting! I assume you used the version of Triangle
that is distributed with libmesh?  Do you have any plans for doing
something similar for 3D?

If you are willing to share your code that would be great, it might inspire
someone else to make it into a more generalized libmesh capability...

-- 
John
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to