dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22287
Re: [Question #150226]: Using mesher region information /?tags
Question #150226 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/150226
Anders Logg proposed the following answer:
Sorry, there was a typo in the code I sent. Try this:
from dolfin import *
mesh = UnitSquare(2, 2)
mesh.data().create_mesh_function("cell_domains", 2) # 2 = dim of cells in 2D
mesh.data().create_mesh_function("exterior_facet_domains", 1) # 1 = dim of facets in 2D
file = File("mesh.xml")
file << mesh
I think "group id" sounds too generic. If it has a specific meaning
(like indicators for domains or material parameters) then it might be
natural to write that data as part of the mesh XML file in the <data>
section. If it has no meaning, I would just write it to a separate XML
file (containing a MeshFunction) and name that file something like
foo_data.xml where foo is the name of the mesh file.
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.