dolfin/ale

Documentation for C++ code found in dolfin/ale/*.h

Classes

ALE

C++ documentation for ALE from dolfin/ale/ALE.h:

class dolfin::ALE

This class provides functionality useful for implementation of ALE (Arbitrary Lagrangian-Eulerian) methods, in particular moving the boundary vertices of a mesh and then interpolating the new coordinates for the interior vertices accordingly.

void dolfin::ALE::move(Mesh &mesh, const Function &displacement)

Move coordinates of mesh according to displacement function.

Parameters:
  • mesh – (Mesh ) The mesh to move.
  • displacement – (Function ) A vectorial Lagrange function of matching degree.
void dolfin::ALE::move(Mesh &mesh, const GenericFunction &displacement)

Move coordinates of mesh according to displacement function. This works only for affine meshes. NOTE: This cannot be implemented for higher-order geometries as there is no way of constructing function space for position unless supplied as an argument.

Parameters:
  • mesh – (Mesh ) The affine mesh to move.
  • displacement – (GenericFunction ) A vectorial generic function.
std::shared_ptr<MeshDisplacement> dolfin::ALE::move(std::shared_ptr<Mesh> mesh, const BoundaryMesh &new_boundary)

Move coordinates of mesh according to new boundary coordinates. Works only for affine meshes.

Parameters:
  • mesh – (Mesh ) The affine mesh to move.
  • new_boundary – (BoundaryMesh ) An affine mesh containing just the boundary cells.
Returns:

MeshDisplacement Displacement encapsulated in Expression subclass MeshDisplacement .

std::shared_ptr<MeshDisplacement> dolfin::ALE::move(std::shared_ptr<Mesh> mesh0, const Mesh &mesh1)

Move coordinates of mesh according to adjacent mesh with common global vertices. Works only for affine meshes.

Parameters:
  • mesh0 – (Mesh ) The affine mesh to move.
  • mesh1 – (Mesh ) The affine mesh to be fit.
Returns:

MeshDisplacement Displacement encapsulated in Expression subclass

HarmonicSmoothing

C++ documentation for HarmonicSmoothing from dolfin/ale/HarmonicSmoothing.h:

class dolfin::HarmonicSmoothing

This class implements harmonic mesh smoothing. Poisson’s equation is solved with zero right-hand side (Laplace’s equation) for each coordinate direction to compute new coordinates for all vertices, given new locations for the coordinates of the boundary.

std::shared_ptr<MeshDisplacement> dolfin::HarmonicSmoothing::move(std::shared_ptr<Mesh> mesh, const BoundaryMesh &new_boundary)

Move coordinates of mesh according to new boundary coordinates and return the displacement

Parameters:
Returns:

MeshDisplacement Displacement

MeshDisplacement

C++ documentation for MeshDisplacement from dolfin/ale/MeshDisplacement.h:

class dolfin::MeshDisplacement : public dolfin::Expression

This class encapsulates the CG1 representation of the displacement of a mesh as an Expression . This is particularly useful for the displacement returned by mesh smoothers which can subsequently be used in evaluating forms. The value rank is 1 and the value shape is equal to the geometric dimension of the mesh.

dolfin::MeshDisplacement::MeshDisplacement(const MeshDisplacement &mesh_displacement)

Copy constructor

Parameters:mesh_displacement – (MeshDisplacement() ) Object to be copied.
dolfin::MeshDisplacement::MeshDisplacement(std::shared_ptr<const Mesh> mesh)

Create MeshDisplacement() of given mesh

Parameters:mesh – (Mesh ) Mesh to be displacement defined on.
void dolfin::MeshDisplacement::compute_vertex_values(std::vector<double> &vertex_values, const Mesh &mesh) const

Compute values at all mesh vertices.

Parameters:
  • vertex_values – (Array<double>) The values at all vertices.
  • mesh – (Mesh ) The mesh.
void dolfin::MeshDisplacement::eval(Array<double> &values, const Array<double> &x, const ufc::cell &cell) const

Evaluate at given point in given cell.

Parameters:
  • values – (Array<double>) The values at the point.
  • x – (Array<double>) The coordinates of the point.
  • cell – (ufc::cell ) The cell which contains the given point.
Function &dolfin::MeshDisplacement::operator[](const std::size_t i)

Extract subfunction In python available as MeshDisplacement.sub(i)

Parameters:i – (std::size_t) Index of subfunction.
const Function &dolfin::MeshDisplacement::operator[](const std::size_t i) const

Extract subfunction. Const version

Parameters:i – (std::size_t) Index of subfunction.
dolfin::MeshDisplacement::~MeshDisplacement()

Destructor.