On 8/8/22 02:44, M. Bänsch wrote:
*** Caution: EXTERNAL Sender ***
Dear community,
I am currently trying to implement h-adaptive mesh refinement into step-67 (by
adding a refine_grid() functionality). As references I looked into step-31
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dealii.org%2Fcurrent%2Fdoxygen%2Fdeal.II%2Fstep_31.html&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C748797de48544ab12a7f08da791a3eb8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637955450882849163%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6qPfXFxiq0ozBmOtX8MYP5BrnmuvzYY7iBJLeM%2Bv%2BYg%3D&reserved=0>,
step-33
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dealii.org%2Fcurrent%2Fdoxygen%2Fdeal.II%2Fstep_33.html&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C748797de48544ab12a7f08da791a3eb8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637955450882849163%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XCKIzscMt9PFmPe5aUYV3%2FNSuOBsPCCYk5QgcoR1TIw%3D&reserved=0>,
the previous question for step-59
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fg%2Fdealii%2Fc%2FokNWVIHwcTA%2Fm%2FqhfflrXkBgAJ&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C748797de48544ab12a7f08da791a3eb8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637955450882849163%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7m%2BsPB5lHeunKIo%2BmzlIdYkXBRpfVehRIge3MijHYEU%3D&reserved=0>
and the distributed::SolutionTransfer documentation.
I tried to adapt the approach in the SolutionTransfer documentation
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dealii.org%2Fcurrent%2Fdoxygen%2Fdeal.II%2Fclassparallel_1_1distributed_1_1SolutionTransfer.html&data=05%7C01%7CWolfgang.Bangerth%40colostate.edu%7C748797de48544ab12a7f08da791a3eb8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637955450882849163%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SpPh8sR2M%2Fd6YD1gngnxbZFCHzcRKbj5spcwGm1RUn4%3D&reserved=0>
so that it matches what I see in the references.
Unfortunately, I get the following error:
-----------------
The violated condition was:
(data_range.size() % bytes_per_entry == 0)
Additional information:
This exception -- which is used in many places in the library -- usually
indicates that some condition which the author of the code thought must be
satisfied at a certain point in an algorithm, is not fulfilled. An example
would be that the first part of an algorithm sorts elements of an array in
ascending order, and a second part of the algorithm later encounters an
element that is not larger than the previous one.
There is usually not very much you can do if you encounter such an exception
since it indicates an error in deal.II, not in your own program. Try to come
up with the smallest possible program that still demonstrates the error and
contact the deal.II mailing lists with it to obtain help.
-----------------
The previous question basically achieved what I am trying to implement but the
additional functionality that comes with step-59's setup_system() call takes
care of all the interpolation etc.
I have the feeling that I misunderstood something in the documentation (for
example replacing the interpolated_solution part. Would someone be able to
tell me if I made a mistake with adapting the documentation to what I have.
Is there also some mistake on my part since I need another structure
for LinearAlgebra::distributed::Vector (instead of the TrilinosWrappers
vectors from the documentation)?
Any help would be much appreciated.
It's hard to say what the reason is without having a small test case that
shows the issue. Since the issue happens during solution transfer, it is
almost certainly not something related to whether or not you build solutions.
As is generically the case, it is easiest to find the problem if you reduce
the program that produces the error to something as minimal as possible --
just throw out everything that can be thrown out. Do you think you can come up
with such a program?
Separately (and almost certainly unrelated): Did you mean to reinit() the
'solution' variable twice here?
```
LinearAlgebra::distributed::Vector<Number> old_solution;
old_solution.reinit(locally_owned_dofs,
locally_relevant_dofs,
MPI_COMM_WORLD);
old_solution = solution;
soltrans.prepare_for_coarsening_and_refinement(old_solution);
solution.reinit(locally_owned_dofs, MPI_COMM_WORLD);
soltrans.interpolate(solution);
```
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
--
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/faf09fcd-6050-d494-23ec-ee4b4b59a215%40colostate.edu.