Skip to content

ComplianceMatrixImage

View the compliance matrix as an binary image.

Target: SofaMatrix

namespace: sofa::component::constraintset

parents:

  • BaseObject

Data

Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
Image
bitmap Visualization of the representation of the matrix as a binary image. White pixels are zeros, black pixels are non-zeros. invalid matrix
Name Description Destination type name
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used) BaseContext
slaves Sub-objects used internally by this object BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject
constraintSolver Link to the constraint solver containing a compliance matrix ConstraintSolverImpl

Examples

ComplianceMatrixImage.scn

<Node   name="Root" gravity="0 -10 0" time="0" animate="0"  dt="0.01" >
    <RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
    <RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Correction"/> <!-- Needed to use components [GenericConstraintCorrection] -->
    <RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Model"/> <!-- Needed to use components [UniformLagrangianConstraint] -->
    <RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [GenericConstraintSolver] -->
    <RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint] -->
    <RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [TransformEngine] -->
    <RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [StringMeshCreator] -->
    <RequiredPlugin name="Sofa.Component.LinearSolver.Direct"/> <!-- Needed to use components [EigenSimplicialLLT] -->
    <RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [DistanceMapping] -->
    <RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass] -->
    <RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
    <RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
    <RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [EdgeSetGeometryAlgorithms EdgeSetTopologyContainer] -->
    <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
    <RequiredPlugin name="SofaMatrix"/> <!-- Needed to use components [ComplianceMatrixImage] -->

    <VisualStyle displayFlags="hideVisualModels showBehaviorModels showMappings showForceFields" />
    <FreeMotionAnimationLoop solveVelocityConstraintFirst="true" />
    <GenericConstraintSolver tolerance="1e-9" maxIterations="1000"/>
    <ComplianceMatrixImage/>

    <StringMeshCreator name="loader" resolution="20" scale3d="1 1 1" />

    <TransformEngine name="translate" input_position="@loader.position" translation="0 0 0" />
    <EulerImplicitSolver />
    <EigenSimplicialLLT />
    <GenericConstraintCorrection />

    <EdgeSetTopologyContainer position="@translate.output_position" edges="@loader.edges" />
    <MechanicalObject name="defoDOF" template="Vec3d" showObject="1" />
    <EdgeSetGeometryAlgorithms drawEdges="true" />
    <FixedProjectiveConstraint indices="0" />
    <DiagonalMass  name="mass" totalMass="1e-3"/>
    <Node name="extensionsNode" >
        <MechanicalObject template="Vec1d"  name="extensionsDOF" />
        <DistanceMapping  name="distanceMapping" />
        <UniformLagrangianConstraint template="Vec1d" iterative="false" />
    </Node>

</Node>
def createScene(root_node):

   root = root_node.addChild('Root', gravity="0 -10 0", time="0", animate="0", dt="0.01")

   root.addObject('RequiredPlugin', name="Sofa.Component.AnimationLoop")
   root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Lagrangian.Correction")
   root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Lagrangian.Model")
   root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Lagrangian.Solver")
   root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Projective")
   root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Transform")
   root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
   root.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Direct")
   root.addObject('RequiredPlugin', name="Sofa.Component.Mapping.NonLinear")
   root.addObject('RequiredPlugin', name="Sofa.Component.Mass")
   root.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
   root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
   root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Dynamic")
   root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
   root.addObject('RequiredPlugin', name="SofaMatrix")
   root.addObject('VisualStyle', displayFlags="hideVisualModels showBehaviorModels showMappings showForceFields")
   root.addObject('FreeMotionAnimationLoop', solveVelocityConstraintFirst="true")
   root.addObject('GenericConstraintSolver', tolerance="1e-9", maxIterations="1000")
   root.addObject('ComplianceMatrixImage', )
   root.addObject('StringMeshCreator', name="loader", resolution="20", scale3d="1 1 1")
   root.addObject('TransformEngine', name="translate", input_position="@loader.position", translation="0 0 0")
   root.addObject('EulerImplicitSolver', )
   root.addObject('EigenSimplicialLLT', )
   root.addObject('GenericConstraintCorrection', )
   root.addObject('EdgeSetTopologyContainer', position="@translate.output_position", edges="@loader.edges")
   root.addObject('MechanicalObject', name="defoDOF", template="Vec3d", showObject="1")
   root.addObject('EdgeSetGeometryAlgorithms', drawEdges="true")
   root.addObject('FixedProjectiveConstraint', indices="0")
   root.addObject('DiagonalMass', name="mass", totalMass="1e-3")

   extensions_node = Root.addChild('extensionsNode')

   extensions_node.addObject('MechanicalObject', template="Vec1d", name="extensionsDOF")
   extensions_node.addObject('DistanceMapping', name="distanceMapping")
   extensions_node.addObject('UniformLagrangianConstraint', template="Vec1d", iterative="false")