Skip to content
Snippets Groups Projects
Commit 1b83048b authored by Oliver Sander's avatar Oliver Sander
Browse files

actually transfer arguments of loadBalance() to UG

[[Imported from SVN: r1378]]
parent 5a62f262
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,10 @@ namespace Dune {
/** \brief Please doc me! */
GridIdentifier type () { return UGGrid_Id; };
/** \brief Distributes this grid over the available nodes in a distributed machine */
/** \brief Distributes this grid over the available nodes in a distributed machine
*
\param maxlevel does currently get ignored
*/
void loadBalance(int strategy, int minlevel, int depth, int maxlevel, int minelement);
/*! The communication interface
......
......@@ -502,17 +502,31 @@ void UGGrid < dim, dimworld >::globalRefine(int refCount)
template < int dim, int dimworld >
void UGGrid < dim, dimworld >::loadBalance(int strategy, int minlevel, int depth, int maxlevel, int minelement)
{
char* argv[4];
/** \todo Test for valid arguments */
std::string argStrings[4];
std::stringstream numberAsAscii[4];
argv[0] = "lb 0";
argv[1] = "c 1";
argv[2] = "d 2";
argv[3] = "e 1";
numberAsAscii[0] << strategy;
argStrings[0] = "lb " + numberAsAscii[0].str();
numberAsAscii[1] << minlevel;
argStrings[1] = "c " + numberAsAscii[1].str();
numberAsAscii[2] << depth;
argStrings[2] = "d " + numberAsAscii[2].str();
numberAsAscii[3] << minelement;
argStrings[3] = "e " + numberAsAscii[3].str();
const char* argv[4] = {argStrings[0].c_str(),
argStrings[1].c_str(),
argStrings[2].c_str(),
argStrings[3].c_str()};
#ifdef _2
int errCode = UG2d::LBCommand(4, argv);
int errCode = UG2d::LBCommand(4, (char**)argv);
#else
int errCode = UG3d::LBCommand(4, argv);
int errCode = UG3d::LBCommand(4, (char**)argv);
#endif
if (errCode)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment