#include <MappingGraph.h>
Connexions between objects through mappings
Graph must be built with the build() function.
Classes | |
struct | SameGroupComponents |
Public Member Functions | |
core::objectmodel::BaseContext * | getRootNode () const |
Return the node used to start the exploration of the scene graph in order to build the mapping graph. More... | |
const sofa::type::vector< BaseMechanicalState * > & | getMainMechanicalStates () const |
Return the list of all mechanical states which are not mapped. More... | |
MappingInputs | getTopMostMechanicalStates (BaseMechanicalState *) const |
MappingInputs | getTopMostMechanicalStates (core::behavior::BaseForceField *) const |
MappingInputs | getTopMostMechanicalStates (core::behavior::BaseMass *) const |
ComponentGroups | makeComponentGroups (const sofa::core::ExecParams *params) const |
Create groups of components associated to the same mechanical state. More... | |
bool | hasAnyMapping () const |
bool | hasAnyMappingInput (BaseMechanicalState *) const |
Return true if the provided mechanical state is an output of a mapping. More... | |
bool | hasAnyMappingInput (core::behavior::BaseForceField *) const |
Return true if the mechanical states associated to the provided force field is an output of a mapping. More... | |
bool | hasAnyMappingInput (core::behavior::BaseMass *) const |
Return true if the mechanical states associated to the provided mass is an output of a mapping. More... | |
bool | isMechanicalStateInContext (BaseMechanicalState *) const |
Return true if the provided mechanical state has been visited when building the mapping graph. More... | |
bool | isMappingInput (BaseMechanicalState *mappingInput, BaseMechanicalState *mappingOutput) const |
MappingInputs | getMappingInputs (BaseMechanicalState *) const |
sofa::type::vector< core::BaseMapping * > | getBottomUpMappingsFrom (BaseMechanicalState *) const |
sofa::Size | getTotalNbMainDofs () const |
Return the sum of the degrees of freedom of all main mechanical states. More... | |
type::Vec2u | getPositionInGlobalMatrix (BaseMechanicalState *) const |
Return where in the global matrix the provided mechanical state writes its contribution. More... | |
type::Vec2u | getPositionInGlobalMatrix (BaseMechanicalState *a, BaseMechanicalState *b) const |
Return where in the global matrix the provided mechanical states writes its contribution. More... | |
MappingGraph ()=default | |
bool | isBuilt () const |
void | build (const sofa::core::ExecParams *params, core::objectmodel::BaseContext *rootNode) |
Build the graph: mandatory to get valid data from the functions that use the graph. More... | |
|
default |
void sofa::component::linearsystem::MappingGraph::build | ( | const sofa::core::ExecParams * | params, |
core::objectmodel::BaseContext * | rootNode | ||
) |
Build the graph: mandatory to get valid data from the functions that use the graph.
sofa::type::vector< core::BaseMapping * > sofa::component::linearsystem::MappingGraph::getBottomUpMappingsFrom | ( | BaseMechanicalState * | mstate | ) | const |
const sofa::type::vector< core::behavior::BaseMechanicalState * > & sofa::component::linearsystem::MappingGraph::getMainMechanicalStates | ( | ) | const |
Return the list of all mechanical states which are not mapped.
sofa::type::vector< BaseMechanicalState * > sofa::component::linearsystem::MappingGraph::getMappingInputs | ( | BaseMechanicalState * | mstate | ) | const |
Returns all mechanical states which are input of a mapping where the mechanical state in parameter is an output
type::Vec2u sofa::component::linearsystem::MappingGraph::getPositionInGlobalMatrix | ( | BaseMechanicalState * | mstate | ) | const |
Return where in the global matrix the provided mechanical state writes its contribution.
type::Vec2u sofa::component::linearsystem::MappingGraph::getPositionInGlobalMatrix | ( | BaseMechanicalState * | a, |
BaseMechanicalState * | b | ||
) | const |
Return where in the global matrix the provided mechanical states writes its contribution.
core::objectmodel::BaseContext * sofa::component::linearsystem::MappingGraph::getRootNode | ( | ) | const |
Return the node used to start the exploration of the scene graph in order to build the mapping graph.
auto sofa::component::linearsystem::MappingGraph::getTopMostMechanicalStates | ( | BaseMechanicalState * | mstate | ) | const |
Return the list of mechanical states which are: 1) non-mapped 2) input of a mapping involving the provided mechanical state as an output. The search is recursive (more than one level of mapping) and is done during mapping graph construction.
auto sofa::component::linearsystem::MappingGraph::getTopMostMechanicalStates | ( | core::behavior::BaseForceField * | forceField | ) | const |
Return the list of mechanical states which are: 1) non-mapped 2) input of a mapping involving the mechanical states associated to the provided force field as an output. The search is recursive (more than one level of mapping) and is done during mapping graph construction.
auto sofa::component::linearsystem::MappingGraph::getTopMostMechanicalStates | ( | core::behavior::BaseMass * | mass | ) | const |
Return the list of mechanical states which are: 1) non-mapped 2) input of a mapping involving the mechanical states associated to the provided mass as an output. The search is recursive (more than one level of mapping) and is done during mapping graph construction.
|
inline |
Return the sum of the degrees of freedom of all main mechanical states.
bool sofa::component::linearsystem::MappingGraph::hasAnyMapping | ( | ) | const |
bool sofa::component::linearsystem::MappingGraph::hasAnyMappingInput | ( | BaseMechanicalState * | mstate | ) | const |
Return true if the provided mechanical state is an output of a mapping.
bool sofa::component::linearsystem::MappingGraph::hasAnyMappingInput | ( | core::behavior::BaseForceField * | forceField | ) | const |
Return true if the mechanical states associated to the provided force field is an output of a mapping.
bool sofa::component::linearsystem::MappingGraph::hasAnyMappingInput | ( | core::behavior::BaseMass * | mass | ) | const |
Return true if the mechanical states associated to the provided mass is an output of a mapping.
bool sofa::component::linearsystem::MappingGraph::isBuilt | ( | ) | const |
bool sofa::component::linearsystem::MappingGraph::isMappingInput | ( | BaseMechanicalState * | mappingInput, |
BaseMechanicalState * | mappingOutput | ||
) | const |
Return true if @input is a mapping input of @output. Multiple intermediate mappings are supported In term of graph connectivity, return true if the two nodes of the directed graph are connected
bool sofa::component::linearsystem::MappingGraph::isMechanicalStateInContext | ( | BaseMechanicalState * | mstate | ) | const |
Return true if the provided mechanical state has been visited when building the mapping graph.
MappingGraph::ComponentGroups sofa::component::linearsystem::MappingGraph::makeComponentGroups | ( | const sofa::core::ExecParams * | params | ) | const |
Create groups of components associated to the same mechanical state.