Exemple #1
0
    def __createDataset(self):
        from esys.weipa.weipacpp import EscriptDataset
        from esys.weipa import createDataset

        ds = createDataset(self._domain, **self._data)
        ds.setCycleAndTime(self._N, self._time)
        ds.setMetadataSchemaString(self._md_schema, self._metadata)
        ds.setMeshLabels(self._meshlabels[0], self._meshlabels[1], self._meshlabels[2])
        ds.setMeshUnits(self._meshunits[0], self._meshunits[1], self._meshunits[2])
        return ds
Exemple #2
0
    def siloWriterCallback(self, k, x, Jx, g_Jx, norm_dJ=None, norm_dx=None):
        """
        callback function that can be used to track the solution

        :param k: iteration count
        :param x: current approximation
        :param Jx: value of cost function
        :param g_Jx: gradient of f at x
        """
        fn='inv.%d'%k
        ds=createDataset(susceptibility=self.getCostFunction().getProperties(x))
        ds.setCycleAndTime(k,k)
        ds.saveSilo(fn)
        self.logger.debug("J(m) = %e"%Jx)
Exemple #3
0
    def siloWriterCallback(self, k, x, Jx, g_Jx, norm_dJ=None, norm_dx=None):
        """
        callback function that can be used to track the solution

        :param k: iteration count
        :param x: current approximation
        :param Jx: value of cost function
        :param g_Jx: gradient of f at x
        """
        fn = 'inv.%d' % k
        ds = createDataset(density=self.getCostFunction().getProperties(x))
        ds.setCycleAndTime(k, k)
        ds.saveSilo(fn)
        self.logger.debug("J(m) = %e" % Jx)