Skip to content
Snippets Groups Projects
Commit 9dcb9208 authored by laurence's avatar laurence
Browse files

ENH: foamyHexMesh: enable point randomisation for point file insertion

parent 8d3508f7
Branches
Tags
No related merge requests found
......@@ -59,7 +59,12 @@ pointFile::pointFile
decomposition
),
pointFileName_(detailsDict().lookup("pointFile")),
insideOutsideCheck_(detailsDict().lookup("insideOutsideCheck"))
insideOutsideCheck_(detailsDict().lookup("insideOutsideCheck")),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
)
{
Info<< " Inside/Outside check is " << insideOutsideCheck_.asText()
<< endl;
......@@ -161,7 +166,14 @@ List<Vb::Point> pointFile::initialPoints() const
{
if (insidePoints[i])
{
const point& p(points[i]);
point& p = points[i];
if (randomiseInitialGrid_)
{
p.x() += randomPerturbationCoeff_*(rndGen().scalar01() - 0.5);
p.y() += randomPerturbationCoeff_*(rndGen().scalar01() - 0.5);
p.z() += randomPerturbationCoeff_*(rndGen().scalar01() - 0.5);
}
initialPoints.append(Vb::Point(p.x(), p.y(), p.z()));
}
......
......@@ -65,6 +65,12 @@ private:
//- Check if inserted points are inside or outside
Switch insideOutsideCheck_;
//- Should the initial positions be randomised
Switch randomiseInitialGrid_;
//- Randomise the initial positions by fraction of the initialCellSize_
scalar randomPerturbationCoeff_;
public:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment