Determine boundaries by cell-by-cell inspection
I am trying to perform a simulation of a 3D free surface flow.
I already have the mesh, and now I have to set the BCs for it.
For the no-slip surfaces I would just use on_boundary.
I can easily identify the inflow and outflow faces, as those are in planes, so I would do something like:
def inside(x, on_boundary):
on_boundary and (x in the inflow/outflow plane)
For the free surface BC I do have some additional work to do. I extracted the coordinates of all points lying on the free surface with Paraview, stored them in a Python array(FS_coor), performed an iteration through all cells in the mesh and stored in a list all cells(FS_cells) that have at least three of their nodes among the surface nodes (I am using CG degree 1 elements).
Is it possible to create a MeshFunction that can get the cells a face belongs to, and mark that face if it is both on_boundary and the cell it belongs to (the only cell it belongs to) is among FS_cells?
I hope the explanation was understandable, and if any of you can think of an easier way to do it, please let me know!
Thanks,
Marcos
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Mikael Mortensen
- Solved:
- Last query:
- Last reply: