示例#1
0
    reduce = float(sys.argv[2])

# Set maximum running time.
maxTime = 8000

# Set maximumum area mismatch.
maxMismatch = 0.2

# Set sampling interval.
sampleInterval = 40

# Set time of the next sample.
nextSample = 40

# Hole vectors.
initialHoles = pyslsm.VectorHole()
targetHoles = pyslsm.VectorHole()

# Create a dumbbell from two vertically offset holes.
targetHoles.append(pyslsm.Hole(50, 69, 20))
targetHoles.append(pyslsm.Hole(50, 31, 20))

# Store dumbbell data (needed for sensitivity callback).
upperLobeCentre = targetHoles[0].coord.y
lowerLobeCentre = targetHoles[1].coord.y
lobeSeparation = upperLobeCentre - lowerLobeCentre

# Initialise the system with a circle in the upper lobe.
initialHoles.append(pyslsm.Hole(50, 69, 15))

# Initialise a 100x100 level set domain.
示例#2
0
# Maximum displacement per iteration, in units of the mesh spacing.
# This is the CFL limit.
moveLimit = 0.5

# Set maximum running time.
maxTime = 50

# Set sampling interval.
sampleInterval = 1

# Set time of the next sample.
nextSample = 1

# Create a hole at position (100, 100) with a radius of 80 grid units.
holes = pyslsm.VectorHole()
holes.append(pyslsm.Hole(100, 100, 80))

# Initialise a 200x200 level set domain.
levelSet = pyslsm.LevelSet(200, 200, holes, moveLimit, 6, True)

# Initialise io object.
io = pyslsm.InputOutput()

# Reinitialise the level set to a signed distance function.
levelSet.reinitialise()

# Initialise the boundary object.
boundary = pyslsm.Boundary()

# Perform initial boundary discretisation.