Hi,
I'm not sure I understand exactly what you want to do, but if you know
which cell you want in a triangulation by level and index you can get its
center by creating the cell iterator. For example:
const int dim = 2;
Triangulation<dim> triangulation;
GridGenerator::hyper_cube(triangulation);
const unsigned int cell_level = 0, cell_index = 0;
const auto cell = Triangulation<dim>::active_cell_iterator(&triangulation,
cell_level,
cell_index);
std::cout << cell->center() << std::endl;
Maybe this answer is useful too:
https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#can-i-convert-triangulation-cell-iterators-to-dofhandler-cell-iterators
Best,
Simon
On Thursday, April 29, 2021 at 10:48:30 AM UTC+2 [email protected] wrote:
> Hi all,
>
> I'm looking to map DoF from the bottom of an extruded volumetric mesh to
> the corresponding DOF on the surface of the mesh. Right now, I'm saving the
> cell "number"/ID of each cell in the bottom layer of the volume mesh, and
> want to match it with a surface cell by comparing their centers
>
> - I could loop over all the volume cells until I find the one matching
> the surface cell center, but as I have the cell numbers, I would rather
> access the cell center from the cell id (which looks to me like an
> unsigned
> int)
> - something like get_cell(cell_id)->center --- is this possible?
> - Alternatively, I was thinking that a periodic boundary condition
> linking the bottom of the volume mesh with the top might be able to
> achieve
> the same thing, but I wasn't sure how to go about setting it up
>
> Any pointers would be appreciated!
> Corbin
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/3833b90d-1855-494f-953c-38fa2f4ce868n%40googlegroups.com.