示例#1
0
    def __init__(self,
                 name,
                 backup=False,
                 debug=False,
                 boundaryDict=False,
                 listDict=False,
                 listDictWithHeader=False,
                 listLengthUnparsed=None,
                 preserveComments=True,
                 noHeader=False,
                 binaryMode=False,
                 noBody=False,
                 doMacroExpansion=False,
                 dontRead=False,
                 noVectorOrTensor=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 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
        """

        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
        
        if not dontRead:
            self.readFile()
示例#2
0
    def __init__(self,name,backup=False,debug=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.debug=debug
        
        self.header=None
        
        self.readFile()

        if self.content.has_key("FoamFile"):
            self.header={ "FoamFile" : self.content["FoamFile"] }
            self.content.pop("FoamFile")
示例#3
0
    def __init__(self,name,backup=False,debug=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.debug=debug
        
        self.header=None
        
        self.readFile()

        if self.content.has_key("FoamFile"):
            self.header={ "FoamFile" : self.content["FoamFile"] }
            self.content.pop("FoamFile")
示例#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)