mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Random: Replaced drand48 with an in-class implementation
This is faster than the library functionality that it replaces, as it allows the compiler to do inlining. It also does not utilise any static state so generators do not interfere with each other. It is also faster than the the array lookup in cachedRandom. The cachedRandom class therefore offers no advantage over Random and has been removed.
This commit is contained in:
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Remove face
|
||||
label candidateFacei = rndGen.integer(0, mesh.nInternalFaces()-1);
|
||||
label candidateFacei = rndGen.sampleAB<label>(0, mesh.nInternalFaces());
|
||||
Info<< "Wanting to delete face " << mesh.faceCentres()[candidateFacei]
|
||||
<< nl << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user