Fix: Prevent erroneous warning about failed library loading if new dynamicMesh is constructed multiple times
This commit is contained in:
parent
ac941215d5
commit
80aa1d588f
1 changed files with 20 additions and 4 deletions
|
@ -37,13 +37,29 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
|||
forAll(libNames,i) {
|
||||
const word libName("lib"+libNames[i]+".so");
|
||||
|
||||
bool ok=dlLibraryTable::open(libName);
|
||||
if(!ok) {
|
||||
WarningIn("dynamicFvMesh::New(const IOobject& io)")
|
||||
<< "Loading of dynamic mesh library " << libName
|
||||
bool libLoaded = false;
|
||||
|
||||
dlLibraryTable& ll = dlLibraryTable::loadedLibraries;
|
||||
|
||||
forAllConstIter(dlLibraryTable, ll, llI)
|
||||
{
|
||||
if (ll(llI.key()) == libName)
|
||||
{
|
||||
libLoaded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!libLoaded)
|
||||
{
|
||||
bool ok=dlLibraryTable::open(libName);
|
||||
if(!ok) {
|
||||
WarningIn("dynamicFvMesh::New(const IOobject& io)")
|
||||
<< "Loading of dynamic mesh library " << libName
|
||||
<< " unsuccesful. Some dynamic mesh methods may not be "
|
||||
<< " available"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue