Skip to main content

DPF C++ client library 2023 R2

Example

Last update: 10.07.2023

Example helper functions.

//
// COPYRIGHT ANSYS. ALL RIGHTS RESERVED.
//
#include "Example.h"
namespace {
LoadPlugin(const std::string &plugin,
const std::string &pluginName)
{
std::string suffix;
std::string prefix = "";
#ifdef LINUX
suffix = ".so";
prefix = "lib";
#else
suffix = ".dll";
#endif
std::string path_to_dll = prefix + plugin + suffix;
char* mapdlName = (char*)path_to_dll.c_str();
return ansys::dpf::core::loadDpfPlugin(mapdlName, pluginName);
}
};
ansys::dpf::Examples::FuncPtrs &
ansys::dpf::Examples::GetExampleFuncs() {
static FuncPtrs exampleFuncs;
return exampleFuncs;
}
ansys::dpf::Examples::FuncNames &
ansys::dpf::Examples::GetExampleFuncsNames() {
static FuncNames exampleFuncNames;
return exampleFuncNames;
}
ansys::dpf::Examples::LoadMAPDL()
{
return LoadPlugin("mapdlOperatorsCore", "mapdl");
}
ansys::dpf::Examples::LoadMESH()
{
return LoadPlugin("meshOperatorsCore", "mesh");
}
Definition: dpf_api_base.h:1060
static DpfError loadDpfPlugin(std::string const &plugin_path, std::string const &plugin_name, std::string const &symbol="LoadOperators")