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
7 changes: 5 additions & 2 deletions src/sofa/metis/MetisOrderingMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ extern "C" {
namespace sofa::metis
{

int MetisOrderingMethodClass = sofa::core::RegisterObject("Nested dissection algorithm implemented in the METIS library.")
.add<MetisOrderingMethod>();
void registerMetisOrderingMethod(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Nested dissection algorithm implemented in the METIS library.")
.add<MetisOrderingMethod>());
}

std::string MetisOrderingMethod::methodName() const
{
Expand Down
15 changes: 9 additions & 6 deletions src/sofa/metis/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@

#include <sofa/core/ObjectFactory.h>
using sofa::core::ObjectFactory;
#include <sofa/helper/system/PluginManager.h>

#include <Eigen/MetisSupport>

namespace sofa::metis
{
extern void registerMetisOrderingMethod(sofa::core::ObjectFactory* factory);

extern "C" {
SOFA_METIS_API void initExternalModule();
SOFA_METIS_API const char* getModuleName();
SOFA_METIS_API const char* getModuleVersion();
SOFA_METIS_API const char* getModuleDescription();
SOFA_METIS_API const char* getModuleComponentList();
SOFA_METIS_API void registerObjects(sofa::core::ObjectFactory* factory);
}


template<class EigenSolverFactory, class Scalar>
void registerOrderingMethods()
{
Expand All @@ -55,6 +57,9 @@ namespace sofa::metis

void init()
{
// make sure that this plugin is registered into the PluginManager
sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME);

static bool first = true;
if (first)
{
Expand Down Expand Up @@ -87,11 +92,9 @@ namespace sofa::metis
return "";
}

const char* getModuleComponentList()
void registerObjects(sofa::core::ObjectFactory* factory)
{
/// string containing the names of the classes provided by the plugin
static std::string classes = ObjectFactory::getInstance()->listClassesFromTarget(sofa_tostring(SOFA_TARGET));
return classes.c_str();
registerMetisOrderingMethod(factory);
}

}
Loading