t8code icon indicating copy to clipboard operation
t8code copied to clipboard

Matching the face to the boundary conditions on the coarse mesh

Open HenningScheufler opened this issue 2 years ago • 3 comments

Thanks for the maintaining and developing this extremely useful library.

The documentation is quite good and i was able to get started quite quickly. However, it unclear to me how i can correlate a face of a cell to a boundary condition on the coarse mesh. So i want to basically know which cell face has which boundary label (e.g. top,bot,left,right):

grafik

HenningScheufler avatar Dec 12 '23 17:12 HenningScheufler

Hello Henning,

i am sorry for the late reply, currently almost everyone is ill or on holidays. We are happy that you are working with t8code. Please feel free to ask any questions.

To answer your question: you can use cmesh attributes to store arbitrary user information on each tree. So you could for example create a new struct with the infos

int tree_face;
int boundary_condition; // could also be a string or whatever you prefer

and then add one for each face to the cmesh trees via t8_cmesh_set_attribute (https://github.com/DLR-AMR/t8code/blob/main/src/t8_cmesh.h#L267)

You can read it with the corresponding get function.

To find out whether an element's face satisfies a bc you can use t8_element_is_root_boundary and t8_element_tree_face from https://github.com/DLR-AMR/t8code/blob/main/src/t8_element_cxx.hxx to determine if it's at the boundary and if so at which tree face it sits on and then get the attribute as above.

I hope that was clear and we really should write a Tutorial about attributes and bc.

Best wishes and happy holidays.

holke avatar Dec 19 '23 07:12 holke

Thanks for the help. I will post the solution if i have it

HenningScheufler avatar Dec 19 '23 17:12 HenningScheufler

Hi @HenningScheufler, just checking whether this is resolved? Can we close the issue, or do you still have issues?

holke avatar Jan 29 '24 14:01 holke