Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sofa/framework/Simulation/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ set(HEADER_FILES
${SRC_ROOT}/mappinggraph/MappingGraphNode.h
${SRC_ROOT}/mappinggraph/MappingGraphVisitor.h
${SRC_ROOT}/mappinggraph/VisitorApplication.h
${SRC_ROOT}/mappinggraph/MappingGraphUser.h

${SRC_ROOT}/mechanicalvisitor/MechanicalAccFromFVisitor.h
${SRC_ROOT}/mechanicalvisitor/MechanicalAccumulateJacobian.h
Expand Down Expand Up @@ -243,6 +244,7 @@ set(SOURCE_FILES
${SRC_ROOT}/mappinggraph/ExportDot.cpp
${SRC_ROOT}/mappinggraph/MappingGraphAlgorithms.cpp
${SRC_ROOT}/mappinggraph/MappingGraphVisitor.cpp
${SRC_ROOT}/mappinggraph/MappingGraphUser.cpp

${SRC_ROOT}/mechanicalvisitor/MechanicalAccFromFVisitor.cpp
${SRC_ROOT}/mechanicalvisitor/MechanicalAccumulateJacobian.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void ImplicitIntegrationScheme::setupIntegrationStep(const core::ExecParams* par
m_xResult = xResult;
m_vResult = vResult;

m_mappingGraph.build(this->getContext());
this->m_mappingGraph.build(this->getContext());


// dx is no longer allocated by default (but it will be deleted automatically by the mechanical objects)
Expand All @@ -76,4 +76,4 @@ void ImplicitIntegrationScheme::integrate(const core::ExecParams* params, SReal
finalizeIntegrationStep();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <sofa/core/behavior/LinearSolverAccessor.h>
#include <sofa/simulation/MappingGraphMechanicalOperations.h>
#include <sofa/simulation/MappingGraph.h>
#include <sofa/simulation/mappinggraph/MappingGraphUser.h>

namespace sofa::simulation::common
{
Expand All @@ -41,7 +42,8 @@ namespace sofa::simulation::integrationscheme

class SOFA_SIMULATION_CORE_API ImplicitIntegrationScheme :
public sofa::core::behavior::BaseIntegrationScheme,
public sofa::core::behavior::LinearSolverAccessor
public sofa::core::behavior::LinearSolverAccessor,
public sofa::simulation::MappingGraphUser
{
public:
SOFA_ABSTRACT_CLASS2(ImplicitIntegrationScheme, sofa::core::behavior::BaseIntegrationScheme, sofa::core::behavior::LinearSolverAccessor);
Expand Down Expand Up @@ -161,8 +163,6 @@ class SOFA_SIMULATION_CORE_API ImplicitIntegrationScheme :

std::shared_ptr<sofa::simulation::common::VectorOperations > m_vop;
std::unique_ptr<sofa::simulation::common::MappingGraphMechanicalOperations> m_mop;

sofa::simulation::MappingGraph m_mappingGraph;
};
} // namespace sofa::component::integrationscheme

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <sofa/simulation/mappinggraph/MappingGraphUser.h>

namespace sofa::simulation
{

const MappingGraph& MappingGraphUser::getMappingGraph() const { return m_mappingGraph; }

} // namespace sofa::simulation
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#pragma once

#include <sofa/simulation/config.h>
#include <sofa/simulation/MappingGraph.h>

namespace sofa::simulation
{

class SOFA_SIMULATION_CORE_API MappingGraphUser : virtual public sofa::core::Base
{
public:

const MappingGraph& getMappingGraph() const;

protected:

MappingGraph m_mappingGraph;
};

}
Loading