def __init__(self, nd=2, V_model=None, barycenters=None, flags_rigidbody=None): """ TODO """ assert(nd in [2, 3]) self.nd = nd if self.nd == 2: sdInfo = {(0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i'))} else: sdInfo = {(0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i'))} TC_base.__init__(self, nc=1, variableNames=['am'], diffusion={0: {0: {0: 'constant'}}}, potential={0: {0: 'u'}}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True) self.flowModelIndex=V_model self.barycenters = barycenters if flags_rigidbody is not None: self.flags_rigidbody = flags_rigidbody else: Profiling.logEvent("Warning: flags_rigidbody was not set for"+ "AddedMass model, using a zero array of length"+ "1000, this sets all boundaries as fixed walls"+ "for the added mass model and might cause"+ " issues if the domain contains more flags") self.flags_rigidbody = np.zeros(1000, dtype='int32')
def __init__(self, nd=2, V_model=None, barycenters=None, flags_rigidbody=None): """ TODO """ assert(nd in [2, 3]) self.nd = nd if self.nd == 2: sdInfo = {(0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i'))} else: sdInfo = {(0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i'))} TC_base.__init__(self, nc=1, variableNames=['am'], diffusion={0: {0: {0: 'constant'}}}, potential={0: {0: 'u'}}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True) self.flowModelIndex=V_model self.barycenters = barycenters if flags_rigidbody is not None: self.flags_rigidbody = flags_rigidbody else: Profiling.logEvent("Warning: flags_rigidbody was not set for"+ "AddedMass model, using a zero array of length"+ "1000, this sets all boundaries as fixed walls"+ "for the added mass model and might cause"+ " issues if the domain contains more flags") self.flags_rigidbody = np.zeros(1000, dtype='int32')
def initialize(self): if self.nd == 2: sdInfo = { (0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i')) } else: sdInfo = { (0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i')) } TC_base.__init__(self, nc=1, variableNames=['pInit'], advection={0: { 0: 'constant' }}, potential={0: { 0: 'u' }}, diffusion={0: { 0: { 0: 'linear' } }}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True)
def __init__(self, modelIndex=None, fluidModelIndex=None, pressureIncrementModelIndex=None, useRotationalForm=False): """Construct a coefficients object :param pressureIncrementModelIndex: The index into the model list """ TC_base.__init__( self, nc=1, variableNames=['p'], reaction={0: { 0: 'linear' }}, # = p - p_last - phi advection={0: { 0: 'constant' }}) # div (\mu velocity) self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex self.pressureIncrementModelIndex = pressureIncrementModelIndex if pressureIncrementModelIndex is None: assert useRotationalForm == False, "The rotational form must be de-activated if there is no model for press increment" self.useRotationalForm = useRotationalForm
def __init__(self, rho_f_min=998.0, rho_s_min=998.0, nd=2, modelIndex = None, fluidModelIndex = None): """Construct a coefficients object :param modelIndex: This model's index into the model list :param fluidModelIndex: The fluid momentum model's index """ assert(nd in [2,3]) self.nd = nd if self.nd == 2: sdInfo = {(0,0):(np.array([0,1,2],dtype='i'), np.array([0,1],dtype='i'))} else: sdInfo = {(0,0):(np.array([0,1,2,3],dtype='i'), np.array([0,1,2],dtype='i'))} TC_base.__init__(self, nc = 1, variableNames = ['pInc'], diffusion = {0:{0:{0:'constant'}}}, potential = {0:{0:'u'}}, advection = {0:{0:'constant'}}, sparseDiffusionTensors=sdInfo, useSparseDiffusion = True) self.rho_f_min = rho_f_min self.rho_s_min = rho_s_min self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex
def __init__(self, modelIndex=None, fluidModelIndex=None, pressureIncrementModelIndex=None, useRotationalForm=False, initialize=True): """Construct a coefficients object :param pressureIncrementModelIndex: The index into the model list """ TC_base.__init__( self, nc=1, variableNames=['p'], reaction={0: { 0: 'linear' }}, # = p - p_last - phi advection={0: { 0: 'constant' }}) # div (\mu velocity) self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex self.pressureIncrementModelIndex = pressureIncrementModelIndex self.useRotationalForm = useRotationalForm if initialize: self.initialize()
def __init__(self, rho_f_min=998.0, rho_s_min=998.0, nd=2, VOS_model=0, VOF_model=1, modelIndex=None, fluidModelIndex=None, sedModelIndex=None, fixNullSpace=False, INTEGRATE_BY_PARTS_DIV_U=True, nullSpace="NoNullSpace"): """Construct a coefficients object :param modelIndex: This model's index into the model list :param fluidModelIndex: The fluid momentum model's index """ """ TODO """ self.nullSpace = nullSpace self.fixNullSpace = fixNullSpace self.INTEGRATE_BY_PARTS_DIV_U = INTEGRATE_BY_PARTS_DIV_U self.VOS_model = VOS_model self.VOF_model = VOF_model assert (nd in [2, 3]) self.nd = nd if self.nd == 2: sdInfo = { (0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i')) } else: sdInfo = { (0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i')) } TC_base.__init__(self, nc=1, variableNames=['pInc'], diffusion={0: { 0: { 0: 'constant' } }}, potential={0: { 0: 'u' }}, advection={0: { 0: 'constant' }}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True) self.rho_f_min = rho_f_min self.rho_s_min = rho_s_min self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex self.sedModelIndex = sedModelIndex
def __init__(self, aOfX, fOfX, velocity=None, nc=1, nd=2, l2proj=None, timeVaryingCoefficients=False, forceStrongDirichlet=False, useMetrics=0.0, sc_uref=1.0, sc_beta=1.0): self.useMetrics = useMetrics self.forceStrongDirichlet = forceStrongDirichlet self.aOfX = aOfX self.fOfX = fOfX self.velocity = velocity self.nd = nd self.l2proj = l2proj self.timeVaryingCoefficients = timeVaryingCoefficients self.sc_uref = sc_uref self.sc_beta = sc_beta mass = {} advection = {} diffusion = {} potential = {} reaction = {} hamiltonian = {} for i in range(nc): diffusion[i] = {i: {i: 'constant'}} reaction[i] = {i: 'constant'} advection[i] = {i: 'linear'} #now include for gravity type terms potential[i] = {i: 'u'} #end i sdInfo = { (0, 0): (numpy.arange(start=0, stop=self.nd**2 + 1, step=self.nd, dtype='i'), numpy.array([range(self.nd) for row in range(self.nd)], dtype='i')) } TC_base.__init__(self, nc, mass, advection, diffusion, potential, reaction, hamiltonian, variableNames=['u'], sparseDiffusionTensors=sdInfo, useSparseDiffusion=True, movingDomain=False)
def __init__(self, useMetrics=1.0, epsFactHeaviside=3.0, epsFactDirac=3.0, epsFactDiffusion=1.0, nd=2, modelIndex=None, fluidModelIndex=None, pressureModelIndex=None, useRotationalForm=False): """Construct a coefficients object :param pressureIncrementModelIndex: The index into the model list """ self.nd = nd if self.nd == 2: sdInfo = { (0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i')) } else: sdInfo = { (0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i')) } TC_base.__init__(self, nc=1, variableNames=['pInit'], advection={0: { 0: 'constant' }}, potential={0: { 0: 'u' }}, diffusion={0: { 0: { 0: 'linear' } }}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True) self.useMetrics = useMetrics self.modelIndex = modelIndex self.epsFactHeaviside = epsFactHeaviside self.epsFactDirac = epsFactDirac self.epsFactDiffusion = epsFactDiffusion self.fluidModelIndex = fluidModelIndex self.pressureModelIndex = pressureModelIndex self.useRotationalForm = useRotationalForm
def __init__(self, modelIndex=None, fluidModelIndex=None, pressureIncrementModelIndex=None, useRotationalForm=False): """Construct a coefficients object :param pressureIncrementModelIndex: The index into the model list """ TC_base.__init__(self, nc=1, variableNames=['p'], reaction={0: {0: 'linear'}}, # = p - p_last - phi advection={0: {0: 'constant'}}) # div (\mu velocity) self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex self.pressureIncrementModelIndex = pressureIncrementModelIndex if pressureIncrementModelIndex is None: assert useRotationalForm == False, "The rotational form must be de-activated if there is no model for press increment" self.useRotationalForm = useRotationalForm
def __init__(self, rho_f_min=998.0, rho_s_min=998.0, nd=2, VOS_model=0, VOF_model=1, modelIndex = None, fluidModelIndex = None, sedModelIndex = None, fixNullSpace=False, INTEGRATE_BY_PARTS_DIV_U=True): """Construct a coefficients object :param modelIndex: This model's index into the model list :param fluidModelIndex: The fluid momentum model's index """ self.fixNullSpace=fixNullSpace self.INTEGRATE_BY_PARTS_DIV_U=INTEGRATE_BY_PARTS_DIV_U self.VOS_model=VOS_model self.VOF_model=VOF_model assert(nd in [2,3]) self.nd = nd if self.nd == 2: sdInfo = {(0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i'))} else: sdInfo = {(0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i'))} TC_base.__init__(self, nc=1, variableNames=['pInc'], diffusion={0: {0: {0: 'constant'}}}, potential={0: {0: 'u'}}, advection={0: {0: 'constant'}}, sparseDiffusionTensors=sdInfo, useSparseDiffusion=True) self.rho_f_min = rho_f_min self.rho_s_min = rho_s_min self.modelIndex = modelIndex self.fluidModelIndex = fluidModelIndex self.sedModelIndex = sedModelIndex
def __init__(self, useMetrics=1.0, epsFactHeaviside=3.0, epsFactDirac=3.0, epsFactDiffusion=1.0, nd=2, modelIndex=None, fluidModelIndex=None, pressureModelIndex=None, useRotationalForm=False): """Construct a coefficients object :param pressureIncrementModelIndex: The index into the model list """ self.nd = nd if self.nd == 2: sdInfo = {(0, 0): (np.array([0, 1, 2], dtype='i'), np.array([0, 1], dtype='i'))} else: sdInfo = {(0, 0): (np.array([0, 1, 2, 3], dtype='i'), np.array([0, 1, 2], dtype='i'))} TC_base.__init__(self, nc=1, variableNames=['pInit'], advection={0: {0: 'constant'}}, potential={0: {0: 'u'}}, diffusion={0: {0: {0: 'linear'}}}, sparseDiffusionTensors=sdInfo, useSparseDiffusion = True) self.useMetrics = useMetrics self.modelIndex = modelIndex self.epsFactHeaviside = epsFactHeaviside self.epsFactDirac = epsFactDirac self.epsFactDiffusion = epsFactDiffusion self.fluidModelIndex = fluidModelIndex self.pressureModelIndex = pressureModelIndex self.useRotationalForm = useRotationalForm