Hi Rajat,

I’m a bit ashamed to say that I’ve had a pull-request that adds support for 
Mesquite and Verdict to the library out for quite some time now. That’s this 
one here:
https://github.com/dealii/dealii/pull/8196 
<https://github.com/dealii/dealii/pull/8196>
That includes all of the CMake stuff to pick up Mesquite and Verdict that are 
built as stand-alone projects, as well as the header-only implementation of the 
grid smoothing tools as well as a load of tests (which also demonstrate how to 
use the interface). You can do the untangling/smoothing in the 
original/reference configuration or the current/Eulerian configuration (so, 
untangle the displaced mesh). Everything works “in memory” — no copies to and 
from temporary files. The only thing that I think that isn’t yet implemented 
(if my memory serves me correctly) is support for distributed triangulations 
(and some of the quality algorithms from Verdict).

In case its useful, there’s also a sister pull request that adds Mesquite to 
our bundled libraries:
https://github.com/dealii/dealii/pull/5971 
<https://github.com/dealii/dealii/pull/5971> 


Here your can see a glimpse of the untangler at work:
https://github.com/dealii/dealii/pull/5971#issuecomment-369842462 
<https://github.com/dealii/dealii/pull/5971#issuecomment-369842462>

Unfortunately things got a little tricky, because Mesquite is now considered a 
“dead” project upstream. So we had to pause to think about how we’d make this 
available for users that get the library from all sources (i.e. build it 
themselves vs. builds distributed with linux). After that, I didn’t have the 
time to work on this any further, and I’ve not found the right occasion to make 
another push to get it into the library. But maybe after this next release I’ll 
try to do so. 

For now, you can use Mesquite+Verdict from the pull request in (at least) one 
of these two ways:
1. By adding CMake configuration files from one of those two open PRs to your 
own deal.II source, and then just transferring the header-only implementation 
that can be found here: 
https://github.com/dealii/dealii/pull/8196/files#diff-16296062eac3dac69ddadc0f4d1647c1d8ad7c2d82e108ccb3d69932c88ba90a
 
<https://github.com/dealii/dealii/pull/8196/files#diff-16296062eac3dac69ddadc0f4d1647c1d8ad7c2d82e108ccb3d69932c88ba90a>
 . Or you can rebase the branch from the PR on a more recent version of deal.II 
and use it “as is”. Github doesn’t indicate that there are any merge conflicts.
2. You could write your own CMake configuration files for your own project that 
can be used to pick up a Mesquite + Verdict, and then add the header file that 
does the implementation directly to your project.

I know that neither of these are a great solution, but they’re probably less 
effort than writing this all from scratch? Since there’s definitely some active 
interest from the community, I’ll try a bit harder to get this feature into the 
library in the release after the next one.

Best,
Jean-Paul


> On 1. Mar 2021, at 23:55, rajat.a...@gmail.com <rajat.arora9...@gmail.com> 
> wrote:
> 
> Hello everyone,
> 
> I am trying to solve a 3d solid mechanics problem using deal.ii, PetSc, and 
> p4est (p::d::triangulation) where in the mesh moves in time (like step-18).  
> After a while, the distortion in the mesh is too much and I am looking for a 
> re-meshing strategy that can help untangle the mesh and transfer the solution 
> and Gauss point history variables from old mesh to new mesh. 
> 
> 
> After looking at several posts in this group related to the above use case, I 
> have come to the following strategy. Please let me know if this is okay. I 
> would also like to contribute my solution for anyone else to use, therefore I 
> am also open to any implementation-specific suggestions.
> 
> 1. Write the old mesh in the vtk file.
> 2. Read the mesh in mesquite and smoothen it.
> 3. Calculate the "displacement" of the mesh coordinates and write them in a 
> file.
> 
> 4. Now, restart your code with the old mesh file, and setup everything like 
> before.
> 5. Create a new triangulation that is same as old mesh and then move its 
> vertices    using the displacements calculated above in Mesquite.
> 
> 6. You may use FeFieldFunction to transfer the solution from the old mesh to 
> the new mesh by one of the following 2 methods:
>       a) L2 projection from old mesh to new mesh (Projection)
>       b) Simple evaluation of solution values on the new nodal coordinates 
> (Interpolation)
> 
> Note 1: One good thing in this approach is that FeFieldFunction would not 
> throw exception if you ensure that the new mesh has the same partition as the 
> old mesh. In this case,  new mesh is just displaced from the old mesh.
> 
> Note 2: Also, instead of writing mesh and displacement solutions to file, 
> things can be transferred in memory but the strategy remains the same.
> 
> Here are my questions related to implementation.
> 
> 
> Q1. Please let me know if this strategy is fine. 
> 
> Q2. Can we use VectorTools::Interpolate/ project function instead of using 
> the FeFieldFunction on our own? I ask this because the documentation says the 
> the tria's should have a common coarse grid to use 
> VectorTools:Interpolate/Project. Does that mean 
> VectorTools:Interpolate/Project can only be used when there is refinement 
> and/or coarsening happening. It cannot be used when the two meshes are just 
> displaced wrt to each other?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <https://groups.google.com/d/forum/dealii?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+unsubscr...@googlegroups.com 
> <mailto:dealii+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/f3562a4b-325f-41b9-834a-1e7f23b65575n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/f3562a4b-325f-41b9-834a-1e7f23b65575n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/39E5B03E-8799-4362-9CEA-B48A65D30DAB%40gmail.com.

Reply via email to