def __init__(self,value,unit=None): default_unit = _findUnit('IntrinsicPermeability') if unit==None: unit = default_unit print("default unit of ",default_unit,type(default_unit)) pass Tensor.__init__(self,value,unit)
def __init__(self, value, unit=None): default_unit = _findUnit('IntrinsicPermeability') if unit == None: unit = default_unit print("default unit of ", default_unit, type(default_unit)) pass Tensor.__init__(self, value, unit)
def __init__(self, value=None, dxx=None, dyy=None, dzz=None, unit="kg*m/s***3/K"): self.dxx = dxx self.dyy = dyy self.dzz = dzz self.value = value self.unit = default_unit = _findUnit('ThermalConductivity') if (dxx or dyy or dzz) and not value: if (dyy or dzz) and type(dxx) == NoneType: raise Exception("check the effective diffusion definition") val = dxx if not type(dyy) == NoneType: val = Tensor2D(dxx, dyy) if not type(dzz) == NoneType: val = Tensor3D(dxx, dyy, dzz) pass elif (not type(value) == NoneType): if type(value) in [FloatType, IntType] or isInstance( value, IsotropicTensor): val = value if isinstance(value, IsotropicTensor): value = value.getValues() pass if not type(dxx) == NoneType: val = Tensor2D(value, dxx) if not type(dyy) == NoneType: val = Tensor3D(value, dxx, dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx should be of none type") if type(dyy) != NoneType: raise Exception("dyy should be of none type") val = value pass if type(dzz) != NoneType: raise Exception("dzz should be of none type") pass try: vol = val except: msg = 'ya should have given a value for effective diffusion' raise Warning(msg) Tensor.__init__(self, value=val, unit=self.unit)
def __init__(self,value = None,dxx = None,dyy = None,dzz = None, unit = "kg*m/s***3/K"): self.dxx = dxx self.dyy = dyy self.dzz = dzz self.value = value self.unit = default_unit = _findUnit('ThermalConductivity') if (dxx or dyy or dzz) and not value: if (dyy or dzz) and type(dxx)==NoneType: raise Exception("check the effective diffusion definition") val=dxx if not type(dyy)==NoneType:val=Tensor2D(dxx,dyy) if not type(dzz)==NoneType:val=Tensor3D(dxx,dyy,dzz) pass elif (not type(value)==NoneType): if type(value) in [FloatType, IntType] or isInstance(value,IsotropicTensor): val=value if isinstance(value,IsotropicTensor): value = value.getValues() pass if not type(dxx)==NoneType:val=Tensor2D(value,dxx) if not type(dyy)==NoneType:val=Tensor3D(value,dxx,dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx should be of none type") if type(dyy) != NoneType: raise Exception("dyy should be of none type") val=value pass if type(dzz) != NoneType: raise Exception("dzz should be of none type") pass try: vol=val except: msg='ya should have given a value for effective diffusion' raise Warning(msg) Tensor.__init__(self, value=val,unit=self.unit)
def __init__(self, value=None, dxx=None, dyy=None, dzz=None, unit=unit): if type(dxx) not in [FloatType, IntType, NoneType]: raise Exception(" dxx should be a float") if type(dyy) not in [FloatType, IntType, NoneType]: raise Exception(" dyy should be a float") if type(dzz) not in [FloatType, IntType, NoneType]: raise Exception(" dzz should be a float") if value == None: if (dyy or dzz) and type(dxx) == NoneType: raise IncorrectValue("check the definition of the effective diffusion,\n"+\ " at least one real component has to be introduced (dxx)") val = dxx if type(dyy) != NoneType: val = Tensor2D(dxx, dyy) if type(dzz) != NoneType: val = Tensor3D(dxx, dyy, dzz) pass elif (type(value) != NoneType): if type(value) in [FloatType, IntType]: val = value if not type(dxx) == NoneType: val = Tensor2D(value, dxx) if not type(dyy) == NoneType: val = Tensor3D(value, dxx, dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx type error") if type(dyy) != NoneType: raise Exception("dyy type error") val = value pass if type(dzz) != NoneType: six.reraise(TypeError, "dzz type error ", dzz) pass try: vol = val except: raise Warning("check the effective diffusion value ") Tensor.__init__(self, val, unit=unit)
def __init__(self, value = None, dxx = None, dyy = None, dzz = None, unit = unit): if type(dxx) not in [FloatType,IntType, NoneType]: raise Exception(" dxx should be a float") if type(dyy) not in [FloatType,IntType, NoneType]: raise Exception(" dyy should be a float") if type(dzz) not in [FloatType,IntType, NoneType]: raise Exception(" dzz should be a float") if value == None: if (dyy or dzz) and type(dxx) == NoneType: raise IncorrectValue("check the definition of the effective diffusion,\n"+\ " at least one real component has to be introduced (dxx)") val=dxx if type(dyy) != NoneType: val=Tensor2D(dxx,dyy) if type(dzz) != NoneType: val=Tensor3D(dxx,dyy,dzz) pass elif (type(value) != NoneType): if type(value) in [FloatType,IntType]: val=value if not type(dxx) == NoneType: val = Tensor2D(value,dxx) if not type(dyy) == NoneType: val = Tensor3D(value,dxx,dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx type error") if type(dyy) != NoneType: raise Exception("dyy type error") val=value pass if type(dzz) != NoneType: six.reraise(TypeError, "dzz type error ", dzz) pass try: vol = val except: raise Warning("check the effective diffusion value ") Tensor.__init__(self, val,unit = unit)
def __init__(self, value, unit=None): default_unit = _findUnit('Permeability') default_unit = "m/s" if unit == None: unit = default_unit Tensor.__init__(self, value, unit)
def __init__(self, value, unit=None): default_unit = _findUnit('HydraulicConductivity') if unit == None: unit = default_unit pass Tensor.__init__(self, value, unit)
def __init__(self,value,unit=None): default_unit = _findUnit('Permeability') if unit==None: unit = default_unit Tensor.__init__(self,value,unit)
def __init__(self,value,unit=None): default_unit = _findUnit('HydraulicConductivity') if unit==None: unit = default_unit pass Tensor.__init__(self, value, unit)