Hi,
I am working on a 3d surface mesh. so, i meshed the 3D surface in GMSH, and imported to dolfin using the dolfin-convert.
when i print the node coordinates, I see only two coordinates. Why is this happening?
For example, in fenics I see,
Node 0: [-0. -0.]
Node 1: [0.7 0.1]
Node 2: [0. 0.]
Node 3: [0.7 0.1]
Node 4: [0.08230965 0.04710366]
........... and so on...
GMSH file:
$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
4
1 5 "fixed"
1 7 "fixed2"
1 8 "load"
2 6 "domain"
$EndPhysicalNames
$Nodes
116
node 1 -0 -0 0
node 2 0.7 0.1 0
node 3 0 0 1
node 4 0.7 0.1 1
node 5 0.08230965019596791 0.04710365937903452 0
..........and so on ..............
i use the following lines to read the mesh,
mesh = Mesh()
h5_file = "../mesh_files/membrane-only.h5"
hdf = HDF5File(mesh.mpi_comm(), h5_file, "r")
hdf.read(mesh, "/mesh", False)
# define mesh parameters
nsd = mesh.geometry().dim()
n = FacetNormal(mesh)
I = Identity(nsd)
h = CellDiameter(mesh)
print(nsd)
# read mesh functions
boundaries = MeshFunction("size_t", mesh, nsd - 1)
ds = ds(metadata={'quadrature_degree': 2}, subdomain_data=boundaries)
hdf.read(boundaries, "/boundaries")
domains = MeshFunction("size_t", mesh, nsd)
dx = dx(metadata={'quadrature_degree': 2}, subdomain_data=domains)
hdf.read(domains, "/domains")
x_i = SpatialCoordinate(mesh)
# Get the coordinates of the nodes
coordinates = mesh.coordinates()
# Print the coordinates
for i, coord in enumerate(coordinates):
print(f"Node {i}: {coord}")