Exemple #1
0
 def perform(self, test):
     if self.skip:
         return
     print >> sys.stderr, "Running", self.referencefile
     if self.commands:
         from ooflib.common import utils
         for cmd in self.commands:
             utils.OOFexec(cmd)
     menuitem = getattr(OOF.Mesh.Analyze, self.operation)
     menuitem.callWithDefaults(
         mesh='microstructure:skeleton:' + self.mesh,
         data=getOutput(self.output, **self.oparams),
         time=self.time,
         domain=self.domain,
         sampling=self.sampling,
         destination=OutputStream(filename='test.dat', mode='w'))
     ## TODO 3.1: The default params for fp_file_compare include
     ## "comment='#'", so comments in files aren't compared.  This
     ## is useful for log files, since they contain a comment with
     ## the OOF version number, which changes.  However, output
     ## files include meaningful comments that *should* be
     ## compared.  Adding "comment=None" to the args here would
     ## achieve that.  Doing so makes the tests fail because the
     ## output files have "show_x=True" and the reference files
     ## have "show_x=1".  Do the reference files need to be
     ## updated, or do some versions of Python write bools as 1,0
     ## instead of True,False?
     test.assert_(
         fp_file_compare('test.dat',
                         os.path.join('output_data', self.referencefile),
                         self.tolerance))
     file_utils.remove('test.dat')
Exemple #2
0
 def load(self):
     utils.OOFexec(self.cmd)
Exemple #3
0
# -*- python -*-

# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# [email protected]. 

from ooflib.common import utils
from ooflib.common import debug
from ooflib.SWIG.common import config
utils.OOFexec('import ooflib.SWIG.common.ooferror') # exception handling
utils.OOFexec('from ooflib.common.IO.mainmenu import OOF') # Main OOF menu
import ooflib.common.excepthook

import ooflib.common.IO.activeareamenu
import ooflib.common.IO.activeareamodmenu
import ooflib.common.IO.automatic
import ooflib.common.IO.automaticdoc
import ooflib.common.IO.bitmapdisplay
import ooflib.common.IO.bitoverlaydisplay
import ooflib.common.IO.colormap
import ooflib.common.IO.layereditor       # adds LayerEditor to OOF menu
import ooflib.common.IO.menudump
import ooflib.common.IO.microstructuremenu
import ooflib.common.IO.pixelgroupmenu
import ooflib.common.IO.pixelinfo
import ooflib.common.IO.pixelinfodisplay
import ooflib.common.IO.pixelselectionmenu
Exemple #4
0
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# [email protected].

# All components of engine that need initialization *before* they're
# used should be imported here.  Using OOFexec makes the names
# available in the __main__ environment in text mode.

from ooflib.common import debug
from ooflib.common import parallel_enable
from ooflib.common import utils
import ooflib.SWIG.engine.ooferror2
from ooflib.SWIG.common import config

import ooflib.engine.materialplugin
utils.OOFexec('from ooflib.engine.problem import *')
import ooflib.engine.IO.propertymenu
import ooflib.engine.IO.materialmenu
import ooflib.engine.builtinprops
if config.dimension() == 2:
    import ooflib.engine.skeleton
elif config.dimension() == 3:
    import ooflib.engine.skeleton3d
import ooflib.engine.skeletoncontext
import ooflib.engine.skeletonselectionmodes
import ooflib.SWIG.engine.masterelement
import ooflib.SWIG.engine.material
import ooflib.engine.boundary
import ooflib.engine.IO.outputDefs
import ooflib.engine.IO.xmloutputs
import ooflib.engine.IO.propertyoutputreg