isoSurfaceBaseNew.C
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) 2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "isoSurfaceBase.H"
29 #include "isoSurfaceCell.H"
31 #include "isoSurfaceTopo.H"
32 
33 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
34 
37 (
38  const isoSurfaceParams& params,
39  const volScalarField& cellValues,
40  const scalarField& pointValues,
41  const scalar iso,
42  const bitSet& ignoreCells
43 )
44 {
46 
48  {
49  ptr.reset
50  (
51  new isoSurfacePoint
52  (
53  /* fvMesh implicit from cellValues */
54  cellValues,
56  iso,
57  params,
58  ignoreCells // unused
59  )
60  );
61  }
62  else if (params.algorithm() == isoSurfaceParams::ALGO_CELL)
63  {
64  ptr.reset
65  (
66  new isoSurfaceCell
67  (
68  cellValues.mesh(), // polyMesh
69  cellValues.primitiveField(),
71  iso,
72  params,
73  ignoreCells
74  )
75  );
76  }
77  else
78  {
79  // ALGO_TOPO, ALGO_DEFAULT
80  ptr.reset
81  (
82  new isoSurfaceTopo
83  (
84  cellValues.mesh(), // polyMesh
85  cellValues.primitiveField(),
87  iso,
88  params,
89  ignoreCells
90  )
91  );
92  }
93 
94  // Cannot really fail (with current logic)
95  // if (!ptr)
96  // {
97  // FatalErrorInFunction
98  // << "Unknown iso-surface algorithm ("
99  // << int(params.algorithm()) << ")\n"
100  // << exit(FatalError);
101  // }
102 
103  return ptr;
104 }
105 
106 
107 // ************************************************************************* //
const scalarField & pointValues() const noexcept
The mesh point values used for creating the iso-surface.
Marching tet iso surface algorithm with optional filtering to keep only points originating from mesh ...
Preferences for controlling iso-surface algorithms.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:37
A surface formed by the iso value. After "Regularised Marching Tetrahedra: improved iso-surface extra...
const scalarField & cellValues() const noexcept
The mesh cell values used for creating the iso-surface.
A surface formed by the iso value. After "Polygonising A Scalar Field Using Tetrahedrons", Paul Bourke (http://paulbourke.net/geometry/polygonise) and "Regularised Marching Tetrahedra: improved iso-surface extraction", G.M. Treece, R.W. Prager and A.H. Gee.
algorithmType algorithm() const noexcept
Get current algorithm.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
static autoPtr< isoSurfaceBase > New(const isoSurfaceParams &params, const volScalarField &cellValues, const scalarField &pointValues, const scalar iso, const bitSet &ignoreCells=bitSet())
Create for specified algorithm type.