示例#1
0
L = (2.0, 1.0)
he = L[1] / 10
he *= 0.5
he *= 0.5
#print he
useObstacle = True  #False
nLevels = 1
#parallelPartitioningType = proteus.MeshTools.MeshParallelPartitioningTypes.element
parallelPartitioningType = proteus.MeshTools.MeshParallelPartitioningTypes.node
nLayersOfOverlapForParallel = 0
structured = False  #True
if useHex:
    nnx = 4 * Refinement + 1
    nny = 2 * Refinement + 1
    hex = True
    domain = Domain.RectangularDomain(L)
else:
    boundaries = [
        'left', 'right', 'bottom', 'top', 'front', 'back', 'obstacle'
    ]
    boundaryTags = dict([(key, i + 1) for (i, key) in enumerate(boundaries)])
    obstacle_radius = 0.1 * L[1]
    if structured:
        nnx = int(round(L[0] / he) + 1)
        nny = int(round(L[1] / he) + 1)
    else:
        if useObstacle:
            vertices = [
                [0.0, 0.0],  #0
                [L[0], 0.0],  #1
                [L[0], L[1]],  #2
示例#2
0
T = opts.T
dt_fixed = opts.dt_fixed
dt_init = min(0.1 * dt_fixed, opts.dt_init)
runCFL = opts.cfl
nDTout = int(round(T / dt_fixed))
fixedTimeStep = opts.fixedTimeStep

# ----- DOMAIN ----- #

# domain = Domain.PlanarStraightLineGraphDomain()
# domain replacement
if useHex:
    nnx = 4 * refinement + 1
    nny = 2 * refinement + 1
    hex = True
    domain = Domain.RectangularDomain(tank_dim)
elif structured:
    nnx = 4 * refinement
    nny = 2 * refinement
    domain = Domain.RectangularDomain(tank_dim)
    boundaryTags = domain.boundaryTags

elif usePUMI and not genMesh:
    from proteus.MeshAdaptPUMI import MeshAdapt
    domain = Domain.PUMIDomain(dim=nd,manager=MeshAdapt.AdaptManager()) #initialize the domain
    he = 0.06
    domain.AdaptManager.PUMIAdapter.loadModelAndMesh(b"Reconstructed.dmg", b"Reconstructed.smb")
    modelDict = {'flow':0,'phase':2,'corrections':[3,4]}
    domain.AdaptManager.modelDict = modelDict
    domain.AdaptManager.sizeInputs = [b'pseudo']
    domain.AdaptManager.adapt = opts.adapt