esys.escript.levelset Package

Classes

class esys.escript.levelset.LevelSet(phi, reinit_max=10, reinitialize_after=1, smooth=2.0, useReducedOrder=False)

Bases: object

The level set method tracking an interface defined by the zero contour of the level set function phi which defines the signed distance of a point x from the interface. The contour phi(x)=0 defines the interface.

It is assumed that phi(x)<0 defines the volume of interest, phi(x)>0 the outside world.

getAdvectionSolverOptions()

Returns the solver options for the interface advective.

getDomain()

Returns the domain.

getH()

Returns the mesh size.

getInterface(phi=None, smoothing_width=None)

creates a characteristic function which is 1 over the over the length 2*h*smoothing_width around the interface and zero elsewhere

getJumpingParameter(param_neg=-1, param_pos=1, phi=None)

Creates a function with param_neg where phi<0 and param_pos where phi>0 (no smoothing).

Parameters:
  • param_neg – value of parameter on the negative side (phi<0)
  • param_pos – value of parameter on the positive side (phi>0)
  • phi – level set function to be used. If not present the current level set is used.
getLevelSetFunction()

Returns the level set function.

getReinitializationSolverOptions()

Returns the options of the solver for the reinitialization

getSmoothedJump(phi=None, smoothing_width=None)

Creates a smooth interface from -1 to 1 over the length 2*h*smoothing_width where -1 is used where the level set is negative and 1 where the level set is 1.

getSmoothedParameter(param_neg=-1, param_pos=1, phi=None, smoothing_width=None)

Creates a smoothed function with param_neg where phi<0 and param_pos where phi>0 which is smoothed over a length smoothing_width across the interface.

Parameters:smoothing_width – width of the smoothing zone relative to mesh size. If not present the initial value of smooth is used.
getTimeStepSize(flux)

Returns a new dt for a given flux using the Courant condition.

Parameters:flux – flux field
getVolume()

Returns the volume of the phi(x)<0 region.

makeCharacteristicFunction(contour=0, phi=None, positiveSide=True, smoothing_width=None)

Makes a smooth characteristic function of the region phi(x)>contour if positiveSide and phi(x)<contour otherwise.

Parameters:
  • phi – level set function to be used. If not present the current level set is used.
  • smoothing_width – width of the smoothing zone relative to mesh size. If not present the initial value of smooth is used.
update(dt)

Updates the level set function.

Parameters:dt – time step forward

Functions

Others

  • __builtins__
  • __copyright__
  • __doc__
  • __file__
  • __license__
  • __name__
  • __package__
  • __url__