Thank you for your input! That was my first attempt at tackling this. However, I run into problems with the line
for(const auto & face : cell-> face_iterators()). No matter what member function I choose off of the DoFCellAccessor class template reference, I get some version of the following: class dealii::DoFCellAccessor<dealii::DoFHandler<1, 1>, false>’ has no member named ‘face_iterators’; did you mean ‘face_iterator’? If I then try the correction: I obtain the following: invalid use of ‘using face_iterator'= class dealii::TriaIterator<dealii::DoFAccessor<0, dealii::DoFHandler<1, 1>, false> >’ Like I said, this seems to happen with all the member functions I choose for DoFCellAccessor. On Sunday, March 7, 2021 at 3:07:09 PM UTC-5 [email protected] wrote: > 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/69b308e3-13ef-43fb-a9d3-a765b7017fb0n%40googlegroups.com.
