I am not completely sure what you want to accomplish, but I think the
following code should work for your purpose:
```
for(const auto & cell : triangulation.active_cell_iterators())
for(const auto & face : cell-> face_iterators())
if(face->at_boundary() && face->boundary_id() == 1)
// do something useful
```
(plus minus a few typos)
Hope that helps,
Peter
On Sunday, 7 March 2021 at 21:00:12 UTC+1 [email protected] wrote:
> Yes, I have tried it. The problem I am having is with the
> 'face->boundary_id() == 1' piece. I get an error which states that :
> 'face' was not declared in this scope.
>
> The only other place that 'face' appears in my code is where I set the
> boundary ids like the following:
>
> triangulation.begin_active->face()->set_boundary_id()
>
> Is there an easier way to access that boundary in the second half of that
> if statement above other than
>
> (face->boundary_id() == 1)
>
> or is this the correct approach and it needs to be amended somehow?
> On Sunday, March 7, 2021 at 1:49:12 PM UTC-5 Wolfgang Bangerth wrote:
>
>> On 3/7/21 5:30 AM, Nikki Holtzer wrote:
>> >
>> > For a 1d problem, I would like to implement a "boundary matrix" for an
>> > absorbing boundary condition such as the one presented in Step 24 for
>> only the
>> > left boundary. Is it necessary to have the 'if' statement be a
>> conditional
>> > over faces like in Step 24 even though it is a 1d problem or is
>> something like
>> >
>> > if (cell->at_boundary() && (face->boundary_id() == 1)) {
>> > }
>> > acceptable?
>>
>> The statement is ok I believe (have you tried?), the question is what you
>> want
>> to do after that.
>>
>> Best
>> W.
>>
>> --
>> ------------------------------------------------------------------------
>> 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/b84474b8-4a97-44e4-8eb8-d45f5e31b992n%40googlegroups.com.