    

 ## On this page

  

 

 # Example

 Last update: 16.07.2025 

Example helper functions.

//

// COPYRIGHT ANSYS. ALL RIGHTS RESERVED.

//

\#include "Example.h"

 

namespace {

 <a id="_a0" name="_a0"></a>[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml)

 LoadPlugin(const std::string &amp;plugin,

 const std::string &amp;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 <a id="a1" name="a1"></a>[ansys::dpf::core::loadDpfPlugin](classansys_1_1dpf_1_1core.xhtml#addc032f5882185bcf940ce7adf293327)(mapdlName, pluginName);

 }

};

 

ansys::dpf::Examples::FuncPtrs &amp;

ansys::dpf::Examples::GetExampleFuncs() {

 static FuncPtrs exampleFuncs;

 return exampleFuncs;

}

 

ansys::dpf::Examples::FuncNames &amp;

ansys::dpf::Examples::GetExampleFuncsNames() {

 static FuncNames exampleFuncNames;

 return exampleFuncNames;

}

 

[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml)

ansys::dpf::Examples::LoadMAPDL()

{

 return LoadPlugin("mapdlOperatorsCore", "mapdl");

}

[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml)

ansys::dpf::Examples::LoadMESH()

{

 return LoadPlugin("meshOperatorsCore", "mesh");

}

[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml)

**Definition:** dpf_api_base.h:1060



[ansys::dpf::core::loadDpfPlugin](classansys_1_1dpf_1_1core.xhtml#addc032f5882185bcf940ce7adf293327)

static DpfError loadDpfPlugin(std::string const &amp;plugin_path, std::string const &amp;plugin_name, std::string const &amp;symbol="LoadOperators")