mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamyHexMesh: enable point randomisation for point file insertion
This commit is contained in:
@ -59,7 +59,12 @@ pointFile::pointFile
|
|||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
pointFileName_(detailsDict().lookup("pointFile")),
|
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()
|
Info<< " Inside/Outside check is " << insideOutsideCheck_.asText()
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -161,7 +166,14 @@ List<Vb::Point> pointFile::initialPoints() const
|
|||||||
{
|
{
|
||||||
if (insidePoints[i])
|
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()));
|
initialPoints.append(Vb::Point(p.x(), p.y(), p.z()));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,6 +65,12 @@ private:
|
|||||||
//- Check if inserted points are inside or outside
|
//- Check if inserted points are inside or outside
|
||||||
Switch insideOutsideCheck_;
|
Switch insideOutsideCheck_;
|
||||||
|
|
||||||
|
//- Should the initial positions be randomised
|
||||||
|
Switch randomiseInitialGrid_;
|
||||||
|
|
||||||
|
//- Randomise the initial positions by fraction of the initialCellSize_
|
||||||
|
scalar randomPerturbationCoeff_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user