Beispiel #1
0
 def _init__with_2_param( self, *args ):
     if len(args) != 2:
        raise AssertionError( "len( args ) != 2" )
     argc = 0
     
     from Foam.finiteVolume import fvMesh
     try:
         fvMesh.ext_isinstance( args[ argc ] )
     except TypeError:
         raise AssertionError( "args[ argc ].__class__ != fvMesh" )
     mesh = args[ argc ]; argc +=1
     
     from Foam.OpenFOAM import dictionary
     try:
         dictionary.ext_isinstance( args[ argc ] )
     except TypeError:
         raise AssertionError( "args[ argc ].__class__ != dictionary" )
     dict_ = args[ argc ]
     PtrList_TypeBase.__init__( self )
     from Foam.OpenFOAM import polyPatchID, word, readLabel, readScalar
     self.patchID_ = polyPatchID( dict_.lookup( word( "patch" ) ), mesh.boundaryMesh() )
     self.faceIndex_ = readLabel( dict_.lookup( word( "face" ) ) )
     self.dir_ = self.getDir( dict_ )
     self.value_ = readScalar( dict_.lookup( word( "value" ) ) )
     self.checkPatchFace(mesh)
Beispiel #2
0
    def _init__with_2_param(self, *args):
        if len(args) != 2:
            raise AssertionError("len( args ) != 2")
        argc = 0

        from Foam.finiteVolume import fvMesh
        try:
            fvMesh.ext_isinstance(args[argc])
        except TypeError:
            raise AssertionError("args[ argc ].__class__ != fvMesh")
        mesh = args[argc]
        argc += 1

        from Foam.OpenFOAM import dictionary
        try:
            dictionary.ext_isinstance(args[argc])
        except TypeError:
            raise AssertionError("args[ argc ].__class__ != dictionary")
        dict_ = args[argc]
        PtrList_TypeBase.__init__(self)
        from Foam.OpenFOAM import polyPatchID, word, readLabel, readScalar
        self.patchID_ = polyPatchID(dict_.lookup(word("patch")),
                                    mesh.boundaryMesh())
        self.faceIndex_ = readLabel(dict_.lookup(word("face")))
        self.dir_ = self.getDir(dict_)
        self.value_ = readScalar(dict_.lookup(word("value")))
        self.checkPatchFace(mesh)
Beispiel #3
0
    def _init__with_6_param(self, *args):
        if len(args) != 6:
            raise AssertionError("len( args ) != 6")

        argc = 0
        from Foam.finiteVolume import fvMesh
        try:
            fvMesh.ext_isinstance(args[argc])
        except TypeError:
            raise AssertionError("args[ argc ].__class__ != fvMesh")
        mesh = args[argc]
        argc += 1

        from Foam.OpenFOAM import word
        try:
            patchName = word(str(args[argc]))
        except ValueError:
            raise AttributeError("The second arg is not string")
        argc += 1

        try:
            faceIndex = int(args[argc])
        except ValueError:
            raise AttributeError("The third arg is not label")
        argc += 1

        try:
            dir_ = int(args[argc])
        except ValueError:
            raise AttributeError("The fourth arg is not direction")
        if dir_ < 0 or dir_ > 255:
            raise AttributeError("The fourth arg is not direction")
        argc += 1

        try:
            value = float(args[argc])
        except ValueError:
            raise AttributeError("The fifth arg is not scalar")

        from Foam.OpenFOAM import polyPatchID
        self.patchID_ = polyPatchID(patchName, mesh.boundaryMesh())
        self.faceIndex_ = faceIndex
        self.dir_ = dir_
        self.value_ = value
        self.checkPatchFace(mesh)
Beispiel #4
0
 def _init__with_6_param(self, *args):
     if len(args) != 6:
        raise AssertionError( "len( args ) != 6" )
     
     argc = 0
     from Foam.finiteVolume import fvMesh
     try:
         fvMesh.ext_isinstance( args[ argc ] )
     except TypeError:
         raise AssertionError( "args[ argc ].__class__ != fvMesh" )
     mesh = args[ argc ]; argc +=1
     
     from Foam.OpenFOAM import word
     try:
         patchName = word( str( args[ argc ] ) )
     except ValueError:
        raise AttributeError("The second arg is not string")
     argc +=1
     
     try:
        faceIndex = int( args[ argc ] )
     except ValueError:
        raise AttributeError("The third arg is not label")
     argc +=1
     
     try:
        dir_ = int( args[ argc ] )
     except ValueError:
        raise AttributeError("The fourth arg is not direction")
     if dir_ < 0 or dir_>255:
        raise AttributeError("The fourth arg is not direction") 
     argc +=1
     
     try:
        value = float( args[ argc ] )
     except ValueError:
        raise AttributeError ("The fifth arg is not scalar")
     
     from Foam.OpenFOAM import polyPatchID
     self.patchID_ = polyPatchID( patchName, mesh.boundaryMesh() )
     self.faceIndex_ = faceIndex
     self.dir_ = dir_
     self.value_ = value
     self.checkPatchFace(mesh)