this seems like an obvious task to do but I can’t seem to find the obvious way to do it.
I have a tetrahedron mesh which I’m happily exporting to the “.medit” file format with .mesh extension - in readable or .meshb in binary format.
Moreover, each tetrahedron has a label which encodes material properties coming from the CAD program.
(In case it is interesting: The PDE to solve is the steady-state heat equation with non-constant coefficients according to the material’s thermal conductivities. Each label has one and only one thermal conductivity in K/(nm) associated with it. I easily figured out the weak form and the how to solve the equation in Freefem.)
I just can’t manage to write my tetrahedra labels into the “.mesh” file in such a way that I can easily import them into a function in Freefem.
Since this is such a profane task, I think there should be a canonical way to do it.
Ideally, I would like to write the tet labels with the libMeshb library. but that’s for the bonus points.
Thanks for help!
It is trivial,
the tetra label is code in region number
mesh3 Th("yours.mesh"); fespace Ph(Th,P0); Ph coef = region; // Be careful because coef is real finite function and region is integer. plot(coef,wait=1); // to see coef .. // here use coef directly in your formulation.
In my first phrase I already admitted myself it’s probably obvious.
However, it is actually not obvious because it does require a restricted keyword “region” which one has to find and which pulls the information somehow from a global namespace. That’s not obvious at all.
Even if it was “trivial”, there is no need to publicly humiliate your users.
Also, you ignore the part of the question about meshb.
For me in French trivial mean very simple with no other idéal sorry for this error