simplexSmoother.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "simplexSmoother.H"
29 #include "tetrahedron.H"
30 #include "partTetMeshSimplex.H"
31 
32 //#define DEBUGSmooth
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
42 :
43  points_(simplex.pts()),
44  tets_(simplex.tets()),
45  pointI_(tets_[0][3]),
46  bb_()
47 {
48  point min(VGREAT, VGREAT, VGREAT), max(-VGREAT, -VGREAT, -VGREAT);
49  forAll(tets_, tetI)
50  {
51  const partTet& pt = tets_[tetI];
53  (
54  points_[pt.a()],
55  points_[pt.b()],
56  points_[pt.c()],
57  points_[pt.d()]
58  );
59 
60  min = Foam::min(min, tet.a());
61  max = Foam::max(max, tet.a());
62 
63  min = Foam::min(min, tet.b());
64  max = Foam::max(max, tet.b());
65 
66  min = Foam::min(min, tet.c());
67  max = Foam::max(max, tet.c());
68  }
69 
70  bb_.max() = max;
71  bb_.min() = min;
72 }
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
77 {}
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 // Member functions
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 } // End namespace Foam
85 
86 // ************************************************************************* //
Foam::partTetMeshSimplex
Definition: partTetMeshSimplex.H:52
Foam::boundBox::max
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
Foam::partTet::d
label d() const
Definition: partTetI.H:78
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::partTet::b
label b() const
Definition: partTetI.H:68
Foam::simplexSmoother::simplexSmoother
simplexSmoother(const simplexSmoother &)
Disallow default bitwise copy construct.
Foam::partTet
Definition: partTet.H:53
Foam::tetrahedron::c
const Point & c() const
Definition: tetrahedronI.H:87
partTetMeshSimplex.H
Foam::simplexSmoother::points_
DynList< point, 128 > & points_
mesh points
Definition: simplexSmoother.H:62
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
Foam::simplexSmoother::tets_
const DynList< partTet, 128 > & tets_
list tets around the given vertex
Definition: simplexSmoother.H:65
Foam::simplexSmoother::~simplexSmoother
virtual ~simplexSmoother()
Definition: simplexSmoother.C:76
Foam::partTet::c
label c() const
Definition: partTetI.H:73
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::tetrahedron::a
const Point & a() const
Return vertices.
Definition: tetrahedronI.H:73
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::simplexSmoother::bb_
boundBox bb_
bound box
Definition: simplexSmoother.H:71
Foam::Vector< scalar >
Foam::tetrahedron::b
const Point & b() const
Definition: tetrahedronI.H:80
Foam::partTet::a
label a() const
Return vertices.
Definition: partTetI.H:63
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
simplexSmoother.H
tetrahedron.H
Foam::tetrahedron
A tetrahedron primitive.
Definition: tetrahedron.H:62