Beispiel #1
0
    def __init__(self, mesh, element, name='fspace'):

        self._themiselement = ThemisElement(element)

        self.ncomp = self._themiselement.get_ncomp()
        self._mesh = mesh
        self._name = name
        self._spaces = [
            self,
        ]
        self.nspaces = 1
        self.npatches = mesh.npatches

        UFLFunctionSpace.__init__(self, mesh, element)

        #create das and lgmaps
        self._composite_da = PETSc.DMComposite().create()
        self._da = []
        self._lgmaps = []
        self._component_offsets = []
        for ci in xrange(self.ncomp):
            self._component_offsets.append(self.npatches * ci)
            das = []
            lgmaps = []
            for bi in range(self.npatches):
                das.append(mesh.create_dof_map(self._themiselement, ci, bi))
                lgmaps.append(das[bi].getLGMap())
                self._composite_da.addDM(das[bi])
            self._da.append(das)
            self._lgmaps.append(lgmaps)
        self._composite_da.setUp()

        self._component_lgmaps = self._composite_da.getLGMaps()
        self._overall_lgmap = self._composite_da.getLGMap()
        self._cb_lis = self._composite_da.getLocalISs()
Beispiel #2
0
    def __init__(self, mesh, element, name='fspace', si=0, parent=None):

        self._themiselement = ThemisElement(element)
        self._uflelement = element

        self.interpolatory = self._themiselement.interpolatory

        self.ncomp = self._themiselement.ncomp
        self._mesh = mesh
        self._name = name
        self._spaces = [
            self,
        ]
        self.nspaces = 1

        self._si = si
        if parent is None:
            self._parent = self
        else:
            self._parent = parent

        UFLFunctionSpace.__init__(self, mesh, element)

        # create das and lgmaps
        self._composite_da = PETSc.DMComposite().create()
        self._da = []
        self._lgmaps = []
        self._component_offsets = []
        for ci in range(self.ncomp):
            self._component_offsets.append(ci)
            da = mesh.create_dof_map(self._themiselement, ci)
            lgmap = da.getLGMap()
            self._composite_da.addDM(da)
            self._da.append(da)
            self._lgmaps.append(lgmap)
        self._composite_da.setUp()

        self._component_lgmaps = self._composite_da.getLGMaps()
        self._overall_lgmap = self._composite_da.getLGMap()
        self._cb_lis = self._composite_da.getLocalISs()