#include <MechanicalMapping.h>


Public Member Functions | |
| MechanicalMapping (In *from, Out *to) | |
| virtual | ~MechanicalMapping () |
| virtual void | applyJT (typename In::VecDeriv &out, const typename Out::VecDeriv &in)=0 |
| Apply the reverse mapping on force vectors. | |
| virtual void | applyJT (typename In::VecConst &, const typename Out::VecConst &) |
| Apply the reverse mapping on constraint matrix. | |
| virtual BaseMechanicalState * | getMechFrom () |
| Get the source (upper) model. | |
| virtual BaseMechanicalState * | getMechTo () |
| Get the destination (lower, mapped) model. | |
| virtual bool | isMechanical () |
| Return false if this mapping should only be used as a regular mapping instead of a mechanical mapping. | |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| virtual void | propagateX () |
| Propagate position from the source model to the destination model. | |
| virtual void | propagateXfree () |
| Propagate free-motion position from the source model to the destination model. | |
| virtual void | propagateV () |
| Propagate velocity from the source model to the destination model. | |
| virtual void | propagateDx () |
| Propagate displacement from the source model to the destination model. | |
| virtual void | accumulateForce () |
| Accumulate forces from the destination model back to the source model. | |
| virtual void | accumulateDf () |
| Accumulate force deltas from the destination model back to the source model. | |
| virtual void | accumulateConstraint () |
| Accumulate constraint from the destination model back to the source model. | |
Static Public Member Functions | |
| static std::string | templateName (const MechanicalMapping< In, Out > *=NULL) |
Data Fields | |
| Data< bool > | f_isMechanical |
Protected Member Functions | |
| bool | getShow () const |
| If true, display the mapping. | |
A MechanicalMapping is a mapping between two MechanicalState. Position, velocity and displacement are propagated from the source (upper) model to the destination (lower, or mapped) model, while forces and constraints are accumulated back from the destination model to the source model.
If the mapping is linear, then it can be represented by a matrix J, and most computations correspond to multiply this matrix or its transpose to the given vectors.
Definition at line 60 of file MechanicalMapping.h.
| sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::MechanicalMapping | ( | In * | from, | |
| Out * | to | |||
| ) | [inline] |
Definition at line 51 of file MechanicalMapping.inl.
| sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::~MechanicalMapping | ( | ) | [inline, virtual] |
Definition at line 58 of file MechanicalMapping.inl.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateConstraint | ( | ) | [inline, virtual] |
Accumulate constraint from the destination model back to the source model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ C_in += J^t C_out $
This method retrieves the constraint matrices and call the internal applyJT() method implemented by the component.
Reimplemented from sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 134 of file MechanicalMapping.inl.
References sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::applyJT(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateDf | ( | ) | [inline, virtual] |
Accumulate force deltas from the destination model back to the source model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ df_in += J^t df_out $
This method retrieves the force vectors and call the internal applyJT() method implemented by the component.
Reimplemented from sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 127 of file MechanicalMapping.inl.
References sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::applyJT(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateForce | ( | ) | [inline, virtual] |
Accumulate forces from the destination model back to the source model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ f_in += J^t f_out $
This method retrieves the force vectors and call the internal applyJT() method implemented by the component.
Reimplemented from sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 117 of file MechanicalMapping.inl.
References sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::applyJT(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| virtual void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::applyJT | ( | typename In::VecConst & | , | |
| const typename Out::VecConst & | ||||
| ) | [inline, virtual] |
Apply the reverse mapping on constraint matrix.
If the MechanicalMapping can be represented as a matrix J, this method computes $ Out += J^t In $
This method must be reimplemented by all mappings if they need to support constraints.
Definition at line 83 of file MechanicalMapping.h.
| virtual void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::applyJT | ( | typename In::VecDeriv & | out, | |
| const typename Out::VecDeriv & | in | |||
| ) | [pure virtual] |
Apply the reverse mapping on force vectors.
If the MechanicalMapping can be represented as a matrix J, this method computes $ out += J^t in $
This method must be reimplemented by all mappings.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateConstraint(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateDf(), and sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateForce().
| BaseMechanicalState * sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::getMechFrom | ( | ) | [inline, virtual] |
Get the source (upper) model.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 63 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::fromModel.
| BaseMechanicalState * sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::getMechTo | ( | ) | [inline, virtual] |
Get the destination (lower, mapped) model.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 69 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::toModel.
| bool sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::getShow | ( | ) | const [inline, protected] |
If true, display the mapping.
Reimplemented from sofa::core::Mapping< TIn, TOut >.
Definition at line 158 of file MechanicalMapping.h.
References sofa::core::objectmodel::BaseObject::getContext().
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::init | ( | ) | [inline, virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::Mapping< TIn, TOut >.
Definition at line 81 of file MechanicalMapping.inl.
References sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateXfree(), and sofa::core::Mapping< TIn, TOut >::updateMapping().
| bool sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::isMechanical | ( | ) | [inline, virtual] |
Return false if this mapping should only be used as a regular mapping instead of a mechanical mapping.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 75 of file MechanicalMapping.inl.
References sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::f_isMechanical.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateDx | ( | ) | [inline, virtual] |
Propagate displacement from the source model to the destination model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ dx_out = J dx_in $
This method retrieves the dx vectors and call the internal applyJ() method implemented by the component.
Reimplemented from sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 102 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::applyJ(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateV | ( | ) | [inline, virtual] |
Propagate velocity from the source model to the destination model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ v_out = J v_in $
This method retrieves the v vectors and call the internal apply() method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 95 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::applyJ(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateX | ( | ) | [inline, virtual] |
Propagate position from the source model to the destination model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ x_out = J x_in $
This method retrieves the x vectors and call the internal apply() method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 88 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::apply(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateXfree | ( | ) | [inline, virtual] |
Propagate free-motion position from the source model to the destination model.
If the MechanicalMapping can be represented as a matrix J, this method computes $ xfree_out = J xfree_in $
This method retrieves the xfree vectors and call the internal apply() method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMechanicalMapping.
Definition at line 109 of file MechanicalMapping.inl.
References sofa::core::Mapping< TIn, TOut >::apply(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::init().
| static std::string sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::templateName | ( | const MechanicalMapping< In, Out > * | = NULL |
) | [inline, static] |
Definition at line 152 of file MechanicalMapping.h.
| Data<bool> sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::f_isMechanical |
Definition at line 63 of file MechanicalMapping.h.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::isMechanical().
1.5.7.1