Example #1
0
 def __init__(self):
     CodeInterfaceBase.__init__(self)
     self.preCommand = "python "  # this is the precommand
     self.printTag = 'RAVEN INTERFACE'
     self.outputPrefix = 'out~'
     self.outStreamsNamesAndType = {
     }  # Outstreams names and type {'outStreamName':[DataObjectName,DataObjectType]}
     self.outDatabases = {
     }  # as outStreams, but {name: path/and/file} for databases
     # path to the module that contains the function to modify and convert the sampled vars (optional)
     # 2 methods are going to be inquired (if present and needed):
     # - convertNotScalarSampledVariables
     # - manipulateScalarSampledVariables
     self.extModForVarsManipulationPath = None
     # 'noscalar' = True if convertNotScalarSampledVariables exists in extModForVarsManipulation module
     # 'scalar'   = True if manipulateScalarSampledVariables exists in extModForVarsManipulation module
     self.hasMethods = {'noscalar': False, 'scalar': False}
     # inner working directory
     self.innerWorkingDir = ''
     # linked DataObjects and Databases
     self.linkedDataObjectOutStreamsNames = None
     self.linkedDatabaseName = None
     # input manipulation module
     self.inputManipulationModule = None
     self.printFailedRuns = False  # whether to print failed runs to the screen
Example #2
0
 def __init__(self):
     """
   Initializes the GenericCode Interface.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
Example #3
0
 def __init__(self):
   """
     Constructor.
     @ In, None
     @ Out, None
   """
   CodeInterfaceBase.__init__(self)
   # CTF creates enormous CSVs that are all floats, so we use numpy to speed up the loading
   self.setCsvLoadUtil('numpy')
Example #4
0
 def __init__(self):
     """
   Initializes the GenericCode Interface.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.variablesToLoad = [
     ]  # the variables that should be loaded from the mat file (by default, all of them)
Example #5
0
 def __init__(self):
     """
   Constructor
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.melgenApp = MelgenApp()
     self.inputExtensions = ['i', 'inp']
 def __init__(self):
     """
   Constructor.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.melcorInterface = MelcorApp()
     self.melgenInterface = MelgenApp()
Example #7
0
 def __init__(self):
   """
     Constructor
     @ In, None
     @ Out, None
   """
   CodeInterfaceBase.__init__(self)
   self.MooseInterface = MooseBasedApp()
   self.MooseInterface.addDefaultExtension()
Example #8
0
 def __init__(self):
     """
   Constructor.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.outputPrefix = 'out~'
     self.vectorPPFound = None  # Indicates if a MOOSE vector postprocessor is in use
     self.vectorPPDict = None  # Contains information about the postprocessor used
Example #9
0
 def __init__(self):
     """
   Constructor.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.PhisicsInterface = Phisics()
     self.PhisicsInterface.addDefaultExtension()
     self.Relap5Interface = Relap5()
     self.Relap5Interface.addDefaultExtension()
Example #10
0
 def __init__(self):
     """
   Constructor
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.sequence = [
     ]  # this contains the sequence that needs to be run. For example, ['triton'] or ['origen'] or ['triton','origen']
     self.timeUOM = 's'  # uom of time (i.e. s, h, m, d, y )
     self.outputRoot = {}  # the root of the output sequences
Example #11
0
 def __init__(self):
     """
   Initializes the GenericCode Interface.
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(
         self
     )  # The base class doesn't actually implement this, but futureproofing.
     self.inputExtensions = [
     ]  # list of extensions for RAVEN to edit as inputs
     self.outputExtensions = [
     ]  # list of extensions for RAVEN to gather data from?
     self.execPrefix = ''  # executioner command prefix (e.g., 'python ')
     self.execPostfix = ''  # executioner command postfix (e.g. -zcvf)
     self.caseName = None  # base label for outgoing files, should default to inputFileName
     self.fixedOutFileName = None  # CSV output filename of the run code (in case it is hardcoded in the driven code)
Example #12
0
 def __init__(self):
     """
   Constructor
   @ In, None
   @ Out, None
 """
     CodeInterfaceBase.__init__(self)
     self.MooseInterface = MooseBasedApp(
     )  #used to perturb MAMMOTH input files
     self.MooseInterface.addDefaultExtension()
     self.BisonInterface = MooseBasedApp(
     )  #used to perturb Bison input files
     self.BisonInterface.addDefaultExtension()
     self.RattlesnakeInterface = Rattlesnake(
     )  #used to perturb Rattlesnake and Yak input files
     #FIXME Would like to use RELAP7() as interface, but Distributions block appears to be out of date when running Mammoth
     #self.Relap7Interface = RELAP7()             #used to perturb RELAP7 input files
     self.Relap7Interface = MooseBasedApp()
     self.Relap7Interface.addDefaultExtension()
Example #13
0
 def _readMoreXML(self, xmlNode):
     """
   Function to read the portion of the xml input that belongs to this specialized class and initialize
   some members based on inputs. This can be overloaded in specialize code interface in order to
   read specific flags
   @ In, xmlNode, xml.etree.ElementTree.Element, Xml element node
   @ Out, None.
 """
     CodeInterfaceBase._readMoreXML(self, xmlNode)
     sequence = xmlNode.find("sequence")
     if sequence is None:
         self.sequence = ['triton']
     else:
         self.sequence = [elm.strip() for elm in sequence.text.split(",")]
     if self.sequence.count('triton') > 1 or self.sequence.count(
             'origen') > 1:
         raise IOError(
             "Multiple triton or origen sequences are not supported yet!")
     timeUOM = xmlNode.find("timeUOM")
     if timeUOM is not None:
         self.timeUOM = timeUOM.text.strip()
         if self.timeUOM not in ['s', 'm', 'h', 'd', 'y']:
             raise IOError("timeUOM not recognized. Supported are:" +
                           ','.join(['s', 'm', 'h', 'd', 'y']))