On latest dev branch. Script to recreate:
# %%
import underworld3 as uw
from underworld3.systems import Stokes
import numpy as np
import sympy
import os
from petsc4py import PETSc
# %%
res = 0.2
mesh = uw.meshing.UnstructuredSimplexBox(
minCoords=(-1.0, 0.0),
maxCoords=(1.0, 1.0),
cellSize= res,
regular=False,
qdegree=3,
)
# %%
swarm = uw.swarm.Swarm(mesh=mesh)
material = swarm.add_variable(name="material", size=1, dtype=PETSc.IntType)
swarm.populate(fill_param=4)
swarm.write_timestep(filename='swarm', swarmname='swarm', index=0, outputPath='./', swarmVars=[material])
On latest dev branch. Script to recreate: