def _write_data(self, vtuf, mk, sk):
    name = self.mesh_inf[mk][0]
    mesh = self.mesh[mk]
    soln = self.soln[sk]
    shapecls = subclass_where(BaseShape, name=name)
    subdvcls = subclass_where(BaseShapeSubDiv, name=name)
    (nspts, neles) = mesh.shape[:2]
    svpts = shapecls.std_ele(self.divisor)
    nsvpts = len(svpts)
    soln_b = shapecls(nspts, self.cfg)
    mesh_vtu_op = soln_b.sbasis.nodal_basis_at(svpts)
    soln_vtu_op = soln_b.ubasis.nodal_basis_at(svpts)
    vpts = np.dot(mesh_vtu_op, mesh.reshape(nspts, (- 1)))
    vpts = vpts.reshape(nsvpts, (- 1), self.ndims)
    vsol = np.dot(soln_vtu_op, soln.reshape((- 1), (self.nvars * neles)))
    vsol = vsol.reshape(nsvpts, self.nvars, (- 1)).swapaxes(0, 1)
    if (self.ndims == 2):
        vpts = np.pad(vpts, [(0, 0), (0, 0), (0, 1)], 'constant')
    self._write_darray(vpts.swapaxes(0, 1), vtuf, self.dtype)
    nodes = subdvcls.subnodes(self.divisor)
    vtu_con = np.tile(nodes, (neles, 1))
    vtu_con += (np.arange(neles) * nsvpts)[:, None]
    vtu_off = np.tile(subdvcls.subcelloffs(self.divisor), (neles, 1))
    vtu_off += (np.arange(neles) * len(nodes))[:, None]
    vtu_typ = np.tile(subdvcls.subcelltypes(self.divisor), neles)
    self._write_darray(vtu_con, vtuf, np.int32)
    self._write_darray(vtu_off, vtuf, np.int32)
    self._write_darray(vtu_typ, vtuf, np.uint8)
    privarmap = self.elementscls.privarmap[self.ndims]
    visvarmap = self.elementscls.visvarmap[self.ndims]
    vsol = np.array(self.elementscls.conv_to_pri(vsol, self.cfg))
    for vnames in visvarmap.values():
        ix = [privarmap.index(vn) for vn in vnames]
        self._write_darray(vsol[ix].T, vtuf, self.dtype)
def _write_data(self, vtuf, mk, sk):
    name = self.mesh_inf[mk][0]
    mesh = self.mesh[mk]
    soln = self.soln[sk]
    shapecls = subclass_where(BaseShape, name=name)
    subdvcls = subclass_where(BaseShapeSubDiv, name=name)
    (nspts, neles) = mesh.shape[:2]
    svpts = shapecls.std_ele(self.divisor)
    nsvpts = len(svpts)
    soln_b = shapecls(nspts, self.cfg)
    mesh_vtu_op = soln_b.sbasis.nodal_basis_at(svpts)
    soln_vtu_op = soln_b.ubasis.nodal_basis_at(svpts)
    vpts = np.dot(mesh_vtu_op, mesh.reshape(nspts, (- 1)))
    vpts = vpts.reshape(nsvpts, (- 1), self.ndims)
    vsol = np.dot(soln_vtu_op, soln.reshape((- 1), (self.nvars * neles)))
    vsol = vsol.reshape(nsvpts, self.nvars, (- 1)).swapaxes(0, 1)
    if (self.ndims == 2):
        vpts = np.pad(vpts, [(0, 0), (0, 0), (0, 1)], 'constant')
    self._write_darray(vpts.swapaxes(0, 1), vtuf, self.dtype)
    nodes = subdvcls.subnodes(self.divisor)
    vtu_con = np.tile(nodes, (neles, 1))
    vtu_con += (np.arange(neles) * nsvpts)[:, None]
    vtu_off = np.tile(subdvcls.subcelloffs(self.divisor), (neles, 1))
    vtu_off += (np.arange(neles) * len(nodes))[:, None]
    vtu_typ = np.tile(subdvcls.subcelltypes(self.divisor), neles)
    self._write_darray(vtu_con, vtuf, np.int32)
    self._write_darray(vtu_off, vtuf, np.int32)
    self._write_darray(vtu_typ, vtuf, np.uint8)
    privarmap = self.elementscls.privarmap[self.ndims]
    visvarmap = self.elementscls.visvarmap[self.ndims]
    vsol = np.array(self.elementscls.conv_to_pri(vsol, self.cfg))
    for vnames in visvarmap.values():
        ix = [privarmap.index(vn) for vn in vnames]
        self._write_darray(vsol[ix].T, vtuf, self.dtype)