xfem.lsetcurv module

class xfem.lsetcurv.LevelSetMeshAdaptation(**kwargs)

Bases: object

Class to compute a proper mesh deformation to improve a piecewise (multi-) linear level set approximation to obtain a higher order accurate approximation.

Computes a continuous function that describes a shift between points that are on the (P1 ) approximated level set function and its higher order accurate approximation. The transformation is only applied on elements where a level value inside a certain interval (lower,upper) exists.

The result is a deform function (D) which is computed pointwise as

1)phi_lin( x ) = phi_h(Psi(x))

with Psi(x) = x + d(x) qn(x) =: D(x)

for all x on ‘cut’ elements

with

phi_hself.lset_ho

the higher order level set function

phi_linself.lset_p1

the P1 level set function

PsiId + self.deform

the resulting deformation

qnself.qn

normal direction field

This class holds its own members for the higher order an lower order (P1) approximation of the level set function and only depends on the input of a mesh and a CoefficientFunction (the levelset function) (and options).

A LevelSetMeshAdaptation can also be used as a context manager. In this case, the mesh deformation is applied on the mesh inside the context.

BFI(domain_type, form, definedonelements=None)

Convenience function to construct Symbolic(Cut)BFI based on the domain_type and the known level set function.

CalcDeformation(**kwargs)
CalcMaxDistance(**kwargs)
Integrate(**kwargs)
Integrator(SymbolicFI, domain_type, form, definedonelements=None)

Convenience function to construct Symbolic(Cut)LFI/Symbolic(Cut)BFI

LFI(domain_type, form, definedonelements=None)

Convenience function to construct Symbolic(Cut)LFI based on the domain_type and the known level set function.

MarkForRefinement(**kwargs)
ProjectGFs(**kwargs)
ProjectOnUpdate(gf, update_domain=None)

When the LevelsetMeshAdaptation class generates a new deformation (due to a new level set function) all GridFunction that have been stored through ProjectOnUpdate will be projected from the previous to the new mesh by an essentially local projection (Oswald projection of the shifted evaluation)

gfuGridFunction (or list of GridFunctions)

GridFunction(s) to store for later deformation updates.

levelset_domain(domain_type=<DOMAIN_TYPE.IF: 2>)
Return a levelset_domain dictionary.
Args:

domain_type (DOMAIN_TYPE, optional): domain type for level set doamin. Defaults to IF.

Returns:

dict: levelset domain

order_deform = 2
order_lset = 2
order_qn = 2