-
Hi all, Me again, in the Navier-Stokes miniapps, I see that most of the time, the boundary conditions are applied using an arbitrary function(x,t), that return either the pressure or velocity. All the boundaries use the same function and the boundaries are identified based on their position "x". In complex geometries, it is complicated to find a condition to identify each boundary. Maybe it's a dumb question, but is it possible to identify the surfaces by their attribute number or any form of Identification number ? Thank you ! Francis |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Yes this is of course possible. Boundaries on meshes can be tagged by boundary attributes during the meshing process. You can look at https://github.com/mfem/mfem/blob/master/miniapps/navier/navier_turbchan.cpp#L154-L157 where I specify attributes instead of checking the topological location. |
Beta Was this translation helpful? Give feedback.
-
Using gmsh, we would setup BC using physical groups. I tried to define a very simple rectangular surface mesh with four distinct sides, and it seems that the
gmsh -2 -format msh2 test.geo Just load the mesh and display Mesh mesh;
mesh.LoadFromFile(mesh_file);
std::cout << "bdr_attributes: " << mesh.bdr_attributes.Max() << std::endl;
/*
Gmsh reader: all element attributes were zero.
MFEM only supports positive element attributes.
Setting element attributes to 1.
Assertion failed: (size > 0) is false:
--> Array is empty with size 0
... in function: T mfem::Array<T>::Max() const [with T = int]
... in file: /home/francisg/git/mfem/general/array.cpp:70
Aborted (core dumped)
*/ Somehow, the physical groups are lost... Idealy, we would be able to retrieve the boundary ID corresponding to a named physical names, but that doesn't seems to be implemented at the moment. |
Beta Was this translation helpful? Give feedback.
Yes this is of course possible. Boundaries on meshes can be tagged by boundary attributes during the meshing process. You can look at https://github.com/mfem/mfem/blob/master/miniapps/navier/navier_turbchan.cpp#L154-L157 where I specify attributes instead of checking the topological location.