mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cellShape::reset() - simplifies modification of existing shapes
This commit is contained in:
@ -334,8 +334,7 @@ bool Foam::hexMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -371,8 +371,7 @@ bool Foam::prismMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -329,8 +329,7 @@ bool Foam::pyrMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -274,8 +274,7 @@ bool Foam::tetMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -296,8 +296,7 @@ bool Foam::tetWedgeMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -396,8 +396,7 @@ bool Foam::wedgeMatcher::matches
|
||||
)
|
||||
)
|
||||
{
|
||||
shape = cellShape(model(), vertLabels());
|
||||
|
||||
shape.reset(model(), vertLabels());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -105,7 +105,7 @@ public:
|
||||
inline cellShape
|
||||
(
|
||||
const cellModel& model,
|
||||
labelUList&& labels,
|
||||
labelList&& labels,
|
||||
const bool doCollapse = false
|
||||
);
|
||||
|
||||
@ -173,18 +173,26 @@ public:
|
||||
//- Centroid of the cell
|
||||
inline point centre(const UList<point>& points) const;
|
||||
|
||||
//- Scalar magnitude
|
||||
inline scalar mag(const UList<point>& points) const;
|
||||
|
||||
//- Reset from components
|
||||
inline void reset
|
||||
(
|
||||
const cellModel& model,
|
||||
const labelUList& labels,
|
||||
const bool doCollapse = false
|
||||
);
|
||||
|
||||
//- Collapse shape to correct one after removing duplicate vertices
|
||||
void collapse();
|
||||
|
||||
//- Return info proxy, to print information to a stream
|
||||
Foam::InfoProxy<cellShape> info() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
//- Scalar magnitude
|
||||
inline scalar mag(const UList<point>& points) const;
|
||||
|
||||
//- Collapse shape to correct one after removing duplicate vertices
|
||||
void collapse();
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -78,7 +78,7 @@ inline Foam::cellShape::cellShape
|
||||
inline Foam::cellShape::cellShape
|
||||
(
|
||||
const cellModel& model,
|
||||
labelUList&& labels,
|
||||
labelList&& labels,
|
||||
const bool doCollapse
|
||||
)
|
||||
:
|
||||
@ -296,4 +296,21 @@ inline Foam::scalar Foam::cellShape::mag(const UList<point>& points) const
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::cellShape::reset
|
||||
(
|
||||
const cellModel& model,
|
||||
const labelUList& labels,
|
||||
const bool doCollapse
|
||||
)
|
||||
{
|
||||
static_cast<labelList&>(*this) = labels;
|
||||
m = &model;
|
||||
|
||||
if (doCollapse)
|
||||
{
|
||||
collapse();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -130,8 +130,7 @@ void Foam::blockMesh::createCells() const
|
||||
}
|
||||
|
||||
// Construct collapsed cell and add to list
|
||||
cells_[celli] = cellShape(hex, cellPoints, true);
|
||||
|
||||
cells_[celli].reset(hex, cellPoints, true);
|
||||
++celli;
|
||||
}
|
||||
}
|
||||
|
||||
@ -518,8 +518,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::voxelMeshSearch::makeMesh
|
||||
cellShapes.setSize(bCells.size());
|
||||
forAll(cellShapes, celli)
|
||||
{
|
||||
cellShapes[celli] =
|
||||
cellShape(hex, labelList(bCells[celli]), false);
|
||||
cellShapes[celli].reset(hex, labelList(bCells[celli]), false);
|
||||
}
|
||||
|
||||
//Info<< "Creating boundary faces" << endl;
|
||||
|
||||
Reference in New Issue
Block a user