def get_view(self, system, comm, varmap):
        view = self.__class__(system._sysdata, system._probdata, comm)
        view.alloc_complex = self.alloc_complex
        view_size = 0

        start = -1

        alloc_complex = self.alloc_complex

        # varmap is ordered, in the same order as _dat
        for name, pname in iteritems(varmap):
            if name in self._dat:
                acc = self._dat[name]
                if acc.pbo or acc.remote:
                    view._dat[pname] = Accessor(view, None, acc.val, acc.meta,
                                                self._probdata,
                                                alloc_complex)
                else:
                    pstart, pend = acc.slice
                    if start == -1:
                        start = pstart
                        end = pend
                    else:
                        assert pstart == end, \
                               "%s not contiguous in block containing %s" % \
                               (name, varmap.keys())
                    end = pend
                    meta = acc.meta

                    if alloc_complex:
                        imag_val = acc.imag_val
                    else:
                        imag_val = None

                    view._dat[pname] = Accessor(view,
                                                (view_size, view_size + meta['size']),
                                                acc.val, meta, self._probdata,
                                                alloc_complex, imag_val=imag_val)
                    view_size += meta['size']

        if start == -1: # no items found
            view.vec = self.vec[0:0]
            if alloc_complex:
                view.imag_vec = self.imag_vec[0:0]

        else:
            view.vec = self.vec[start:end]
            if alloc_complex:
                view.imag_vec = self.imag_vec[start:end]

        return view
Return a new `VecWrapper` that is a view into this one.
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/core/vec_wrapper.py/VecWrapper.get_view