Exemplo n.º 1
0
 def __init__(self,
              name,
              extensionType,
              frontvalue=0,
              backvalue=0,
              ncells=1,
              backup=False):
     """:param name: The name of the parameter file
        :param backup: create a backup-copy of the file
     """
     FileBasisBackup.__init__(self,name,backup=backup)
     self.parsedBlockMesh=ParsedBlockMeshDict(name)
     self.vertexNum=len(self.parsedBlockMesh["vertices"])
     self.extensionType=extensionType
     self.frontvalue=frontvalue
     self.backvalue=backvalue
     self.ncells=ncells
     self.minBound=self.getBounds()
    def __init__(self,
                 name,
                 backup=False,
                 debug=False,
                 boundaryDict=False,
                 listDict=False,
                 listDictWithHeader=False,
                 listLengthUnparsed=None,
                 preserveComments=True,
                 noHeader=False,
                 binaryMode=False,
                 treatBinaryAsASCII=False,
                 noBody=False,
                 doMacroExpansion=False,
                 dontRead=False,
                 noVectorOrTensor=False,
                 dictStack=None,
                 createZipped=True,
                 longListOutputThreshold=20):
        """:param name: The name of the parameter file
        :param backup: create a backup-copy of the file
        :param boundaryDict: the file to parse is a boundary file
        :param listDict: the file only contains a list
        :param listDictWithHeader: the file only contains a list and a header
        :param listLengthUnparsed: Lists longer than that length are not parsed
        :param binaryMode: Parse long lists in binary mode (to be overridden by
        the settings in the header).
        :param treatBinaryAsASCII: even if the header says that this is a
        binary file treat it like an ASCII-file
        :param noHeader: don't expect a header
        :param noBody: don't read the body of the file (only the header)
        :param doMacroExpansion: expand #include and $var
        :param noVectorOrTensor: short lists of length 3, 6 an 9 are NOT
        interpreted as vectors or tensors
        :param dontRead: Do not read the file during construction
        :param longListOutputThreshold: Lists that are longer than this are
        prefixed with a length
        :param dictStack: dictionary stack for lookup (only used for include)
        """

        self.noHeader = noHeader
        self.noBody = noBody
        FileBasisBackup.__init__(self,
                                 name,
                                 backup=backup,
                                 createZipped=createZipped)
        self.debug = debug
        self.boundaryDict = boundaryDict
        self.listDict = listDict
        self.listDictWithHeader = listDictWithHeader
        self.listLengthUnparsed = listLengthUnparsed
        self.doMacros = doMacroExpansion
        self.preserveComments = preserveComments
        self.noVectorOrTensor = noVectorOrTensor
        self.header = None
        self.content = None
        self.longListOutputThreshold = longListOutputThreshold
        self.binaryMode = binaryMode
        self.treatBinaryAsASCII = treatBinaryAsASCII
        self.lastDecoration = ""
        self.dictStack = dictStack

        if not dontRead:
            self.readFile()
    def __init__(self,
                 name,
                 backup=False,
                 debug=False,
                 boundaryDict=False,
                 listDict=False,
                 listDictWithHeader=False,
                 listLengthUnparsed=None,
                 preserveComments=True,
                 noHeader=False,
                 binaryMode=False,
                 treatBinaryAsASCII=False,
                 noBody=False,
                 doMacroExpansion=False,
                 dontRead=False,
                 noVectorOrTensor=False,
                 dictStack=None,
                 write_tables=False,
                 createZipped=True,
                 longListOutputThreshold=20):
        """@param name: The name of the parameter file
        @param backup: create a backup-copy of the file
        @param boundaryDict: the file to parse is a boundary file
        @param listDict: the file only contains a list
        @param listDictWithHeader: the file only contains a list and a header
        @param listLengthUnparsed: Lists longer than that length are not parsed
        @param binaryMode: Parse long lists in binary mode (to be overridden by
        the settings in the header).
        @param treatBinaryAsASCII: even if the header says that this is a
        binary file treat it like an ASCII-file
        @param noHeader: don't expect a header
        @param noBody: don't read the body of the file (only the header)
        @param doMacroExpansion: expand #include and $var
        @param noVectorOrTensor: short lists of length 3, 6 an 9 are NOT
        interpreted as vectors or tensors
        @param dontRead: Do not read the file during construction
        @param longListOutputThreshold: Lists that are longer than this are
        prefixed with a length
        @param dictStack: dictionary stack for lookup (only used for include)
        """

        self.noHeader=noHeader
        self.noBody=noBody
        FileBasisBackup.__init__(self,
                                 name,
                                 backup=backup,
                                 createZipped=createZipped)
        self.debug=debug
        self.boundaryDict=boundaryDict
        self.listDict=listDict
        self.listDictWithHeader=listDictWithHeader
        self.listLengthUnparsed=listLengthUnparsed
        self.doMacros=doMacroExpansion
        self.preserveComments=preserveComments
        self.noVectorOrTensor=noVectorOrTensor
        self.header=None
        self.content=None
        self.longListOutputThreshold=longListOutputThreshold
        self.binaryMode=binaryMode
        self.treatBinaryAsASCII=treatBinaryAsASCII
        self.lastDecoration=""
        self.dictStack=dictStack
        self.write_tables = write_tables

        if not dontRead:
            self.readFile()
Exemplo n.º 4
0
    def __init__(self,name,backup=False):
        """:param name: The name of the parameter file
        :param backup: create a backup-copy of the file"""

        FileBasisBackup.__init__(self,name,backup=backup)
    def __init__(self,name,backup=False):
        """:param name: The name of the parameter file
        :param backup: create a backup-copy of the file"""

        FileBasisBackup.__init__(self,name,backup=backup)