示例#1
0
class CommonInitialCondition_old:
    """
    Common InitialCondition definition. 
    It means we can use that class for any kind of problem, hydraulic, chemical/transport ...
    """    
    def __init__(self, domain = None, value = None):
        """
        domain can be a region of the domain, it could also be a simple body associated to .
        """
        memberShip(domain.support,[CartesianMesh, Body])
        self.domain = domain
        
#        if domain !=None:
#            if isinstance(domain,Region):
#                memberShip(domain.support,[CartesianMesh, Body])
#            elif isinstance(domain,Body):
#                pass
#            elif isinstance(domain,CartesianMesh):
#                pass
#        self.domain = domain
        #
        #
        #
        print("dbg CommonInitialCondition",value)
        if type(value) == None:
            self.value = Head(0.0,"m")
        elif isinstance(value,Head):
            self.value = value
        else:
            raise Exception(" to modify, the pressure must be scaled ")

    def getDomain(self):
        """get initial conditions  zones"""
        return self.domain

    def getRegion(self):
        """get initial conditions  zones"""
        return self.domain

    def getSupport(self):
        """get initial conditions  zones"""
        dir(self.domain)
        return self.domain

    def getValue(self):
        """
        get initial conditions Value
        """
        return self.value.getValue()
示例#2
0
class CommonInitialCondition_old:
    """
    Common InitialCondition definition. 
    It means we can use that class for any kind of problem, hydraulic, chemical/transport ...
    """
    def __init__(self, domain=None, value=None):
        """
        domain can be a region of the domain, it could also be a simple body associated to .
        """
        memberShip(domain.support, [CartesianMesh, Body])
        self.domain = domain

        #        if domain !=None:
        #            if isinstance(domain,Region):
        #                memberShip(domain.support,[CartesianMesh, Body])
        #            elif isinstance(domain,Body):
        #                pass
        #            elif isinstance(domain,CartesianMesh):
        #                pass
        #        self.domain = domain
        #
        #
        #
        print("dbg CommonInitialCondition", value)
        if type(value) == None:
            self.value = Head(0.0, "m")
        elif isinstance(value, Head):
            self.value = value
        else:
            raise Exception(" to modify, the pressure must be scaled ")

    def getDomain(self):
        """get initial conditions  zones"""
        return self.domain

    def getRegion(self):
        """get initial conditions  zones"""
        return self.domain

    def getSupport(self):
        """get initial conditions  zones"""
        dir(self.domain)
        return self.domain

    def getValue(self):
        """
        get initial conditions Value
        """
        return self.value.getValue()