mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
168 lines
5.2 KiB
C++
168 lines
5.2 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 2 of the License, or (at your
|
|
option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
Class
|
|
offsetTriSurfaceMesh
|
|
|
|
Description
|
|
triSurfaceMesh with offset. Used to define refinement boxes as a region
|
|
within certain distance to the refinement surface.
|
|
Note: reloads surface.
|
|
|
|
SourceFiles
|
|
offsetTriSurfaceMesh.C
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef offsetTriSurfaceMesh_H
|
|
#define offsetTriSurfaceMesh_H
|
|
|
|
#include "triSurfaceMesh.H"
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
|
|
/*---------------------------------------------------------------------------*\
|
|
Class offsetTriSurfaceMesh Declaration
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
class offsetTriSurfaceMesh
|
|
:
|
|
public triSurfaceMesh
|
|
{
|
|
// Private data
|
|
|
|
const scalar offset_;
|
|
|
|
public:
|
|
|
|
//- Runtime type information
|
|
TypeName("offsetTriSurfaceMesh");
|
|
|
|
|
|
// Constructors
|
|
|
|
//- Construct from triSurface and offset
|
|
offsetTriSurfaceMesh(const IOobject&, const triSurface&, const scalar);
|
|
|
|
//- Construct read and offset
|
|
offsetTriSurfaceMesh(const IOobject& io, const scalar);
|
|
|
|
//- Construct as searchableSurface
|
|
offsetTriSurfaceMesh
|
|
(
|
|
const word& name,
|
|
const objectRegistry& obj,
|
|
const dictionary& dict
|
|
);
|
|
|
|
|
|
// Destructor
|
|
|
|
virtual ~offsetTriSurfaceMesh();
|
|
|
|
|
|
// Member Functions
|
|
|
|
// searchableSurface implementation
|
|
|
|
//- Calculate nearest point on surface. Returns
|
|
// - bool : any point found nearer than nearestDistSqr
|
|
// - label: relevant index in surface
|
|
// - point: actual nearest point found
|
|
virtual pointIndexHit findNearest
|
|
(
|
|
const point& sample,
|
|
const scalar nearestDistSqr
|
|
) const;
|
|
|
|
//- Calculate nearest point on edge. Returns
|
|
// - bool : any point found nearer than nearestDistSqr
|
|
// - label: relevant index in surface
|
|
// - point: actual nearest point found
|
|
virtual pointIndexHit findNearestOnEdge
|
|
(
|
|
const point& sample,
|
|
const scalar nearestDistSqr
|
|
) const;
|
|
|
|
//- Find nearest to line. Returns
|
|
// - bool : any point found?
|
|
// - label: relevant index in shapes
|
|
// - point: actual nearest point found
|
|
// sets:
|
|
// - tightest : bounding box
|
|
// - linePoint : corresponding nearest point on line
|
|
virtual pointIndexHit findNearest
|
|
(
|
|
const linePointRef& ln,
|
|
treeBoundBox& tightest,
|
|
point& linePoint
|
|
) const
|
|
{
|
|
notImplemented("offsetTriSurfaceMesh::findNearest(..)");
|
|
return pointIndexHit();
|
|
}
|
|
|
|
//- Find nearest intersection of line between start and end.
|
|
virtual pointIndexHit findLine
|
|
(
|
|
const point& start,
|
|
const point& end
|
|
) const
|
|
{
|
|
notImplemented("offsetTriSurfaceMesh::findLine(..)");
|
|
return pointIndexHit();
|
|
}
|
|
|
|
//- Find any intersection of line between start and end.
|
|
virtual pointIndexHit findLineAny
|
|
(
|
|
const point& start,
|
|
const point& end
|
|
) const
|
|
{
|
|
notImplemented("offsetTriSurfaceMesh::findLine(..)");
|
|
return pointIndexHit();
|
|
}
|
|
|
|
//- Determine type (inside/outside/mixed) for point. unknown if
|
|
// cannot be determined (e.g. non-manifold surface)
|
|
virtual volumeType getVolumeType(const point&) const;
|
|
|
|
};
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace Foam
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|