Compare commits

..

7 Commits

204 changed files with 16687 additions and 7493 deletions

View File

@ -9,7 +9,6 @@ It is likely incomplete...
- Yu Ankun
- Tetsuo Aoyagi
- Akira Azami
- Pete Bachant
- William Bainbridge
- Gabriel Barajas
- Kutalmis Bercin

View File

@ -1,10 +1,15 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lsampling

View File

@ -56,6 +56,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fvOptions.H"
#include "simpleControl.H"
@ -71,7 +72,7 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createDynamicFvMesh.H"
simpleControl simple(mesh);
@ -87,6 +88,16 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
// Do any mesh changes
mesh.controlledUpdate();
if (mesh.changing())
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & fvc::interpolate(U);
}
while (simple.correctNonOrthogonal())
{
fvScalarMatrix TEqn

View File

@ -412,7 +412,7 @@ int main(int argc, char *argv[])
}
{
Info<< "range-for of list (" << list1.count_nonnull() << '/'
Info<< "range-for of list (" << list1.count() << '/'
<< list1.size() << ") non-null entries" << nl
<< "(" << nl;
for (const auto& item : list1)

View File

@ -1,11 +0,0 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
# Remove surface and features
rm -rf constant/triSurface
#------------------------------------------------------------------------------

View File

@ -1,27 +0,0 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#- Generate 2x2x1 cells
runApplication blockMesh
#- Remove cell0
runApplication topoSet
runApplication subsetMesh c0 -patch exposed0 -overwrite
#- Put exposed faces (2) into separate patches
runApplication -s face topoSet
runApplication createPatch -overwrite
#- Decompose - creates one processor without any faces in patches
runApplication decomposePar
#- Extract inter-patch points. Should include processor that does not
#- have faces on patch ...
mkdir -p constant/triSurface
runParallel surfaceMeshExtract \
-patches '(exposed0 exposed1)' -featureAngle 180 \
constant/triSurface/blockMesh.obj
#------------------------------------------------------------------------------

View File

@ -1,7 +0,0 @@
- 2x2x1 mesh
- remove one cell, exposing two faces
- move exposed faces into two patches
- decompose onto 3
- run surfaceMeshExtract -featureAngle 180
- should also mark points on the processor that has no
faces but is coupled

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu 0.01;
// ************************************************************************* //

View File

@ -1,88 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
//- Single block
(0 0 0)
(2 0 0)
(2 2 0)
(0 2 0)
(0 0 2)
(2 0 2)
(2 2 2)
(0 2 2)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (2 2 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
topWall
{
type wall;
faces
(
(3 7 6 2)
);
}
bottomWall
{
type wall;
faces
(
(1 5 4 0)
);
}
fixedWalls
{
type wall;
faces
(
(0 4 7 3)
(2 6 5 1)
);
}
frontAndBack
{
type patch;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
exposed0
{
type patch;
faces ();
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 16;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -1,44 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pointSync false;
// Patches to create.
patches
(
// Example of creating mapped patches using geometric matching
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
// Name of new patch
name exposed1;
// Dictionary to construct new patch from
patchInfo
{
type patch;
}
// How to select the faces:
// - set : specify faceSet in 'set'
// - patches : specify names in 'patches'
// - autoPatch : attempts automatic patching of the specified
// candidates in 'patches'.
constructFrom set;
set exposed0;
}
);
// ************************************************************************* //

View File

@ -1,24 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- The total number of domains (mandatory)
numberOfSubdomains 3;
//- The decomposition method (mandatory)
method scotch;
// ************************************************************************* //

View File

@ -1,51 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default orthogonal;
}
// ************************************************************************* //

View File

@ -1,52 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.05;
}
pFinal
{
$p;
relTol 0;
}
U
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-05;
relTol 0;
}
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name c0;
type cellSet;
action new;
source labelToCell;
value (0);
}
{
name c0;
type cellSet;
action invert;
}
{
name exposed0;
type faceSet;
action new;
source patchToFace;
patch exposed0;
}
{
name exposed0;
type faceSet;
action subset;
source boxToFace;
box (-100 1 -100)(100 100 100);
}
);
// ************************************************************************* //

View File

@ -43,6 +43,7 @@ Description
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "polyTopoChanger.H"
#include "edgeCollapser.H"
#include "perfectInterface.H"
@ -1059,7 +1060,8 @@ int main(int argc, char *argv[])
);
// Topo change container
polyTopoChange meshMod(mesh);
//polyTopoChange meshMod(mesh);
batchPolyTopoChange meshMod(mesh);
perfectStitcher.setRefinement
(
@ -1085,7 +1087,9 @@ int main(int argc, char *argv[])
);
// Construct new mesh from polyTopoChange.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
//autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
polyTopoChanger XXX (mesh, IOobject::NO_READ);
autoPtr<mapPolyMesh> map = XXX.changeMesh(mesh, meshMod);
// Update fields
mesh.updateMesh(map());

View File

@ -622,7 +622,7 @@ int main(int argc, char *argv[])
}
// Execute all polyMeshModifiers
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh();
mesh.movePoints(morphMap->preMotionPoints());

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2024 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -220,7 +220,7 @@ PtrList<FieldType> subsetFields
const pointMesh& pMesh
)
{
//const fvMesh& baseMesh = subsetter.baseMesh();
const fvMesh& baseMesh = subsetter.baseMesh();
const UPtrList<const IOobject> fieldObjects
(
@ -247,8 +247,8 @@ PtrList<FieldType> subsetFields
IOobject
(
io.name(),
pMesh.thisDb().time().timeName(),
pMesh.thisDb(),
baseMesh.time().timeName(),
baseMesh,
IOobjectOption::MUST_READ,
IOobjectOption::NO_WRITE,
IOobjectOption::NO_REGISTER
@ -382,8 +382,6 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createNamedMesh.H"
// Make sure pointMesh gets constructed/read as well
(void)pointMesh::New(mesh, IOobject::READ_IF_PRESENT);
// arg[1] = word (cellSet) or wordRes (cellZone)
// const word selectionName = args[1];
@ -585,7 +583,7 @@ int main(int argc, char *argv[])
// Read point fields and subset
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const pointMesh& pMesh = pointMesh::New(mesh, IOobject::READ_IF_PRESENT);
const pointMesh& pMesh = pointMesh::New(mesh);
#undef createSubsetFields
#define createSubsetFields(FieldType, Variable) \
@ -665,18 +663,6 @@ int main(int argc, char *argv[])
subsetter.subMesh().write();
processorMeshes::removeFiles(subsetter.subMesh());
auto* subPointMeshPtr =
subsetter.subMesh().thisDb().findObject<pointMesh>
(
pointMesh::typeName
);
if (subPointMeshPtr)
{
pointMesh& subPointMesh = const_cast<pointMesh&>(*subPointMeshPtr);
subPointMesh.setInstance(subsetter.subMesh().facesInstance());
subPointMesh.write();
}
// Volume fields
for (const auto& fld : vScalarFlds) { fld.write(); }

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2022,2024 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -661,9 +661,6 @@ int main(int argc, char *argv[])
),
decompDictFile
);
// Make sure pointMesh gets read as well
(void)pointMesh::New(mesh, IOobject::READ_IF_PRESENT);
// Decompose the mesh
if (!decomposeFieldsOnly)
@ -783,7 +780,6 @@ int main(int argc, char *argv[])
PtrList<labelIOList> cellProcAddressingList(mesh.nProcs());
PtrList<labelIOList> boundaryProcAddressingList(mesh.nProcs());
PtrList<labelIOList> pointProcAddressingList(mesh.nProcs());
PtrList<labelIOList> pointBoundaryProcAddressingList(mesh.nProcs());
PtrList<fvFieldDecomposer> fieldDecomposerList(mesh.nProcs());
PtrList<pointFieldDecomposer> pointFieldDecomposerList
@ -854,10 +850,7 @@ int main(int argc, char *argv[])
// Point fields
// ~~~~~~~~~~~~
// Read decomposed pointMesh
const pointMesh& pMesh =
pointMesh::New(mesh, IOobject::READ_IF_PRESENT);
const pointMesh& pMesh = pointMesh::New(mesh);
pointFieldDecomposer::fieldsCache pointFieldCache;
@ -1126,34 +1119,7 @@ int main(int argc, char *argv[])
pointProcAddressingList
);
const pointMesh& procPMesh =
pointMesh::New(procMesh, IOobject::READ_IF_PRESENT);
if (!pointBoundaryProcAddressingList.set(proci))
{
pointBoundaryProcAddressingList.set
(
proci,
autoPtr<labelIOList>::New
(
IOobject
(
"boundaryProcAddressing",
procMesh.facesInstance(),
polyMesh::meshSubDir
/pointMesh::meshSubDir,
procPMesh.thisDb(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
boundaryProcAddressing
)
);
}
const auto& pointBoundaryProcAddressing =
pointBoundaryProcAddressingList[proci];
const pointMesh& procPMesh = pointMesh::New(procMesh);
if (!pointFieldDecomposerList.set(proci))
{
@ -1165,7 +1131,7 @@ int main(int argc, char *argv[])
pMesh,
procPMesh,
pointProcAddressing,
pointBoundaryProcAddressing
boundaryProcAddressing
)
);
}
@ -1177,12 +1143,6 @@ int main(int argc, char *argv[])
if (times.size() == 1)
{
// Early deletion
pointBoundaryProcAddressingList.set
(
proci,
nullptr
);
pointProcAddressingList.set(proci, nullptr);
pointFieldDecomposerList.set(proci, nullptr);
}

View File

@ -44,12 +44,6 @@ License
#include "decompositionModel.H"
#include "hexRef8Data.H"
// For handling pointMeshes with additional patches
#include "pointMesh.H"
#include "meshPointPatch.H"
#include "processorPointPatch.H"
#include "DynamicField.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::domainDecomposition::mark
@ -746,101 +740,6 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
procMesh.write();
// Add pointMesh if it was available
const auto* pMeshPtr =
thisDb().cfindObject<pointMesh>(pointMesh::typeName);
if (pMeshPtr)
{
const auto& pMesh = *pMeshPtr;
const auto& pMeshBoundary = pMesh.boundary();
// 1. Generate pointBoundaryMesh from polyBoundaryMesh (so ignoring
// any additional patches
const auto& procPointMesh = pointMesh::New(procMesh);
pointBoundaryMesh& procBoundary =
const_cast<pointBoundaryMesh&>(procPointMesh.boundary());
// 2. Explicitly add subsetted meshPointPatches
forAll(pMeshBoundary, patchi)
{
const auto* mppPtr = isA<meshPointPatch>(pMeshBoundary[patchi]);
if (mppPtr && (procBoundary.findPatchID(mppPtr->name()) == -1))
{
const auto& mpp = *mppPtr;
DynamicList<label> procMeshPoints(mpp.size());
DynamicField<vector> procNormals(mpp.size());
forAll(mpp.meshPoints(), i)
{
const label pointi = mpp.meshPoints()[i];
const label procPointi = pointLookup[pointi];
if (procPointi != -1)
{
procMeshPoints.append(procPointi);
procNormals.append(mpp.pointNormals()[i]);
}
}
procBoundary.push_back
(
new meshPointPatch
(
mpp.name(),
procMeshPoints,
procNormals,
procBoundary.size(),
procBoundary,
meshPointPatch::typeName
)
);
}
}
// 3. Shuffle new patches before any processor patches
labelList oldToNew(procBoundary.size());
label newPatchi = 0;
forAll(procBoundary, patchi)
{
if (!isA<processorPointPatch>(procBoundary[patchi]))
{
oldToNew[patchi] = newPatchi;
newPatchi++;
}
}
// decomposed-to-undecomposed patch numbering
labelList boundaryProcAddressing(identity(newPatchi));
boundaryProcAddressing.setSize(procBoundary.size(), -1);
forAll(procBoundary, patchi)
{
if (isA<processorPointPatch>(procBoundary[patchi]))
{
oldToNew[patchi] = newPatchi++;
}
}
procBoundary.reorder(oldToNew, true);
// Write pointMesh/boundary
procBoundary.write();
// Write pointMesh/boundaryProcAddressing
IOobject ioAddr
(
"boundaryProcAddressing",
procMesh.facesInstance(),
polyMesh::meshSubDir/pointMesh::meshSubDir,
procPointMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
);
IOListRef<label>(ioAddr, boundaryProcAddressing).write();
}
// Write points if pointsInstance differing from facesInstance
if (facesInstancePointsPtr_)
{

View File

@ -411,18 +411,24 @@ int main(int argc, char *argv[])
{
Info<< "Reconstructing point fields" << nl << endl;
const pointMesh& pMesh = pointMesh::New
(
mesh,
IOobject::READ_IF_PRESENT
);
const pointMesh& pMesh = pointMesh::New(mesh);
PtrList<pointMesh> pMeshes(procMeshes.meshes().size());
forAll(pMeshes, proci)
{
pMeshes.set
(
proci,
new pointMesh(procMeshes.meshes()[proci])
);
}
pointFieldReconstructor reconstructor
(
pMesh,
procMeshes.pointMeshes(),
pMeshes,
procMeshes.pointProcAddressing(),
procMeshes.pointMeshBoundaryProcAddressing()
procMeshes.boundaryProcAddressing()
);
reconstructor.reconstructAllFields(objects, selectedFields);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,13 +34,10 @@ Description
Extract patch or faceZone surfaces from a polyMesh.
Depending on output surface format triangulates faces.
Region numbers on faces not guaranteed to be the same as the patch indices.
Region numbers on faces no guaranteed to be the same as the patch indices.
Optionally only extracts named patches.
Optionally filters out points on feature-edges and generates pointPatches
for these - written to pointMesh/boundary.
If run in parallel, processor patches get filtered out by default and
the mesh is merged (based on topology).
@ -51,7 +48,6 @@ Description
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "pointMesh.H"
#include "emptyPolyPatch.H"
#include "processorPolyPatch.H"
#include "ListListOps.H"
@ -59,11 +55,6 @@ Description
#include "globalMeshData.H"
#include "globalIndex.H"
#include "timeSelector.H"
#include "meshPointPatch.H"
#include "unitConversion.H"
#include "dummyTransform.H"
#include "syncTools.H"
#include "processorPointPatch.H"
using namespace Foam;
@ -115,551 +106,6 @@ labelList getSelectedPatches
}
label addMeshPointPatches
(
const polyMesh& mesh,
const pointMesh& pMesh,
const uindirectPrimitivePatch& allBoundary,
const labelUList& faceToZone,
const surfZoneIdentifierList& surfZones,
const scalar edgeFeatureAngle,
const scalar pointFeatureAngle,
const bool verbose = true
)
{
const pointBoundaryMesh& pointBm = pMesh.boundary();
const label nPointPatches = pointBm.size();
const globalMeshData& globalData = mesh.globalData();
const indirectPrimitivePatch& cpp = globalData.coupledPatch();
const mapDistribute& map = globalData.globalEdgeSlavesMap();
const auto& mp = allBoundary.meshPoints();
const vector nullVector(vector::uniform(0));
const auto assignNonNull = [&](vector& x, const vector& y)
{
if (x == nullVector && y != nullVector)
{
x = y;
}
};
// Calculate parallel-consistent point normals (as unweighted average
// of faceNormals). Note: only valid on patch points, not on mesh points
// that are coupled to these.
const pointField pointNormals
(
PatchTools::pointNormals
(
mesh,
allBoundary
)
);
// Expand to all coupled points
pointField meshPointNormals(mesh.nPoints(), nullVector);
UIndirectList<vector>(meshPointNormals, mp) = pointNormals;
syncTools::syncPointList
(
mesh,
meshPointNormals,
assignNonNull,
nullVector
);
// Find correspondence between allBoundary and coupled edges
labelList allEdges;
labelList coupledEdges;
bitSet sameEdgeOrientation;
PatchTools::matchEdges
(
allBoundary,
cpp,
allEdges,
coupledEdges,
sameEdgeOrientation
);
// To construct the patches we need to know per edge
// - patch on either side (if topological feature edge)
// - faceNormal on either side (if feature angle)
// We need to know per point
// - patches on all connected faces
// - faceNormals on all connected faces? And compare to average?
// or edge normals on all connected edges
typedef Tuple2<label, vector> PN;
const PN nullPN(-1, nullVector);
// Point-based analysis
// ~~~~~~~~~~~~~~~~~~~~
// Collect per (mesh)point the zones (1, 2 or >2). Note: per mesh to
// make it easier to sync. See edge-based code below where we explicitly
// have to transfer from patch-edge to mesh-point etc. Note sure which one
// fits better....
labelPairList pointToZones(mesh.nPoints(), labelPair(-1, -1));
{
// Combine zones.
const auto combineZones = [&](labelPair& x, const labelPair& y)
{
if (x == labelPair(-2, -2))
{
// Already marked
}
else if (y == labelPair(-2, -2))
{
x = y;
}
else
{
// Find first free slot
if (x[0] == -1)
{
if (y[0] != -1)
{
x[0] = y[0];
}
else
{
x[0] = y[1];
}
}
else if (x[1] == -1)
{
if (y[0] != -1 && y[0] != x[0])
{
x[1] = y[0];
}
else if (y[1] != -1 && y[1] != x[1])
{
x[1] = y[1];
}
}
else
{
// Both x slots filled. See if y adds a 3rd element
if (y[0] != -1 && y[0] != x[0] && y[0] != x[1])
{
x = labelPair(-2, -2);
}
else if (y[1] != -1 && y[1] != x[0] && y[1] != x[1])
{
x = labelPair(-2, -2);
}
}
}
};
forAll(allBoundary, facei)
{
const auto& f = allBoundary[facei];
const label zonei = faceToZone[facei];
for (const label pointi : f)
{
auto& pZones = pointToZones[pointi];
if (pZones != labelPair(-2, -2) && !pZones.contains(zonei))
{
if (pZones.first() == -1)
{
pZones.first() = zonei;
}
else if (pZones.second() == -1)
{
pZones.second() = zonei;
}
else
{
// Mark as >2 zones
pZones = labelPair(-2, -2);
}
}
}
}
syncTools::syncPointList
(
mesh,
pointToZones,
combineZones,
labelPair(-1, -1),
dummyTransform()
);
}
// Edge-based analysis
// ~~~~~~~~~~~~~~~~~~~~
// 1. Local analysis
List<Pair<PN>> allEdgeToFaces
(
allBoundary.nEdges(),
Pair<PN>(nullPN, nullPN)
);
{
const auto& edgeFaces = allBoundary.edgeFaces();
const auto& faceNormals = allBoundary.faceNormals();
forAll(edgeFaces, edgei)
{
const auto& eFaces = edgeFaces[edgei];
const vector& n0 = faceNormals[eFaces[0]];
const label zone0 = faceToZone[eFaces[0]];
if (eFaces.size() == 1)
{
allEdgeToFaces[edgei] = Pair<PN>(PN(zone0, n0), nullPN);
}
else
{
const vector& n1 = faceNormals[eFaces[1]];
const label zone1 = faceToZone[eFaces[1]];
allEdgeToFaces[edgei] = Pair<PN>
(
PN(zone0, n0),
PN(zone1, n1)
);
}
}
}
// 2. Sync across coupled patches
{
// Combine pair of normals
const auto vectorPairMax = [&](Pair<PN>& x, const Pair<PN>& y)
{
if (x[0] == nullPN)
{
if (y[0] != nullPN)
{
x[0] = y[0];
}
else
{
x[0] = y[1];
}
}
else if (x[1] == nullPN)
{
if (y[0] != nullPN && y[0] != x[0])
{
x[1] = y[0];
}
else
{
x[1] = y[1];
}
}
};
List<Pair<PN>> cppEdgeData
(
map.constructSize(),
Pair<PN>(nullPN, nullPN)
);
UIndirectList<Pair<PN>>(cppEdgeData, coupledEdges) =
UIndirectList<Pair<PN>>(allEdgeToFaces, allEdges);
globalData.syncData
(
cppEdgeData,
globalData.globalEdgeSlaves(),
globalData.globalEdgeTransformedSlaves(),
map,
globalData.globalTransforms(),
vectorPairMax,
dummyTransform()
);
UIndirectList<Pair<PN>>(allEdgeToFaces, allEdges) =
UIndirectList<Pair<PN>>(cppEdgeData, coupledEdges);
}
// Now we have all the per-patch edge information
// - do inter-patch edges
// - do feature-angle edges
// Store on mesh points
const auto assignNonNullPN = [&](PN& x, const PN& y)
{
if (x.second() == nullVector && y.second() != nullVector)
{
x = y;
}
};
// Storing the normal for points that are on inter-patch edges
vectorField patchEdgeNormal(mesh.nPoints(), nullVector);
// Storing the normal for points that are on patch-internal feat edges
List<PN> featEdgeNormal(mesh.nPoints(), nullPN);
forAll(allEdgeToFaces, edgei)
{
const edge& e = allBoundary.edges()[edgei];
const label mp0 = mp[e[0]];
const label mp1 = mp[e[1]];
const Pair<PN>& facesInfo = allEdgeToFaces[edgei];
if (facesInfo[1] == nullPN)
{
// Boundary edge
patchEdgeNormal[mp0] = pointNormals[e[0]];
patchEdgeNormal[mp1] = pointNormals[e[1]];
}
else
{
if (facesInfo[0].first() != facesInfo[1].first())
{
// Inter-patch
patchEdgeNormal[mp0] = pointNormals[e[0]];
patchEdgeNormal[mp1] = pointNormals[e[1]];
}
else
{
// Same patch - check for feature angle
const vector& n0 = facesInfo[0].second();
const vector& n1 = facesInfo[1].second();
if ((n0 & n1) < Foam::cos(degToRad(edgeFeatureAngle)))
{
if (patchEdgeNormal[mp0] == nullVector)
{
featEdgeNormal[mp0] = PN
(
facesInfo[0].first(), // zone
pointNormals[e[0]]
);
}
if (patchEdgeNormal[mp1] == nullVector)
{
featEdgeNormal[mp1] = PN
(
facesInfo[0].first(), // zone
pointNormals[e[1]]
);
}
}
}
}
}
syncTools::syncPointList
(
mesh,
patchEdgeNormal,
assignNonNull,
nullVector
);
syncTools::syncPointList
(
mesh,
featEdgeNormal,
assignNonNullPN,
nullPN,
dummyTransform()
);
// Make sure that inter-patch points are not also in feature-edge
// points. Note: not absolutely nessecary since all inter-patch points
// will also be in the 'normal' facePointPatches.
DynamicList<label> multiZoneMeshPoints(allBoundary.nPoints());
forAll(pointToZones, pointi)
{
if (pointToZones[pointi] == labelPair(-2, -2))
{
multiZoneMeshPoints.append(pointi);
// Unmark as feature angle point
patchEdgeNormal[pointi] = nullVector;
featEdgeNormal[pointi] = nullPN;
}
}
DynamicList<label> twoZoneMeshPoints(allBoundary.nPoints());
forAll(patchEdgeNormal, pointi)
{
if (patchEdgeNormal[pointi] != nullVector)
{
twoZoneMeshPoints.append(pointi);
// Unmark as feature angle point
featEdgeNormal[pointi] = nullPN;
}
}
// Sort featEdgeNormal according to zone
List<List<label>> zoneToMeshPoints(surfZones.size());
List<vectorField> zoneToNormal(surfZones.size());
{
labelList sizes(surfZones.size(), 0);
forAll(featEdgeNormal, pointi)
{
const auto& pInfo = featEdgeNormal[pointi];
if (pInfo != nullPN)
{
const label zonei = pInfo.first();
sizes[zonei]++;
}
}
forAll(zoneToMeshPoints, zonei)
{
zoneToMeshPoints[zonei].setSize(sizes[zonei]);
zoneToNormal[zonei].setSize(sizes[zonei]);
}
sizes = 0;
forAll(featEdgeNormal, pointi)
{
const auto& pInfo = featEdgeNormal[pointi];
if (pInfo != nullPN)
{
const label zonei = pInfo.first();
const label index = sizes[zonei]++;
zoneToMeshPoints[zonei][index] = pointi;
zoneToNormal[zonei][index] = pInfo.second();
}
}
}
// Add patches
forAll(zoneToMeshPoints, zonei)
{
const label nPoints =
returnReduce(zoneToMeshPoints[zonei].size(), sumOp<label>());
const word patchName(surfZones[zonei].name() + "Edges");
if (nPoints && (pointBm.findPatchID(patchName) == -1))
{
const_cast<pointBoundaryMesh&>(pointBm).push_back
(
new meshPointPatch
(
patchName,
zoneToMeshPoints[zonei],
zoneToNormal[zonei],
pointBm.size(),
pointBm,
meshPointPatch::typeName
)
);
if (verbose)
{
const auto& ppp = pointBm.last();
Info<< "Added feature-edges pointPatch " << ppp.name()
<< " with " << nPoints << " points" << endl;
}
}
}
// Add inter-patch points
const word allEdgePatchName("boundaryEdges");
const label nPatchEdgePoints =
returnReduce(twoZoneMeshPoints.size(), sumOp<label>());
if (nPatchEdgePoints && (pointBm.findPatchID(allEdgePatchName) == -1))
{
const_cast<pointBoundaryMesh&>(pointBm).push_back
(
new meshPointPatch
(
allEdgePatchName,
twoZoneMeshPoints,
vectorField
(
patchEdgeNormal, // is pointNormal expanded to all mesh
twoZoneMeshPoints
),
pointBm.size(),
pointBm,
meshPointPatch::typeName
)
);
if (verbose)
{
const auto& ppp = pointBm.last();
Info<< "Added inter-patch pointPatch " << ppp.name()
<< " with " << nPatchEdgePoints << " points" << endl;
}
}
const word allPointPatchName("boundaryPoints");
const label nMultiPoints =
returnReduce(multiZoneMeshPoints.size(), sumOp<label>());
if (nMultiPoints && (pointBm.findPatchID(allPointPatchName) == -1))
{
const_cast<pointBoundaryMesh&>(pointBm).push_back
(
new meshPointPatch
(
allPointPatchName,
multiZoneMeshPoints,
vectorField
(
meshPointNormals, // is pointNormal expanded to all mesh
multiZoneMeshPoints
),
pointBm.size(),
pointBm,
meshPointPatch::typeName
)
);
if (verbose)
{
const auto& ppp = pointBm.last();
Info<< "Added multi-patch pointPatch " << ppp.name()
<< " with " << nMultiPoints << " points" << endl;
}
}
// Shuffle into order
labelList oldToNew(pointBm.size());
label newPatchi = 0;
forAll(pointBm, patchi)
{
if (!isA<processorPointPatch>(pointBm[patchi]))
{
oldToNew[patchi] = newPatchi++;
}
}
forAll(pointBm, patchi)
{
if (isA<processorPointPatch>(pointBm[patchi]))
{
oldToNew[patchi] = newPatchi++;
}
}
const_cast<pointBoundaryMesh&>(pointBm).reorder(oldToNew, true);
return pointBm.size() - nPointPatches;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
@ -706,12 +152,6 @@ int main(int argc, char *argv[])
true // mark as an advanced option
);
argList::addOptionCompat("exclude-patches", {"excludePatches", 2306});
argList::addOption
(
"featureAngle",
"angle",
"Auto-extract feature edges/points and put into separate point-patches"
);
#include "setRootCase.H"
#include "createTime.H"
@ -759,28 +199,9 @@ int main(int argc, char *argv[])
<< nl << endl;
}
scalar featureAngle = 180.0;
const bool specifiedFeature = args.readIfPresent
(
"featureAngle",
featureAngle
);
Info<< "Reading mesh from time " << runTime.value() << endl;
#include "createNamedPolyMesh.H"
if (specifiedFeature)
{
Info<< "Detecting all sharp (>" << featureAngle
<< " degrees) patch edges." << nl << endl;
//#include "createNamedPointMesh.H"
// Do not read constant/pointMesh - construct from polyMesh only
Info<< "Create pointMesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
(void)pointMesh::New(mesh);
}
// User specified times
instantList timeDirs = timeSelector::select0(runTime, args);
@ -854,8 +275,6 @@ int main(int argc, char *argv[])
// Mesh face and compact zone indx
DynamicList<label> faceLabels;
DynamicList<label> compactZones;
// Per compact 'zone' index the name and location
surfZoneIdentifierList surfZones;
{
// Collect sizes. Hash on names to handle local-only patches (e.g.
@ -897,17 +316,6 @@ int main(int argc, char *argv[])
Pstream::broadcast(compactZoneID);
// Zones
surfZones.resize_nocopy(compactZoneID.size());
forAllConstIters(compactZoneID, iter)
{
surfZones[*iter] = surfZoneIdentifier(iter.key(), *iter);
Info<< "surfZone " << *iter
<< " : " << surfZones[*iter].name()
<< endl;
}
// Rework HashTable into labelList just for speed of conversion
labelList patchToCompactZone(bMesh.size(), -1);
labelList faceZoneToCompactZone(bMesh.size(), -1);
@ -953,7 +361,7 @@ int main(int argc, char *argv[])
// Addressing engine for all faces
const uindirectPrimitivePatch allBoundary
uindirectPrimitivePatch allBoundary
(
UIndirectList<face>(mesh.faces(), faceLabels),
mesh.points()
@ -991,7 +399,7 @@ int main(int argc, char *argv[])
// Gather all ZoneIDs
List<labelList> gatheredZones(Pstream::nProcs());
gatheredZones[Pstream::myProcNo()] = compactZones;
gatheredZones[Pstream::myProcNo()].transfer(compactZones);
Pstream::gatherList(gatheredZones);
// On master combine all points, faces, zones
@ -1019,6 +427,16 @@ int main(int argc, char *argv[])
gatheredZones.clear();
// Zones
surfZoneIdentifierList surfZones(compactZoneID.size());
forAllConstIters(compactZoneID, iter)
{
surfZones[*iter] = surfZoneIdentifier(iter.key(), *iter);
Info<< "surfZone " << *iter
<< " : " << surfZones[*iter].name()
<< endl;
}
UnsortedMeshedSurface<face> unsortedFace
(
std::move(allPoints),
@ -1045,31 +463,6 @@ int main(int argc, char *argv[])
sortedFace.write(globalCasePath);
}
if (specifiedFeature)
{
// Add edge patches
const auto& pMesh = pointMesh::New(mesh);
const label nAdded = addMeshPointPatches
(
mesh,
pMesh,
allBoundary, // all patches together
compactZones, // originating compactZone
surfZones, // per compactZone the index
featureAngle,
featureAngle
);
if (nAdded)
{
pMesh.boundary().write();
}
}
}
Info<< "End\n" << endl;

View File

@ -440,15 +440,6 @@ pointSet_doc
}
//- All points of pointpatch
{
source patchToPoint;
patches ("patch.*");
// or
patch somePatch;
}
//- Copy elements from pointSet
{
source pointToPoint;

View File

@ -75,7 +75,7 @@ wmake $targetType lagrangian/distributionModels
parallel/Allwmake $targetType $*
wmake $targetType dynamicFvMesh
wmake $targetType topoChangerFvMesh
#HJ wmake $targetType topoChangerFvMesh
wmake $targetType sampling
transportModels/Allwmake $targetType $*
@ -130,6 +130,9 @@ wmake $targetType rigidBodyMeshMotion
wmake $targetType atmosphericModels
wmake $targetType optimisation/adjointOptimisation/adjoint
# Moved by HJ
wmake $targetType topoChangerFvMesh
# interfaceTracking libs
dynamicFaMesh/Allwmake $targetType $*

View File

@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Foam_ODESolver_H
#define Foam_ODESolver_H
#ifndef ODESolver_H
#define ODESolver_H
#include "ODESystem.H"
#include "typeInfo.H"
@ -56,9 +56,10 @@ namespace Foam
class ODESolver
{
protected:
// Protected Data
// Protected data
//- Reference to ODESystem
const ODESystem& odes_;
@ -105,7 +106,7 @@ public:
class stepState
{
public:
public:
const bool forward;
scalar dxTry;
@ -170,14 +171,14 @@ public:
// Member Functions
//- The number of equations to solve
label nEqns() const noexcept { return n_; }
//- Return the number of equations to solve
inline label nEqns() const;
//- Access to the absolute tolerance field
scalarField& absTol() noexcept { return absTol_; }
//- Return access to the absolute tolerance field
inline scalarField& absTol();
//- Access to the relative tolerance field
scalarField& relTol() noexcept { return relTol_; }
//- Return access to the relative tolerance field
inline scalarField& relTol();
//- Resize the ODE solver
virtual bool resize() = 0;

View File

@ -27,19 +27,36 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::ODESolver::nEqns() const
{
return n_;
}
inline Foam::scalarField& Foam::ODESolver::absTol()
{
return absTol_;
}
inline Foam::scalarField& Foam::ODESolver::relTol()
{
return relTol_;
}
template<class Type>
inline void Foam::ODESolver::resizeField(UList<Type>& f, const label n)
{
// shallowResize
f.shallowCopy(f.data(), n);
f.shallowCopy(UList<Type>(f.begin(), n));
}
template<class Type>
inline void Foam::ODESolver::resizeField(UList<Type>& f) const
{
// shallowResize
f.shallowCopy(f.data(), n_);
resizeField(f, n_);
}

View File

@ -716,10 +716,8 @@ $(pointMeshMapper)/pointPatchMapper.C
pointPatches = $(pointMesh)/pointPatches
$(pointPatches)/pointPatch/pointPatch.C
$(pointPatches)/pointPatch/pointPatchNew.C
$(pointPatches)/facePointPatch/facePointPatch.C
$(pointPatches)/facePointPatch/facePointPatchNew.C
$(pointPatches)/meshPointPatch/meshPointPatch.C
basicPointPatches = $(pointPatches)/basic
$(basicPointPatches)/coupled/coupledPointPatch.C

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
Foam::label Foam::Detail::PtrListDetail<T>::count_nonnull() const noexcept
Foam::label Foam::Detail::PtrListDetail<T>::count() const noexcept
{
label n = 0;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -95,8 +95,8 @@ public:
//- Return pointer to element or nullptr for out-of-range access.
inline T* get(const label i);
//- The number of non-nullptr entries in the list
label count_nonnull() const noexcept;
//- Return the number of non-null entries
label count() const noexcept;
//- FatalError if any null exists in the list
inline void checkNonNull() const;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,8 +40,8 @@ Foam::Ostream& Foam::Detail::PtrListDetail<T>::write
{
const label len = this->size();
// The net length, optionally after trimming any nullptr
const label netLen = (trimNull ? this->count_nonnull() : len);
// The net length (after trimming any nullptr)
const label netLen = (trimNull ? this->count() : len);
if (!netLen)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -257,8 +257,8 @@ public:
//- Size of the underlying storage.
inline label capacity() const noexcept;
//- The number of non-nullptr entries in the list
inline label count_nonnull() const noexcept;
//- The number of non-null entries in the list
inline label count() const noexcept;
//- Reference to the first element of the list
inline T& front();
@ -648,10 +648,6 @@ public:
//- Move append another list to the end of this list.
//FOAM_DEPRECATED_FOR(2022-10, "push_back()")
void append(UPtrList<T>&& other) { this->push_back(std::move(other)); }
//- The number of non-nullptr entries in the list
FOAM_DEPRECATED_FOR(2024-01, "count_nonnull()")
label count() const noexcept { return count_nonnull(); }
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -124,9 +124,9 @@ inline Foam::label Foam::UPtrList<T>::capacity() const noexcept
template<class T>
inline Foam::label Foam::UPtrList<T>::count_nonnull() const noexcept
inline Foam::label Foam::UPtrList<T>::count() const noexcept
{
return ptrs_.count_nonnull();
return ptrs_.count();
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020-2024 OpenCFD Ltd.
Copyright (C) 2020-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -132,7 +132,7 @@ public:
// Member Functions
//- True if compiled with libz support
static bool supports_gz() noexcept;
static bool supports_gz();
// Access
@ -276,7 +276,7 @@ public:
// Member Functions
//- True if compiled with libz support
static bool supports_gz() noexcept;
static bool supports_gz();
// Access

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,7 +40,7 @@ License
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
bool Foam::ifstreamPointer::supports_gz() noexcept
bool Foam::ifstreamPointer::supports_gz()
{
#ifdef HAVE_LIBZ
return true;
@ -50,7 +50,7 @@ bool Foam::ifstreamPointer::supports_gz() noexcept
}
bool Foam::ofstreamPointer::supports_gz() noexcept
bool Foam::ofstreamPointer::supports_gz()
{
#ifdef HAVE_LIBZ
return true;
@ -71,7 +71,7 @@ Foam::ifstreamPointer::ifstreamPointer
IOstreamOption streamOpt // Currently unused
)
:
ptr_()
ptr_(nullptr)
{
open(pathname, streamOpt);
}
@ -82,7 +82,7 @@ Foam::ifstreamPointer::ifstreamPointer
const fileName& pathname
)
:
ptr_()
ptr_(nullptr)
{
open(pathname);
}
@ -110,7 +110,7 @@ Foam::ofstreamPointer::ofstreamPointer
const bool atomic
)
:
ptr_(),
ptr_(nullptr),
atomic_(atomic)
{
std::ios_base::openmode mode

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -468,41 +468,6 @@ inline IOstream& scientific(IOstream& io)
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::StreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- A wrapper to hold a std::stream type for OpenFOAM wrapped streams.
//- This is necessary since the OpenFOAM streams hold a reference to
//- the normal std::stream
template<class StreamType>
class StreamAllocator
{
protected:
// Protected Data
//- The std::stream
StreamType stream_;
// Constructors
//- Default construct (empty)
StreamAllocator() = default;
};
} // End namespace Detail
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Functions/Algorithms
namespace Detail
{
//- Termination for input looping (no-op)
template<class IS> inline void inputLoop(IS&) {}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,6 +46,60 @@ SourceFiles
namespace Foam
{
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::StringStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- Allocator for variants of a std stringstream
template<class StreamType>
class StringStreamAllocator
{
protected:
// Protected Member Data
//- The stream type
typedef StreamType stream_type;
//- The input/output stream.
stream_type stream_;
// Constructors
//- Default construct
StringStreamAllocator() = default;
//- Copy construct from string
StringStreamAllocator(const std::string& s)
:
stream_(s)
{}
public:
// Member Functions
//- Get the string - as Foam::string rather than std::string
Foam::string str() const
{
return Foam::string(stream_.str());
}
//- Set the string
void str(const std::string& s)
{
stream_.str(s);
}
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class IStringStream Declaration
\*---------------------------------------------------------------------------*/
@ -53,12 +107,10 @@ namespace Foam
//- Input from string buffer, using a ISstream. Always UNCOMPRESSED.
class IStringStream
:
public Foam::Detail::StreamAllocator<std::istringstream>,
public Foam::ISstream
public Detail::StringStreamAllocator<std::istringstream>,
public ISstream
{
typedef
Foam::Detail::StreamAllocator<std::istringstream>
allocator_type;
typedef Detail::StringStreamAllocator<std::istringstream> allocator_type;
public:
@ -81,11 +133,9 @@ public:
IOstreamOption streamOpt = IOstreamOption()
)
:
allocator_type(),
allocator_type(s),
ISstream(stream_, "input", streamOpt.format(), streamOpt.version())
{
stream_.str(s);
}
{}
//- Construct from char*
explicit IStringStream
@ -94,32 +144,20 @@ public:
IOstreamOption streamOpt = IOstreamOption()
)
:
allocator_type(),
allocator_type(s),
ISstream(stream_, "input", streamOpt.format(), streamOpt.version())
{
stream_.str(s);
}
{}
//- Copy construct, copies content and format
IStringStream(const IStringStream& str)
:
allocator_type(),
allocator_type(str.str()),
ISstream(stream_, str.name(), static_cast<IOstreamOption>(str))
{
stream_.str(str.str());
}
{}
// Member Functions
//- Get the string.
//- As Foam::string instead of std::string (may change in future)
Foam::string str() const { return Foam::string(stream_.str()); }
//- Set the string
void str(const std::string& s) { stream_.str(s); }
//- Reset the input buffer and rewind the stream
virtual void reset(const std::string& s)
{
@ -182,12 +220,10 @@ public:
//- Output to string buffer, using a OSstream. Always UNCOMPRESSED.
class OStringStream
:
public Foam::Detail::StreamAllocator<std::ostringstream>,
public Foam::OSstream
public Detail::StringStreamAllocator<std::ostringstream>,
public OSstream
{
typedef
Foam::Detail::StreamAllocator<std::ostringstream>
allocator_type;
typedef Detail::StringStreamAllocator<std::ostringstream> allocator_type;
public:
@ -206,23 +242,13 @@ public:
//- Copy construct, copies content and format
OStringStream(const OStringStream& str)
:
allocator_type(),
allocator_type(str.str()),
OSstream(stream_, str.name(), static_cast<IOstreamOption>(str))
{
stream_.str(str.str());
}
{}
// Member Functions
//- Get the string.
//- As Foam::string instead of std::string (may change in future)
Foam::string str() const { return Foam::string(stream_.str()); }
//- Set the string
void str(const std::string& s) { stream_.str(s); }
//- Reset the output buffer and rewind the stream
void reset()
{

View File

@ -91,14 +91,13 @@ Foam::ITstream& Foam::ITstream::empty_stream()
}
Foam::tokenList Foam::ITstream::parse_chars
Foam::tokenList Foam::ITstream::parse
(
const char* s,
size_t nbytes,
const UList<char>& input,
IOstreamOption streamOpt
)
{
ISpanStream is(s, nbytes, streamOpt);
ISpanStream is(input, streamOpt);
tokenList tokens;
parseStream(is, tokens);
@ -106,14 +105,31 @@ Foam::tokenList Foam::ITstream::parse_chars
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ITstream::reset(const char* input, size_t nbytes)
Foam::tokenList Foam::ITstream::parse
(
const std::string& input,
IOstreamOption streamOpt
)
{
ISpanStream is(input, nbytes, static_cast<IOstreamOption>(*this));
ISpanStream is(input, streamOpt);
parseStream(is, static_cast<tokenList&>(*this));
ITstream::seek(0); // rewind(), but bypasss virtual
tokenList tokens;
parseStream(is, tokens);
return tokens;
}
Foam::tokenList Foam::ITstream::parse
(
const char* input,
IOstreamOption streamOpt
)
{
ISpanStream is(input, strlen(input), streamOpt);
tokenList tokens;
parseStream(is, tokens);
return tokens;
}
@ -238,7 +254,10 @@ Foam::ITstream::ITstream
:
ITstream(streamOpt, name)
{
reset(input.cdata(), input.size_bytes());
ISpanStream is(input, streamOpt);
parseStream(is, static_cast<tokenList&>(*this));
ITstream::seek(0); // rewind(), but bypasss virtual
}
@ -251,7 +270,10 @@ Foam::ITstream::ITstream
:
ITstream(streamOpt, name)
{
reset(input.data(), input.size());
ISpanStream is(input, streamOpt);
parseStream(is, static_cast<tokenList&>(*this));
ITstream::seek(0); // rewind(), but bypasss virtual
}
@ -264,7 +286,10 @@ Foam::ITstream::ITstream
:
ITstream(streamOpt, name)
{
reset(input, strlen(input));
ISpanStream is(input, strlen(input), streamOpt);
parseStream(is, static_cast<tokenList&>(*this));
ITstream::seek(0); // rewind(), but bypasss virtual
}

View File

@ -77,18 +77,6 @@ class ITstream
// but leave any excess capacity (ie, like reserve).
void reserveCapacity(const label newCapacity);
//- Convert input sequence into a list of tokens,
static tokenList parse_chars
(
const char* s,
size_t nbytes,
IOstreamOption streamOpt
);
//- Convert input sequence into a list of tokens,
//- using the existing stream format. Rewinds the stream
void reset(const char* input, size_t nbytes);
//- Failsafe read-access to token at specified location
//- or undefinedToken
inline const token& peekNoFail(const label i) const
@ -170,47 +158,6 @@ public:
const string& name = "input"
);
#if __cplusplus >= 201703L
//- Construct token list by parsing the input character sequence
// Uses static parse function internally.
explicit ITstream
(
std::string_view s,
IOstreamOption streamOpt = IOstreamOption()
)
:
ITstream(streamOpt)
{
reset(s.data(), s.size());
}
#endif
//- Construct token list by parsing the input character sequence
// Uses static parse function internally.
explicit ITstream
(
stdFoam::span<char> s,
IOstreamOption streamOpt = IOstreamOption()
)
:
ITstream(streamOpt)
{
reset(s.data(), s.size());
}
//- Construct token list by parsing the input character sequence
// Uses static parse function internally.
explicit ITstream
(
stdFoam::span<const char> s,
IOstreamOption streamOpt = IOstreamOption()
)
:
ITstream(streamOpt)
{
reset(s.data(), s.size());
}
// Additional constructors
@ -260,10 +207,7 @@ public:
(
const UList<char>& input,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(input.cdata(), input.size(), streamOpt);
}
);
//- Create token list by parsing the input string
//- until no good tokens remain.
@ -271,10 +215,7 @@ public:
(
const std::string& input,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(input.data(), input.size(), streamOpt);
}
);
//- Create token list by parsing the input character sequence
//- until no good tokens remain.
@ -282,45 +223,7 @@ public:
(
const char* input,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(input, strlen(input), streamOpt);
}
#if __cplusplus >= 201703L
//- Create token list by parsing the input character sequence
//- until no good tokens remain.
static tokenList parse
(
std::string_view s,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(s.data(), s.size(), streamOpt);
}
#endif
//- Create token list by parsing the input character sequence
//- until no good tokens remain.
static tokenList parse
(
stdFoam::span<char> s,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(s.data(), s.size(), streamOpt);
}
//- Create token list by parsing the input character sequence
//- until no good tokens remain.
static tokenList parse
(
stdFoam::span<const char> s,
IOstreamOption streamOpt = IOstreamOption()
)
{
return parse_chars(s.data(), s.size(), streamOpt);
}
);
// Member Functions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2019-2024 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -35,8 +35,8 @@ Description
#ifndef Foam_OSHA1stream_H
#define Foam_OSHA1stream_H
#include "SHA1.H"
#include "OSstream.H"
#include "SHA1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,6 +114,33 @@ public:
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::OSHA1streamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::osha1stream
class OSHA1streamAllocator
{
protected:
// Protected Data
//- The output stream
Foam::osha1stream stream_;
// Constructors
//- Default construct
OSHA1streamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class OSHA1stream Declaration
\*---------------------------------------------------------------------------*/
@ -121,12 +148,10 @@ public:
//- The output stream for calculating SHA1 digests
class OSHA1stream
:
public Foam::Detail::StreamAllocator<Foam::osha1stream>,
public Foam::OSstream
public Detail::OSHA1streamAllocator,
public OSstream
{
typedef
Foam::Detail::StreamAllocator<Foam::osha1stream>
allocator_type;
typedef Detail::OSHA1streamAllocator allocator_type;
public:

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,6 +42,8 @@ See Also
#define Foam_ICharStream_H
#include "ISpanStream.H"
#include "List.H"
#include "DynamicList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -203,6 +205,33 @@ public:
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::ICharStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::icharstream
class ICharStreamAllocator
{
protected:
// Protected Data
//- The stream
Foam::icharstream stream_;
// Constructors
//- Default construct
ICharStreamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class ICharStream Declaration
\*---------------------------------------------------------------------------*/
@ -210,12 +239,10 @@ public:
//- An ISstream with internal List storage. Always UNCOMPRESSED.
class ICharStream
:
public Foam::Detail::StreamAllocator<Foam::icharstream>,
public Detail::ICharStreamAllocator,
public Foam::ISstream
{
typedef
Foam::Detail::StreamAllocator<Foam::icharstream>
allocator_type;
typedef Detail::ICharStreamAllocator allocator_type;
public:

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2024 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,6 +65,7 @@ See Also
#define Foam_ISpanStream_H
#include "memoryStreamBuffer.H"
#include "UList.H"
#include "ISstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -212,23 +213,49 @@ public:
//- Some information about the input buffer position/capacity
void debug_info(Ostream& os) const
{
os << "get=" << input_pos() << '/' << capacity();
os << "get="
<< input_pos() << '/' << capacity();
}
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::ISpanStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::ispanstream
class ISpanStreamAllocator
{
protected:
// Protected Data
//- The stream
Foam::ispanstream stream_;
// Constructors
//- Default construct (empty)
ISpanStreamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class ISpanStream Declaration
\*---------------------------------------------------------------------------*/
class ISpanStream
:
public Foam::Detail::StreamAllocator<Foam::ispanstream>,
public Detail::ISpanStreamAllocator,
public Foam::ISstream
{
typedef
Foam::Detail::StreamAllocator<Foam::ispanstream>
allocator_type;
typedef Detail::ISpanStreamAllocator allocator_type;
public:

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2024 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -109,13 +109,7 @@ public:
//- The current output position within the buffer (tellp)
std::streampos output_pos() const
{
return buffer_type::span_tellp();
}
//- The number of bytes outputted
std::streamsize count() const
{
return buffer_type::size_bytes();
return (buffer_type::span_tellp());
}
//- The put buffer capacity
@ -195,6 +189,33 @@ public:
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::OCharStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::ocharstream
class OCharStreamAllocator
{
protected:
// Protected Data
//- The stream
Foam::ocharstream stream_;
// Constructors
//- Default construct - empty
OCharStreamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class OCharStream Declaration
\*---------------------------------------------------------------------------*/
@ -202,12 +223,10 @@ public:
//- An OSstream with internal List storage
class OCharStream
:
public Foam::Detail::StreamAllocator<Foam::ocharstream>,
public Detail::OCharStreamAllocator,
public Foam::OSstream
{
typedef
Foam::Detail::StreamAllocator<Foam::ocharstream>
allocator_type;
typedef Detail::OCharStreamAllocator allocator_type;
public:
@ -258,11 +277,8 @@ public:
//- The current output position within the buffer (tellp)
std::streampos output_pos() const { return stream_.output_pos(); }
//- The number of bytes outputted
std::streamsize count() const { return stream_.count(); }
//- The current output size. Same as count(), output_pos(), tellp().
label size() const { return label(stream_.count()); }
//- The current output size. Same as tellp(), output_pos()
label size() const { return label(stream_.output_pos()); }
//- The put buffer capacity
std::streamsize capacity() const { return stream_.capacity(); }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2024 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -35,6 +35,7 @@ Description
#define Foam_OScountStream_H
#include "OSstream.H"
#include <iostream>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -125,7 +126,7 @@ class ocountstream
// Member Functions
//- The number of bytes counted
//- The number of bytes counted.
std::streamsize count() const noexcept { return size_; }
//- Reset the count
@ -154,7 +155,7 @@ public:
//- This hides both signatures of std::basic_ios::rdbuf()
countbuf* rdbuf() { return &buf_; }
//- The number of bytes counted
//- \return The number of bytes counted
std::streamsize count() const noexcept { return buf_.count(); }
//- Reset the count
@ -172,6 +173,33 @@ public:
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::OCountStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::ocountstream
class OCountStreamAllocator
{
protected:
// Protected Data
//- The output stream
Foam::ocountstream stream_;
// Constructors
//- Default construct
OCountStreamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class OCountStream Declaration
\*---------------------------------------------------------------------------*/
@ -179,12 +207,10 @@ public:
//- An output stream for calculating byte counts
class OCountStream
:
public Foam::Detail::StreamAllocator<Foam::ocountstream>,
public Foam::OSstream
public Detail::OCountStreamAllocator,
public OSstream
{
typedef
Foam::Detail::StreamAllocator<Foam::ocountstream>
allocator_type;
typedef Detail::OCountStreamAllocator allocator_type;
public:
@ -212,10 +238,10 @@ public:
// Member Functions
//- The number of bytes counted
//- \return The number of bytes counted
std::streamsize count() const noexcept { return stream_.count(); }
//- The number of bytes counted
//- \return The number of bytes counted
std::streamsize size() const noexcept { return stream_.count(); }
//- Reset the count

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2024 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -83,6 +83,7 @@ See Also
#define Foam_OSpanStream_H
#include "memoryStreamBuffer.H"
#include "DynamicList.H"
#include "OSstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -140,12 +141,6 @@ public:
return buffer_type::span_tellp();
}
//- The number of bytes outputted
std::streamsize count() const
{
return buffer_type::size_bytes();
}
//- The put buffer capacity
std::streamsize capacity() const
{
@ -204,23 +199,49 @@ public:
//- Some information about the output buffer position/capacity
void debug_info(Ostream& os) const
{
os << "put=" << output_pos() << '/' << capacity();
os << "put="
<< output_pos() << '/' << capacity();
}
};
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::OSpanStreamAllocator Declaration
\*---------------------------------------------------------------------------*/
//- An allocator for holding Foam::ospanstream
class OSpanStreamAllocator
{
protected:
// Protected Data
//- The stream
Foam::ospanstream stream_;
// Constructors
//- Default construct (empty)
OSpanStreamAllocator() = default;
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class OSpanStream Declaration
\*---------------------------------------------------------------------------*/
class OSpanStream
:
public Foam::Detail::StreamAllocator<Foam::ospanstream>,
public Detail::OSpanStreamAllocator,
public Foam::OSstream
{
typedef
Foam::Detail::StreamAllocator<Foam::ospanstream>
allocator_type;
typedef Detail::OSpanStreamAllocator allocator_type;
public:
@ -293,11 +314,8 @@ public:
//- The current output position within the buffer (tellp)
std::streampos output_pos() const { return stream_.output_pos(); }
//- The number of bytes outputted
std::streamsize count() const { return stream_.count(); }
//- The current output size. Same as count(), output_pos(), tellp().
label size() const { return label(stream_.count()); }
//- The current output size. Same as tellp(), output_pos()
label size() const { return label(stream_.output_pos()); }
//- The put buffer capacity
std::streamsize capacity() const { return stream_.capacity(); }

View File

@ -1,10 +0,0 @@
Foam::Info
<< "Create pointMesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
// Register pointMesh on the database
const Foam::pointMesh& pMesh = pointMesh::New
(
mesh,
Foam::IOobject::READ_IF_PRESENT
);

View File

@ -6,7 +6,6 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,11 +42,22 @@ Foam::procLduMatrix::procLduMatrix
lowerAddr_(ldum.lduAddr().lowerAddr()),
diag_(ldum.diag()),
upper_(ldum.upper()),
lower_(ldum.lower()),
interfaces_(interfaces.count_nonnull())
lower_(ldum.lower())
{
label nInterfaces = 0;
forAll(interfaces, i)
{
if (interfaces.set(i))
{
nInterfaces++;
}
}
interfaces_.setSize(nInterfaces);
nInterfaces = 0;
forAll(interfaces, i)
{
if (interfaces.set(i))
@ -63,6 +73,7 @@ Foam::procLduMatrix::procLduMatrix
);
}
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,74 +33,9 @@ License
#include "PstreamBuffers.H"
#include "lduSchedule.H"
#include "globalMeshData.H"
#include "processorPointPatch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(pointBoundaryMesh, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::pointBoundaryMesh::hasGroupIDs() const
{
if (groupIDsPtr_)
{
// Use existing cache
return !groupIDsPtr_->empty();
}
const auto& patches = *this;
for (const auto& p : patches)
{
if (!p.inGroups().empty())
{
return true;
}
}
return false;
}
void Foam::pointBoundaryMesh::calcGroupIDs() const
{
if (groupIDsPtr_)
{
return; // Or FatalError
}
groupIDsPtr_.emplace(16);
auto& groupLookup = *groupIDsPtr_;
const auto& patches = *this;
forAll(patches, patchi)
{
for (const word& groupName : patches[patchi].inGroups())
{
groupLookup(groupName).push_back(patchi);
}
}
// Remove groups that clash with patch names
forAll(patches, patchi)
{
if (groupLookup.erase(patches[patchi].name()))
{
WarningInFunction
<< "Removed group '" << patches[patchi].name()
<< "' which clashes with patch " << patchi
<< " of the same name."
<< endl;
}
}
}
void Foam::pointBoundaryMesh::addPatches(const polyBoundaryMesh& pbm)
{
// Set boundary patches
@ -108,7 +43,7 @@ void Foam::pointBoundaryMesh::addPatches(const polyBoundaryMesh& pbm)
patches.resize_null(pbm.size());
forAll(pbm, patchi)
forAll(patches, patchi)
{
// NB: needs ptr() to get *pointPatch instead of *facePointPatch
patches.set(patchi, facePointPatch::New(pbm[patchi], *this).ptr());
@ -125,301 +60,21 @@ Foam::pointBoundaryMesh::pointBoundaryMesh
)
:
pointPatchList(),
regIOobject
(
IOobject
(
"boundary",
//m.thisDb().time().findInstance(m.meshDir(), "boundary"),
pbm.mesh().facesInstance(),
polyMesh::meshSubDir/pointMesh::meshSubDir,
m.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false // Avoid conflict with polyMesh/boundary
)
),
mesh_(m)
{
addPatches(pbm);
if (debug)
{
pointPatchList& Patches = *this;
Pout<< "pointBoundaryMesh::pointBoundaryMesh"
<< "(const pointMesh&, const polyBoundaryMesh&): "
<< "constructed pointBoundaryMesh:" << endl;
Pout<< incrIndent;
for (const auto& pp : Patches)
{
Pout<< indent
<< "index:" << pp.index() << " patch:" << pp.name()
<< " type:" << pp.type() << endl;
}
Pout<< decrIndent;
}
}
Foam::pointBoundaryMesh::pointBoundaryMesh
(
const IOobject& io,
const pointMesh& m,
const polyBoundaryMesh& pbm
)
:
pointPatchList(),
regIOobject
(
IOobject
(
"boundary",
io.instance(),
polyMesh::meshSubDir/pointMesh::meshSubDir,
io.db(),
io.readOpt(),
io.writeOpt(),
false //io.registerObject() // or always set to false?
)
),
mesh_(m)
{
pointPatchList& Patches = *this;
if (isReadRequired() || (isReadOptional() && headerOk()))
{
if (readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningInFunction
<< "Specified IOobject::MUST_READ_IF_MODIFIED but class"
<< " does not support automatic rereading."
<< endl;
}
if (debug)
{
Pout<< "pointBoundaryMesh::pointBoundaryMesh"
<< "(const IOobject&, const pointMesh&,"
<< " const polyBoundaryMesh&): "
<< "Constructing from boundary file " << objectRelPath()
<< endl;
}
// Read pointPatchList
Istream& is = readStream(typeName);
PtrList<entry> patchEntries(is);
Patches.setSize(patchEntries.size());
forAll(Patches, patchi)
{
// Try construct-from-dictionary first
const word& name = patchEntries[patchi].keyword();
autoPtr<pointPatch> pPtr
(
pointPatch::New
(
name,
patchEntries[patchi].dict(),
patchi,
*this
)
);
if (!pPtr)
{
const label polyPatchi = pbm.findPatchID(name, false);
// Try as facePointPatch from polyPatch
pPtr = facePointPatch::New(pbm[polyPatchi], *this);
pPtr->index() = patchi;
}
Patches.set(patchi, pPtr);
}
// Check state of IOstream
is.check
(
"pointBoundaryMesh::pointBoundaryMesh"
"(const IOobject&, const pointMesh&,"
" const polyBoundaryMesh&)"
);
close();
}
else
{
if (debug)
{
Pout<< "pointBoundaryMesh::pointBoundaryMesh"
<< "(const IOobject&, const pointMesh&,"
<< " const polyBoundaryMesh&): "
<< "Constructing from polyBoundaryMesh only"
<< endl;
}
addPatches(pbm);
}
if (debug)
{
Pout<< "pointBoundaryMesh::pointBoundaryMesh"
<< "(const IOobject&, const pointMesh&, const polyBoundaryMesh&): "
<< "constructed pointBoundaryMesh:" << endl;
Pout<< incrIndent;
for (const auto& pp : Patches)
{
Pout<< indent
<< "index:" << pp.index() << " patch:" << pp.name()
<< " type:" << pp.type() << endl;
}
Pout<< decrIndent;
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::pointBoundaryMesh::nNonProcessor() const
{
const pointPatchList& patches = *this;
label count = 0;
for (const auto& p : patches)
{
if (isA<processorPointPatch>(p))
{
break;
}
++count;
}
return count;
}
Foam::label Foam::pointBoundaryMesh::nProcessorPatches() const
{
const pointPatchList& patches = *this;
label count = 0;
for (const auto& p : patches)
{
if (isA<processorPointPatch>(p))
{
++count;
}
}
return count;
}
Foam::wordList Foam::pointBoundaryMesh::names() const
{
return PtrListOps::get<word>(*this, nameOp<pointPatch>());
}
Foam::wordList Foam::pointBoundaryMesh::types() const
{
return PtrListOps::get<word>(*this, typeOp<pointPatch>());
}
Foam::wordList Foam::pointBoundaryMesh::physicalTypes() const
{
return
PtrListOps::get<word>
(
*this,
[](const pointPatch& p) { return p.physicalType(); }
);
}
const Foam::HashTable<Foam::labelList>&
Foam::pointBoundaryMesh::groupPatchIDs() const
{
if (!groupIDsPtr_)
{
calcGroupIDs();
}
return *groupIDsPtr_;
}
Foam::labelList Foam::pointBoundaryMesh::indices
(
const wordRe& matcher,
const bool useGroups
) const
{
if (matcher.empty())
{
return labelList();
}
// Only check groups if requested and they exist
const bool checkGroups = (useGroups && this->hasGroupIDs());
labelHashSet ids(0);
if (matcher.isPattern())
{
if (checkGroups)
{
const auto& groupLookup = groupPatchIDs();
forAllConstIters(groupLookup, iter)
{
if (matcher(iter.key()))
{
// Add patch ids associated with the group
ids.insert(iter.val());
}
}
}
if (ids.empty())
{
return PtrListOps::findMatching(*this, matcher);
}
else
{
ids.insert(PtrListOps::findMatching(*this, matcher));
}
}
else
{
// Literal string.
// Special version of above for reduced memory footprint.
const label patchId = PtrListOps::firstMatching(*this, matcher);
if (patchId >= 0)
{
return labelList(one{}, patchId);
}
else if (checkGroups)
{
const auto iter = groupPatchIDs().cfind(matcher);
if (iter.good())
{
// Hash ids associated with the group
ids.insert(iter.val());
}
}
}
return ids.sortedToc();
return mesh().boundaryMesh().indices(matcher, useGroups);
}
@ -429,43 +84,7 @@ Foam::labelList Foam::pointBoundaryMesh::indices
const bool useGroups
) const
{
if (matcher.empty())
{
return labelList();
}
else if (matcher.size() == 1)
{
return this->indices(matcher.front(), useGroups);
}
labelHashSet ids(0);
// Only check groups if requested and they exist
if (useGroups && this->hasGroupIDs())
{
ids.reserve(this->size());
const auto& groupLookup = groupPatchIDs();
forAllConstIters(groupLookup, iter)
{
if (matcher(iter.key()))
{
// Add patch ids associated with the group
ids.insert(iter.val());
}
}
}
if (ids.empty())
{
return PtrListOps::findMatching(*this, matcher);
}
else
{
ids.insert(PtrListOps::findMatching(*this, matcher));
}
return ids.sortedToc();
return mesh().boundaryMesh().indices(matcher, useGroups);
}
@ -476,91 +95,13 @@ Foam::labelList Foam::pointBoundaryMesh::indices
const bool useGroups
) const
{
//return mesh().boundaryMesh().indices(select, ignore, useGroups);
if (ignore.empty())
{
return this->indices(select, useGroups);
}
const wordRes::filter matcher(select, ignore);
labelHashSet ids(0);
// Only check groups if requested and they exist
if (useGroups && this->hasGroupIDs())
{
ids.reserve(this->size());
const auto& groupLookup = groupPatchIDs();
forAllConstIters(groupLookup, iter)
{
if (matcher(iter.key()))
{
// Add patch ids associated with the group
ids.insert(iter.val());
}
}
}
if (ids.empty())
{
return PtrListOps::findMatching(*this, matcher);
}
else
{
ids.insert(PtrListOps::findMatching(*this, matcher));
}
return ids.sortedToc();
return mesh().boundaryMesh().indices(select, ignore, useGroups);
}
Foam::label Foam::pointBoundaryMesh::findPatchID
(
const word& patchName,
bool allowNotFound
) const
Foam::label Foam::pointBoundaryMesh::findPatchID(const word& patchName) const
{
//return mesh().boundaryMesh().findPatchID(patchName);
if (patchName.empty())
{
return -1;
}
const label patchId = PtrListOps::firstMatching(*this, patchName);
if (patchId >= 0)
{
return patchId;
}
if (!allowNotFound)
{
FatalErrorInFunction
<< "Patch '" << patchName << "' not found. "
<< "Available patch names";
if (polyMesh::defaultRegion != mesh_.name())
{
FatalError
<< " in region '" << mesh_.name() << "'";
}
FatalError
<< " include: " << names() << endl
<< exit(FatalError);
}
// Patch not found
if (debug)
{
Pout<< "label pointBoundaryMesh::findPatchID(const word&) const"
<< " Patch named " << patchName << " not found. "
<< "Available patch names: " << names() << endl;
}
// Not found, return -1
return -1;
return mesh().boundaryMesh().findPatchID(patchName);
}
@ -702,80 +243,4 @@ void Foam::pointBoundaryMesh::updateMesh()
}
void Foam::pointBoundaryMesh::reorder
(
const labelUList& oldToNew,
const bool validBoundary
)
{
// Change order of patches
pointPatchList::reorder(oldToNew);
// Adapt indices
pointPatchList& patches = *this;
forAll(patches, patchi)
{
patches[patchi].index() = patchi;
}
// Clear group-to-patch addressing. Note: could re-calculate
groupIDsPtr_.reset(nullptr);
if (validBoundary)
{
updateMesh();
}
if (debug)
{
pointPatchList& Patches = *this;
Pout<< "pointBoundaryMesh::reorder"
<< "(const labelUList&, const bool): "
<< "reordered pointBoundaryMesh:" << endl;
Pout<< incrIndent;
for (const auto& pp : Patches)
{
Pout<< indent
<< "index:" << pp.index() << " patch:" << pp.name()
<< " type:" << pp.type() << endl;
}
Pout<< decrIndent;
}
}
bool Foam::pointBoundaryMesh::writeData(Ostream& os) const
{
const pointPatchList& patches = *this;
os << patches.size() << nl << token::BEGIN_LIST << incrIndent << nl;
forAll(patches, patchi)
{
os << indent << patches[patchi].name() << nl
<< indent << token::BEGIN_BLOCK << nl
<< incrIndent << patches[patchi] << decrIndent
<< indent << token::END_BLOCK << endl;
}
os << decrIndent << token::END_LIST;
// Check state of IOstream
os.check("pointBoundaryMesh::writeData(Ostream& os) const");
return os.good();
}
//bool Foam::pointBoundaryMesh::writeObject
//(
// IOstreamOption
//) const
//{
// return regIOobject::writeObject(fmt, ver, IOstream::UNCOMPRESSED);
//}
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,7 +39,6 @@ SourceFiles
#define Foam_pointBoundaryMesh_H
#include "pointPatch.H"
#include "regIOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,29 +56,19 @@ class wordRes;
class pointBoundaryMesh
:
public pointPatchList,
public regIOobject
public pointPatchList
{
// Private Data
//- Reference to mesh
const pointMesh& mesh_;
//- Demand-driven: list of patch ids per group
mutable autoPtr<HashTable<labelList>> groupIDsPtr_;
// Private Member Functions
//- Calculate geometry for the patches (transformation tensors etc.)
void calcGeometry();
//- Some patches have inGroup entries
bool hasGroupIDs() const;
//- Calculate group name to patch ids lookup
void calcGroupIDs() const;
//- Assign facePointPatches corresponding to the given polyBoundaryMesh
void addPatches(const polyBoundaryMesh& pbm);
@ -96,27 +85,11 @@ public:
friend class pointMesh;
//- Runtime type information
TypeName("pointBoundaryMesh");
// Constructors
//- Construct from polyBoundaryMesh
pointBoundaryMesh(const pointMesh&, const polyBoundaryMesh&);
//- Construct from IOobject and polyBoundaryMesh
pointBoundaryMesh
(
const IOobject& io,
const pointMesh&,
const polyBoundaryMesh&
);
//- Destructor
virtual ~pointBoundaryMesh() = default;
// Member Functions
@ -126,21 +99,6 @@ public:
return mesh_;
}
//- The number of patches before the first processor patch.
label nNonProcessor() const;
//- The number of processorPointPatch patches
label nProcessorPatches() const;
//- Return a list of patch names
wordList names() const;
//- Return a list of patch types
wordList types() const;
//- Return a list of physical types
wordList physicalTypes() const;
//- Return (sorted) patch indices for all matches.
// A no-op (returns empty list) for an empty matcher
labelList indices(const wordRe& matcher, const bool useGroups) const;
@ -163,38 +121,14 @@ public:
//- Find patch index given a name
// A no-op (returns -1) for an empty patchName
label findPatchID
(
const word& patchName,
const bool allowNotFound = true
) const;
label findPatchID(const word& patchName) const;
//- The patch indices per patch group
const HashTable<labelList>& groupPatchIDs() const;
//- Correct pointBoundaryMesh after moving points
//- Correct polyBoundaryMesh after moving points
void movePoints(const pointField&);
//- Correct pointBoundaryMesh after topology update
//- Correct polyBoundaryMesh after topology update
void updateMesh();
//- Reorders patches. Ordering does not have to be done in
// ascending or descending order. Reordering has to be unique.
// (is shuffle) If validBoundary calls updateMesh()
// after reordering to recalculate data (so call needs to be parallel
// sync in that case)
void reorder(const labelUList& oldToNew, const bool validBoundary);
//- writeData member function required by regIOobject
virtual bool writeData(Ostream&) const;
// //- Write using given format, version and form uncompression
// virtual bool writeObject
// (
// IOstreamOption streamOpt,
// const bool writeOnProc
// ) const;
// Housekeeping

View File

@ -37,12 +37,9 @@ License
namespace Foam
{
defineTypeNameAndDebug(pointMesh, 0);
defineTypeNameAndDebug(pointMesh, 0);
}
Foam::word Foam::pointMesh::meshSubDir = "pointMesh";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
@ -91,66 +88,8 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh)
}
Foam::pointMesh::pointMesh(const polyMesh& pMesh, const IOobject& io)
:
MeshObject<polyMesh, Foam::UpdateableMeshObject, pointMesh>(pMesh),
GeoMesh<polyMesh>(pMesh),
boundary_(io, *this, pMesh.boundaryMesh())
{
if (debug)
{
Pout<< "pointMesh::pointMesh(const polyMesh&): "
<< "Constructing from IO " << io.objectRelPath()
<< endl;
}
// Calculate the geometry for the patches (transformation tensors etc.)
boundary_.calcGeometry();
}
Foam::pointMesh::pointMesh
(
const polyMesh& pMesh,
const IOobjectOption::readOption rOpt
)
:
pointMesh
(
pMesh,
IOobject
(
pMesh.name(), // polyMesh region
pMesh.facesInstance(), // polyMesh topology instance
pMesh.time(),
rOpt,
Foam::IOobject::NO_WRITE
)
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::pointMesh::setInstance
(
const fileName& inst,
const IOobjectOption::writeOption wOpt
)
{
if (debug)
{
Pout<< "pointMesh::setInstance(): "
<< "Setting instance to " << inst << endl;
}
this->writeOpt(wOpt);
this->instance() = inst;
boundary_.writeOpt(wOpt);
boundary_.instance() = inst;
}
bool Foam::pointMesh::movePoints()
{
if (debug)
@ -179,19 +118,4 @@ void Foam::pointMesh::updateMesh(const mapPolyMesh& mpm)
}
bool Foam::pointMesh::writeObject
(
IOstreamOption streamOpt,
const bool writeOnProc
) const
{
if (debug)
{
Pout<< "pointMesh::writeObject(IOstreamOption, const bool): "
<< "Writing to " << boundary_.objectRelPath() << endl;
}
return boundary_.writeObject(streamOpt, writeOnProc);
}
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2021-2024 OpenCFD Ltd.
Copyright (C) 2021-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -86,26 +86,12 @@ public:
// Declare name of the class and its debug switch
ClassName("pointMesh");
//- Return the mesh sub-directory name (usually "pointMesh")
static word meshSubDir;
// Constructors
//- Construct from polyMesh
explicit pointMesh(const polyMesh& pMesh);
//- Construct from polyMesh and IOobject (used when reading boundary)
explicit pointMesh(const polyMesh& pMesh, const IOobject& io);
//- Construct from polyMesh and readOpt. Takes instance, time etc
//- from polyMesh. Used when reading boundary.
explicit pointMesh
(
const polyMesh& pMesh,
const IOobjectOption::readOption rOpt
);
//- Destructor
~pointMesh() = default;
@ -155,13 +141,6 @@ public:
return GeoMesh<polyMesh>::mesh_.time();
}
//- Set the instance for mesh files
void setInstance
(
const fileName& instance,
const IOobjectOption::writeOption wOpt = IOobject::AUTO_WRITE
);
// Volume Mesh
@ -192,16 +171,6 @@ public:
{
return &pm == this;
}
// Write
//- Write
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool writeOnProc = true
) const;
};

View File

@ -72,39 +72,6 @@ public:
:
facePointPatch(patch, bm)
{}
//- Construct given the original patch and a map
genericPointPatch
(
const genericPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<genericPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
};

View File

@ -91,20 +91,6 @@ Foam::cyclicPointPatch::cyclicPointPatch
{}
Foam::cyclicPointPatch::cyclicPointPatch
(
const cyclicPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
coupledFacePointPatch(patch, bm, index, mapAddressing, reversePointMap),
cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch.patch()))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicPointPatch::~cyclicPointPatch()

View File

@ -105,36 +105,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
cyclicPointPatch
(
const cyclicPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<cyclicPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
//- Destructor
virtual ~cyclicPointPatch();

View File

@ -73,39 +73,6 @@ public:
cyclicPointPatch(patch, bm)
{}
//- Construct given the original patch and a map
cyclicSlipPointPatch
(
const cyclicSlipPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
cyclicPointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<cyclicSlipPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
//- Destructor
virtual ~cyclicSlipPointPatch() = default;

View File

@ -72,39 +72,6 @@ public:
facePointPatch(patch, bm)
{}
//- Construct given the original patch and a map
emptyPointPatch
(
const emptyPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<emptyPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Member Functions

View File

@ -73,40 +73,6 @@ public:
cyclicPointPatch(patch, bm)
{}
//- Construct given the original patch and a map
nonuniformTransformCyclicPointPatch
(
const nonuniformTransformCyclicPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
cyclicPointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::
NewFrom<nonuniformTransformCyclicPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Destructor

View File

@ -117,20 +117,4 @@ Foam::processorPointPatch::processorPointPatch
{}
Foam::processorPointPatch::processorPointPatch
(
const processorPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
coupledFacePointPatch(patch, bm, index, mapAddressing, reversePointMap),
procPolyPatch_(refCast<const processorPolyPatch>(patch.patch()))
{
//? map reverseMeshPoints_ or leave demand-driven
}
// ************************************************************************* //

View File

@ -111,36 +111,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
processorPointPatch
(
const processorPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<processorPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
//- Destructor
virtual ~processorPointPatch() = default;

View File

@ -59,20 +59,6 @@ processorCyclicPointPatch::processorCyclicPointPatch
{}
Foam::processorCyclicPointPatch::processorCyclicPointPatch
(
const processorCyclicPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
processorPointPatch(patch, bm, index, mapAddressing, reversePointMap),
procCycPolyPatch_(refCast<const processorCyclicPolyPatch>(patch.patch()))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
processorCyclicPointPatch::~processorCyclicPointPatch()

View File

@ -89,36 +89,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
processorCyclicPointPatch
(
const processorCyclicPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<processorCyclicPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
//- Destructor
virtual ~processorCyclicPointPatch();

View File

@ -75,38 +75,6 @@ public:
facePointPatch(patch, bm)
{}
//- Construct given the original patch and a map
symmetryPointPatch
(
const symmetryPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
):
facePointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<symmetryPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Member Functions

View File

@ -58,23 +58,6 @@ Foam::symmetryPlanePointPatch::symmetryPlanePointPatch
{}
Foam::symmetryPlanePointPatch::symmetryPlanePointPatch
(
const symmetryPlanePointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap),
symmetryPlanePolyPatch_
(
refCast<const symmetryPlanePolyPatch>(patch.patch())
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::symmetryPlanePointPatch::applyConstraint

View File

@ -74,36 +74,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
symmetryPlanePointPatch
(
const symmetryPlanePointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<symmetryPlanePointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Member Functions

View File

@ -58,20 +58,6 @@ Foam::wedgePointPatch::wedgePointPatch
{}
Foam::wedgePointPatch::wedgePointPatch
(
const wedgePointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap),
wedgePolyPatch_(refCast<const wedgePolyPatch>(patch.patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::wedgePointPatch::applyConstraint

View File

@ -74,36 +74,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
wedgePointPatch
(
const wedgePointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<wedgePointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Member Functions

View File

@ -50,19 +50,4 @@ Foam::coupledFacePointPatch::coupledFacePointPatch
{}
Foam::coupledFacePointPatch::coupledFacePointPatch
(
const coupledFacePointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap),
coupledPointPatch(bm),
coupledPolyPatch_(refCast<const coupledPolyPatch>(patch.patch()))
{}
// ************************************************************************* //

View File

@ -91,16 +91,6 @@ public:
const pointBoundaryMesh& bm
);
//- Construct given the original patch and a map
coupledFacePointPatch
(
const coupledFacePointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Destructor
virtual ~coupledFacePointPatch() = default;

View File

@ -71,39 +71,6 @@ public:
:
facePointPatch(patch, bm)
{}
//- Construct given the original patch and a map
wallPointPatch
(
const wallPointPatch& patch,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
facePointPatch(patch, bm, index, mapAddressing, reversePointMap)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<wallPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
};

View File

@ -84,30 +84,9 @@ Foam::facePointPatch::facePointPatch
const pointBoundaryMesh& bm
)
:
pointPatch(p.name(), p.index(), bm, p.physicalType(), p.inGroups()),
pointPatch(bm),
polyPatch_(p)
{}
Foam::facePointPatch::facePointPatch
(
const facePointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
pointPatch
(
pp.name(),
index,
bm,
pp.physicalType(),
pp.inGroups()
),
polyPatch_(pp.patch())
{}
// ************************************************************************* //

View File

@ -128,36 +128,6 @@ public:
const pointBoundaryMesh& pm
);
//- Construct given the original patch and a map
facePointPatch
(
const facePointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<facePointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
// Selectors

View File

@ -1,218 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "meshPointPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "pointMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(meshPointPatch, 0);
//- Needs run-time selection table on pointPatch, not facePointPatch
addToRunTimeSelectionTable
(
pointPatch,
meshPointPatch,
dictionary
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::meshPointPatch::meshPointPatch
(
const word& name,
const labelUList& meshPoints,
const vectorField& pointNormals,
const label index,
const pointBoundaryMesh& bm,
const word& patchType
)
:
pointPatch(name, index, bm, word::null, wordList()),
meshPoints_(meshPoints),
pointNormals_(pointNormals)
{
if (meshPoints_.size() != pointNormals_.size())
{
FatalErrorInFunction << "patch " << name
<< " size of meshPoints " << meshPoints_.size()
<< " differs from size of pointNormals " << pointNormals_.size()
<< exit(FatalError);
}
}
Foam::meshPointPatch::meshPointPatch
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh& bm,
const word& patchType
)
:
pointPatch(name, dict, index, bm),
meshPoints_(dict.get<labelList>("meshPoints")),
pointNormals_("normals", dict, meshPoints_.size())
{}
Foam::meshPointPatch::meshPointPatch
(
const meshPointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
meshPointPatch
(
pp.name(),
labelList(reversePointMap, labelList(pp.meshPoints(), mapAddressing)),
vectorField(pp.pointNormals(), mapAddressing),
index,
bm,
pp.type()
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::meshPointPatch::movePoints(PstreamBuffers&, const pointField& p)
{
localPointsPtr_.reset(nullptr);
// Recalculate the point normals? Something like
//if (owner())
//{
// const SubList<face> subFaces
// (
// mesh.faces(),
// mesh.nBoundaryFaces(),
// mesh.nInternalFaces()
// );
// const primitivePatch pp(subFaces, mesh.points());
//
//
// for (const label pointi : meshPoints())
// {
// const auto fnd(pp.meshPointMap().find(pointi));
// if (fnd)
// {
// const label patchPointi = fnd();
// // Determine point patch equiv
//
// const auto& point
//
//
}
void Foam::meshPointPatch::updateMesh(PstreamBuffers&)
{
localPointsPtr_.reset(nullptr);
// Do what to pointNormals? Don't know what the new mesh points are
}
const Foam::pointField& Foam::meshPointPatch::localPoints() const
{
if (!localPointsPtr_)
{
localPointsPtr_.reset
(
new pointField
(
boundaryMesh().mesh().mesh().points(),
meshPoints()
)
);
}
return localPointsPtr_();
}
//const Foam::vectorField& Foam::meshPointPatch::pointNormals() const
//{
// if (!pointNormalsPtr_)
// {
// pointNormalsPtr_.reset(new vectorField(size()));
// vectorField& pointNormals = pointNormalsPtr_();
// forAll(constraints_, i)
// {
// pointNormals[i] = constraints_[i].second();
// }
// }
// return pointNormalsPtr_();
//}
//void Foam::meshPointPatch::applyConstraint
//(
// const label pointi,
// pointConstraint& pc
//) const
//{
// pc.combine(constraints_[pointi]);
//}
//
//
//void Foam::meshPointPatch::setConstraints
//(
// const List<pointConstraint>& pc
//)
//{
// constraints_ = pc;
// localPointsPtr_.reset(nullptr);
// pointNormalsPtr_.reset(nullptr);
//}
void Foam::meshPointPatch::write(Ostream& os) const
{
pointPatch::write(os);
meshPoints().writeEntry("meshPoints", os);
pointNormals().writeEntry("normals", os);
}
// ************************************************************************* //

View File

@ -1,193 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::meshPointPatch
Description
pointPatch with explicitly provided points instead of using the points
of a polyPatch.
SourceFiles
meshPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef meshPointPatch_H
#define meshPointPatch_H
#include "pointPatch.H"
#include "polyPatch.H"
#include "autoPtr.H"
#include "patchIdentifier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class meshPointPatch Declaration
\*---------------------------------------------------------------------------*/
class meshPointPatch
:
public pointPatch
{
private:
// Private Member Functions
//- No copy construct
meshPointPatch(const meshPointPatch&) = delete;
//- No copy assignment
void operator=(const meshPointPatch&) = delete;
protected:
// Protected Member Data
//- Explicit mesh points
const labelList meshPoints_;
const vectorField pointNormals_;
//- Demand-driven local points
mutable autoPtr<pointField> localPointsPtr_;
// Protected Member Functions
//- Correct patches after moving points
virtual void movePoints(PstreamBuffers&, const pointField&);
//- Update of the patch topology
virtual void updateMesh(PstreamBuffers&);
public:
//- Runtime type information
TypeName("meshPoint");
// Constructors
//- Construct from components
meshPointPatch
(
const word& name,
const labelUList& meshPoints,
const vectorField& pointNormals,
const label index,
const pointBoundaryMesh& bm,
const word& patchType
);
//- Construct from dictionary
meshPointPatch
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh& bm,
const word& patchType
);
//- Construct given the original patch and a map
meshPointPatch
(
const meshPointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
);
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const
{
return autoPtr<pointPatch>::NewFrom<meshPointPatch>
(
*this,
bm,
index,
mapAddressing,
reversePointMap
);
}
//- Destructor
virtual ~meshPointPatch() = default;
// Member Functions
//- Return size
virtual label size() const
{
return meshPoints().size();
}
//- Return mesh points
virtual const labelList& meshPoints() const
{
return meshPoints_;
}
//- Return pointField of points in patch
virtual const pointField& localPoints() const;
//- Return point unit normals
virtual const vectorField& pointNormals() const
{
return pointNormals_;
}
//- Write the pointPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,7 +6,6 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,33 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(pointPatch, 0);
// int pointPatch::disallowGenericPointPatch
// (
// debug::debugSwitch("disallowGenericPointPatch", 0)
// );
defineRunTimeSelectionTable(pointPatch, dictionary);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::pointPatch::write(Ostream& os) const
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
patchIdentifier::write(os);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const pointPatch& p)
{
p.write(os);
os.check("Ostream& operator<<(Ostream& os, const pointPatch& p");
return os;
defineTypeNameAndDebug(pointPatch, 0);
}

View File

@ -38,7 +38,6 @@ SourceFiles
#ifndef Foam_pointPatch_H
#define Foam_pointPatch_H
#include "patchIdentifier.H"
#include "labelList.H"
#include "vectorField.H"
#include "pointField.H"
@ -55,8 +54,6 @@ class pointConstraint;
class pointPatch;
class PstreamBuffers;
Ostream& operator<<(Ostream&, const pointPatch&);
//- Store lists of pointPatch as a PtrList
typedef PtrList<pointPatch> pointPatchList;
@ -65,8 +62,6 @@ typedef PtrList<pointPatch> pointPatchList;
\*---------------------------------------------------------------------------*/
class pointPatch
:
public patchIdentifier
{
// Private Data
@ -119,90 +114,14 @@ public:
TypeName("basePatch");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
pointPatch,
dictionary,
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh& bm,
const word& patchType
),
(name, dict, index, bm, patchType)
);
// Constructor
//- Construct from components
explicit pointPatch
(
const word& name,
const label index,
const pointBoundaryMesh& bm,
const word& physicalType,
const wordList& inGroups
)
//- Construct from boundary mesh
explicit pointPatch(const pointBoundaryMesh& bm)
:
patchIdentifier(name, index, physicalType, inGroups),
boundaryMesh_(bm)
{}
//- Construct from dictionary
explicit pointPatch
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh& bm
)
:
patchIdentifier(name, dict, index),
boundaryMesh_(bm)
{}
//- Construct given the original patch and a map
explicit pointPatch
(
const pointPatch& pp,
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
)
:
patchIdentifier(pp.name(), index, pp.physicalType(), pp.inGroups()),
boundaryMesh_(bm)
{}
//- Construct and return a subset clone,
//- resetting the point list and boundary mesh
virtual autoPtr<pointPatch> clone
(
const pointBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const labelUList& reversePointMap
) const = 0;
// Selectors
//- Return a pointer to a new patch created on freestore. Returns
//- null if not found
static autoPtr<pointPatch> New
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh&
);
//- Destructor
virtual ~pointPatch() = default;
@ -210,9 +129,15 @@ public:
// Member Functions
//- Return name
virtual const word& name() const = 0;
//- Return size
virtual label size() const = 0;
//- Return the index of this patch in the pointBoundaryMesh
virtual label index() const = 0;
//- Return boundaryMesh reference
const pointBoundaryMesh& boundaryMesh() const
{
@ -247,14 +172,6 @@ public:
pointConstraint&
) const
{}
//- Write the pointPatch data as a dictionary
virtual void write(Ostream&) const;
// Ostream Operator
friend Ostream& operator<<(Ostream&, const pointPatch&);
};

View File

@ -1,56 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::pointPatch> Foam::pointPatch::New
(
const word& name,
const dictionary& dict,
const label index,
const pointBoundaryMesh& bm
)
{
// Similar to polyPatchNew but no support for generic since we want it
// to fall through to the construct-from-polyPatch
DebugInFunction << "Constructing pointPatch" << endl;
const word patchType(dict.lookup("type"));
//dict.readIfPresent("geometricType", patchType);
auto* ctorPtr = dictionaryConstructorTable(patchType);
if (!ctorPtr)
{
return nullptr;
}
return autoPtr<pointPatch>(ctorPtr(name, dict, index, bm, patchType));
}
// ************************************************************************* //

View File

@ -1404,9 +1404,6 @@ void Foam::polyBoundaryMesh::reorder
patches[patchi].index() = patchi;
}
// Clear group-to-patch addressing. Note: could re-calculate
groupIDsPtr_.reset(nullptr);
if (validBoundary)
{
updateMesh();

View File

@ -109,14 +109,19 @@ public:
this->push_back(range);
}
// FUTURE?
// #if __cplusplus >= 201703L
// std::string_view view(size_t pos) const
// {}
// #else
// stdFoam::span<const char> view(size_t pos) const
// {}
// #endif
//- Const reference to the first element,
//- for consistency with other OpenFOAM containers
auto first() const -> decltype(this->front())
{
return this->front();
}
//- Const reference to the last element,
//- for consistency with other OpenFOAM containers
auto last() const -> decltype(this->back())
{
return this->back();
}
};

View File

@ -22,6 +22,7 @@ $(polyMeshModifier)/polyMeshModifier.C
$(polyMeshModifier)/polyMeshModifierNew.C
polyTopoChange/polyTopoChanger/polyTopoChanger.C
polyTopoChange/polyTopoChanger/polyTopoChangerChangeMesh.C
polyTopoChange/polyTopoChange/addPatchCellLayer.C
polyTopoChange/polyTopoChange/pointEdgeCollapse/pointEdgeCollapse.C
polyTopoChange/polyTopoChange/edgeCollapser.C
@ -76,6 +77,10 @@ meshCut/refineCell/refineCell.C
meshCut/wallLayerCells/wallLayerCells.C
meshCut/wallLayerCells/wallNormalInfo/wallNormalInfo.C
refinement/refinement/refinement.C
refinement/polyhedralRefinement/polyhedralRefinement.C
refinement/prismatic2DRefinement/prismatic2DRefinement.C
polyTopoChange/attachPolyTopoChanger/attachPolyTopoChanger.C
polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C

View File

@ -31,7 +31,7 @@ License
#include "polyMesh.H"
#include "Time.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -365,7 +365,7 @@ bool Foam::attachDetach::changeTopology() const
}
void Foam::attachDetach::setRefinement(polyTopoChange& ref) const
void Foam::attachDetach::setRefinement(batchPolyTopoChange& ref) const
{
// Insert the attach/detach instructions into the topological change

View File

@ -122,10 +122,10 @@ class attachDetach
// Topological changes
//- Attach interface
void attachInterface(polyTopoChange&) const;
void attachInterface(batchPolyTopoChange&) const;
//- Detach interface
void detachInterface(polyTopoChange&) const;
void detachInterface(batchPolyTopoChange&) const;
//- Calculate point match addressing
void calcPointMatchMap() const;
@ -215,7 +215,7 @@ public:
//- Insert the layer addition/removal instructions
// into the topological change
virtual void setRefinement(polyTopoChange&) const;
virtual void setRefinement(batchPolyTopoChange&) const;
//- Modify motion points to comply with the topological change
virtual void modifyMotionPoints(pointField& motionPoints) const;

View File

@ -29,7 +29,7 @@ License
#include "attachDetach.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "polyTopoChanger.H"
#include "polyRemovePoint.H"
#include "polyRemoveFace.H"
@ -43,7 +43,7 @@ const Foam::scalar Foam::attachDetach::positionDifference_ = 1e-8;
void Foam::attachDetach::attachInterface
(
polyTopoChange& ref
batchPolyTopoChange& ref
) const
{
// Algorithm:
@ -62,7 +62,7 @@ void Foam::attachDetach::attachInterface
if (debug)
{
Pout<< "void attachDetach::attachInterface("
<< "polyTopoChange& ref) const "
<< "batchPolyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Attaching interface" << endl;
}
@ -266,7 +266,7 @@ void Foam::attachDetach::attachInterface
if (debug)
{
Pout<< "void attachDetach::attachInterface("
<< "polyTopoChange& ref) const "
<< "batchPolyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Finished attaching interface" << endl;
}

View File

@ -28,7 +28,7 @@ License
#include "attachDetach.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "polyTopoChanger.H"
#include "polyAddPoint.H"
#include "polyModifyFace.H"
@ -38,7 +38,7 @@ License
void Foam::attachDetach::detachInterface
(
polyTopoChange& ref
batchPolyTopoChange& ref
) const
{
// Algorithm:
@ -66,7 +66,7 @@ void Foam::attachDetach::detachInterface
if (debug)
{
Pout<< "void attachDetach::detachInterface("
<< "polyTopoChange& ref) const "
<< "batchPolyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Detaching interface" << endl;
}
@ -75,7 +75,7 @@ void Foam::attachDetach::detachInterface
const faceZoneMesh& zoneMesh = mesh.faceZones();
// Check that zone is in increasing order (needed since adding faces
// in same order - otherwise polyTopoChange face ordering will mess up
// in same order - otherwise batchPolyTopoChange face ordering will mess up
// correspondence)
if (debug)
{
@ -467,7 +467,7 @@ void Foam::attachDetach::detachInterface
if (debug)
{
Pout<< "void attachDetach::detachInterface("
<< "polyTopoChange& ref) const "
<< "batchPolyTopoChange& ref) const "
<< " for object " << name() << " : "
<< "Finished detaching interface" << endl;
}

View File

@ -29,7 +29,7 @@ License
#include "layerAdditionRemoval.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "polyTopoChanger.H"
#include "polyAddPoint.H"
#include "polyAddCell.H"
@ -88,7 +88,7 @@ Foam::tmp<Foam::vectorField> Foam::layerAdditionRemoval::extrusionDir() const
void Foam::layerAdditionRemoval::addCellLayer
(
polyTopoChange& ref
batchPolyTopoChange& ref
) const
{
// Insert the layer addition instructions into the topological change
@ -108,7 +108,7 @@ void Foam::layerAdditionRemoval::addCellLayer
if (debug)
{
Pout<< "void layerAdditionRemoval::addCellLayer("
<< "polyTopoChange& ref) const for object " << name() << " : "
<< "batchPolyTopoChange& ref) const for object " << name() << " : "
<< "Adding cell layer" << endl;
}
@ -682,7 +682,7 @@ void Foam::layerAdditionRemoval::addCellLayer
if (debug)
{
Pout<< "void layerAdditionRemoval::addCellLayer(polyTopoChange&) const "
Pout<< "void layerAdditionRemoval::addCellLayer(batchPolyTopoChange&) const "
<< " for object " << name() << ": "
<< "Finished adding cell layer" << endl;
}

View File

@ -355,7 +355,7 @@ bool Foam::layerAdditionRemoval::changeTopology() const
}
void Foam::layerAdditionRemoval::setRefinement(polyTopoChange& ref) const
void Foam::layerAdditionRemoval::setRefinement(batchPolyTopoChange& ref) const
{
// Insert the layer addition/removal instructions
// into the topological change
@ -367,7 +367,7 @@ void Foam::layerAdditionRemoval::setRefinement(polyTopoChange& ref) const
// Clear addressing. This also resets the addition/removal data
if (debug)
{
Pout<< "layerAdditionRemoval::setRefinement(polyTopoChange&) "
Pout<< "layerAdditionRemoval::setRefinement(batchPolyTopoChange&) "
<< "for object " << name() << " : "
<< "Clearing addressing after layer removal" << endl;
}
@ -383,7 +383,7 @@ void Foam::layerAdditionRemoval::setRefinement(polyTopoChange& ref) const
// Clear addressing. This also resets the addition/removal data
if (debug)
{
Pout<< "layerAdditionRemoval::setRefinement(polyTopoChange&) "
Pout<< "layerAdditionRemoval::setRefinement(batchPolyTopoChange&) "
<< "for object " << name() << " : "
<< "Clearing addressing after layer addition" << endl;
}

View File

@ -119,10 +119,10 @@ class layerAdditionRemoval
tmp<vectorField> extrusionDir() const;
//- Add a layer of cells
void addCellLayer(polyTopoChange&) const;
void addCellLayer(batchPolyTopoChange&) const;
//- Remove a layer of cells
void removeCellLayer(polyTopoChange&) const;
void removeCellLayer(batchPolyTopoChange&) const;
//- Clear addressing
void clearAddressing() const;
@ -179,7 +179,7 @@ public:
//- Insert the layer addition/removal instructions
// into the topological change
virtual void setRefinement(polyTopoChange&) const;
virtual void setRefinement(batchPolyTopoChange&) const;
//- Modify motion points to comply with the topological change
virtual void modifyMotionPoints(pointField& motionPoints) const;

View File

@ -29,7 +29,7 @@ License
#include "layerAdditionRemoval.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "oppositeFace.H"
#include "polyTopoChanger.H"
#include "polyRemoveCell.H"
@ -83,7 +83,7 @@ bool Foam::layerAdditionRemoval::validCollapse() const
void Foam::layerAdditionRemoval::removeCellLayer
(
polyTopoChange& ref
batchPolyTopoChange& ref
) const
{
// Algorithm for layer removal. Second phase: topological change

View File

@ -57,7 +57,7 @@ Foam::displacementMotionSolver::displacementMotionSolver
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
pointMesh::New(mesh, Foam::IOobject::READ_IF_PRESENT)
pointMesh::New(mesh)
)
{}

View File

@ -33,7 +33,7 @@ Description
#include "perfectInterface.H"
#include "polyTopoChanger.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "addToRunTimeSelectionTable.H"
#include "mapPolyMesh.H"
#include "matchPoints.H"
@ -154,7 +154,7 @@ void Foam::perfectInterface::setRefinement
(
const indirectPrimitivePatch& pp0,
const indirectPrimitivePatch& pp1,
polyTopoChange& ref
batchPolyTopoChange& ref
) const
{
const polyMesh& mesh = topoChanger().mesh();
@ -423,11 +423,11 @@ void Foam::perfectInterface::setRefinement
}
void Foam::perfectInterface::setRefinement(polyTopoChange& ref) const
void Foam::perfectInterface::setRefinement(batchPolyTopoChange& ref) const
{
if (debug)
{
Pout<< "bool perfectInterface::setRefinement(polyTopoChange&) const : "
Pout<< "bool perfectInterface::setRefinement(batchPolyTopoChange&) const : "
<< "for object " << name() << " : "
<< "masterPatchID_:" << masterPatchID_
<< " slavePatchID_:" << slavePatchID_

View File

@ -129,7 +129,7 @@ public:
//- Insert the layer addition/removal instructions
// into the topological change
virtual void setRefinement(polyTopoChange&) const;
virtual void setRefinement(batchPolyTopoChange&) const;
//- Insert the layer addition/removal instructions
// into the topological change. Uses only mesh, not any of the
@ -139,7 +139,7 @@ public:
(
const indirectPrimitivePatch& pp0,
const indirectPrimitivePatch& pp1,
polyTopoChange&
batchPolyTopoChange&
) const;
//- Modify motion points to comply with the topological change

View File

@ -65,7 +65,10 @@ void Foam::attachPolyTopoChanger::attach(const bool removeEmptyPatches)
const fileName oldInst = mesh_.facesInstance();
// Execute all polyMeshModifiers
changeMesh(false); // no inflation
// DISABLED - this functionality is lost
// Bad rewrite by Mattijs Janssens - completely misunderstood the interface
// Needs to use polyTopoChange, and not changer.
// changeMesh(false); // no inflation
const pointField p = mesh_.oldPoints();

View File

@ -55,7 +55,7 @@ namespace Foam
// Forward Declarations
class polyTopoChanger;
class polyTopoChange;
class batchPolyTopoChange;
class mapPolyMesh;
class polyMeshModifier;
@ -166,7 +166,7 @@ public:
virtual bool changeTopology() const = 0;
//- Insert the topological change instructions
virtual void setRefinement(polyTopoChange&) const = 0;
virtual void setRefinement(batchPolyTopoChange&) const = 0;
//- Modify motion points to comply with the topological change
virtual void modifyMotionPoints(pointField& motionPoints) const = 0;

File diff suppressed because it is too large Load Diff

View File

@ -86,6 +86,19 @@ class removeFaces
labelList& cellRegion
) const;
//- Changes region of connected set of faces. Returns number of changed
// faces. For use with batch topo change
label changeFaceRegion
(
const labelList& cellRegion,
const boolList& removedFace,
const labelList& nFacesPerEdge,
const label faceI,
const label newRegion,
labelList& faceRegion
) const;
//- Changes region of connected set of faces
label changeFaceRegion
(
@ -119,13 +132,15 @@ class removeFaces
);
//- Merge faceLabels into single face.
template<class TopoChangeEngine>
void mergeFaces
(
const labelList& cellRegion,
const labelList& cellRegionMaster,
const labelHashSet& pointsToRemove,
const labelList& faceLabels,
polyTopoChange& meshMod
TopoChangeEngine& meshMod
) const;
//- Get patch, zone info for facei
@ -141,6 +156,7 @@ class removeFaces
face filterFace(const labelHashSet&, const label) const;
//- Wrapper for meshMod.modifyFace. Reverses face if own>nei.
template<class TopoChangeEngine>
void modFace
(
const face& f,
@ -153,11 +169,10 @@ class removeFaces
const label zoneID,
const bool zoneFlip,
polyTopoChange& meshMod
TopoChangeEngine& meshMod
) const;
//- No copy construct
removeFaces(const removeFaces&) = delete;
@ -199,12 +214,15 @@ public:
//- Play commands into polyTopoChange to remove faces.
template<class TopoChangeEngine>
void setRefinement
(
const labelList& piercedFaces,
const labelList& cellRegion,
const labelList& cellRegionMaster,
polyTopoChange&
// const labelList& pointRegionMaster,
labelList& cellRegionMaster,
TopoChangeEngine&
) const;
//- Force recalculation of locally stored data on topological change
@ -221,6 +239,10 @@ public:
} // End namespace Foam
#ifdef NoRepository
# include "removeFacesTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,9 @@ License
#include "polyTopoChanger.H"
#include "polyMesh.H"
#include "mapPolyMesh.H"
#include "polyTopoChange.H"
#include "batchPolyTopoChange.H"
#include "Time.H"
#include "PtrListOps.H"
@ -192,14 +194,14 @@ bool Foam::polyTopoChanger::changeTopology() const
}
Foam::autoPtr<Foam::polyTopoChange>
Foam::autoPtr<Foam::batchPolyTopoChange>
Foam::polyTopoChanger::topoChangeRequest() const
{
// Collect changes from all modifiers
const PtrList<polyMeshModifier>& topoChanges = *this;
auto ptr = autoPtr<polyTopoChange>::New(mesh());
polyTopoChange& ref = ptr.ref();
auto ptr = autoPtr<batchPolyTopoChange>::New(mesh());
batchPolyTopoChange& ref = ptr.ref();
forAll(topoChanges, morphI)
{
@ -245,35 +247,35 @@ void Foam::polyTopoChanger::update(const mapPolyMesh& m)
}
Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
(
const bool inflate,
const bool syncParallel,
const bool orderCells,
const bool orderPoints
)
{
if (changeTopology())
{
autoPtr<polyTopoChange> ref = topoChangeRequest();
// Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
// (
// const bool inflate,
// const bool syncParallel,
// const bool orderCells,
// const bool orderPoints
// )
// {
// if (changeTopology())
// {
// autoPtr<polyTopoChange> ref = topoChangeRequest();
autoPtr<mapPolyMesh> topoChangeMap = ref().changeMesh
(
mesh_,
inflate,
syncParallel,
orderCells,
orderPoints
);
// autoPtr<mapPolyMesh> topoChangeMap = ref().changeMesh
// (
// mesh_,
// inflate,
// syncParallel,
// orderCells,
// orderPoints
// );
update(topoChangeMap());
mesh_.updateMesh(topoChangeMap());
return topoChangeMap;
}
// update(topoChangeMap());
// mesh_.updateMesh(topoChangeMap());
// return topoChangeMap;
// }
mesh_.topoChanging(false);
return nullptr;
}
// mesh_.topoChanging(false);
// return nullptr;
// }
void Foam::polyTopoChanger::addTopologyModifiers
@ -326,6 +328,13 @@ Foam::label Foam::polyTopoChanger::findModifierID
}
Foam::label Foam::polyTopoChanger::morphIndex() const
{
return morphIndex_;
}
// writeData member function required by regIOobject
bool Foam::polyTopoChanger::writeData(Ostream& os) const
{
os << *this;

View File

@ -51,6 +51,7 @@ namespace Foam
class polyMesh;
class mapPolyMesh;
class polyBoundaryMesh;
class polyTopoChange;
class polyTopoChanger;
Ostream& operator<<(Ostream&, const polyTopoChanger&);
@ -65,6 +66,12 @@ class polyTopoChanger
public PtrList<polyMeshModifier>,
public regIOobject
{
// Private data
//- Current time index for mesh morph
label morphIndex_;
// Private Member Functions
//- Read if IOobject flags set, set modifiers. Return true if read.
@ -84,6 +91,33 @@ protected:
//- Reference to mesh
polyMesh& mesh_;
// Protected Member Functions
// Topology changes
//- Rotate a face nShift positions in anticlockwise direction
static face rotateFace(const face& f, const label nShift);
//- Determine ordering of faces in coupled patches.
// Calculate mapping to shuffle faces inside coupled patches and
// rotation to make 0th vertex in faces align.
static bool reorderCoupledPatches
(
const polyBoundaryMesh& boundary,
const labelList& patchStarts,
const labelList& patchSizes,
const faceList& faces,
const pointField& points,
labelList& faceMap,
labelList& rotation
);
//- Sync communications required for couple patch reordering when
// there is no local topological change
void syncCoupledPatches();
public:
//- Runtime type information
@ -125,19 +159,27 @@ public:
bool changeTopology() const;
//- Return topology change request
autoPtr<polyTopoChange> topoChangeRequest() const;
autoPtr<batchPolyTopoChange> topoChangeRequest() const;
//- Modify point motion
void modifyMotionPoints(pointField&) const;
autoPtr<mapPolyMesh> changeMesh
// autoPtr<mapPolyMesh> changeMesh
// (
// const bool inflate,
// const bool syncParallel = true,
// const bool orderCells = false,
// const bool orderPoints = false
// );
static autoPtr<mapPolyMesh> changeMesh
(
const bool inflate,
const bool syncParallel = true,
const bool orderCells = false,
const bool orderPoints = false
polyMesh&,
const batchPolyTopoChange&
);
autoPtr<mapPolyMesh> changeMesh();
//- Force recalculation of locally stored data on topological change
void update(const mapPolyMesh& m);
@ -147,6 +189,9 @@ public:
//- Find modifier given a name
label findModifierID(const word& modName) const;
//- Return morph index
label morphIndex() const;
//- writeData member function required by regIOobject
bool writeData(Ostream&) const;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,246 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 5.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyhedralRefinement
Description
Isotropic refinement of polyhedral cells using the mesh modifier engine
Each polyhedral cell is split by the following procedure:
1. Adding points at the edge centre, face centre and cell centre,
2. Adding cells n cells where n is the number of points of the cell,
3. Splitting each face into multiple faces going from:
existing corner point -> new edge centre point -> new face centre
point -> other new edge centre point (sharing the same corner point)
4. Adding internal faces going from:
new edge centre point -> new face centre point -> new cell centre
point -> other new face centre point (sharing the same edge)
SourceFiles
polyhedralRefinement.C
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
Rewrite, porting and changes by Hrvoje Jasak, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef polyhedralRefinement_H
#define polyhedralRefinement_H
#include "refinement.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyhedralRefinement Declaration
\*---------------------------------------------------------------------------*/
class polyhedralRefinement
:
public refinement
{
private:
// Private Member Functions
// Helper functions
//- Get least cell level such that the face has at least three
// points smaller than the level
label getAnchorLevel(const label faceI) const;
// Local topology modification functions (operate on cells/faces)
//- Create all internal faces of split cellI into n cells
// where n is the number of cell points
void createInternalFaces
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& faceMidPoint,
const labelList& faceAnchorLevel,
const labelList& edgeMidPoint,
const label cellI,
batchPolyTopoChange& ref
) const;
// Topological change helper functions
//- Get cell added to point of cellI (if any)
label getAnchorCell
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label cellI,
const label faceI,
const label pointI
) const;
//- Set new owner and neighbour (in unspecified order) of pointI
// on faceI
void setNewFaceNeighbours
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label faceI,
const label pointI,
label& own,
label& nei
) const;
//- Find index of point with wantedLevel, starting from fp
label findLevel
(
const face& f,
const label startFp,
const bool searchForward,
const label wantedLevel
) const;
//- Store in maps correspondence from midpoint to anchors and
// faces. Used when creating internal faces
label storeMidPointInfo
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& edgeMidPoint,
const label cellI,
const label faceI,
const bool faceOrder,
const label midPointI,
const label anchorPointI,
const label faceMidPointI,
Map<edge>& midPointToAnchors,
Map<edge>& midPointToFaceMids,
batchPolyTopoChange& ref
) const;
//- If p0 and p1 are existing vertices check if edge is split
// and insert splitPoint. Used with storing mid point
void insertEdgeSplit
(
const labelList& edgeMidPoint,
const label p0,
const label p1,
DynamicList<label>& verts
) const;
// Copy control
//- Disallow default bitwise copy construct
polyhedralRefinement(const polyhedralRefinement&) = delete;
//- Disallow default bitwise assignment
void operator=(const polyhedralRefinement&) = delete;
protected:
// Protected Pure Virtual Member Functions
// Global topology modification functions (operate on whole polyMesh)
//- Set refinement instruction
virtual void setRefinementInstruction
(
batchPolyTopoChange& ref
) const;
//- Set unrefinement instruction
virtual void setUnrefinementInstruction
(
batchPolyTopoChange& ref
) const;
public:
//- Runtime type information
TypeName("polyhedralRefinement");
// Constructors
//- Construct from dictionary
polyhedralRefinement
(
const word& name,
const dictionary& dict,
const label index,
const polyTopoChanger& mme
);
//- Destructor
virtual ~polyhedralRefinement() = default;
// Member Functions
// Edit
//- Set cells to refine given a list of refinement
// candidates. Refinement candidates are extended within the
// function due to possible 4:1 conflicts and specified number of
// buffer layers.
// Note: must be called BEFORE setSplitPointsToUnrefine
virtual void setCellsToRefine
(
const labelList& refinementCellCandidates
);
//- Set split points to unrefine given a list of all mesh points
// that are candidates for unrefinement. Split points are
// determined as a subset of unrefinement candidates, avoiding
// splitting points of cells that are going to be refined at the
// same time and ensuring consistent unrefinement.
// Note: must be called AFTER setCellsToRefine
virtual void setSplitPointsToUnrefine
(
const labelList& unrefinementPointCandidates
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More