Skip to content
Snippets Groups Projects
Commit 3392965a authored by mattijs's avatar mattijs Committed by Mark OLESEN
Browse files

ENH: scaling: added scaling to various sampling routines. See #514.

parent 139edb24
Branches
Tags
No related merge requests found
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -435,7 +435,14 @@ Foam::surfaceToCell::surfaceToCell
),
nearDist_(readScalar(dict.lookup("nearDistance"))),
curvature_(readScalar(dict.lookup("curvature"))),
surfPtr_(new triSurface(surfName_)),
surfPtr_
(
new triSurface
(
surfName_,
dict.lookupOrDefault<scalar>("scale", -1)
)
),
querySurfPtr_(new triSurfaceSearch(*surfPtr_)),
IOwnPtrs_(true)
{
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -59,7 +59,7 @@ void Foam::surfaceToPoint::combine(topoSet& set, const bool add) const
{
cpuTime timer;
triSurface surf(surfName_);
triSurface surf(surfName_, scale_);
Info<< " Read surface from " << surfName_
<< " in = "<< timer.cpuTimeIncrement() << " s" << endl << endl;
......@@ -131,6 +131,7 @@ Foam::surfaceToPoint::surfaceToPoint
:
topoSetSource(mesh),
surfName_(surfName),
scale_(1.0),
nearDist_(nearDist),
includeInside_(includeInside),
includeOutside_(includeOutside)
......@@ -147,6 +148,7 @@ Foam::surfaceToPoint::surfaceToPoint
:
topoSetSource(mesh),
surfName_(fileName(dict.lookup("file")).expand()),
scale_(dict.lookupOrDefault<scalar>("scale", 1.0)),
nearDist_(readScalar(dict.lookup("nearDistance"))),
includeInside_(readBool(dict.lookup("includeInside"))),
includeOutside_(readBool(dict.lookup("includeOutside")))
......@@ -163,6 +165,7 @@ Foam::surfaceToPoint::surfaceToPoint
:
topoSetSource(mesh),
surfName_(checkIs(is)),
scale_(1.0),
nearDist_(readScalar(checkIs(is))),
includeInside_(readBool(checkIs(is))),
includeOutside_(readBool(checkIs(is)))
......
......@@ -67,6 +67,9 @@ class surfaceToPoint
//- Name of surface file
const fileName surfName_;
//- Optional scaling for surface
const scalar scale_;
//- If > 0 : include points with distance to surface less than nearDist.
const scalar nearDist_;
......
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