1 #include <sofa/simulation/MechanicalVisitor.h>
3 namespace SofaCaribou::visitor {
22 sofa::core::TMultiVecId<sofa::core::V_ALL, sofa::core::V_WRITE> a,
23 sofa::core::TMultiVecId<sofa::core::V_ALL, sofa::core::V_READ> b,
25 bool only_mapped =
false)
26 : BaseMechanicalVisitor(params), p_a(a), p_b(b), p_mapped(mapped), p_only_mapped(only_mapped) {
30 bool stopAtMechanicalMapping(sofa::simulation::Node * , sofa::core::BaseMapping *map)
override {
31 if (p_mapped || p_only_mapped)
34 return !map->areForcesMapped();
37 Result fwdMechanicalState(VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
override;
39 Result fwdMappedMechanicalState(VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
override;
41 void copy(sofa::core::behavior::BaseMechanicalState * state)
const ;
43 const char *getClassName()
const override {
return "MultiVecEqualVisitor"; }
45 std::string getInfos()
const override;
48 sofa::core::TMultiVecId<sofa::core::V_ALL, sofa::core::V_WRITE> p_a;
49 sofa::core::TMultiVecId<sofa::core::V_ALL, sofa::core::V_READ> p_b;