matchPoints.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2012 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Description
28  Determine correspondence between points. See below.
29 
30 SourceFiles
31  matchPoints.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef matchPoints_H
36 #define matchPoints_H
37 
38 #include "scalarField.H"
39 #include "pointField.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Function matchPoints Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 //- Determine correspondence between pointFields. Gets passed
51 // local matching distance per point. Returns map from 0 to 1. Returns
52 // true if found corresponding point in 1 for every point in 0; false
53 // otherwise. Compares mag(pt - origin) and does proper comparison for points
54 // with (almost) identical mag. pts0 can be subset of pts1.
55 bool matchPoints
56 (
57  const UList<point>& pts0,
58  const UList<point>& pts1,
59  const UList<scalar>& matchDistance,
60  const bool verbose,
61  labelList& from0To1,
62  const point& origin = point::zero
63 );
64 
65 
66 //- Supply pts0Dir and pts1Dir. They are directions associated with the points
67 // e.g., a face normal associated with each face centre.
68 // A match between similar points is only allowed if their directions are
69 // equal and opposite
70 bool matchPoints
71 (
72  const UList<point>& pts0,
73  const UList<point>& pts1,
74  const UList<point>& pts0Dir,
75  const UList<point>& pts1Dir,
76  const UList<scalar>& matchDistance,
77  const bool verbose,
78  labelList& from0To1,
79  const point& origin = point::zero
80 );
81 
82 
83 } // End namespace Foam
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 #endif
88 
89 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
scalarField.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
pointField.H
Foam::VectorSpace< Vector< Cmpt >, Cmpt, 3 >::zero
static const Vector< Cmpt > zero
Definition: VectorSpace.H:115
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::matchPoints
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
Definition: matchPoints.C:36