Skip to content

raisim::fem ​

namespace

Classes ​

  • class LinearElasticity — Small-displacement, small-strain, isotropic, linear static elasticity with four-node tetrahedra.
  • struct RecoveryErrorEstimate — Zienkiewicz-Zhu estimate of the energy-norm discretization error of a solved linear elastic model.
  • struct TetMesh

Functions ​

estimateRecoveryError ​

#include <raisim/fem/ErrorEstimation.hpp>

cpp
RecoveryErrorEstimate estimateRecoveryError(
    const TetMesh &mesh,
    const std::vector<LinearElasticity::ElementResult> &results,
    const std::vector<LinearElasticity::Material> &materials)

Recovers a continuous stress field by volume-weighted averaging of the element stresses at each vertex, separately for every region, and integrates the energy of its difference to the element stress exactly over each tetrahedron. materials holds one material or one per tetrahedron.

refinementTargets ​

#include <raisim/fem/ErrorEstimation.hpp>

cpp
std::vector<double> refinementTargets(
    const TetMesh &mesh,
    const RecoveryErrorEstimate &estimate,
    double minimumEdge,
    double fraction=.5,
    size_t maximumCells=std::numeric_limits<size_t>::max())

Edge-length targets per tetrahedron for refineElements by Doerfler marking: the elements with the largest estimated errors that together hold fraction of the squared error of all refinable elements get half their longest edge as target, never below minimumEdge (zero sets no floor). Elements already at the minimum edge are not marked. Marking stops early once the refined mesh would exceed about maximumCells, counting eight children per marked element. Unmarked elements get infinity.

refineToEdgeTargets ​

#include <raisim/fem/MeshResolution.hpp>

cpp
TetMesh refineToEdgeTargets(
    TetMesh mesh,
    std::vector<double> targets,
    size_t maximumCells=2000000,
    std::vector<std::array<unsigned int, 2>> *parents=nullptr)

Bisects, longest first, every edge longer than the smaller target of its two vertices. A new vertex takes the mean target of the edge it bisects, so the targets interpolate linearly; an infinite target marks a vertex that needs no refinement and grades the refinement toward its finite neighbours. A tetrahedron is only split across its longest edge, so a requested edge first splits the longer edges of its neighbours (longest-edge propagation), which bounds element quality. Existing vertices keep their indices; when parents is given, it receives the end vertices of the edge each new vertex bisects.

refineElements ​

#include <raisim/fem/MeshResolution.hpp>

cpp
TetMesh refineElements(
    TetMesh mesh,
    std::vector<double> targets,
    size_t maximumCells=2000000,
    std::vector<std::array<unsigned int, 2>> *parents=nullptr)

Bisects every tetrahedron whose longest edge exceeds its target until all of its descendants meet it; halves of a split tetrahedron inherit its target. Neighbours are bisected only as far as conformity and longest-edge propagation require. Infinite targets mark tetrahedra that need no refinement. Existing vertices keep their indices; when parents is given, it receives the end vertices of the edge each new vertex bisects.

refineToMaximumEdge ​

#include <raisim/fem/MeshResolution.hpp>

cpp
TetMesh refineToMaximumEdge(
    TetMesh mesh,
    double maximumEdge,
    size_t maximumCells=2000000)

RaiSim — physics for robotics and AI.