Hi,
I'm using the Dolfin C++ interface.
I would like to store in a Mesh some information related to facet/cell markers, in such a way that when I do
File mesh_file ("my_mesh.xml");
mesh_file << mesh;
also the information about markers is saved.
I've seen that one of the suggested possibility is to use the mesh.domains().
Is this the right way of doing it?
If it is the case, how can I assign values to mesh.domains.markers(n) ??
At the moment I'm storing information in a MeshFunction/MeshValueCollection and I would like to assign it to mesh.domains().markers( dim);
A very simple example is:
int main()
{
using namespace dolfin;
UnitSquareMesh mesh(4,4);
MeshFunction<uint> sub_domains(mesh, 2);
sub_domains.set_all(0);
for (CellIterator cell(mesh); !cell.end(); ++cell)
{
Point p = (*cell).midpoint();
if (p.x() > 0.5)
sub_domains[*cell] = 1;
}
MeshValueCollection<uint> my_sub_domains ;
my_sub_domains = sub_domains;
//how can I do something like
mesh.domains().markers(2) = my_sub_domains;
File mesh_file ("my_mesh.xml");
mesh_file << mesh;
}
Thanks
Marco