Hi!
You need to create bulk_node_ids and bulk_elem_ids after you have a boundary mesh.
They are important to identify points from the boundary mesh in the bulk mesh.
If you have a real 1D mesh (i.e. it consists of lines as elements) then creating boundary meshes in paraview is very simple. You just select a point (via the interactive point selection in the viewer, or the spreadsheat representation) and use the extract selection filter, after that, you can save the selection as a vtu file. In 2D and 3D you can use the extract boundary tool in our binary directory: Extract Boundary
To create MaterialIDs you can use VTUInterface (the latest version! 0.704, as older versions don’t support setting types) in python, for example:
import vtk # needed to set the array type
import vtuIO
f = vtuIO.VTUIO("bulk_mesh.vtu")
f.delete_cell_field("MaterialIDs") # If an old MaterialIds array is already present, delete it
# define material ids with the desired mapping
def mat_ids(x,y,z):
if x<0.5:
return 0
else:
return 1
f.func_to_field(mat_ids, "MaterialIDs","new_bulk_mesh.vtu", cell=True, array_type=vtk.VTK_INT, writefile=True) # it is important that the MaterialIDs array is a cell array of size INT32 (vtk.VTK_INT)