On 3/13/20 5:34 PM, Krishnakumar Gopalakrishnan wrote:
Looking at step-7 and adapting it a little bit, does the following code look
reasonable to mark the boundary ID of the left edge as '1' for later setting
its flux?
for (const auto &cell : triangulation.cell_iterators
<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdealii.org%2Fdeveloper%2Fdoxygen%2Fdeal.II%2Fgroup__CPP11.html%23ga7295c669f32e78c45446ddc236f19136&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7C78a1855a0a7a4b3ac25608d7c7a716c5%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637197392773455746&sdata=c5HWHjdx99F5AhA4Si5Zesfqc3krTMVywMf6E7nso2Y%3D&reserved=0>())
for (const auto &face : cell->face_iterators())
{
const auto center = face->center();
if (std::fabs(center(0)) < 1e-12)
face->set_boundary_id(1);
}
This is based on my assumption that center(0) method of a face iterator shall
return the actual co-ordinate itself (since in the 1D case, the face
degenerates to a single point and its center is the same).
Have you tried this? I think it should work, but it will be faster for you
(and for us) if you just played with stuff and tried whether it actually works :-)
On a related note,
when we use the arrow operator, under which page should I look up the
documentation. Searching for center() returns a whole lot of results in doxygen.
The class in question is TriaAccessor.
Best
WB
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/f8095857-cb3a-360c-34e9-a54ba561b27c%40colostate.edu.