Removing trailing whitespace

This commit is contained in:
Henrik Rusche 2015-05-15 15:57:39 +02:00
parent a9fefbe25b
commit ee97417a27
219 changed files with 161323 additions and 161325 deletions

View file

@ -1,5 +1,5 @@
################################################################################
This file contains brief description of the changes introduced by merging
This file contains brief description of the changes introduced by merging
branches
There are two secions: feature and bugfix
@ -31,7 +31,7 @@ Updated wmake/rules for compilation with ICC 14
* processorPointPatch
Author: Zeljko Tukovic; Merge: Dominik Christ
Correct interpolation of point data on processor boundaries after parallel
Correct interpolation of point data on processor boundaries after parallel
topological changes

View file

@ -42,9 +42,9 @@
December 2004) as release number 3.0. Visit http://foam-extend.org
for more information.
OPENFOAM® is a registered trademark of ESI Group. OpenFOAM-extend and
OPENFOAM® is a registered trademark of ESI Group. OpenFOAM-extend and
foam-extend are a community effort not endorsed by ESI Group.
** Installation
foam-extend-3.1 can be compiled and runs on any linux system
@ -68,7 +68,7 @@
Binary packages are available for download at
http://sourceforge.net/projects/openfoam-extend/ for the following
systems: Ubuntu 14.04, Fedora 20 and Mac OS X.
* Accompanying ThirdParty software:
- gcc compatibility up to 4.8.2
- Paraview 4.0.1
@ -86,7 +86,7 @@
- bison 2.7
- hwloc 1.7.2
- libccmio 2.6.1
** Compatibility
Upstream features from the OpenFOAM® code base are merged into
foam-extend on regular basis. The interface format of
@ -328,8 +328,8 @@ user@machine> git log 3.0.. > commitLog
http://sourceforge.net/apps/mantisbt/openfoam-extend
** How to contribute
All your contributions are highly welcome: New solvers, utilities and
models; bug fixes; documentation. The many ways of contributing and the
All your contributions are highly welcome: New solvers, utilities and
models; bug fixes; documentation. The many ways of contributing and the
contribution process are described in detail at:
http://sourceforge.net/p/openfoam-extend/wiki/HowToContribute/

View file

@ -19,7 +19,7 @@ Table of Contents
9 List of Contributors:
1 Overview
1 Overview
-----------
The foam-extend project is a fork of the OpenFOAM® open source
library for Computational Fluid Dynamics (CFD). It is an open
@ -46,11 +46,11 @@ Table of Contents
December 2004) as release number 3.0. Visit [http://foam-extend.org]
for more information.
OPENFOAM® is a registered trademark of ESI Group. OpenFOAM-extend and
OPENFOAM® is a registered trademark of ESI Group. OpenFOAM-extend and
foam-extend are a community effort not endorsed by ESI Group.
2 Installation
2 Installation
---------------
foam-extend-3.1 can be compiled and runs on any linux system
@ -74,7 +74,7 @@ Table of Contents
Binary packages are available for download at
[http://sourceforge.net/projects/openfoam-extend/] for the following
systems: Ubuntu 14.04, Fedora 20 and Mac OS X.
* Accompanying ThirdParty software:
- gcc compatibility up to 4.8.2
- Paraview 4.0.1
@ -92,9 +92,9 @@ Table of Contents
- bison 2.7
- hwloc 1.7.2
- libccmio 2.6.1
3 Compatibility
3 Compatibility
----------------
Upstream features from the OpenFOAM® code base are merged into
foam-extend on regular basis. The interface format of
@ -103,7 +103,7 @@ Table of Contents
fixes and algorithmic improvements, considered more important than
inter-operability.
4 Main differentiators between foam-extend and OpenFOAM
4 Main differentiators between foam-extend and OpenFOAM
--------------------------------------------------------
A large number of features have been lost within the release of
OpenFOAM since version 1.3, the code base has shrunk by more than
@ -184,7 +184,7 @@ Table of Contents
* Approximately 6000 bug fixes in fundamental level libraries and
discretisation techniques
5 New features in foam-extend-3.1, since foam-extend-3.0
5 New features in foam-extend-3.1, since foam-extend-3.0
---------------------------------------------------------
The list of features is a result of the work of numerous
contributors. The maintainers of foam-extend would formally like to
@ -307,7 +307,7 @@ Table of Contents
- Template depth for block matrix support
- Parallel efficiency improvements
6 Recent successful compilations and tests
6 Recent successful compilations and tests
-------------------------------------------
* Ubuntu 14.04:
@ -337,18 +337,18 @@ Table of Contents
[http://openfoam-extend.sourceforge.net/CDash/viewTest.php?buildid=743]
7 Reporting bugs
7 Reporting bugs
-----------------
To report bugs, please use the MantisBT bugtracker at
[http://sourceforge.net/apps/mantisbt/openfoam-extend]
8 How to contribute
8 How to contribute
--------------------
All your contributions are highly welcome: New solvers, utilities and
models; bug fixes; documentation. The many ways of contributing and the
All your contributions are highly welcome: New solvers, utilities and
models; bug fixes; documentation. The many ways of contributing and the
contribution process are described in detail at:
[http://sourceforge.net/p/openfoam-extend/wiki/HowToContribute/]
9 List of Contributors:
9 List of Contributors:
------------------------
See file ListOfContributors

View file

@ -2,7 +2,7 @@ int nCorr = 0;
if (aMesh.solutionDict().found("nOuterCorrectors"))
{
nCorr =
nCorr =
readInt(aMesh.solutionDict().lookup("nOuterCorrectors"));
}
else

View file

@ -40,7 +40,7 @@ scalar velMag = 0.0;
if (aMesh.nInternalEdges())
{
edgeScalarField SfUfbyDelta =
edgeScalarField SfUfbyDelta =
aMesh.edgeInterpolation::deltaCoeffs()*mag(phis);
CoNum = max(SfUfbyDelta/aMesh.magLe())
@ -53,7 +53,7 @@ if (aMesh.nInternalEdges())
}
Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum
<< " max: " << CoNum
<< " velocity magnitude: " << velMag << endl;
// ************************************************************************* //

View file

@ -1,3 +1,3 @@
icoIbFoam.C
icoIbFoam.C
EXE = $(FOAM_APPBIN)/icoIbFoam

View file

@ -1,3 +1,3 @@
porousSimpleIbFoam.C
porousSimpleIbFoam.C
EXE = $(FOAM_APPBIN)/porousSimpleIbFoam

View file

@ -1,3 +1,3 @@
simpleIbFoam.C
simpleIbFoam.C
EXE = $(FOAM_APPBIN)/simpleIbFoam

View file

@ -12,7 +12,7 @@ nCoupledFacesToBreak = 0;
// only consider tensile tractions
normalTraction = max(normalTraction, scalar(0));
scalarField shearTraction =
cohesiveZone.internalField() *
mag( (I - Foam::sqr(n.internalField())) & traction.internalField() );
@ -424,7 +424,7 @@ nCoupledFacesToBreak = 0;
}
faceToBreakTraction *= scaleFactor;
topoChange = true;
}

View file

@ -23,7 +23,7 @@ The included solvers feature the following capabilities:
arbitrary crack propagation
custom boundary conditions
Aitken's under-relaation for displacement field
A number of people have contributed to the development of the solvers,
mainly within Alojz Ivankovic's research group. The code has been
assembled and is maintained by Philip Cardiff (University College Dublin),

View file

@ -1,3 +1,3 @@
ibContinuityError.C
ibContinuityError.C
EXE = $(FOAM_APPBIN)/ibContinuityError

View file

@ -1095,7 +1095,7 @@ int main(int argc, char *argv[])
{
mesh.addZones(List<pointZone*>(0), fz, cz);
}
removeEmptyPatches(mesh);
mesh.write();

View file

@ -51,23 +51,23 @@ void writePointsToVTK
{
xmlTag xmlRoot("VTKFile");
xmlRoot.addAttribute("type", "PolyData");
xmlTag& xmlPolyData = xmlRoot.addChild("PolyData");
xmlTag& xmlPiece = xmlPolyData.addChild("Piece");
xmlPiece.addAttribute("NumberOfPoints", points.size());
xmlTag& xmlPoints = xmlPiece.addChild("Points");
xmlTag& xmlPointData = xmlPoints.addChild("DataArray");
xmlPointData.addAttribute("type", "Float32");
xmlPointData.addAttribute("NumberOfComponents", 3);
xmlPointData.addAttribute("format", "ascii");
xmlPointData << points;
OFstream os(fn);
os << xmlRoot << endl;
Info << "Created " << fn << endl;
}
@ -83,12 +83,12 @@ void writePointsToVTK
{
// Create subaddressed points
pointField newPoints(addr.size());
forAll(addr, i)
{
newPoints[i] = points[addr[i]];
}
writePointsToVTK
(
fn,
@ -108,23 +108,23 @@ void writeEdgesToVTK
)
{
labelList connectivity(edges.size());
forAll(edges, edgeI)
{
connectivity[edgeI] = 2*(edgeI+1);
}
xmlTag xmlRoot("VTKFile");
xmlRoot.addAttribute("type", "PolyData");
xmlTag& xmlPolyData = xmlRoot.addChild("PolyData");
xmlTag& xmlPiece = xmlPolyData.addChild("Piece");
xmlPiece.addAttribute("NumberOfPoints", points.size());
xmlPiece.addAttribute("NumberOfLines", edges.size());
xmlTag& xmlPoints = xmlPiece.addChild("Points");
xmlTag& xmlPointData = xmlPoints.addChild("DataArray");
xmlPointData.addAttribute("type", "Float32");
xmlPointData.addAttribute("NumberOfComponents", 3);
@ -144,7 +144,7 @@ void writeEdgesToVTK
xmlConnectData.addAttribute("Name", "offsets");
xmlConnectData.addAttribute("format", "ascii");
xmlConnectData << connectivity;
OFstream os(fn);
os << xmlRoot << endl;
@ -165,28 +165,28 @@ void writeEdgesToVTK
DynamicList<point> newPoints;
labelList newPointAddr(points.size(), -1);
LongList<edge> newEdges(addr.size());
forAll(addr, addrI)
{
label edgeI = addr[addrI];
const edge& curEdge = edges[edgeI];
edge& newEdge = newEdges[addrI];
forAll(curEdge, i)
{
label pointId = curEdge[i];
if (newPointAddr[pointId] == -1)
{
newPoints.append(points[pointId]);
newPointAddr[pointId] = newPoints.size()-1;
}
newEdge[i] = newPointAddr[pointId];
}
}
writeEdgesToVTK
(
fn,
@ -207,30 +207,30 @@ void writeFacetsToVTK
)
{
labelList connectivity(facets.size());
forAll(facets, faceI)
{
connectivity[faceI] = 3*(faceI+1);
}
labelList regionData(facets.size());
forAll(facets, faceI)
{
regionData[faceI] = facets[faceI].region();
}
xmlTag xmlRoot("VTKFile");
xmlRoot.addAttribute("type", "PolyData");
xmlTag& xmlPolyData = xmlRoot.addChild("PolyData");
xmlTag& xmlPiece = xmlPolyData.addChild("Piece");
xmlPiece.addAttribute("NumberOfPoints", points.size());
xmlPiece.addAttribute("NumberOfPolys", facets.size());
xmlTag& xmlPoints = xmlPiece.addChild("Points");
xmlTag& xmlPointData = xmlPoints.addChild("DataArray");
xmlPointData.addAttribute("type", "Float32");
xmlPointData.addAttribute("NumberOfComponents", 3);
@ -250,18 +250,18 @@ void writeFacetsToVTK
xmlConnectData.addAttribute("Name", "offsets");
xmlConnectData.addAttribute("format", "ascii");
xmlConnectData << connectivity;
xmlTag& xmlCellData = xmlPiece.addChild("CellData");
xmlTag& xmlCellDataArray = xmlCellData.addChild("DataArray");
xmlCellDataArray.addAttribute("type", "Int32");
xmlCellDataArray.addAttribute("Name", "region");
xmlCellDataArray.addAttribute("format", "ascii");
xmlCellDataArray << regionData;
OFstream os(fn);
os << xmlRoot << endl;
Info << "Created " << fn << endl;
}
@ -276,33 +276,33 @@ void writeFacetsToVTK
const LongList<labelledTri>& facets,
const unallocLabelList& addr
)
{
{
// Remove unused points and create subaddressed facets
DynamicList<point> newPoints;
labelList newPointAddr(points.size(), -1);
LongList<labelledTri> newFacets(addr.size());
forAll(addr, addrI)
{
label faceI = addr[addrI];
const labelledTri& facet = facets[faceI];
const FixedList<label, 3>& pointIds = facet;
FixedList<label, 3> newPointIds;
forAll(pointIds, i)
{
label pointId = pointIds[i];
if (newPointAddr[pointId] == -1)
{
newPoints.append(points[pointId]);
newPointAddr[pointId] = newPoints.size()-1;
}
newPointIds[i] = newPointAddr[pointId];
}
newFacets[addrI] = labelledTri
(
newPointIds[0],
@ -311,7 +311,7 @@ void writeFacetsToVTK
facet.region()
);
}
writeFacetsToVTK
(
fn,
@ -334,36 +334,36 @@ int main(int argc, char *argv[])
// Process commandline arguments
fileName inFileName(args.args()[1]);
fileName outPrefix(args.args()[2]);
// Read original surface
triSurf origSurf(inFileName);
const pointField& points = origSurf.points();
const LongList<labelledTri>& facets = origSurf.facets();
const LongList<edge>& edges = origSurf.featureEdges();
const geometricSurfacePatchList& patches = origSurf.patches();
label index = 0;
// Create file structure for multiblock dataset
mkDir(outPrefix);
mkDir(outPrefix + "/patches");
mkDir(outPrefix + "/pointSubsets");
mkDir(outPrefix + "/edgeSubsets");
mkDir(outPrefix + "/faceSubsets");
// Create VTK multiblock dataset file
xmlTag xmlRoot("VTKFile");
xmlRoot.addAttribute("type", "vtkMultiBlockDataSet");
xmlRoot.addAttribute("version", "1.0");
xmlRoot.addAttribute("byte_order", "LittleEndian");
xmlTag& xmlDataSet = xmlRoot.addChild("vtkMultiBlockDataSet");
// Write faces and feature edges
{
fileName fn = outPrefix / "facets.vtp";
writeFacetsToVTK
(
outPrefix / "facets.vtp",
@ -371,16 +371,16 @@ int main(int argc, char *argv[])
points,
facets
);
xmlTag& tag = xmlDataSet.addChild("DataSet");
tag.addAttribute("index", Foam::name(index++));
tag.addAttribute("name", "facets");
tag.addAttribute("file", fn);
}
{
fileName fn = outPrefix / "featureEdges.vtp";
writeEdgesToVTK
(
outPrefix / "featureEdges.vtp",
@ -388,33 +388,33 @@ int main(int argc, char *argv[])
points,
edges
);
xmlTag& tag = xmlDataSet.addChild("DataSet");
tag.addAttribute("index", Foam::name(index++));
tag.addAttribute("name", "featureEdges");
tag.addAttribute("file", fn);
}
// Write patches
// Create patch addressing
List<DynamicList<label> > patchAddr(patches.size());
forAll(facets, faceI)
{
patchAddr[facets[faceI].region()].append(faceI);
}
{
xmlTag& xmlBlock = xmlDataSet.addChild("Block");
xmlBlock.addAttribute("index", Foam::name(index++));
xmlBlock.addAttribute("name", "patches");
forAll(patches, patchI)
{
{
word patchName = patches[patchI].name();
fileName fn = outPrefix / "patches" / patchName + ".vtp";
writeFacetsToVTK
(
fn,
@ -423,32 +423,32 @@ int main(int argc, char *argv[])
facets,
patchAddr[patchI]
);
xmlTag& tag = xmlBlock.addChild("DataSet");
tag.addAttribute("index", Foam::name(patchI));
tag.addAttribute("name", patchName);
tag.addAttribute("file", fn);
}
}
// Write point subsets
{
xmlTag& xmlBlock = xmlDataSet.addChild("Block");
xmlBlock.addAttribute("index", Foam::name(index++));
xmlBlock.addAttribute("name", "pointSubsets");
DynList<label> subsetIndices;
labelList subsetAddr;
origSurf.pointSubsetIndices(subsetIndices);
forAll(subsetIndices, id)
{
word subsetName = origSurf.pointSubsetName(id);
origSurf.pointsInSubset(id, subsetAddr);
fileName fn = outPrefix / "pointSubsets" / subsetName + ".vtp";
writePointsToVTK
(
fn,
@ -456,32 +456,32 @@ int main(int argc, char *argv[])
points,
subsetAddr
);
xmlTag& tag = xmlBlock.addChild("DataSet");
tag.addAttribute("index", Foam::name(id));
tag.addAttribute("name", subsetName);
tag.addAttribute("file", fn);
}
}
// Write edge subsets
{
xmlTag& xmlBlock = xmlDataSet.addChild("Block");
xmlBlock.addAttribute("index", Foam::name(index++));
xmlBlock.addAttribute("name", "edgeSubsets");
DynList<label> subsetIndices;
labelList subsetAddr;
origSurf.edgeSubsetIndices(subsetIndices);
forAll(subsetIndices, id)
{
word subsetName = origSurf.edgeSubsetName(id);
origSurf.edgesInSubset(id, subsetAddr);
fileName fn = outPrefix / "edgeSubsets" / subsetName + ".vtp";
writeEdgesToVTK
(
fn,
@ -490,32 +490,32 @@ int main(int argc, char *argv[])
edges,
subsetAddr
);
xmlTag& tag = xmlBlock.addChild("DataSet");
tag.addAttribute("index", Foam::name(id));
tag.addAttribute("name", subsetName);
tag.addAttribute("file", fn);
}
}
// Write facet subsets
{
xmlTag& xmlBlock = xmlDataSet.addChild("Block");
xmlBlock.addAttribute("index", Foam::name(index++));
xmlBlock.addAttribute("name", "faceSubsets");
DynList<label> subsetIndices;
labelList subsetAddr;
origSurf.facetSubsetIndices(subsetIndices);
forAll(subsetIndices, id)
{
{
word subsetName = origSurf.facetSubsetName(id);
origSurf.facetsInSubset(id, subsetAddr);
fileName fn = outPrefix / "faceSubsets" / subsetName + ".vtp";
writeFacetsToVTK
(
fn,
@ -524,21 +524,21 @@ int main(int argc, char *argv[])
facets,
subsetAddr
);
xmlTag& tag = xmlBlock.addChild("DataSet");
tag.addAttribute("index", Foam::name(id));
tag.addAttribute("name", subsetName);
tag.addAttribute("file", fn);
}
}
}
OFstream os(outPrefix + ".vtm");
os << xmlRoot << endl;
Info << "Created " << outPrefix + ".vtm" << endl;
Info << "End\n" << endl;
return 0;
}

View file

@ -54,16 +54,16 @@ class xmlTag
public OStringStream
{
// Private data
//- Tag name
word name_;
//- Attributes
HashTable<string> attributes_;
//- Child tags
DynamicList<xmlTag> children_;
public:
// Constructors
@ -76,7 +76,7 @@ public:
attributes_(),
children_()
{}
//- Construct given tag name
xmlTag(const word& name)
:
@ -101,7 +101,7 @@ public:
// Member Functions
//- Add an attribute
template<class T>
void addAttribute(const keyType& key, const T& value)
@ -110,13 +110,13 @@ public:
os << value;
attributes_.insert(key, os.str());
};
//- Add a fileName attribute
void addAttribute(const keyType& key, const fileName& value)
{
attributes_.insert(key, value);
};
//- Add a string attribute
void addAttribute(const keyType& key, const string& value)
{
@ -128,15 +128,15 @@ public:
{
attributes_.insert(key, value);
};
//- Add a child
xmlTag& addChild(const xmlTag& tag)
{
children_.append(tag);
return children_[children_.size()-1];
};
//- Create and add a new child
xmlTag& addChild(const word& name)
{
@ -149,26 +149,26 @@ public:
{
name_ = tag.name_;
attributes_ = tag.attributes_;
children_ = tag.children_;
children_ = tag.children_;
OStringStream::rewind();
Foam::operator<<(*this, tag.str().c_str());
};
// Friend IOstream Operators
friend Ostream& operator<<(Ostream&, const xmlTag&);
template<class Form, class Cmpt, int nCmpt>
friend xmlTag& operator<<(xmlTag&, const VectorSpace<Form, Cmpt, nCmpt>&);
friend xmlTag& operator<<(xmlTag&, const labelledTri&);
template<class T, unsigned Size>
friend xmlTag& operator<<(xmlTag&, const FixedList<T, Size>&);
template<class T>
friend xmlTag& operator<<(xmlTag&, const LongList<T>&);
template<class T>
friend xmlTag& operator<<(xmlTag&, const UList<T>&);
};
@ -180,7 +180,7 @@ Ostream& operator<<(Ostream& os, const xmlTag& tag)
{
// Tag name
os << indent << '<' << tag.name_;
// Attributes and text
for
(
@ -191,24 +191,24 @@ Ostream& operator<<(Ostream& os, const xmlTag& tag)
{
os << token::SPACE << iter.key() << '=' << iter();
}
if (tag.str().size() || tag.children_.size())
{
os << '>' << nl;
// Children
os.incrIndent();
forAll(tag.children_, i)
{
os << tag.children_[i];
}
os.decrIndent();
// Tag text
os << tag.str().c_str();
// Close tag
os << indent << "</" << tag.name_ << '>' << endl;
}
@ -229,9 +229,9 @@ xmlTag& operator<<(xmlTag& tag, const UList<T>& data)
{
tag << data[i] << token::SPACE;
}
tag << nl;
return tag;
}
@ -243,9 +243,9 @@ xmlTag& operator<<(xmlTag& tag, const LongList<T>& data)
{
tag << data[i] << token::SPACE;
}
tag << nl;
return tag;
}
@ -258,9 +258,9 @@ xmlTag& operator<<(xmlTag& tag, const VectorSpace<Form, Cmpt, nCmpt>& data)
{
tag << data[i] << token::SPACE;
}
tag << nl;
return tag;
}
@ -272,9 +272,9 @@ xmlTag& operator<<(xmlTag& tag, const FixedList<T, Size>& data)
{
tag << data[i] << token::SPACE;
}
tag << nl;
return tag;
}
@ -282,10 +282,10 @@ xmlTag& operator<<(xmlTag& tag, const FixedList<T, Size>& data)
xmlTag& operator<<(xmlTag& tag, const labelledTri& data)
{
const triFace& tFace = data;
return tag << tFace;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View file

@ -39,27 +39,27 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
{
# include "setRootCase.H"
# include "createTime.H"
fileName inFileName;
Info << "Reading mesh from file " << endl;
cin >> inFileName;
IFstream file(inFileName);
polyMeshGen pmg(runTime);
polyMeshGenModifier meshModifier(pmg);
label counter;
//- read the number of vertices
pointFieldPMG& points = meshModifier.pointsAccess();
file >> counter;
//- read points from file
points.setSize(counter);
forAll(points, pointI)
@ -68,79 +68,79 @@ int main(int argc, char *argv[])
file >> p.x();
file >> p.y();
file >> p.z();
points[pointI] = p;
}
//- read the number of faces
file >> counter;
faceListPMG& faces = meshModifier.facesAccess();
//- read faces from file
faces.setSize(counter);
forAll(faces, faceI)
{
file >> counter;
face f;
f.setSize(counter);
forAll(f, pI)
file >> f[pI];
faces[faceI] = f.reverseFace();
}
//- read the number of cells
file >> counter;
//- read cells from file
cellListPMG& cells = meshModifier.cellsAccess();
cells.setSize(counter);
forAll(cells, cellI)
{
file >> counter;
cell& c = cells[cellI];
c.setSize(counter);
forAll(c, fI)
file >> c[fI];
}
//- read selections
file >> counter;
wordList patchNames;
Map<label> subsetToPatch;
for(label setI=0;setI<counter;++setI)
{
word sName;
file >> sName;
label type;
file >> type;
label nEntries;
file >> nEntries;
switch( type )
{
case 3:
{
//- face selection
const label id = pmg.addFaceSubset(sName);
patchNames.setSize(patchNames.size()+1);
patchNames[patchNames.size()-1] = sName;
subsetToPatch.insert(id, patchNames.size()-1);
Info << "Reading face selection " << sName << endl;
for(label i=0;i<nEntries;++i)
{
label entryI;
@ -152,7 +152,7 @@ int main(int argc, char *argv[])
{
//- cell selection
const label id = pmg.addCellSubset(sName);
for(label i=0;i<nEntries;++i)
{
label entryI;
@ -164,7 +164,7 @@ int main(int argc, char *argv[])
{
//- node selection
const label id = pmg.addPointSubset(sName);
for(label i=0;i<nEntries;++i)
{
label entryI;
@ -174,31 +174,31 @@ int main(int argc, char *argv[])
} break;
};
}
//- create patches from face selections
VRWGraph boundaryFaces;
labelLongList boundaryOwner;
labelLongList boundaryPatches;
const labelList& owner = pmg.owner();
DynList<label> faceSubsets;
pmg.faceSubsetIndices(faceSubsets);
forAll(faceSubsets, setI)
{
labelLongList setFaces;
pmg.facesInSubset(faceSubsets[setI], setFaces);
forAll(setFaces, i)
{
boundaryFaces.appendList(faces[setFaces[i]]);
boundaryOwner.append(owner[setFaces[i]]);
boundaryPatches.append(subsetToPatch[faceSubsets[setI]]);
}
pmg.removeFaceSubset(faceSubsets[setI]);
}
meshModifier.reorderBoundaryFaces();
meshModifier.replaceBoundary
(
@ -207,9 +207,9 @@ int main(int argc, char *argv[])
boundaryOwner,
boundaryPatches
);
pmg.write();
Info << "End\n" << endl;
return 0;
}

View file

@ -51,10 +51,10 @@ void getPatchIds
)
{
const geometricSurfacePatchList& origPatches = origSurf.patches();
// Create patch name map
HashSet<word> patchNameHash(patchNames);
// Find selected patches
label nFound = 0;
forAll(origPatches, patchI)
@ -65,7 +65,7 @@ void getPatchIds
nFound++;
}
}
if (nFound != patchNames.size())
{
WarningIn("getPatchIds")
@ -83,17 +83,17 @@ void copyFaceSubsets
{
DynList<label> subsetIds;
origSurf.facetSubsetIndices(subsetIds);
forAll(subsetIds, subsetI)
{
label newSubsetId = newSurf.addFacetSubset
(
origSurf.facetSubsetName(subsetI)
);
labelList origFaces;
labelList origFaces;
origSurf.facetsInSubset(subsetI, origFaces);
forAll(origFaces, faceI)
{
newSurf.addFacetToSubset
@ -115,17 +115,17 @@ void copyEdgeSubsets
{
DynList<label> subsetIds;
origSurf.edgeSubsetIndices(subsetIds);
forAll(subsetIds, subsetI)
{
label newSubsetId = newSurf.addEdgeSubset
(
origSurf.edgeSubsetName(subsetI)
);
labelList origEdges;
labelList origEdges;
origSurf.edgesInSubset(subsetI, origEdges);
forAll(origEdges, faceI)
{
newSurf.addEdgeToSubset
@ -147,17 +147,17 @@ void copyPointSubsets
{
DynList<label> subsetIds;
origSurf.pointSubsetIndices(subsetIds);
forAll(subsetIds, subsetI)
{
label newSubsetId = newSurf.addPointSubset
(
origSurf.pointSubsetName(subsetI)
);
labelList origPoints;
labelList origPoints;
origSurf.pointsInSubset(subsetI, origPoints);
forAll(origPoints, faceI)
{
newSurf.addPointToSubset
@ -181,20 +181,20 @@ autoPtr<triSurf> mergeSurfacePatches
{
const geometricSurfacePatchList& origPatches = origSurf.patches();
const LongList<labelledTri>& origFacets = origSurf.facets();
label newPatchId = origPatches.size();
// Determine new patch type
word newPatchType = origPatches[patchIds[0]].geometricType();
// Create patch addressing
List<DynamicList<label> > patchAddr(origPatches.size()+1);
forAll(origFacets, faceI)
{
patchAddr[origFacets[faceI].region()].append(faceI);
}
// Move selected patches to new patch
forAll(patchIds, patchI)
{
@ -205,35 +205,35 @@ autoPtr<triSurf> mergeSurfacePatches
// Create new facets list
LongList<labelledTri> newFacets(origFacets.size());
labelList newFaceAddr(origFacets.size(), -1);
label patchCount = 0;
label faceI = 0;
forAll(patchAddr, patchI)
{
const unallocLabelList& addr = patchAddr[patchI];
if(addr.size())
{
forAll(addr, i)
{
newFacets[faceI] = origFacets[addr[i]];
newFacets[faceI].region() = patchCount;
newFaceAddr[addr[i]] = faceI;
faceI++;
}
}
if(addr.size() || keepPatches)
{
patchCount++;
}
}
// Create new patch list
geometricSurfacePatchList newPatches(patchCount);
patchCount = 0;
forAll(origPatches, patchI)
{
@ -243,13 +243,13 @@ autoPtr<triSurf> mergeSurfacePatches
newPatches[patchCount] = origPatches[patchI];
newPatches[patchCount].index() = patchCount;
}
if(patchAddr[patchI].size() || keepPatches)
{
patchCount++;
}
}
// Add new patch if it contains faces
if(patchAddr[patchAddr.size()-1].size())
{
@ -264,7 +264,7 @@ autoPtr<triSurf> mergeSurfacePatches
{
patchCount++;
}
// Create new surface
autoPtr<triSurf> newSurf
(
@ -276,17 +276,17 @@ autoPtr<triSurf> mergeSurfacePatches
origSurf.points()
)
);
// Transfer face subsets
copyFaceSubsets(origSurf, newSurf());
newSurf->updateFacetsSubsets(newFaceAddr);
// Transfer feature edge subsets
copyEdgeSubsets(origSurf, newSurf());
// Transfer point subsets
copyPointSubsets(origSurf, newSurf());
// Done
return newSurf;
}
@ -309,18 +309,18 @@ int main(int argc, char *argv[])
// Process commandline arguments
fileName inFileName(args.args()[1]);
word newPatchName(args.args()[2]);
fileName outFileName(inFileName);
if( args.options().found("output") )
{
outFileName = args.options()["output"];
}
bool keepPatches = false;
if( args.options().found("keep") )
{
keepPatches = true;
@ -328,10 +328,10 @@ int main(int argc, char *argv[])
// Read original surface
triSurf origSurf(inFileName);
// Get patch ids
DynamicList<label> patchIds;
if (args.options().found("patchNames"))
{
if (args.options().found("patchIds"))
@ -339,10 +339,10 @@ int main(int argc, char *argv[])
FatalError() << "Cannot specify both patch names and ids"
<< Foam::abort(FatalError);
}
IStringStream is(args.options()["patchNames"]);
wordList patchNames(is);
getPatchIds
(
origSurf,
@ -353,32 +353,32 @@ int main(int argc, char *argv[])
if (args.options().found("patchIds"))
{
IStringStream is(args.options()["patchIds"]);
patchIds = labelList(is);
}
if (args.options().found("patchIds"))
{
IStringStream is(args.options()["patchIds"]);
patchIds.append(labelList(is));
}
if (args.options().found("patchIdRange"))
{
IStringStream is(args.options()["patchIdRange"]);
Pair<label> idRange(is);
for(label id = idRange.first(); id <= idRange.second(); id++)
{
patchIds.append(id);
}
}
}
if (!patchIds.size())
{
FatalError() << "No patches specified"
<< Foam::abort(FatalError);
}
// Merge patches
autoPtr<triSurf> newSurf = mergeSurfacePatches
(
@ -387,16 +387,16 @@ int main(int argc, char *argv[])
newPatchName,
keepPatches
);
// Write new surface mesh
newSurf->writeSurface(outFileName);
Info << "Original surface patches: " << origSurf.patches().size() << endl;
Info << "Final surface patches: " << newSurf->patches().size() << endl;
Info << "Surface written to " << outFileName << endl;
Info << "End\n" << endl;
return 0;
}

View file

@ -43,15 +43,15 @@ int main(int argc, char *argv[])
polyMeshGen pmg(runTime);
pmg.read();
if( Pstream::parRun() )
{
polyMeshGenModifier(pmg).addBufferCells();
createFIRESelections(pmg);
}
writeMeshFPMA(pmg, "convertedMesh");
Info << "End\n" << endl;
return 0;
}

View file

@ -24,53 +24,53 @@ def extractFeatureEdges(body, minFeatureAngle = 5):
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
# Check the body type
if not (body.GetShapeType() in [GEOM.SHELL, GEOM.SOLID, GEOM.FACE, GEOM.COMPOUND]):
raise RuntimeError('Supplied object is not a solid, shell or face.')
print 'Extracting edges of %s with feature angle > %g.' % (body.GetName(), minFeatureAngle)
# Extract basic info
faces = geompy.SubShapeAll(body, geompy.ShapeType["FACE"])
curves = geompy.SubShapeAll(body, geompy.ShapeType["EDGE"])
points = geompy.SubShapeAll(body, geompy.ShapeType["VERTEX"])
faceIds = geompy.GetSubShapesIDs(body, faces)
curveIds = geompy.GetSubShapesIDs(body, curves)
nodeIds = geompy.GetSubShapesIDs(body, points)
maxFaceId = max(faceIds)
maxCurveId = max(curveIds)
maxNodeId = max(nodeIds)
# Reverse mapping from curve id to local curve arrays
faceMap = [-1 for i in xrange(maxFaceId+1)]
for localId, id in enumerate(faceIds):
faceMap[id] = localId
curveMap = [-1 for i in xrange(maxCurveId+1)]
for localId, id in enumerate(curveIds):
curveMap[id] = localId
nodeMap = [-1 for i in xrange(maxNodeId+1)]
for localId, id in enumerate(nodeIds):
nodeMap[id] = localId
# Get curves on each face
faceCurveIds = [[curveMap[id] for id in geompy.GetSubShapesIDs(
body,
geompy.SubShapeAll(face, geompy.ShapeType["EDGE"])
)] for face in faces]
# Get faces attached to each curve
curveFaceIds = [[] for id in curveIds]
for faceI, ids in enumerate(faceCurveIds):
for id in ids:
curveFaceIds[id].append(faceI)
# Now that we have the connectivity for curves and faces find the
# feature edges
featureEdgeIds = []
@ -87,21 +87,21 @@ def extractFeatureEdges(body, minFeatureAngle = 5):
angle = geompy.GetAngle(n1, n2)
if angle > minFeatureAngle:
featureEdgeIds.append(curveId)
elif len(adjFaceIds) == 1:
# Curve on standalone face - Add by default
featureEdgeIds.append(curveId)
elif len(adjFaceIds) == 0:
# Standalone curve - Ignore
None
else:
raise RuntimeError('Curve found sharing %d faces. This is unexpected for fully enclosed bodies.' % len(adjFaceIds))
# Done
print "%d feature edges found" % len(featureEdgeIds)
return featureEdgeIds
@ -110,22 +110,22 @@ def extractFeatureEdges(body, minFeatureAngle = 5):
if __name__ == '__main__':
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
# Get current GUI selection
selected = salome.sg.getAllSelected()
if len(selected) != 1:
raise RuntimeError('A single solid, shell or face object must be selected.')
body = salome.myStudy.FindObjectID(selected[0]).GetObject()
# Get feature edges and add to the group 'featureEdges'
featureEdges = geompy.CreateGroup(body, geompy.ShapeType["EDGE"])
geompy.UnionIDs(featureEdges, extractFeatureEdges(body))
geompy.addToStudyInFather(body, featureEdges, 'featureEdges')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)

View file

@ -52,28 +52,28 @@ class triSurf:
from salome.smesh import smeshBuilder
from operator import itemgetter
from collections import OrderedDict
import SMESH, SALOMEDS
# =============================================================================
# Get the Salome mesh object
if object is None:
selected = salome.sg.getAllSelected()
if len(selected) != 1:
raise RuntimeError('A single Salome mesh object must be selected.')
object = salome.myStudy.FindObjectID(selected[0]).GetObject()
try:
object.GetMesh()
except:
raise RuntimeError('Supplied object is not a Salome SMESH mesh.')
smesh = smeshBuilder.New(salome.myStudy)
mesh = smesh.Mesh(object)
print "Converting SMESH Mesh '%s'" % mesh.GetName()
# =============================================================================
# Get basic mesh info
nNodes = mesh.NbNodes()
@ -83,11 +83,11 @@ class triSurf:
nodeIds = mesh.GetNodesId()
faceIds = mesh.GetElementsByType(SMESH.FACE)
edgeIds = mesh.GetElementsByType(SMESH.EDGE)
# Check that mesh is strictly triangular
if nFaces != nTris:
raise RuntimeError('Mesh is not strictly triangular')
# Get patch and subset names & ids
# All SMESH.FACE groups are assumed to be patches
# All SMESH.EDGE groups are assumed to be feature subsets
@ -95,7 +95,7 @@ class triSurf:
patches = OrderedDict()
pointSubsets = OrderedDict()
featureEdgeSubsets = OrderedDict()
for group in mesh.GetGroups():
if group.GetType() == SMESH.FACE:
patches[group.GetName()] = group.GetIDs()
@ -103,7 +103,7 @@ class triSurf:
featureEdgeSubsets[group.GetName()] = group.GetIDs()
elif group.GetType() == SMESH.NODE:
pointSubsets[group.GetName()] = group.GetIDs()
# =============================================================================
# Process faces and patches
# Get patchId for each face
@ -117,44 +117,44 @@ class triSurf:
else:
print "Face %d is assigned to both groups %s and %s" % (faceId, name, patches.keys()[patchIds[faceId-1]])
raise RuntimeError('Groups of faces are not unique, i.e. they overlap.')
patchId += 1
# Compact and reorder patchIds to match faceIds
patchIds = [patchIds[faceId-1] for faceId in faceIds]
# Reorder faces by increasing group id
faceAndpatchIds = sorted(zip(faceIds, patchIds), key=itemgetter(1))
faceIds, patchIds = zip(*faceAndpatchIds)
# Add unused faces to the default patch
defaultFaces = [faceId for faceId, patchId in faceAndpatchIds if patchId == lastPatchId]
if len(defaultFaces) > 0:
patches['defaultFaces'] = defaultFaces
defaultFaces = None
# =============================================================================
# Process feature edges
if not allEdges:
edgeIds = []
for name, ids in featureEdgeSubsets.iteritems():
edgeIds += ids
edgeIds = list(set(edgeIds))
nEdges = len(edgeIds)
# Reverse mapping of edge ids since they aren't necessarily numbered 1..nEdges
if len(edgeIds):
edgeMap = [-1] * max(edgeIds)
else:
edgeMap = []
i=0
for edgeId in edgeIds:
edgeMap[edgeId-1] = i
i += 1
# =============================================================================
# Process nodes
# Reverse mapping of node ids since nodes aren't necessarily numbered 1..nNodes
@ -163,77 +163,77 @@ class triSurf:
for nodeId in nodeIds:
nodeMap[nodeId-1] = i
i += 1
# =============================================================================
self._mesh = mesh
self._nodeIds = nodeIds
self._edgeIds = edgeIds
self._faceIds = faceIds
self._nodeMap = nodeMap
self._edgeMap = edgeMap
self._faceMap = []
self._patches = patches
self._pointSubsets = pointSubsets
self._featureEdgeSubsets = featureEdgeSubsets
self._faceSubsets = {}
print 'Done'
def nNodes(self):
'''
Return the number of nodes
'''
return len(self._nodeIds)
def nEdges(self):
'''
Return the number of edges
'''
return len(self._edgeIds)
def nFacets(self):
'''
Return the number of triangular facets
'''
return len(self._faceIds)
def nPatches(self):
'''
Return the number of patches
'''
return len(self._patches)
def _writePatchDefs(self, f, typeName = 'wall'):
'''
Write the patch definitions to file as an OpenFOAM geometricSurfacePatchList.
NOTE: All patches are assumed to be walls.
'''
patches = self._patches
f.write('%d\n(\n' % len(patches))
for name in patches.iterkeys():
f.write('%s\t%s\n' % (name, typeName))
f.write(')\n')
def _writeNodes(self, f):
'''
Write the nodes to file as an OpenFOAM pointField.
'''
mesh = self._mesh
nodeIds = self._nodeIds
f.write('%d\n(\n' % len(nodeIds))
for x, y, z in [mesh.GetNodeXYZ(nodeId) for nodeId in nodeIds]:
f.write( '( %g %g %g )\n' % (x, y, z))
f.write(')\n')
def _writeFeatureEdges(self, f):
'''
Write the feature edges to file as an OpenFOAM edgeList.
@ -241,35 +241,35 @@ class triSurf:
mesh = self._mesh
nodeMap = self._nodeMap
edgeIds = self._edgeIds
f.write('%d\n(\n' % len(edgeIds))
for edgeId in edgeIds:
nodes = mesh.GetElemNodes(edgeId)
f.write( '(' + ' '.join([str(nodeMap[nodeId-1]) for nodeId in nodes]) + ')\n')
f.write(')\n')
def _writeFacets(self, f):
'''
Write the facets to file as an OpenFOAM List of labelledTri.
'''
from itertools import chain
mesh = self._mesh
nodeMap = self._nodeMap
patches = self._patches
f.write('%d\n(\n' % sum([len(patch) for patch in patches.itervalues()]))
patchId = 0
for patchId, (patchName, faceIds) in enumerate(patches.iteritems()):
for faceId in faceIds:
nodes = mesh.GetElemNodes(faceId)
f.write( '((' + ' '.join([str(nodeMap[nodeId-1]) for nodeId in nodes]) + ') %d)\n' % patchId)
f.write(')\n')
def _writeSubsets(self, f, subsets, map, typeId):
'''
General function to write a subset to file as an OpenFOAM Map<meshSubset>.
@ -277,72 +277,72 @@ class triSurf:
f.write('%d\n(\n' % len(subsets))
for name, ids in subsets.iteritems():
f.write('%s %s %d ( %s )\n' % (name, typeId, len(ids), ' '.join([str(map[id-1]) for id in ids])))
f.write(')\n')
def _writePointSubsets(self, f):
'''
Write the point subsets to file as and OpenFOAM Map<meshSubset>.
'''
self._writeSubsets(f, self._pointSubsets, self._nodeMap, '2')
def _writeFaceSubsets(self, f):
'''
Write the face subsets to file as and OpenFOAM Map<meshSubset>.
'''
self._writeSubsets(f, self._faceSubsets, self._faceMap, '4')
def _writeFeatureEdgeSubsets(self, f):
'''
Write the feature edge subsets to file as and OpenFOAM Map<meshSubset>.
'''
self._writeSubsets(f, self._featureEdgeSubsets, self._edgeMap, '8')
def writeEdgeMesh(self, fileName):
'''
Write to file as an OpenFOAM edgeMesh
fileName - The file name to write
'''
# Create file
f = open(fileName, 'wb') # NOTE: file opened as binary to ensure unix-style line breaks
# Write header
f.write(foamHeader('edgeMesh', self._mesh.GetName()))
self._writeNodes(f)
self._writeFeatureEdges(f)
f.close()
print 'edgeMesh written to %s' % fileName
def writeFtr(self, fileName):
'''
Write to file as an OpenFOAM cfMesh FTR file
fileName - the file name to write
'''
# Create file
f = open(fileName, 'wb') # NOTE: file opened as binary to ensure unix-style line breaks
self._writePatchDefs(f)
self._writeNodes(f)
self._writeFacets(f)
f.close()
print 'triSurf written to %s' % fileName
def writeFms(self, fileName):
'''
Write to file as an OpenFOAM cfMesh FMS file
fileName - the file name to write
'''
# Create file
f = open(fileName, 'wb') # NOTE: file opened as binary to ensure unix-style line breaks
self._writePatchDefs(f)
self._writeNodes(f)
self._writeFacets(f)
@ -350,14 +350,14 @@ class triSurf:
self._writePointSubsets(f)
self._writeFaceSubsets(f)
self._writeFeatureEdgeSubsets(f)
f.close()
print 'triSurf written to %s' % fileName
if __name__ == '__main__':
import salome
salome.salome_init()
import SMESH, SALOMEDS

View file

@ -22,7 +22,7 @@ License
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
Reads the specified surface and writes it in the fms format.
Reads the specified surface and writes it in the fms format.
\*---------------------------------------------------------------------------*/

View file

@ -1 +1 @@
find . ! -name 'All*' | xargs rm -rf
find . ! -name 'All*' | xargs rm -rf

View file

@ -246,7 +246,7 @@ public:
inline dimensionedScalar rotAngle() const;
// Non-constant access to
// Non-constant access to
//- Set position of origin
inline void setXrel(const vector& x);

View file

@ -113,7 +113,7 @@ public:
{
return source_;
}
// Member operators

View file

@ -112,7 +112,7 @@ gradScheme<Type>::fvmGrad
(
"tmp<BlockLduSystem> gradScheme<Type>::fvmGrad\n"
"(\n"
" GeometricField<Type, fvPatchField, volMesh>&"
" GeometricField<Type, fvPatchField, volMesh>&"
")\n"
) << "Implicit gradient operator currently defined only for Gauss linear "
<< "and leastSquares (cell and face limiters are optional)."

View file

@ -97,7 +97,7 @@ public:
const GeometricField<Type, fvPatchField, volMesh>&
) const;
//- Return the BlockLduSystem corresponding to the implicit least
//- Return the BlockLduSystem corresponding to the implicit least
// quares grad discretization. For block coupled systems.
tmp
<

View file

@ -312,7 +312,7 @@ void Foam::fvBlockMatrix<Type>::updateCouplingCoeffs
const Field<matrixType>& icp = matrix.internalCoeffs()[patchI];
const Field<matrixType>& bcp = matrix.boundaryCoeffs()[patchI];
if
if
(
this->coupleUpper()[patchI].activeType()
!= blockCoeffBase::SQUARE

View file

@ -219,7 +219,7 @@ public:
const bool incrementColumnDir
);
//- Insert scalar equation coupling into this fvBlockMatrix
//- Insert scalar equation coupling into this fvBlockMatrix
// Source compensation is done in function updateSourceCoupling()
// after all coupling terms are added. HJ, 27/Apr/2015
void insertEquationCoupling
@ -228,7 +228,7 @@ public:
const direction dirJ,
const scalarField& coeffIJ
);
//- Add field into block field
void blockAdd
(
@ -239,7 +239,7 @@ public:
//- Update coupling of block system.
// Subtracts the block-coefficient coupling as specified by the
// user from the source, leaving the implicit update given by
// user from the source, leaving the implicit update given by
// linearisation
void updateSourceCoupling();

View file

@ -156,7 +156,7 @@ Foam::immersedBoundaryFvPatch::toIbPoints
// const labelledTri& tri = faces[hf[cellI]];
// triPointRef triPt = faces[hf[cellI]].tri(triPoints);
// ibPsi[cellI] =
// ibPsi[cellI] =
// triValues[tri[0]]*triPt.Ni(0, p[cellI])
// + triValues[tri[1]]*triPt.Ni(1, p[cellI])
// + triValues[tri[2]]*triPt.Ni(2, p[cellI]);

View file

@ -651,7 +651,7 @@ void immersedBoundaryFvPatchField<Type>::correctOffDiag
eqn.internalCoeffs()[patchi][patchFacei] =
pTraits<Type>::zero;
eqn.boundaryCoeffs()[patchi][patchFacei] =
pTraits<Type>::zero;
@ -717,7 +717,7 @@ void immersedBoundaryFvPatchField<Type>::motionUpdate() const
template<class Type>
void immersedBoundaryFvPatchField<Type>::setIbCellValues
(
const Field<Type>& ibcValues
const Field<Type>& ibcValues
) const
{
const labelList& ibc = ibPatch_.ibCells();

View file

@ -258,7 +258,7 @@ void immersedBoundaryOmegaWallFunctionFvPatchScalarField::updateCoeffs()
if (yPlusSample > yPlusLam)
{
// Calculate tauW from log-law using k and U at sampling point
tauW = UtanOld[ibCellI]*Cmu25*sqrt(k[ibCellI])*kappa_
/log(E_*yPlusSample);
}
@ -288,12 +288,12 @@ void immersedBoundaryOmegaWallFunctionFvPatchScalarField::updateCoeffs()
G[ibc[ibCellI]] =
sqr((nutw + nuLam)*magGradUw[ibCellI])/
(Cmu25*sqrt(k[ibCellI])*kappa_*y[ibCellI]);
// Compute k at the IB cell
// Compute k at the IB cell
kNew[ibCellI] = tauW/Cmu50; // equilibrium boundary layer
// kNew[ibCellI] = k[ibCellI]; // zero-Gradient (less stable)
// Compute omega at the IB cell
// Compute omega at the IB cell
omegaNew[ibCellI] = sqrt(kNew[ibCellI])/(Cmu25*kappa_*y[ibCellI]);
// Log-Law for tangential velocity - uTau = Cmu25*sqrt(kNew)
@ -313,7 +313,7 @@ void immersedBoundaryOmegaWallFunctionFvPatchScalarField::updateCoeffs()
// quadratic fit
kNew[ibCellI] = k[ibCellI]*sqr(yPlusIB/yPlusLam);
// Compute omega at the IB cell
// Compute omega at the IB cell
omegaNew[ibCellI] = 6.0*nu[ibCellI]/(beta1_*sqr(y[ibCellI]));
// Laminar sub-layer for tangential velocity: uPlus = yPlus

View file

@ -42,7 +42,7 @@ namespace RASModels
void immersedBoundaryVelocityWallFunctionFvPatchVectorField::setIbCellValues
(
const vectorField& ibcValues
const vectorField& ibcValues
) const
{
const labelList& ibc = ibPatch().ibCells();

View file

@ -53,7 +53,7 @@ void immersedBoundaryWallFunctionFvPatchField<Type>::motionUpdate() const
template<class Type>
void immersedBoundaryWallFunctionFvPatchField<Type>::setIbCellValues
(
const Field<Type>& ibcValues
const Field<Type>& ibcValues
) const
{
const labelList& ibc = this->ibPatch().ibCells();

View file

@ -76,24 +76,24 @@ void cartesianMeshExtractor::decomposeSplitHexes()
void cartesianMeshExtractor::createMesh()
{
Info << "Extracting polyMesh" << endl;
//- create points and pointLeaves addressing
createPointsAndAddressing();
//- create the mesh
createPolyMesh();
//- decompose split-hex cells into tetrahedra and pyramids
decomposeSplitHexesIntoTetsAndPyramids();
//- remove unused vertices
polyMeshGenModifier(mesh_).removeUnusedVertices();
Info << "Mesh has :" << nl
<< mesh_.points().size() << " vertices " << nl
<< mesh_.faces().size() << " faces" << nl
<< mesh_.cells().size() << " cells" << endl;
if( Pstream::parRun() )
{
label nCells = mesh_.cells().size();
@ -112,7 +112,7 @@ void cartesianMeshExtractor::createMesh()
<< " This can be reolved by reducing the maxCellSize by a fraction."
<< "i.e. 2.49999 instead of 2.5." << exit(FatalError);
}
Info << "Finished extracting polyMesh" << endl;
}

View file

@ -42,7 +42,7 @@ SourceFiles
namespace Foam
{
class IOdictionary;
/*---------------------------------------------------------------------------*\
@ -54,13 +54,13 @@ class cartesianMeshExtractor
// Private data
//- reference to the octree addressing
meshOctreeAddressing octreeCheck_;
//- reference to the mesh
polyMeshGen& mesh_;
//- decompose split hex cells
bool decomposeSplitHexes_;
//- cell label for a given leaf
labelList* leafCellLabelPtr_;
@ -73,7 +73,7 @@ class cartesianMeshExtractor
//- create mesh data
void createPolyMesh();
//- decompose split hexes into pyramids and tets
void decomposeSplitHexesIntoTetsAndPyramids();
@ -105,7 +105,7 @@ public:
//- decompose split hexes into standard cells
void decomposeSplitHexes();
//- create the mesh with the above options
void createMesh();
};

View file

@ -45,39 +45,39 @@ void cartesianMeshExtractor::decomposeSplitHexesIntoTetsAndPyramids()
if( !decomposeSplitHexes_ ) return;
Info << "Decomposing split-hex cells" << endl;
const faceListPMG& faces = mesh_.faces();
//- decompose faces which have more than 4 vertices
boolList decompose(faces.size(), false);
label nDecomposed(0);
forAll(faces, faceI)
{
if( faces[faceI].size() > 4 )
{
++nDecomposed;
decompose[faceI] = true;
}
}
reduce(nDecomposed, sumOp<label>());
Info << "Decomposing " << nDecomposed
<< " faces with more than 4 vertices" << endl;
if( nDecomposed != 0 )
{
//- decompose marked faces into triangles
decomposeFaces(mesh_).decomposeMeshFaces(decompose);
}
//- decompose cells with 24 faces
const cellListPMG& cells = mesh_.cells();
decompose.setSize(cells.size());
decompose = false;
hexMatcher hex;
forAll(cells, cellI)
{
@ -87,19 +87,19 @@ void cartesianMeshExtractor::decomposeSplitHexesIntoTetsAndPyramids()
decompose[cellI] = true;
}
}
reduce(nDecomposed, sumOp<label>());
Info << "Decomposing " << nDecomposed
<< " cells into tetrahedra and pyramids" << endl;
if( nDecomposed )
{
//- decompose marked cells into tets and pyramids
decomposeCells dc(mesh_);
dc.decomposeMesh(decompose);
}
Info << "Finished decomposing split-hex cells" << endl;
}

View file

@ -46,25 +46,25 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
{
if( !patchWiseLayers_ )
return;
Info << "Checking topology of boundary faces" << endl;
labelHashSet usedPatches;
forAll(patchLabels, i)
usedPatches.insert(patchLabels[i]);
//- create a set of patch pairs. These are pairs at which the layers
//- shall be terminated
std::set<std::pair<label, label> > terminatedPairs;
forAll(treatPatchesWithPatch_, patchI)
{
const DynList<label>& otherPatches = treatPatchesWithPatch_[patchI];
forAll(otherPatches, patchJ)
{
if( patchI == otherPatches[patchJ] )
continue;
terminatedPairs.insert
(
std::make_pair
@ -75,48 +75,48 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
);
}
}
bool changed;
label nDecomposed(0);
boolList decomposeCell(mesh_.cells().size(), false);
do
{
changed = false;
const meshSurfaceEngine& mse = this->surfaceEngine();
const faceList::subList& bFaces = mse.boundaryFaces();
const labelList& faceOwner = mse.faceOwners();
const labelList& facePatches = mse.boundaryFacePatches();
const VRWGraph& faceEdges = mse.faceEdges();
const VRWGraph& edgeFaces = mse.edgeFaces();
const Map<label>& otherProcPatch = mse.otherEdgeFacePatch();
VRWGraph newBoundaryFaces;
labelLongList newBoundaryOwners;
labelLongList newBoundaryPatches;
forAll(bFaces, bfI)
{
const face& bf = bFaces[bfI];
const label fPatch = facePatches[bfI];
if( !usedPatches.found(fPatch) )
continue;
//- find patches of neighbour faces
labelList neiPatches(bf.size());
forAll(bf, eI)
{
const label beI = faceEdges(bfI, eI);
if( edgeFaces.sizeOfRow(beI) == 2 )
{
label neiFace = edgeFaces(beI, 0);
if( neiFace == bfI )
neiFace = edgeFaces(beI, 1);
neiPatches[eI] = facePatches[neiFace];
}
else if( edgeFaces.sizeOfRow(beI) == 1 )
@ -125,7 +125,7 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
neiPatches[eI] = otherProcPatch[beI];
}
}
//- find feature edges and check if the patches meeting there
//- shall be treated together.
bool storedFace(false);
@ -133,16 +133,16 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
{
if( neiPatches[eI] == fPatch )
continue;
std::pair<label, label> pp
(
Foam::min(fPatch, neiPatches[eI]),
Foam::max(fPatch, neiPatches[eI])
);
if( terminatedPairs.find(pp) == terminatedPairs.end() )
continue;
//- create a new face from this edge and the neighbouring edges
bool usePrev(false), useNext(false);
if( neiPatches[neiPatches.rcIndex(eI)] == fPatch )
@ -156,11 +156,11 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
Foam::min(fPatch, neiPatches[neiPatches.rcIndex(eI)]),
Foam::max(fPatch, neiPatches[neiPatches.rcIndex(eI)])
);
if( terminatedPairs.find(ppPrev) == terminatedPairs.end() )
usePrev = true;
}
if( neiPatches[neiPatches.fcIndex(eI)] == fPatch )
{
useNext = true;
@ -172,11 +172,11 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
Foam::min(fPatch, neiPatches[neiPatches.fcIndex(eI)]),
Foam::max(fPatch, neiPatches[neiPatches.fcIndex(eI)])
);
if( terminatedPairs.find(ppNext) == terminatedPairs.end() )
useNext = true;
}
DynList<edge> removeEdges;
if( useNext && usePrev )
{
@ -197,7 +197,7 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
removeEdges[0] = bf.faceEdge(neiPatches.rcIndex(eI));
removeEdges[1] = bf.faceEdge(eI);
}
const face cutFace = help::removeEdgesFromFace(bf, removeEdges);
if( cutFace.size() > 2 )
{
@ -212,19 +212,19 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
newBoundaryOwners.append(faceOwner[bfI]);
newBoundaryPatches.append(fPatch);
}
if( (cutFace.size() > 2) && (rFace.size() > 2) )
{
decomposeCell[faceOwner[bfI]] = true;
changed = true;
++nDecomposed;
}
storedFace = true;
break;
}
if( !storedFace )
{
newBoundaryFaces.appendList(bf);
@ -232,10 +232,10 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
newBoundaryPatches.append(fPatch);
}
}
//- Finally, replace the boundary faces
reduce(changed, maxOp<bool>());
if( changed )
{
polyMeshGenModifier(mesh_).replaceBoundary
@ -245,24 +245,24 @@ void boundaryLayers::checkTopologyOfBoundaryFaces(const labelList& patchLabels)
newBoundaryOwners,
newBoundaryPatches
);
clearOut();
}
} while( changed );
//- decompose owner cells adjacent to the decomposed faces
reduce(nDecomposed, sumOp<label>());
if( nDecomposed != 0 )
{
FatalError << "Critical. Not tested" << exit(FatalError);
decomposeCells dc(mesh_);
dc.decomposeMesh(decomposeCell);
clearOut();
}
mesh_.write();
Info << "Finished checking topology" << endl;
}

View file

@ -33,21 +33,21 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void boundaryLayers::addWrapperLayer()
{
createOTopologyLayers();
if( treatedPatch_[0] ) return;
const meshSurfaceEngine& mse = surfaceEngine();
const labelList& bPoints = mse.boundaryPoints();
boolList treatPatches(mesh_.boundaries().size(), true);
labelLongList newLabelForVertex(nPoints_, -1);
pointFieldPMG& points = mesh_.points();
@ -57,13 +57,13 @@ void boundaryLayers::addWrapperLayer()
points[nPoints_] = points[bPoints[bpI]];
newLabelForVertex[bPoints[bpI]] = nPoints_++;
}
createNewFacesAndCells(treatPatches);
forAll(treatPatches, patchI)
if( treatPatches[patchI] )
treatedPatch_[patchI] = true;
//- delete surface engine
clearOut();
}

View file

@ -54,51 +54,51 @@ namespace Foam
class extrudeLayer
{
// Private data
//- Reference to the mesh
polyMeshGen& mesh_;
//- thickness
const scalar thickness_;
const scalar thickness_;
//- number of points in the original mesh
const label nOrigPoints_;
//- number of faces in the original mesh
const label nOrigFaces_;
//- number of cells in the original mesh
const label nOrigCells_;
//- pairs of faces making the extruded front
LongList<labelPair> extrudedFaces_;
//- store the orientation of the extruded front
//- true if the pair has the same orientation and false otherwise
LongList<bool> pairOrientation_;
//- original point label
labelLongList origPointLabel_;
// Private member functions
//- duplicate faces which will be extruded
void createDuplicateFrontFaces(const LongList<labelPair>&);
//- create new vertices and open the mesh
void createNewVertices();
//- move points to make space for the new cells
void movePoints();
//- create layer cells
void createLayerCells();
//- create new faces at parallel boundaries
void createNewFacesParallel();
//- update boundary patches
void updateBoundary();
// Nested classes
//- this class provides addressing data needed for generating
//- cells emerging as a consequence of self-intersecting layers
@ -107,18 +107,18 @@ class extrudeLayer
// Private data
//- const reference to mesh faces
const faceListPMG& faces_;
//- const reference to extruded face pairs
const LongList<labelPair>& extrudedFaces_;
//- const reference telling the orientation of each face pair
LongList<bool> pairOrientation_;
//- const reference to the extruded faces at points
const VRWGraph& pointExtruded_;
public:
// Construct from faces, extruded face pairs and
// point-extrudedfaces addressing
addressingCalculator
@ -128,41 +128,41 @@ class extrudeLayer
const LongList<bool>& pairOrientation,
const VRWGraph& pointFaces
);
// Destructor
~addressingCalculator();
// Member functions
//- return label of the original face for the given face
inline label origFaceLabel(const label extrudedI) const;
//- return position of point in extruded face
inline label positionInFace
(
const label extrudedI,
const label pointI
) const;
//- return point label in the original face
inline label origPointLabel
(
const label extrudedI,
const label pos
) const;
inline label origPoint
(
const label extrudedI,
const label pointI
) const;
//- find face sharing an edge with the given face
inline label faceSharingEdge
(
const label extrudedI,
const label eI
) const;
//- find faces attached to both points
inline void facesSharingEdge
(
@ -171,7 +171,7 @@ class extrudeLayer
DynList<label>&
) const;
};
// Enumerators
enum extrudeLayerTypes_
{
@ -179,17 +179,17 @@ class extrudeLayer
FRONTVERTEX = 1,
FRONTVERTEXPROCBND = 2
};
//- Disallow bitwise copy construct
extrudeLayer(const extrudeLayer&);
//- Disallow bitwise assignment
void operator=(const extrudeLayer&);
public:
// Constructors
//- Construct from mesh, extrusion faces, thickness and number of layers
extrudeLayer
(
@ -197,10 +197,10 @@ class extrudeLayer
const LongList<labelPair>& extrusionFront,
const scalar thickness = -1.0
);
// Destructor
~extrudeLayer();
// Public member functions
};

View file

@ -49,10 +49,10 @@ inline label extrudeLayer::addressingCalculator::positionInFace
) const
{
const face& f = faces_[extrudedFaces_[extrudedI].first()];
return f.which(pointI);
}
inline label extrudeLayer::addressingCalculator::origPointLabel
(
const label extrudedI,
@ -60,7 +60,7 @@ inline label extrudeLayer::addressingCalculator::origPointLabel
) const
{
const face& of = faces_[extrudedFaces_[extrudedI].second()];
if( pairOrientation_[extrudedI] )
{
return of[pos];
@ -69,13 +69,13 @@ inline label extrudeLayer::addressingCalculator::origPointLabel
{
return of[(of.size()-pos)%of.size()];
}
FatalErrorIn
(
"label extrudeLayer::addressingCalculator::origPointLabel"
"(const label, const label) const"
) << "Cannot find point for the given position" << abort(FatalError);
return -1;
}
@ -88,7 +88,7 @@ inline label extrudeLayer::addressingCalculator::origPoint
const face& f = faces_[extrudedFaces_[extrudedI].first()];
const face& of = faces_[extrudedFaces_[extrudedI].second()];
const label pos = f.which(pointI);
if( pairOrientation_[extrudedI] )
{
return of[pos];
@ -97,13 +97,13 @@ inline label extrudeLayer::addressingCalculator::origPoint
{
return of[(of.size()-pos)%of.size()];
}
FatalErrorIn
(
"label extrudeLayer::addressingCalculator::origPoint"
"(const label, const label) const"
) << "Cannot find point for the given position" << abort(FatalError);
return -1;
}
@ -114,18 +114,18 @@ inline label extrudeLayer::addressingCalculator::faceSharingEdge
) const
{
const face& f = faces_[extrudedFaces_[extrudedI].first()];
const label pointI = f[eI];
const label nextI = f.nextLabel(eI);
label otherFace(-1);
forAllRow(pointExtruded_, pointI, pfI)
{
const label currFaceI = pointExtruded_(pointI, pfI);
if( currFaceI == extrudedI )
continue;
if( pointExtruded_.contains(nextI, currFaceI) )
{
if( otherFace != -1 )
@ -135,11 +135,11 @@ inline label extrudeLayer::addressingCalculator::faceSharingEdge
"(const label, const label) const"
) << "Expected only one such face"
<< abort(FatalError);
otherFace = currFaceI;
}
}
return otherFace;
}
@ -151,11 +151,11 @@ inline void extrudeLayer::addressingCalculator::facesSharingEdge
) const
{
edgeFaces.clear();
forAllRow(pointExtruded_, start, pfI)
{
const label currFaceI = pointExtruded_(start, pfI);
if( pointExtruded_.contains(end, currFaceI) )
edgeFaces.append(currFaceI);
}

View file

@ -39,9 +39,9 @@ Foam::DynList<T, staticSize>::DynList(Istream& is)
"template<class T, Foam::label staticSize>"
"\nFoam::DynList<T, staticSize>::DynList(Istream& is)"
) << "Not implemented" << exit(FatalError);
List<T> helper(is);
nextFree_ = helper.size();
UList<T>::swap(helper);
}
@ -74,7 +74,7 @@ Foam::Istream& Foam::operator>>
"\nFoam::Istream& Foam::operator>>"
"(Foam::Istream& is, Foam::DynList<T, staticSize>& DL)"
) << "Not implemented" << exit(FatalError);
is >> static_cast<List<T>&>(DL);
DL.nextFree_ = DL.List<T>::size();

View file

@ -36,7 +36,7 @@ void Foam::FRWGraph<T, width>::checkIndex(const label i, const label j) const
<< " is not in range " << Foam::label(0)
<< " and " << nRows_ << abort(FatalError);
}
if( (j < 0) || (j >= width) )
FatalErrorIn
(
@ -163,7 +163,7 @@ inline bool Foam::FRWGraph<T,width>::contains
for(register label i=0;i<width;++i)
if( data_[start+i] == e )
return true;
return false;
}
@ -178,7 +178,7 @@ inline Foam::label Foam::FRWGraph<T,width>::containsAtPosition
for(register label i=0;i<width;++i)
if( data_[start+i] == e )
return i;
return -1;
}
@ -193,7 +193,7 @@ inline const T& Foam::FRWGraph<T,width>::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[i * width + j];
}
@ -206,7 +206,7 @@ inline T& Foam::FRWGraph<T,width>::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[i * width + j];
}

View file

@ -81,7 +81,7 @@ IODynList<T, IndexType>::IODynList
readStream(typeName) >> *this;
close();
}
DynList<T, IndexType>::operator=(list);
}

View file

@ -81,7 +81,7 @@ IOLongList<T, Offset>::IOLongList
readStream(typeName) >> *this;
close();
}
LongList<T, Offset>::operator=(list);
}

View file

@ -29,7 +29,7 @@ Description
every time it is resized
SourceFiles
\*---------------------------------------------------------------------------*/
@ -53,24 +53,24 @@ class cellListPMG
// Private data
//- number of used elements
label nElmts_;
// Disallow bitwise assignment
void operator=(const cellListPMG&);
cellListPMG(const cellListPMG&);
// Disallow transfer from cellList
void transfer(cellList&);
public:
// Constructors
//- null construct
inline cellListPMG();
// Destructor
inline ~cellListPMG();
// Member functions
//- return the number of used elements
inline label size() const;
@ -83,15 +83,15 @@ public:
//- add a cell at the end of the list
inline void append(const cell&);
//- return an element with bound checking
inline cell& newElmt(const label);
// Member operators
inline void operator=(const cellList&);
friend inline Ostream& operator<<(Ostream&, const cellListPMG&);
friend inline Istream& operator>>(Istream&, cellListPMG&);
};

View file

@ -52,7 +52,7 @@ inline cellListPMG::~cellListPMG()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline label cellListPMG::size() const
{
return nElmts_;
@ -68,7 +68,7 @@ inline void cellListPMG::setSize(const label nElmts)
cellList copy(label(1.5*nElmts));
for(label i=0;i<nElmts_;++i)
copy[i].transfer(this->operator[](i));
cellList::transfer(copy);
}
else
@ -106,11 +106,11 @@ inline void cellListPMG::operator=(const cellList& cls)
forAll(cls, cI)
this->operator[](cI) = cls[cI];
}
inline Ostream& operator<<(Ostream& os, const cellListPMG& cls)
{
SubList<cell> c(cls, cls.nElmts_, 0);
os << c;
return os;
}
@ -120,7 +120,7 @@ inline Istream& operator>>(Istream& is, cellListPMG& cls)
cellList& cells = static_cast<cellList&>(cls);
is >> cells;
cls.nElmts_ = cells.size();
return is;
}

View file

@ -69,7 +69,7 @@ inline faceListPMG::~faceListPMG()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline label faceListPMG::size() const
{
return nElmts_;
@ -85,7 +85,7 @@ inline void faceListPMG::setSize(const label nElmts)
faceList copy(label(1.5*nElmts));
for(label i=0;i<nElmts_;++i)
copy[i].transfer(this->operator[](i));
faceList::transfer(copy);
}
else
@ -128,11 +128,11 @@ inline void faceListPMG::operator=(const faceList& fcs)
forAll(fcs, fI)
this->operator[](fI) = fcs[fI];
}
inline Ostream& operator<<(Ostream& os, const faceListPMG& fcs)
{
SubList<face> f(fcs, fcs.nElmts_, 0);
os << f;
return os;
}
@ -142,7 +142,7 @@ inline Istream& operator>>(Istream& is, faceListPMG& fcs)
faceList& faces = static_cast<faceList&>(fcs);
is >> faces;
fcs.nElmts_ = faces.size();
return is;
}

View file

@ -67,7 +67,7 @@ inline pointFieldPMG::~pointFieldPMG()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline label pointFieldPMG::size() const
{
return nElmts_;
@ -121,11 +121,11 @@ inline void pointFieldPMG::operator=(const pointField& pts)
forAll(pts, pI)
this->operator[](pI) = pts[pI];
}
inline Ostream& operator<<(Ostream& os, const pointFieldPMG& pts)
{
SubList<point> p(pts, pts.nElmts_, 0);
os << p;
return os;
}
@ -135,7 +135,7 @@ inline Istream& operator>>(Istream& is, pointFieldPMG& pts)
pointField& points = static_cast<pointField&>(pts);
is >> points;
pts.nElmts_ = points.size();
return is;
}

View file

@ -78,39 +78,39 @@ class LongList
// Private data
//- number of allocated elements
label N_;
//- number of elements in the list
label nextFree_;
//- number of used blocks of data
label numBlocks_;
//- maximum number of blocks that can be allocated
//- without reallocating the list containing pointers
//- to the chunks of data
label numAllocatedBlocks_;
//- size of blocks is calculated by powers of 2
//- and therefore the access can be done using shift and mask
label shift_;
label mask_;
//- array of pointers to the blocks of data, each of the size WIDTH
T** dataPtr_;
// Private member functions
//- check index
void checkIndex(label const i) const;
//- initialize width and mask
void initializeParameters();
//- Allocate memory for the list
void allocateSize(const label);
//- delete all elements
void clearOut();
public:
// Constructors
@ -137,9 +137,9 @@ public:
//- Size of the active part of the list.
inline label size() const;
//- Return the binary size in number of characters of the UList
// if the element is a primitive type
// if the element is a primitive type
// i.e. contiguous<T>() == true
inline label byteSize() const;
@ -154,7 +154,7 @@ public:
//- Shrink the list to the number of elements used
inline LongList<T, Offset>& shrink();
//- transfer the list from another one without allocating it
inline void transfer(LongList<T, Offset>&);
@ -163,11 +163,11 @@ public:
//- Append an element at the end of the list
inline void append(const T& e);
//- Append an element at the end of the list if it is not yet
//- present in the list (takes linear time)
inline void appendIfNotIn(const T& e);
//- check if the element is in the list (takes linear time)
inline bool contains(const T& e) const;
inline label containsAtPosition(const T& e) const;
@ -175,7 +175,7 @@ public:
//- Return and remove the element
inline T remove(const label i);
inline T removeLastElement();
//- get and set operators
inline const T& operator[](const label i) const;
inline T& operator[](const label i);
@ -183,14 +183,14 @@ public:
//- Return non-const access to an element,
// resizing the list if necessary
inline T& operator()(const label);
//- return a non-const access to an element,
// resize the list if necessary
inline T& newElmt(const label);
//- Assignment of all entries to the given value
inline void operator=(const T&);
//- Assignment operator
inline void operator=(const LongList<T, Offset>&);
@ -198,7 +198,7 @@ public:
// IOstream operators
//- Read from stream and append to the current content
void appendFromStream(Istream&);
//- Write as a dictionary entry.
void writeEntry(Ostream& os) const;

View file

@ -44,13 +44,13 @@ void Foam::LongList<T, Offset>::initializeParameters()
{
unsigned int t = sizeof(T);
label it(0);
while( t > 1 )
{
t >>= 1;
++it;
}
shift_ = Foam::max(10, Offset - it);
mask_ = 1<<shift_;
mask_ -= 1;
@ -64,10 +64,10 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
clearOut();
return;
}
const label numblock1 = ((s-1)>>shift_) + 1;
const label blockSize = 1<<shift_;
if( numblock1 < numBlocks_ )
{
for(register label i=numblock1;i<numBlocks_;++i)
@ -81,20 +81,20 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
{
numAllocatedBlocks_ += 64;
} while( numblock1 > numAllocatedBlocks_ );
T** dataptr1 = new T*[numAllocatedBlocks_];
for(register label i=0;i<numBlocks_;++i)
dataptr1[i] = dataPtr_[i];
if( dataPtr_ )
delete [] dataPtr_;
dataPtr_ = dataptr1;
}
for(register label i=numBlocks_;i<numblock1;++i)
dataPtr_[i] = new T[blockSize];
}
numBlocks_ = numblock1;
N_ = numBlocks_ * blockSize;
}
@ -104,13 +104,13 @@ void Foam::LongList<T, Offset>::clearOut()
{
for(register label i=0;i<numBlocks_;++i)
delete [] dataPtr_[i];
if( dataPtr_ )
{
delete [] dataPtr_;
dataPtr_ = NULL;
}
N_ = 0;
numBlocks_ = 0;
numAllocatedBlocks_ = 0;
@ -243,7 +243,7 @@ inline void Foam::LongList<T, Offset>::transfer(LongList<T, Offset>& ol)
numAllocatedBlocks_ = ol.numAllocatedBlocks_;
shift_ = ol.shift_;
mask_ = ol.mask_;
ol.dataPtr_ = NULL;
ol.N_ = 0;
ol.nextFree_ = 0;
@ -259,7 +259,7 @@ inline void Foam::LongList<T, Offset>::append(const T& e)
{
allocateSize(nextFree_+1);
}
operator[](nextFree_++) = e;
}
@ -276,7 +276,7 @@ inline bool Foam::LongList<T, Offset>::contains(const T& e) const
for(register label i=0;i<nextFree_;++i)
if( (*this)[i] == e )
return true;
return false;
}
@ -289,7 +289,7 @@ inline Foam::label Foam::LongList<T, Offset>::containsAtPosition
for(register label i=0;i<nextFree_;++i)
if( (*this)[i] == e )
return i;
return -1;
}
@ -303,7 +303,7 @@ inline T Foam::LongList<T, Offset>::remove(const label i)
"void Foam::LongList<T, Offset>::remove()"
) << "List is empty" << abort(FatalError);
}
T el = operator[](i);
operator[](i) = operator[](nextFree_-1);
--nextFree_;
@ -320,7 +320,7 @@ inline T Foam::LongList<T, Offset>::removeLastElement()
"void Foam::LongList<T, Offset>::remove()"
) << "List is empty" << abort(FatalError);
}
T lastEl = operator[](nextFree_-1);
--nextFree_;
return lastEl;
@ -335,7 +335,7 @@ inline const T& Foam::LongList<T, Offset>::operator[](const label i) const
#ifdef FULLDEBUG
checkIndex(i);
#endif
return dataPtr_[i>>shift_][i&mask_];
}
@ -345,7 +345,7 @@ inline T& Foam::LongList<T, Offset>::operator[](const label i)
#ifdef FULLDEBUG
checkIndex(i);
#endif
return dataPtr_[i>>shift_][i&mask_];
}

View file

@ -36,20 +36,20 @@ Foam::Ostream& Foam::operator<<
)
{
os << DL.size() << nl << token::BEGIN_LIST;
for(register label i=0;i<DL.size();++i)
{
os << nl << DL.sizeOfRow(i) << token::BEGIN_LIST;
for(label j=0;j<DL.sizeOfRow(i);++j)
{
if( j > 0 ) os << token::SPACE;
os << DL(i, j);
}
os << token::END_LIST;
}
os << nl << token::END_LIST;
return os;
}
@ -90,14 +90,14 @@ void Foam::VRWGraph::optimizeMemoryUsage()
{
newPosForNode[elI] = -1;
}
//- create new data
for(label elI=0;elI<nElements;++elI)
if( (newPosForNode[elI] != -1) && (newPosForNode[elI] < elI) )
data_[newPosForNode[elI]] = data_[elI];
data_.setSize(pos);
//- renumber rows
nElements = rows_.size();
for(label rowI=0;rowI<nElements;++rowI)

View file

@ -47,32 +47,32 @@ SourceFiles
namespace Foam
{
class VRWGraphModifier;
class rowElement
{
// Private data
label start_;
label size_;
public:
inline rowElement()
:
start_(),
size_()
{}
inline rowElement(const label i, const label j)
:
start_(i),
size_(j)
{}
inline ~rowElement()
{}
inline label start() const
{
return start_;
@ -81,7 +81,7 @@ class rowElement
{
return start_;
}
inline label size() const
{
return size_;
@ -101,7 +101,7 @@ class VRWGraph
// Private data
//- list containing the data
labelLongList data_;
//- number of rows
LongList<rowElement> rows_;
@ -117,9 +117,9 @@ class VRWGraph
FREEENTRY=-11,
FREESTART=-12
};
public:
// Friend classes
friend class VRWGraphSMPModifier;
@ -131,7 +131,7 @@ public:
//- Construct given number of rows
explicit inline VRWGraph(const label size);
//- Construct given number of rows and row size
explicit inline VRWGraph
(
@ -160,7 +160,7 @@ public:
//- Returns the number of rows
inline label size() const;
//- Returns the number of elements in the given row
inline label sizeOfRow(const label rowI) const;
@ -168,7 +168,7 @@ public:
//- Reset the number of rows
inline void setSize(const label);
//- Reset the number of rows. The second argument specifies
//- the reserved column width
inline void setSizeAndColumnWidth
@ -176,11 +176,11 @@ public:
const label newNumRows,
const label rcWidth
);
//- Set the number of rows and the size of each row
template<class ListType>
inline void setSizeAndRowSize(const ListType&);
//- Reset the size of the given row
inline void setRowSize(const label rowI, const label newSize);
@ -192,21 +192,21 @@ public:
//- Append a list as a row at the end of the graph
template<class ListType>
inline void appendList(const ListType& l);
//- Append an element to the given row
inline void append(const label rowI, const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label rowI, const label);
//- Set row with the list
template<class ListType>
inline void setRow(const label rowI, const ListType& l);
//- merge graphs with the identical number of rows
//- into a single one. Use for SMP parallelisation
inline void mergeGraphs(const List<VRWGraph>& graphParts);
//- set the graph to the reverse of the original graph.
//- the rows of such graph store the rows which contain the elements
//- of the original graph
@ -216,33 +216,33 @@ public:
const label nRows,
const GraphType& origGraph
);
template<class GraphType>
inline void reverseAddressing(const GraphType& origGraph);
inline void reverseAddressing
(
const label nRows,
const VRWGraph& origGraph
);
inline void reverseAddressing(const VRWGraph& origGraph);
//- optimize memory usage
// this should be used once the graph will not be resized any more
void optimizeMemoryUsage();
//- check if the element is in the given row (takes linear time)
inline bool contains(const label rowI, const label e) const;
inline label containsAtPosition(const label rowI, const label e) const;
//- get and set operators
inline label operator()(const label i, const label j) const;
inline label& operator()(const label i, const label j);
inline constRow operator[](const label i) const;
inline row operator[](const label i);
//- Assignment operator
inline void operator=(const VRWGraph&);

View file

@ -35,7 +35,7 @@ inline void Foam::VRWGraph::checkIndex(const label i, const label j) const
<< " is not in range " << Foam::label(0)
<< " and " << rows_.size() << abort(FatalError);
}
if( (j < 0) || (j >= rows_[i].size()) )
FatalErrorIn
(
@ -137,7 +137,7 @@ inline void Foam::VRWGraph::setSize(const label size)
if( size > rows_.size() )
{
rowElement rowInfo(INVALIDROW, NONE);
for(label i=rows_.size();i<size;++i)
rows_.append(rowInfo);
}
@ -163,16 +163,16 @@ void Foam::VRWGraph::setSizeAndColumnWidth
data_.setSize(newNumRows * rcWidth);
data_ = FREEENTRY;
rows_.setSize(newNumRows);
label start(0);
for(label i=0;i<newNumRows;++i)
{
rows_[i].start() = start;
rows_[i].size() = 0;
data_[start] = FREESTART;
start += rcWidth;
}
}
@ -183,12 +183,12 @@ inline void Foam::VRWGraph::setSizeAndRowSize(const ListType& l)
//- set the size of graph rows
const label nRows = l.size();
rows_.setSize(nRows);
label start(0);
for(label rowI=0;rowI<nRows;++rowI)
{
rows_[rowI].size() = l[rowI];
if( rows_[rowI].size() != NONE )
{
rows_[rowI].start() = start;
@ -197,10 +197,10 @@ inline void Foam::VRWGraph::setSizeAndRowSize(const ListType& l)
{
rows_[rowI].start() = INVALIDROW;
}
start += rows_[rowI].size();
}
data_.setSize(start);
}
@ -216,7 +216,7 @@ inline void Foam::VRWGraph::setRowSize(const label rowI, const label newSize)
<< " is not in range " << Foam::label(0)
<< " and " << rows_.size() << abort(FatalError);
# endif
const label start = rows_[rowI].start();
if( start == INVALIDROW )
{
@ -232,7 +232,7 @@ inline void Foam::VRWGraph::setRowSize(const label rowI, const label newSize)
{
//- check if there is some unused space after the last element
bool foundUnused(true);
for(label i=rows_[rowI].size();i<newSize;++i)
{
const label j = start + i;
@ -246,7 +246,7 @@ inline void Foam::VRWGraph::setRowSize(const label rowI, const label newSize)
break;
}
}
if( foundUnused )
{
//- row can be extended without copying
@ -265,7 +265,7 @@ inline void Foam::VRWGraph::setRowSize(const label rowI, const label newSize)
for(label i=rows_[rowI].size();i<newSize;++i)
data_.append(NONE);
}
rows_[rowI].size() = newSize;
}
else if( newSize < rows_[rowI].size() )
@ -295,7 +295,7 @@ inline void Foam::VRWGraph::appendList
rows_.append(rowElement(INVALIDROW, 0));
return;
}
rowElement rowInfo(data_.size(), l.size());
const label size = l.size();
for(label elI=0;elI<size;++elI)
@ -318,7 +318,7 @@ inline void Foam::VRWGraph::append(const label rowI, const label el)
const label oldStart = re.start();
const label oldSize = re.size();
++re.size();
if( oldStart + oldSize < data_.size() )
{
if(
@ -378,7 +378,7 @@ inline void Foam::VRWGraph::mergeGraphs(const List<VRWGraph>& graphParts)
"inline void Foam::VRWGraph::mergeGraphs(const List<VRWGraph>&)"
) << "Cannot merge graphs" << abort(FatalError);
}
//- find the number of elements in each row
labelLongList nElmtsInRow(nRows);
for(label rowI=0;rowI<nRows;++rowI)
@ -386,12 +386,12 @@ inline void Foam::VRWGraph::mergeGraphs(const List<VRWGraph>& graphParts)
label sum(0);
for(label i=0;i<nGraphs;++i)
sum += graphParts[i].sizeOfRow(rowI);
nElmtsInRow[rowI] = sum;
}
setSizeAndRowSize(nElmtsInRow);
//- Finally, assemble the merged graph
for(label rowI=0;rowI<nRows;++rowI)
{
@ -413,26 +413,26 @@ inline void Foam::VRWGraph::reverseAddressing
{
const label origSize = origGraph.size();
labelLongList nElmtsInRow(nRows);
for(label rowI=0;rowI<nRows;++rowI)
nElmtsInRow[rowI] = 0;
for(label rowI=0;rowI<origSize;++rowI)
{
const label rowSize = origGraph[rowI].size();
for(label i=0;i<rowSize;++i)
++nElmtsInRow[origGraph[rowI][i]];
}
setSizeAndRowSize(nElmtsInRow);
nElmtsInRow = 0;
//- finally fill in the data
for(label rowI=0;rowI<origSize;++rowI)
{
const label rowSize = origGraph[rowI].size();
for(label i=0;i<rowSize;++i)
{
const label el = origGraph[rowI][i];
@ -446,14 +446,14 @@ inline void Foam::VRWGraph::reverseAddressing(const GraphType& origGraph)
{
const label size = origGraph.size();
label maxValue(-1);
for(label rowI=0;rowI<size;++rowI)
{
const label rowSize = origGraph[rowI].size();
for(label i=0;i<rowSize;++i)
maxValue = Foam::max(maxValue, origGraph[rowI][i]);
}
++maxValue;
reverseAddressing(maxValue, origGraph);
}
@ -466,26 +466,26 @@ inline void Foam::VRWGraph::reverseAddressing
{
const label origSize = origGraph.size();
labelLongList nElmtsInRow(nRows);
for(label rowI=0;rowI<nRows;++rowI)
nElmtsInRow[rowI] = 0;
for(label rowI=0;rowI<origSize;++rowI)
{
const label rowSize = origGraph.sizeOfRow(rowI);
for(label i=0;i<rowSize;++i)
++nElmtsInRow[origGraph(rowI, i)];
}
setSizeAndRowSize(nElmtsInRow);
nElmtsInRow = 0;
//- finally fill in the data
for(label rowI=0;rowI<origSize;++rowI)
{
const label rowSize = origGraph.sizeOfRow(rowI);
for(label i=0;i<rowSize;++i)
{
const label el = origGraph(rowI, i);
@ -498,14 +498,14 @@ inline void Foam::VRWGraph::reverseAddressing(const VRWGraph& origGraph)
{
const label size = origGraph.size();
label maxValue(-1);
for(label rowI=0;rowI<size;++rowI)
{
const label rowSize = origGraph.sizeOfRow(rowI);
for(label i=0;i<rowSize;++i)
maxValue = Foam::max(maxValue, origGraph(rowI, i));
}
++maxValue;
reverseAddressing(maxValue, origGraph);
}
@ -520,11 +520,11 @@ inline bool Foam::VRWGraph::contains
if( start == INVALIDROW )
return false;
const label size = rows_[rowI].size();
for(register label i=0;i<size;++i)
if( data_[start+i] == e )
return true;
return false;
}
@ -537,12 +537,12 @@ inline Foam::label Foam::VRWGraph::containsAtPosition
const label start = rows_[rowI].start();
if( start == INVALIDROW )
return -1;
const label size = rows_[rowI].size();
for(register label i=0;i<size;++i)
if( data_[start+i] == e )
return i;
return -1;
}
@ -557,7 +557,7 @@ inline Foam::label Foam::VRWGraph::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[rows_[i].start() + j];
}
@ -570,7 +570,7 @@ inline Foam::label& Foam::VRWGraph::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[rows_[i].start() + j];
}

View file

@ -27,7 +27,7 @@ Class
Description
This class is a modifier for VRWGraph which allows for multi-threaded
execution of most time-consuimg functions
SourceFiles
VRWGraphSMPModifier.H
VRWGraphSMPModifier.C
@ -64,7 +64,7 @@ class VRWGraphSMPModifier
//- Disallow bitwise assignment
void operator=(const VRWGraphSMPModifier&);
public:
// Constructor
@ -81,27 +81,27 @@ public:
//- set the size and row sizes
template<class ListType>
void setSizeAndRowSize(const ListType&);
//- merge graphs with the identical number of rows
//- into a single one. Use for SMP parallelisation
void mergeGraphs(const List<VRWGraph>& graphParts);
//- set the graph to the reverse of the original graph.
//- the rows of such graph store the rows which contain the elements
//- of the original graph
template<class GraphType>
void reverseAddressing(const GraphType& origGraph);
void reverseAddressing(const VRWGraph& origGraph);
//- set the graph to the reverse of the original graph and mapped
//- to another space.
template<class ListType, class GraphType>
void reverseAddressing(const ListType&, const GraphType&);
template<class ListType>
void reverseAddressing(const ListType&, const VRWGraph&);
//- optimize memory usage
// this should be used once the graph will not be resized any more
void optimizeMemoryUsage();

View file

@ -36,12 +36,12 @@ Foam::Ostream& Foam::operator<<
)
{
os << DL.size() << nl << token::BEGIN_LIST;
for(register label i=0;i<DL.size();++i)
{
os << nl << DL[i];
}
os << nl << token::END_LIST;
return os;
}

View file

@ -51,11 +51,11 @@ namespace Foam
class VRWGraphList
{
// Private data
//- graph containing the data
VRWGraph data_;
//- number of rows
LongList<rowElement> rows_;
@ -67,7 +67,7 @@ class VRWGraphList
const label j,
const label k
) const;
public:
// Constructors
@ -88,10 +88,10 @@ public:
//- Returns the number of graphs
inline label size() const;
//- Returns the number of rows in the graph at that position
inline label sizeOfGraph(const label posI) const;
//- Return the number of element in the row at the given position
inline label sizeOfRow(const label posI, const label rowI) const;
@ -103,7 +103,7 @@ public:
//- Append a graph at the end of the graphList
template<class GraphType>
inline void appendGraph(const GraphType& l);
//- get and set operators
inline label operator()
(
@ -111,11 +111,11 @@ public:
const label j,
const label k
) const;
inline label& operator()(const label i, const label j, const label k);
inline const subGraph<const VRWGraph> operator[](const label i) const;
//- Assignment operator
inline void operator=(const VRWGraphList&);

View file

@ -25,7 +25,7 @@ License
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline void Foam::VRWGraphList::checkIndex
@ -45,7 +45,7 @@ inline void Foam::VRWGraphList::checkIndex
<< " is not in range " << Foam::label(0)
<< " and " << rows_.size() << abort(FatalError);
}
if( (j < 0) || (j >= rows_[i].size()) )
FatalErrorIn
(
@ -54,7 +54,7 @@ inline void Foam::VRWGraphList::checkIndex
) << "Row index " << Foam::label(j)
<< " is not in range " << Foam::label(0)
<< " and " << rows_[i].size() << abort(FatalError);
if( (k < 0) || (k >= data_.sizeOfRow(rows_[i].start()+j)) )
FatalErrorIn
(
@ -125,10 +125,10 @@ inline void Foam::VRWGraphList::appendGraph
)
{
rowElement re(data_.size(), l.size());
for(label i=0;i<l.size();++i)
data_.appendList(l[i]);
rows_.append(re);
}
@ -144,7 +144,7 @@ inline Foam::label Foam::VRWGraphList::operator()
#ifdef FULLDEBUG
checkIndex(i, j, k);
#endif
return data_(rows_[i].start() + j, k);
}
@ -157,7 +157,7 @@ inline Foam::label& Foam::VRWGraphList::operator()
#ifdef FULLDEBUG
checkIndex(i, j, k);
#endif
return data_(rows_[i].start() + j, k);
}

View file

@ -43,7 +43,7 @@ SourceFiles
namespace Foam
{
class VRWGraph;
template<class graphType> class graphRow;
@ -60,14 +60,14 @@ class graphRow
// Private data
//- reference to the graph
graphType& data_;
//- row number
const label rowI_;
// Private member functions
//- check index
inline void checkIndex(const label i) const;
public:
// Constructors
@ -94,21 +94,21 @@ public:
inline void clear();
// Member Operators
//- Append an element to the given row
inline void append(const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label);
//- check if the element is in the given row (takes linear time)
inline bool contains(const label e) const;
inline label containsAtPosition(const label e) const;
//- set and get operators
inline label operator[](const label) const;
inline label& operator[](const label);
//- Assignment operator
inline void operator=(const graphRow<graphType>&);
template<class listType>

View file

@ -160,7 +160,7 @@ inline Foam::Ostream& operator<<
for(Foam::label i=0;i<r.size();++i)
os << r[i] << " ";
os << ")";
return os;
}

View file

@ -59,17 +59,17 @@ class subGraph
// Private data
//- reference to the graph
graphType& data_;
//- starts at row
const label start_;
//- number of rows in the subGraph
const label size_;
// Private member functions
//- check index
inline void checkIndex(const label i) const;
public:
// Constructors
@ -93,17 +93,17 @@ public:
inline label sizeOfRow(const label rowI) const;
// Member Operators
//- Append an element to the given row
inline void append(const label rowI, const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label rowI, const label);
//- check if the element is in the given row (takes linear time)
inline bool contains(const label rowI, const label e) const;
inline label containsAtPosition(const label rowI, const label e) const;
//- set and get operators
inline label operator()(const label i, const label j) const;
inline label& operator()(const label i, const label j);

View file

@ -137,7 +137,7 @@ inline Foam::label Foam::subGraph<graphType>::operator()
# ifdef FULLDEBUG
checkIndex(i);
# endif
return data_(start_+i, j);
}
@ -183,13 +183,13 @@ inline Foam::Ostream& operator<<
for(Foam::label j=0;j<sg.sizeOfRow(i);++j)
{
if( j > 0 ) os << " ";
os << sg(i, j);
}
os << ")";
}
os << "\n" << ")";
return os;

View file

@ -57,19 +57,19 @@ void Foam::fpmaMesh::writePoints(Foam::OFstream& fpmaGeometryFile) const
const point& p = points[pointI];
fpmaGeometryFile << p.x() << ' ' << p.y() << ' ' << p.z() << ' ';
}
fpmaGeometryFile << nl;
}
void fpmaMesh::writeCells(OFstream& fpmaGeometryFile) const
{
const cellListPMG& cells = mesh_.cells();
fpmaGeometryFile << cells.size() << nl;
forAll(cells, cellI)
{
const cell& c = cells[cellI];
fpmaGeometryFile << c.size();
forAll(c, fI)
fpmaGeometryFile << ' ' << c[fI];
@ -84,7 +84,7 @@ void Foam::fpmaMesh::writeFaces(OFstream& fpmaGeometryFile) const
forAll(faces, faceI)
{
const face& f = faces[faceI];
fpmaGeometryFile << f.size();
forAllReverse(f, pI)
fpmaGeometryFile << ' ' << f[pI];
@ -96,9 +96,9 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
{
//- write patches as face selections
const PtrList<boundaryPatch>& patches = mesh_.boundaries();
label nSubsets(0);
nSubsets += patches.size();
DynList<label> indices;
mesh_.pointSubsetIndices(indices);
@ -110,15 +110,15 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
mesh_.cellSubsetIndices(indices);
nSubsets += indices.size();
Info << "Mesh has " << indices.size() << " cell subsets" << endl;
fpmaGeometryFile << nSubsets << nl;
//- write patches as face selections
forAll(patches, patchI)
{
label start = patches[patchI].patchStart();
const label size = patches[patchI].patchSize();
fpmaGeometryFile << patches[patchI].patchName() << nl;
fpmaGeometryFile << 3 << nl;
fpmaGeometryFile << size << nl;
@ -126,14 +126,14 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
fpmaGeometryFile << start++ << ' ';
fpmaGeometryFile << nl;
}
//- write node selections
mesh_.pointSubsetIndices(indices);
forAll(indices, indexI)
{
labelLongList nodesInSubset;
mesh_.pointsInSubset(indices[indexI], nodesInSubset);
fpmaGeometryFile << mesh_.pointSubsetName(indices[indexI]) << nl;
fpmaGeometryFile << 1 << nl;
fpmaGeometryFile << nodesInSubset.size() << nl;
@ -141,14 +141,14 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
fpmaGeometryFile << nodesInSubset[i] << ' ';
fpmaGeometryFile << nl;
}
//- write face selections
mesh_.faceSubsetIndices(indices);
forAll(indices, indexI)
{
labelLongList facesInSubset;
mesh_.facesInSubset(indices[indexI], facesInSubset);
fpmaGeometryFile << mesh_.faceSubsetName(indices[indexI]) << nl;
fpmaGeometryFile << 3 << nl;
fpmaGeometryFile << facesInSubset.size() << nl;
@ -156,14 +156,14 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
fpmaGeometryFile << facesInSubset[i] << ' ';
fpmaGeometryFile << nl;
}
//- write cell selections
mesh_.cellSubsetIndices(indices);
forAll(indices, indexI)
{
labelLongList cellsInSubset;
mesh_.cellsInSubset(indices[indexI], cellsInSubset);
fpmaGeometryFile << mesh_.cellSubsetName(indices[indexI]) << nl;
fpmaGeometryFile << 2 << nl;
fpmaGeometryFile << cellsInSubset.size() << nl;
@ -177,7 +177,7 @@ void Foam::fpmaMesh::writeSubsets(Foam::OFstream& fpmaGeometryFile) const
void fpmaMesh::write(OFstream& fpmaGeometryFile) const
{
writePoints(fpmaGeometryFile);
writeFaces(fpmaGeometryFile);
writeCells(fpmaGeometryFile);

View file

@ -60,11 +60,11 @@ class fpmaMesh
void operator=(const fpmaMesh&);
void writePoints(OFstream& fpmaGeometryFile) const;
void writeFaces(OFstream& fpmaGeometryFile) const;
void writeCells(OFstream& fpmaGeometryFile) const;
void writeSubsets(OFstream& fpmaGeometryFile) const;
public:

View file

@ -44,7 +44,7 @@ namespace Foam
{
class polyMeshGen;
void writeMeshFPMA(const polyMeshGen& mesh, const word& fName);
void createFIRESelections(polyMeshGen& mesh);

View file

@ -28,7 +28,7 @@ Description
Decomposes selected cells into pyramids
SourceFiles
\*---------------------------------------------------------------------------*/
@ -56,16 +56,16 @@ class decomposeCells
wordList patchNames_;
VRWGraph newBoundaryFaces_;
labelLongList newBoundaryPatches_;
VRWGraphList facesOfNewCells_;
// Private member functions
//- check if the valid pyramids are generated from the split cells
//- this check splits faces which could
//- result in multiple inbetween faces
void checkFaceConnections(const boolList& decomposeCell);
//- create addressing needed to decompose the cell
void findAddressingForCell
(
@ -75,7 +75,7 @@ class decomposeCells
DynList<DynList<label, 8> >& faceEdges,
DynList<DynList<label, 2>, 64>& edgeFaces
) const;
//- find the apex of the pyramids
label findTopVertex
(
@ -84,15 +84,15 @@ class decomposeCells
const DynList<edge, 64>& edges,
const DynList<DynList<label, 2>, 64>& edgeFaces
);
void decomposeCellIntoPyramids(const label cellI);
void createPointsAndCellFaces(const boolList& decomposeCell);
void storeBoundaryFaces(const boolList& decomposeCell);
void removeDecomposedCells(const boolList& decomposeCell);
void addNewCells();
//- disallows bitwise construct

View file

@ -50,7 +50,7 @@ class decomposeFaces
// private data
//- reference to the mesh
polyMeshGen& mesh_;
//- number of points
VRWGraph newFacesForFace_;

View file

@ -56,7 +56,7 @@ label faceDecomposition::concaveVertex() const
evn /= mag(evn);
const vector prod = (ev ^ evn);
if( (prod & n) < -SMALL )
{
if( concaveVrt != -1 )
@ -134,7 +134,7 @@ bool faceDecomposition::isFacePlanar() const
const point c = f_.centre(points_);
forAll(f_, pI)
tol = Foam::max(tol, Foam::mag(c - points_[f_[pI]]));
tol *= 0.05;
return isFacePlanar(tol);
@ -191,7 +191,7 @@ faceList faceDecomposition::decomposeFace() const
if( il == ir - 1 )
storage.newElmt(fI++) = rf;
}
il++;
ir--;
@ -256,7 +256,7 @@ faceList faceDecomposition::decomposeFaceIntoTriangles(const label cv) const
add[0] = f_[start];
add[1] = edg[i].start();
add[2] = edg[i].end();
fcs.newElmt(fI++) = add;
}
@ -266,12 +266,12 @@ faceList faceDecomposition::decomposeFaceIntoTriangles(const label cv) const
Info << "face " << faceNo << " " << f_
<< " is decomposed into " << fcs << endl;
# endif
return fcs;
}
faceList fcs(1, f_);
return fcs;
}

View file

@ -49,14 +49,14 @@ class faceDecomposition
{
// private data
const face& f_;
const pointField& points_;
// private member functions
//- find concave vertex and return its position
//- in the face
label concaveVertex() const;
//- decomposes the face into triangle starting from
//- the given vertex
faceList decomposeFaceIntoTriangles(const label cv) const;
@ -91,7 +91,7 @@ public:
//- decompose face into triangles
faceList decomposeFaceIntoTriangles() const;
//- decompose face into the minimal number
//- of convex faces
faceList decomposeFace() const;

View file

@ -47,18 +47,18 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class labelledMeshOctreeCubeCoordinates Declaration
\*---------------------------------------------------------------------------*/
class labelledMeshOctreeCubeCoordinates
{
// Private data
//- label
label cLabel_;
//- cube coordinates
meshOctreeCubeCoordinates coordinates_;
public:
// Constructors
//- Null construct
labelledMeshOctreeCubeCoordinates()
@ -66,7 +66,7 @@ class labelledMeshOctreeCubeCoordinates
cLabel_(-1),
coordinates_()
{}
//- Construct from label and cube coordinates
labelledMeshOctreeCubeCoordinates
(
@ -77,32 +77,32 @@ class labelledMeshOctreeCubeCoordinates
cLabel_(cl),
coordinates_(cc)
{}
// Destructor
~labelledMeshOctreeCubeCoordinates()
{}
// Member functions
//- return cube label
inline label cubeLabel() const
{
return cLabel_;
}
//- return the value
inline const meshOctreeCubeCoordinates& coordinates() const
{
return coordinates_;
}
// Member operators
inline void operator=(const labelledMeshOctreeCubeCoordinates& lcc)
{
cLabel_ = lcc.cLabel_;
coordinates_ = lcc.coordinates_;
}
inline bool operator==
(
const labelledMeshOctreeCubeCoordinates& lcc
@ -110,10 +110,10 @@ class labelledMeshOctreeCubeCoordinates
{
if( cLabel_ == lcc.cLabel_ )
return true;
return false;
}
inline bool operator!=
(
const labelledMeshOctreeCubeCoordinates& lcc
@ -121,7 +121,7 @@ class labelledMeshOctreeCubeCoordinates
{
return !this->operator==(lcc);
}
// Friend operators
friend Ostream& operator<<
(
@ -141,7 +141,7 @@ class labelledMeshOctreeCubeCoordinates
return os;
}
friend Istream& operator>>
(
Istream& is,
@ -150,16 +150,16 @@ class labelledMeshOctreeCubeCoordinates
{
// Read beginning of labelledMeshOctreeCubeCoordinates
is.readBegin("labelledMeshOctreeCubeCoordinates");
is >> lcc.cLabel_;
is >> lcc.coordinates_;
// Read end of labelledMeshOctreeCubeCoordinates
is.readEnd("labelledMeshOctreeCubeCoordinates");
// Check state of Istream
is.check("operator>>(Istream&, labelledMeshOctreeCubeCoordinates");
return is;
}
};

View file

@ -47,18 +47,18 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class labelledPoint Declaration
\*---------------------------------------------------------------------------*/
class labelledPoint
{
// Private data
//- point label
label pLabel_;
//- point coordinates
point coords_;
public:
// Constructors
//- Null construct
labelledPoint()
@ -66,62 +66,62 @@ class labelledPoint
pLabel_(-1),
coords_(vector::zero)
{}
//- Construct from point and label
labelledPoint(const label pl, const point& p)
:
pLabel_(pl),
coords_(p)
{}
// Destructor
~labelledPoint()
{}
// Member functions
//- return point label
inline label pointLabel() const
{
return pLabel_;
}
inline label& pointLabel()
{
return pLabel_;
}
//- return point coordinates
inline const point& coordinates() const
{
return coords_;
}
inline point& coordinates()
{
return coords_;
}
// Member operators
inline void operator=(const labelledPoint& lp)
{
pLabel_ = lp.pLabel_;
coords_ = lp.coords_;
}
inline bool operator==(const labelledPoint& lp) const
{
if( pLabel_ == lp.pLabel_ )
return true;
return false;
}
inline bool operator!=(const labelledPoint& lp) const
{
return !this->operator==(lp);
}
// Friend operators
friend Ostream& operator<<(Ostream& os, const labelledPoint& lp)
{
@ -134,21 +134,21 @@ class labelledPoint
return os;
}
friend Istream& operator>>(Istream& is, labelledPoint& lp)
{
// Read beginning of labelledPoint
is.readBegin("labelledPoint");
is >> lp.pLabel_;
is >> lp.coords_;
// Read end of labelledPoint
is.readEnd("labelledPoint");
// Check state of Istream
is.check("operator>>(Istream&, labelledPoint");
return is;
}
};

View file

@ -46,18 +46,18 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class refLabelledPoint Declaration
\*---------------------------------------------------------------------------*/
class refLabelledPoint
{
// Private data
//- label of the object it is associated to
label objectLabel_;
//- point to be transferred
labelledPoint p_;
public:
// Constructors
//- Null construct
refLabelledPoint()
@ -65,52 +65,52 @@ class refLabelledPoint
objectLabel_(-1),
p_()
{}
//- Construct from label and labelledPoint
refLabelledPoint(const label pl, const labelledPoint& p)
:
objectLabel_(pl),
p_(p)
{}
// Destructor
~refLabelledPoint()
{}
// Member functions
//- return label of the object it is associated to
inline label objectLabel() const
{
return objectLabel_;
}
//- return labelledPoint
inline const labelledPoint& lPoint() const
{
return p_;
}
// Member operators
inline void operator=(const refLabelledPoint& lp)
{
objectLabel_ = lp.objectLabel_;
p_ = lp.p_;
}
inline bool operator==(const refLabelledPoint& lp) const
{
if( objectLabel_ == lp.objectLabel_ )
return true;
return false;
}
inline bool operator!=(const refLabelledPoint& lp) const
{
return !this->operator==(lp);
}
// Friend operators
friend Ostream& operator<<(Ostream& os, const refLabelledPoint& lp)
{
@ -123,21 +123,21 @@ class refLabelledPoint
return os;
}
friend Istream& operator>>(Istream& is, refLabelledPoint& lp)
{
// Read beginning of refLabelledPoint
is.readBegin("refLabelledPoint");
is >> lp.objectLabel_;
is >> lp.p_;
// Read end of refLabelledPoint
is.readEnd("refLabelledPoint");
// Check state of Istream
is.check("operator>>(Istream&, refLabelledPoint");
return is;
}
};

View file

@ -47,21 +47,21 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class labelledPointScalar Declaration
\*---------------------------------------------------------------------------*/
class labelledPointScalar
{
// Private data
//- point label
label pLabel_;
//- point coordinates
point coords_;
//- scalar data
scalar weight_;
public:
// Constructors
//- Null construct
labelledPointScalar()
@ -70,7 +70,7 @@ class labelledPointScalar
coords_(vector::zero),
weight_(0.0)
{}
//- Construct from point and label
labelledPointScalar(const label pl, const point& p, const scalar s)
:
@ -78,67 +78,67 @@ class labelledPointScalar
coords_(p),
weight_(s)
{}
// Destructor
~labelledPointScalar()
{}
// Member functions
//- return point label
inline label pointLabel() const
{
return pLabel_;
}
inline label& pointLabel()
{
return pLabel_;
}
//- return point coordinates
inline const point& coordinates() const
{
return coords_;
}
inline point& coordinates()
{
return coords_;
}
//- return scalar value
inline const scalar& scalarValue() const
{
return weight_;
}
inline scalar& scalarValue()
{
return weight_;
}
// Member operators
inline void operator=(const labelledPointScalar& lps)
{
pLabel_ = lps.pLabel_;
coords_ = lps.coords_;
weight_ = lps.weight_;
}
inline bool operator==(const labelledPointScalar& lps) const
{
if( pLabel_ == lps.pLabel_ )
return true;
return false;
}
inline bool operator!=(const labelledPointScalar& lps) const
{
return !this->operator==(lps);
}
// Friend operators
friend Ostream& operator<<(Ostream& os, const labelledPointScalar& lps)
{
@ -152,22 +152,22 @@ class labelledPointScalar
return os;
}
friend Istream& operator>>(Istream& is, labelledPointScalar& lps)
{
// Read beginning of labelledPointScalar
is.readBegin("labelledPointScalar");
is >> lps.pLabel_;
is >> lps.coords_;
is >> lps.weight_;
// Read end of labelledPointScalar
is.readEnd("labelledPointScalar");
// Check state of Istream
is.check("operator>>(Istream&, labelledPointScalar");
return is;
}
};

View file

@ -46,19 +46,19 @@ namespace Foam
/*---------------------------------------------------------------------------*\
Class parPartTet Declaration
\*---------------------------------------------------------------------------*/
class parPartTet
{
// Private data
labelledPoint pts_[4];
public:
// Constructors
inline parPartTet()
{}
explicit inline parPartTet
(
const labelledPoint& p0,
@ -72,31 +72,31 @@ public:
pts_[2] = p2;
pts_[3] = p3;
}
// Destructor
~parPartTet()
{}
// Member functions
// Member operators
inline const labelledPoint& operator[](const label i) const
{
return pts_[i];
}
inline bool operator !=(const parPartTet& ptf) const
{
Serr << "Not implemented" << endl;
::exit(1);
return true;
}
// Friend operators
inline friend Ostream& operator<<(Ostream& os, const parPartTet& ppt)
{
os << token::BEGIN_LIST;
@ -110,21 +110,21 @@ public:
os.check("operator<<(Ostream&, const parPartTet&");
return os;
}
inline friend Istream& operator>>(Istream& is, parPartTet& ppt)
{
// Read beginning of parPartTet
is.readBegin("parPartTet");
for(label i=0;i<4;++i)
is >> ppt.pts_[i];
// Read end of parHelper
is.readEnd("parPartTet");
// Check state of Istream
is.check("operator>>(Istream&, parPartTet");
return is;
}
};

View file

@ -52,41 +52,41 @@ class sortEdgesIntoChains
{
// Members
const DynList<edge>& bEdges_;
bool openEdges_;
Map<label> newNodeLabel_;
List<DynList<label> > edgesAtPoint_;
DynList<labelList> createdChains_;
// Private member functions
void createNodeLabels();
bool findPointsBelongingToTheChain
(
const label currPos,
boolList& chainEdges
) const;
void shrinkEdges(const boolList& chainEdges);
void createChainFromEdges(const boolList& chainEdges);
void sortEdges();
public:
sortEdgesIntoChains
(
const DynList<edge>& bEdges
);
~sortEdgesIntoChains();
// Member functions
//- a list of points which have not yet been resolved
const DynList<labelList>& sortedChains() const;
};

View file

@ -43,7 +43,7 @@ SourceFiles
namespace Foam
{
namespace help
{

View file

@ -46,7 +46,7 @@ scalar textToScalar(const word& w)
{
std::stringstream ss;
ss << w;
double s;
ss >> s;
return s;
@ -62,7 +62,7 @@ word scalarToText(const scalar s)
{
std::ostringstream ss;
ss << s;
return ss.str();
}
@ -70,7 +70,7 @@ word labelToText(const label l)
{
std::ostringstream ss;
ss << l;
return ss.str();
}

View file

@ -52,13 +52,13 @@ namespace help
//- convert the text to scalar
scalar textToScalar(const word& w);
//- convert the text to label
label textToLabel(const word& w);
//- convert the scalar value into text
word scalarToText(const scalar s);
//- convert the integer value into text
word labelToText(const label l);

View file

@ -38,9 +38,9 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void partTetMesh::createPointsAndTets(const List<direction>& useCell)
{
const pointFieldPMG& points = origMesh_.points();
@ -52,88 +52,88 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
const PtrList<processorBoundaryPatch>& procBoundaries =
origMesh_.procBoundaries();
const label nInternalFaces = origMesh_.nInternalFaces();
//- check how many neighbours of a face are marked for smoothing
labelList usedFace(faces.size(), 0);
//- mark faces
forAll(faces, faceI)
{
if( useCell[owner[faceI]] )
++usedFace[faceI];
if( neighbour[faceI] < 0 )
continue;
if( useCell[neighbour[faceI]] )
++usedFace[faceI];
}
//- send data at processor boundaries
forAll(procBoundaries, patchI)
{
const label start = procBoundaries[patchI].patchStart();
const label size = procBoundaries[patchI].patchSize();
labelLongList dataToSend;
for(label faceI=0;faceI<size;++faceI)
{
if( usedFace[start+faceI] )
dataToSend.append(faceI);
}
OPstream toOtherProc
(
Pstream::blocking,
procBoundaries[patchI].neiProcNo(),
dataToSend.byteSize()
);
toOtherProc << dataToSend;
}
//- receive data at proc boundaries
forAll(procBoundaries, patchI)
{
labelLongList receivedData;
IPstream fromOtherProc
(
Pstream::blocking,
procBoundaries[patchI].neiProcNo()
);
fromOtherProc >> receivedData;
const label start = procBoundaries[patchI].patchStart();
forAll(receivedData, faceI)
++usedFace[start+receivedData[faceI]];
}
const vectorField& faceCentres = origMesh_.addressingData().faceCentres();
const vectorField& cellCentres = origMesh_.addressingData().cellCentres();
labelLongList nodeLabelForPoint(points.size(), -1);
labelLongList nodeLabelForFace(faces.size(), -1);
labelLongList nodeLabelForCell(cells.size(), -1);
points_.clear();
smoothVertex_.clear();
//- create BOUNDARY points
forAll(boundaries, patchI)
{
const boundaryPatch& patch = boundaries[patchI];
const label start = patch.patchStart();
const label end = start + patch.patchSize();
for(label faceI=start;faceI<end;++faceI)
{
if( !usedFace[faceI] )
continue;
const face& f = faces[faceI];
if( f.size() > 3 )
{
//- create face centre
@ -141,7 +141,7 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
points_.append(faceCentres[faceI]);
smoothVertex_.append(FACECENTRE);
}
//- add face corners
forAll(f, pI)
{
@ -150,27 +150,27 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
{
nodeLabelForPoint[pointI] = points_.size();
points_.append(points[pointI]);
smoothVertex_.append(BOUNDARY);
}
}
}
}
}
//- create points at processor boundaries
forAll(procBoundaries, patchI)
{
const processorBoundaryPatch& patch = procBoundaries[patchI];
const label start = patch.patchStart();
const label end = start + patch.patchSize();
for(label faceI=start;faceI<end;++faceI)
{
if( !usedFace[faceI] )
continue;
const face& f = faces[faceI];
if( f.size() > 3 )
{
//- create face centre
@ -178,7 +178,7 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
points_.append(faceCentres[faceI]);
smoothVertex_.append(FACECENTRE);
}
//- add face corners
const direction vType = usedFace[faceI]==2?SMOOTH:NONE;
forAll(f, pI)
@ -188,24 +188,24 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
{
nodeLabelForPoint[pointI] = points_.size();
points_.append(points[pointI]);
smoothVertex_.append(vType);
}
else if( vType == NONE )
{
smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
}
}
}
}
}
//- create points for internal faces
for(label faceI=0;faceI<nInternalFaces;++faceI)
{
if( usedFace[faceI] )
{
const face& f = faces[faceI];
if( f.size() > 3 )
{
//- create face centre
@ -213,7 +213,7 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
points_.append(faceCentres[faceI]);
smoothVertex_.append(FACECENTRE);
}
//- add face corners
const direction vType = usedFace[faceI]==2?SMOOTH:NONE;
forAll(f, pI)
@ -223,28 +223,28 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
{
nodeLabelForPoint[pointI] = points_.size();
points_.append(points[pointI]);
smoothVertex_.append(vType);
}
else if( vType == NONE )
{
smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
}
}
}
}
}
//- create tets
tetMatcher tet;
forAll(useCell, cI)
if( useCell[cI] )
{
const cell& c = cells[cI];
if( tet.matchShape(false, faces, owner, cI, cells[cI]) )
{
const labelList& tVrt = tet.vertLabels();
//- add tet
tets_.append
(
@ -256,19 +256,19 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForPoint[tVrt[3]]
)
);
continue;
}
nodeLabelForCell[cI] = points_.size();
const label centreLabel = points_.size();
points_.append(cellCentres[cI]);
smoothVertex_.append(CELLCENTRE);
forAll(c, fI)
{
const face& f = faces[c[fI]];
if( owner[c[fI]] == cI )
{
if( f.size() == 3 )
@ -280,12 +280,12 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForPoint[f[1]],
centreLabel
);
# ifdef DEBUGSmooth
Info << "1.1 Tet " << tets_.size() << " is "
<< tet << endl;
# endif
tets_.append(tet);
}
else
@ -299,12 +299,12 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForFace[c[fI]],
centreLabel
);
# ifdef DEBUGSmooth
Info << "1.2 Tet " << tets_.size() << " is "
<< tet << endl;
# endif
tets_.append(tet);
}
}
@ -320,12 +320,12 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForPoint[f[2]],
centreLabel
);
# ifdef DEBUGSmooth
Info << "2.1 Tet " << tets_.size() << " is "
<< tet << endl;
# endif
tets_.append(tet);
}
else
@ -339,19 +339,19 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForFace[c[fI]],
centreLabel
);
# ifdef DEBUGSmooth
Info << "2.2 Tet " << tets_.size() << " is "
<< tet << endl;
# endif
tets_.append(tet);
}
}
}
}
}
//- create node labels in origMesh_
nodeLabelInOrigMesh_.setSize(points_.size());
nodeLabelInOrigMesh_ = -1;
@ -360,10 +360,10 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
{
nodeLabelInOrigMesh_[nodeLabelForPoint[pI]] = pI;
}
//- create pointTets_
pointTets_.reverseAddressing(points_.size(), tets_);
//- create addressing for parallel runs
if( Pstream::parRun() )
{
@ -373,13 +373,13 @@ void partTetMesh::createPointsAndTets(const List<direction>& useCell)
nodeLabelForFace,
nodeLabelForCell
);
createBufferLayers();
}
# ifdef DEBUGSmooth
forAll(nodeLabelInOrigMesh_, pI)
if(
if(
(nodeLabelInOrigMesh_[pI] != -1) &&
(mag(points_[pI] - points[nodeLabelInOrigMesh_[pI]]) > SMALL)
)
@ -395,18 +395,18 @@ void partTetMesh::createSMOOTHPointsOrdering() const
{
internalPointsOrderPtr_ = new VRWGraph();
VRWGraph& internalPointsOrder = *internalPointsOrderPtr_;
internalPointsOrder.setSize(0);
labelLongList order(points_.size(), -1);
boolList helper(points_.size());
bool found;
do
{
found = false;
helper = false;
labelLongList selectedPoints;
forAll(points_, nodeI)
{
if( smoothVertex_[nodeI] & SMOOTH )
@ -415,13 +415,13 @@ void partTetMesh::createSMOOTHPointsOrdering() const
continue;
if( order[nodeI] != -1 )
continue;
//- find neighbouring FACECENTRE and CELLCENTRE points
DynList<label, 64> neiCentrePoints, neiSmoothPoints;
forAllRow(pointTets_, nodeI, ptI)
{
const partTet& tet = tets_[pointTets_(nodeI, ptI)];
for(label i=0;i<4;++i)
if( smoothVertex_[tet[i]] & (FACECENTRE+CELLCENTRE) )
{
@ -432,37 +432,37 @@ void partTetMesh::createSMOOTHPointsOrdering() const
neiSmoothPoints.appendIfNotIn(tet[i]);
}
}
//- find neighbouring SMOOTH points
forAll(neiCentrePoints, ncI)
{
const label centreI = neiCentrePoints[ncI];
forAllRow(pointTets_, centreI, ptI)
{
const partTet& tet = tets_[pointTets_(centreI, ptI)];
for(label i=0;i<4;++i)
if( smoothVertex_[tet[i]] & SMOOTH )
neiSmoothPoints.appendIfNotIn(tet[i]);
}
}
//- select the point and mark neighbouring SMOOTH points
selectedPoints.append(nodeI);
order[nodeI] = internalPointsOrder.size();
forAll(neiSmoothPoints, i)
helper[neiSmoothPoints[i]] = true;
}
}
if( selectedPoints.size() != 0 )
{
internalPointsOrder.appendList(selectedPoints);
found = true;
}
} while( found );
}
@ -470,17 +470,17 @@ void partTetMesh::createBOUNDARYPointsOrdering() const
{
boundaryPointsOrderPtr_ = new VRWGraph();
VRWGraph& boundaryPointsOrder = *boundaryPointsOrderPtr_;
boundaryPointsOrder.setSize(0);
labelLongList order(points_.size(), -1);
boolList helper(points_.size());
bool found;
do
{
found = false;
helper = false;
labelLongList selectedPoints;
forAll(points_, nodeI)
{
@ -490,13 +490,13 @@ void partTetMesh::createBOUNDARYPointsOrdering() const
continue;
if( order[nodeI] != -1 )
continue;
//- find neighbouring FACECENTRE and CELLCENTRE points
DynList<label, 64> neiCentrePoints, neiSmoothPoints;
forAllRow(pointTets_, nodeI, ptI)
{
const partTet& tet = tets_[pointTets_(nodeI, ptI)];
for(label i=0;i<4;++i)
if( smoothVertex_[tet[i]] & (FACECENTRE+CELLCENTRE) )
{
@ -507,37 +507,37 @@ void partTetMesh::createBOUNDARYPointsOrdering() const
neiSmoothPoints.appendIfNotIn(tet[i]);
}
}
//- find neighbouring BOUNDARY points
forAll(neiCentrePoints, ncI)
{
const label centreI = neiCentrePoints[ncI];
forAllRow(pointTets_, centreI, ptI)
{
const partTet& tet = tets_[pointTets_(centreI, ptI)];
for(label i=0;i<4;++i)
if( smoothVertex_[tet[i]] & BOUNDARY )
neiSmoothPoints.appendIfNotIn(tet[i]);
}
}
//- select the point and mark neighbouring BOUNDARY points
selectedPoints.append(nodeI);
order[nodeI] = boundaryPointsOrder.size();
forAll(neiSmoothPoints, i)
helper[neiSmoothPoints[i]] = true;
}
}
if( selectedPoints.size() != 0 )
{
boundaryPointsOrder.appendList(selectedPoints);
found = true;
}
} while( found );
}

View file

@ -40,7 +40,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void partTetMesh::createParallelAddressing
@ -52,27 +52,27 @@ void partTetMesh::createParallelAddressing
{
//- vertices marked as SMOOTH and BOUNDARY are used by the smoother
const direction useType = SMOOTH + BOUNDARY;
//- allocate global point labels
if( !globalPointLabelPtr_ )
globalPointLabelPtr_ = new labelLongList();
labelLongList& globalTetPointLabel = *globalPointLabelPtr_;
globalTetPointLabel.setSize(points_.size());
globalTetPointLabel = -1;
//- allocated point-processors addressing
if( !pAtProcsPtr_ )
pAtProcsPtr_ = new VRWGraph();
VRWGraph& pProcs = *pAtProcsPtr_;
pProcs.setSize(0);
pProcs.setSize(points_.size());
//- allocate global-to-local point addressing
if( !globalToLocalPointAddressingPtr_ )
globalToLocalPointAddressingPtr_ = new Map<label>();
Map<label>& globalToLocal = *globalToLocalPointAddressingPtr_;
globalToLocal.clear();
//- allocate storage for points at parallel boundaries
if( !pAtParallelBoundariesPtr_ )
pAtParallelBoundariesPtr_ = new labelLongList();
@ -82,23 +82,23 @@ void partTetMesh::createParallelAddressing
//- create point-processors addressing
std::map<label, labelLongList> exchangeData;
std::map<label, labelLongList>::iterator iter;
const polyMeshGenAddressing& addressing = origMesh_.addressingData();
const Map<label>& globalToLocalPointAddressing =
addressing.globalToLocalPointAddressing();
const VRWGraph& pAtProcs = addressing.pointAtProcs();
const DynList<label>& pNeiProcs = addressing.pointNeiProcs();
forAll(pNeiProcs, procI)
exchangeData.insert(std::make_pair(pNeiProcs[procI], labelLongList()));
//- make sure that the same vertices are marked for smoothing on all procs
//- this is performed by sending the labels of vertices which are not used
//- for tet mesh creation and the tet mesh vertices which are not moved
forAllConstIter(Map<label>, globalToLocalPointAddressing, it)
{
const label pI = it();
if(
nodeLabelForPoint[pI] == -1 ||
!smoothVertex_[nodeLabelForPoint[pI]]
@ -109,12 +109,12 @@ void partTetMesh::createParallelAddressing
const label neiProc = pAtProcs(pI, procI);
if( neiProc == Pstream::myProcNo() )
continue;
exchangeData[neiProc].append(it.key());
}
}
}
//- exchange data with other processors
labelLongList receivedData;
help::exchangeMap(exchangeData, receivedData);
@ -123,62 +123,62 @@ void partTetMesh::createParallelAddressing
forAll(receivedData, i)
{
const label pointI = globalToLocalPointAddressing[receivedData[i]];
if( nodeLabelForPoint[pointI] == -1 )
continue;
smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
}
for(iter=exchangeData.begin();iter!=exchangeData.end();++iter)
iter->second.clear();
//- start creating global-to-local addressing
//- find the starting point labels
label startPoint(0), nLocalPoints(0), nSharedPoints(0);
//- count the number of points at processor boundaries
forAllConstIter(Map<label>, globalToLocalPointAddressing, it)
{
const label pI = it();
if( nodeLabelForPoint[pI] == -1 )
continue;
if( !(smoothVertex_[nodeLabelForPoint[pI]] & useType) )
continue;
++nSharedPoints;
label pMin(Pstream::myProcNo());
forAllRow(pAtProcs, pI, procI)
pMin = Foam::min(pMin, pAtProcs(pI, procI));
if( pMin == Pstream::myProcNo() )
++nLocalPoints;
}
labelList nPointsAtProc(Pstream::nProcs());
nSharedPoints -= nLocalPoints;
nPointsAtProc[Pstream::myProcNo()] = points_.size() - nSharedPoints;
Pstream::gatherList(nPointsAtProc);
Pstream::scatterList(nPointsAtProc);
for(label i=0;i<Pstream::myProcNo();++i)
startPoint += nPointsAtProc[i];
//- create global labels for points at processor boundaries
forAllConstIter(Map<label>, globalToLocalPointAddressing, it)
{
const label pI = it();
if( nodeLabelForPoint[pI] == -1 )
continue;
const label pLabel = nodeLabelForPoint[pI];
if( !(smoothVertex_[pLabel] & useType) )
continue;
label pMin(Pstream::myProcNo());
forAllRow(pAtProcs, pI, procI)
{
@ -186,19 +186,19 @@ void partTetMesh::createParallelAddressing
pProcs.append(pLabel, neiProc);
pMin = Foam::min(pMin, neiProc);
}
if( pMin != Pstream::myProcNo() )
continue;
globalTetPointLabel[pLabel] = startPoint++;
forAllRow(pAtProcs, pI, procI)
{
const label neiProc = pAtProcs(pI, procI);
if( neiProc == Pstream::myProcNo() )
continue;
//- the following information is sent to other processor
//- 1. global point label in the original mesh
//- 2. global point label in the tet mesh
@ -210,7 +210,7 @@ void partTetMesh::createParallelAddressing
//- exchange data with other processors
receivedData.clear();
help::exchangeMap(exchangeData, receivedData);
label counter(0);
while( counter < receivedData.size() )
{
@ -218,17 +218,17 @@ void partTetMesh::createParallelAddressing
const label tgI = receivedData[counter++];
const label pLabel =
nodeLabelForPoint[globalToLocalPointAddressing[gpI]];
globalTetPointLabel[pLabel] = tgI;
}
//- set global labels for remaining points
forAll(globalTetPointLabel, pI)
{
if( globalTetPointLabel[pI] == -1 )
globalTetPointLabel[pI] = startPoint++;
}
//- create global to local mapping
forAll(globalTetPointLabel, pI)
{
@ -238,20 +238,20 @@ void partTetMesh::createParallelAddressing
globalToLocal.insert(globalTetPointLabel[pI], pI);
}
}
//- mark vertices at parallel boundaries
forAll(smoothVertex_, pI)
if( (smoothVertex_[pI] & useType) && (pProcs.sizeOfRow(pI) != 0) )
smoothVertex_[pI] |= PARALLELBOUNDARY;
//- create neighbour processors addressing
if( !neiProcsPtr_ )
neiProcsPtr_ = new DynList<label>();
DynList<label>& neiProcs = *neiProcsPtr_;
for(iter=exchangeData.begin();iter!=exchangeData.end();++iter)
neiProcs.append(iter->first);
# ifdef DEBUGSmooth
for(label i=0;i<Pstream::nProcs();++i)
{
@ -259,21 +259,21 @@ void partTetMesh::createParallelAddressing
{
Pout << "globalTetPointLabel " << globalTetPointLabel << endl;
}
returnReduce(i, sumOp<label>());
}
returnReduce(1, sumOp<label>());
forAll(nodeLabelForPoint, pI)
{
const label tpI = nodeLabelForPoint[pI];
if( tpI != -1 && globalTetPointLabel[tpI] == -1 )
FatalError << "Crap1 " << tpI << abort(FatalError);
}
returnReduce(1, sumOp<label>());
forAll(nodeLabelForFace, fI)
{
const label tpI = nodeLabelForFace[fI];
@ -284,33 +284,33 @@ void partTetMesh::createParallelAddressing
FatalError << "Crap2" << tpI << abort(FatalError);
}
}
returnReduce(1, sumOp<label>());
forAll(nodeLabelForCell, cI)
{
const label tpI = nodeLabelForCell[cI];
if( tpI != -1 && globalTetPointLabel[tpI] == -1 )
FatalError << "Crap3" << tpI << abort(FatalError);
}
forAll(smoothVertex_, vI)
if( smoothVertex_[vI] & partTetMesh::PARALLELBOUNDARY )
Pout << "Point " << globalTetPointLabel[vI]
<< " is at par bnd" << endl;
Serr << Pstream::myProcNo() << "points " << points_ << endl;
Serr << Pstream::myProcNo() << "Tets " << tets_ << endl;
forAll(pProcs, pI)
{
if( pProcs.sizeOfRow(pI) == 0 )
continue;
Serr << Pstream::myProcNo() << "Point " << globalTetPointLabel[pI]
<< " is at procs " << pProcs[pI] << " n tets "
<< pointTets_[pI].size() << endl;
}
returnReduce(1, sumOp<label>());
# endif
}
@ -321,12 +321,12 @@ void partTetMesh::createBufferLayers()
labelLongList& globalTetPointLabel = *globalPointLabelPtr_;
Map<label>& globalToLocal = *globalToLocalPointAddressingPtr_;
const DynList<label>& neiProcs = *this->neiProcsPtr_;
if( !pAtBufferLayersPtr_ )
pAtBufferLayersPtr_ = new labelLongList();
labelLongList& pAtBufferLayers = *pAtBufferLayersPtr_;
pAtBufferLayers.clear();
//- create the map
std::map<label, LongList<parPartTet> > exchangeTets;
forAll(neiProcs, procI)
@ -334,32 +334,32 @@ void partTetMesh::createBufferLayers()
(
std::make_pair(neiProcs[procI], LongList<parPartTet>())
);
//- go through the tets and add the ones having vertices at parallel
//- boundaries for sending
forAll(tets_, tetI)
{
const partTet& pt = tets_[tetI];
DynList<label> sendToProcs;
forAll(pt, i)
{
const label pLabel = pt[i];
if( smoothVertex_[pLabel] & PARALLELBOUNDARY )
{
forAllRow(pProcs, pLabel, i)
{
const label neiProc = pProcs(pLabel, i);
if( neiProc == Pstream::myProcNo() )
continue;
sendToProcs.appendIfNotIn(neiProc);
}
}
}
if( sendToProcs.size() )
{
const parPartTet tet
@ -369,36 +369,36 @@ void partTetMesh::createBufferLayers()
labelledPoint(globalTetPointLabel[pt[2]], points_[pt[2]]),
labelledPoint(globalTetPointLabel[pt[3]], points_[pt[3]])
);
forAll(sendToProcs, i)
{
exchangeTets[sendToProcs[i]].append(tet);
forAll(pt, j)
{
if( pProcs.sizeOfRow(pt[j]) == 0 )
pAtBufferLayers.append(pt[j]);
pProcs.appendIfNotIn(pt[j], sendToProcs[i]);
}
}
}
}
LongList<parPartTet> receivedTets;
help::exchangeMap(exchangeTets, receivedTets);
exchangeTets.clear();
Map<label> newGlobalToLocal;
forAll(receivedTets, i)
{
const parPartTet& tet = receivedTets[i];
DynList<label> tetPointLabels;
for(label j=0;j<4;++j)
{
const label gpI = tet[j].pointLabel();
if( globalToLocal.found(gpI) )
{
const label pI = globalToLocal[gpI];
@ -419,13 +419,13 @@ void partTetMesh::createBufferLayers()
DynList<label> helper;
helper.append(tets_.size());
pointTets_.appendList(helper);
globalTetPointLabel.append(gpI);
helper[0] = Pstream::myProcNo();
pProcs.appendList(helper);
}
}
//- append tet
tets_.append
(
@ -438,7 +438,7 @@ void partTetMesh::createBufferLayers()
)
);
}
//- insert the global labels of the buffer points
//- into the globalToLocal map
forAllConstIter(Map<label>, newGlobalToLocal, it)
@ -455,13 +455,13 @@ void partTetMesh::createBufferLayers()
if( it() < pProcs.size() )
forAllRow(pProcs, it(), j)
np.append(pProcs(it(), j));
Pout << "Tet mesh point " << it() << " has global label "
<< it.key() << " and is located at procs "
<< np << endl;
}
}
returnReduce(1, sumOp<label>());
}
# endif

View file

@ -49,7 +49,7 @@ partTetMeshSimplex::partTetMeshSimplex
const LongList<point>& points = tm.points();
const LongList<partTet>& tets = tm.tets();
const VRWGraph& pt = tm.pointTets();
tets_.setSize(pt.sizeOfRow(pI));
label counter(0);
@ -67,11 +67,11 @@ partTetMeshSimplex::partTetMeshSimplex
++counter;
}
}
# ifdef DEBUGSmooth
Info << "Tet " << tetI << " is " << tet << endl;
# endif
const label pos = tet.whichPosition(pI);
switch( pos )
{
@ -143,12 +143,12 @@ partTetMeshSimplex::partTetMeshSimplex
{
tets_.setSize(pt.size());
label pI(0);
Map<label> addr;
forAll(pt, tetI)
{
const parPartTet& tet = pt[tetI];
label pos(-1);
for(label i=0;i<4;++i)
{
@ -158,11 +158,11 @@ partTetMeshSimplex::partTetMeshSimplex
pts_.append(tet[i].coordinates());
++pI;
}
if( tet[i].pointLabel() == gpI )
pos = i;
}
switch( pos )
{
case 0:
@ -223,7 +223,7 @@ partTetMeshSimplex::partTetMeshSimplex
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
partTetMeshSimplex::~partTetMeshSimplex()
{}

View file

@ -26,9 +26,9 @@ Class
Description
A simplex which is used for smoothing purposes
SourceFiles
\*---------------------------------------------------------------------------*/
@ -42,7 +42,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
class partTetMesh;
@ -55,45 +55,45 @@ class partTetMeshSimplex
// Private data
//- points making the simplex
DynList<point, 128> pts_;
//- tets making the simplex
DynList<partTet, 128> tets_;
public:
// Constructors
//- Construct from partTetMeshSimplex and point label
partTetMeshSimplex(const partTetMesh& tm, const label pI);
//- Construct from the list of parPartTet and point label
partTetMeshSimplex
(
const DynList<parPartTet>& pt,
const label gpI
);
// Destructor
~partTetMeshSimplex();
// Member functions
//- return points
inline DynList<point, 128>& pts()
{
return pts_;
}
//- return points
inline const DynList<point, 128>& pts() const
{
return pts_;
}
//- return tets
inline const DynList<partTet, 128>& tets() const
{
return tets_;
}
//- return centre point coordinates
inline const point& centrePoint() const
{

View file

@ -37,9 +37,9 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void partTriMesh::createPointsAndTrias
(
const List<direction>& useFace
@ -52,7 +52,7 @@ void partTriMesh::createPointsAndTrias
const labelList& bPoints = meshSurface.boundaryPoints();
const labelList& bp = meshSurface.bp();
const faceList::subList& bFaces = meshSurface.boundaryFaces();
meshSurfacePointLabelInTriMesh_.setSize(bPoints.size());
meshSurfacePointLabelInTriMesh_ = -1;
labelList nodeLabelForFace(bFaces.size(), -1);
@ -128,7 +128,7 @@ void partTriMesh::createPointsAndTrias
pts[npI] = points[bPoints[bpI]];
pointType_[npI] |= SMOOTH;
}
forAll(nodeLabelForFace, bfI)
if( nodeLabelForFace[bfI] != -1 )
{
@ -148,7 +148,7 @@ void partTriMesh::createPointsAndTrias
if( pI != -1 )
pointType_[pI] |= FEATUREEDGE;
}
//- create addressing for parallel runs
if( Pstream::parRun() )
{
@ -157,7 +157,7 @@ void partTriMesh::createPointsAndTrias
meshSurfacePointLabelInTriMesh_,
nodeLabelForFace
);
createBufferLayers();
}
}

View file

@ -49,7 +49,7 @@ partTriMeshSimplex::partTriMeshSimplex
const pointField& points = tm.points();
const LongList<labelledTri>& trias = tm.triangles();
const VRWGraph& pt = tm.pointTriangles();
trias_.setSize(pt.sizeOfRow(pI));
label counter(0);
@ -68,11 +68,11 @@ partTriMeshSimplex::partTriMeshSimplex
++counter;
}
}
# ifdef DEBUGSmooth
Info << "Tet " << tetI << " is " << tet << endl;
# endif
label pos(-1);
for(label i=0;i<3;++i)
if( tri[i] == pI )
@ -109,7 +109,7 @@ partTriMeshSimplex::partTriMeshSimplex
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
partTriMeshSimplex::~partTriMeshSimplex()
{}

View file

@ -26,9 +26,9 @@ Class
Description
A simplex which is used for smoothing purposes
SourceFiles
\*---------------------------------------------------------------------------*/
@ -42,7 +42,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
class partTriMesh;
@ -55,38 +55,38 @@ class partTriMeshSimplex
// Private data
//- points making the simplex
DynList<point, 32> pts_;
//- triangles making the simplex
DynList<triFace, 32> trias_;
public:
// Constructors
//- Construct from partTriMesh and point label
partTriMeshSimplex(const partTriMesh& tm, const label pI);
// Destructor
~partTriMeshSimplex();
// Member functions
//- return points
inline DynList<point, 32>& pts()
{
return pts_;
}
//- return points
inline const DynList<point, 32>& pts() const
{
return pts_;
}
//- return triangles
inline const DynList<triFace, 32>& triangles() const
{
return trias_;
}
//- return centre point coordinates
inline const point& centrePoint() const
{

View file

@ -43,7 +43,7 @@ defineTemplateTypeNameAndDebugWithName
"polyBoundaryMesh",
0
);
defineTypeNameAndDebug(boundaryPatchBase, 0);
defineRunTimeSelectionTable(boundaryPatchBase, dictionary);
@ -60,7 +60,7 @@ autoPtr<boundaryPatchBase> boundaryPatchBase::New
//- Other patch types are treated as ordinary patches
if( type != "processor" )
type = "patch";
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
@ -76,7 +76,7 @@ autoPtr<boundaryPatchBase> boundaryPatchBase::New
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalIOError);
}
return autoPtr<boundaryPatchBase>(cstrIter()(name, dict));
}
@ -90,7 +90,7 @@ autoPtr<boundaryPatchBase> boundaryPatchBase::New
return boundaryPatchBase::New(name, dict);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
boundaryPatchBase::boundaryPatchBase
@ -106,7 +106,7 @@ boundaryPatchBase::boundaryPatchBase
nFaces_(nF),
startFace_(sF)
{}
boundaryPatchBase::boundaryPatchBase(const word& name, const dictionary& dict)
:
name_(name),

View file

@ -51,23 +51,23 @@ namespace Foam
class boundaryPatchBase
{
protected:
// Protected data
word name_;
word type_;
label nFaces_;
label startFace_;
public:
//- Runtime type information
TypeName("boundaryPatchBase");
// Constructors
boundaryPatchBase
(
const word&,
@ -84,7 +84,7 @@ public:
{}
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
@ -98,20 +98,20 @@ public:
);
// Selectors
static autoPtr<boundaryPatchBase> New
(
const word& name,
const dictionary& dict
);
static autoPtr<boundaryPatchBase> New
(
Istream&
);
// Construct and return a clone
autoPtr<boundaryPatchBase> clone() const
{
return New
@ -120,7 +120,7 @@ public:
this->dict()
);
}
//- Write
virtual void write(Ostream&) const = 0;
@ -133,45 +133,45 @@ public:
{
return name_;
}
inline word& patchName()
{
return name_;
}
inline const word& patchType() const
{
return type_;
}
inline word& patchType()
{
return type_;
}
inline label patchStart() const
{
return startFace_;
}
inline label& patchStart()
{
return startFace_;
}
inline label patchSize() const
{
return nFaces_;
}
inline label& patchSize()
{
return nFaces_;
}
//- Return as dictionary of entries
virtual dictionary dict() const = 0;
// Member operators
friend Ostream& operator<<(Ostream&, const boundaryPatchBase&);
virtual Istream& operator>>(Istream&) = 0;

View file

@ -39,7 +39,7 @@ namespace Foam
defineTypeNameAndDebug(processorBoundaryPatch, 0);
addToRunTimeSelectionTable(boundaryPatchBase, processorBoundaryPatch, dictionary);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
processorBoundaryPatch::processorBoundaryPatch
@ -56,7 +56,7 @@ processorBoundaryPatch::processorBoundaryPatch
myProcNo_(myProcNo),
neighbProcNo_(neighbProcNo)
{}
processorBoundaryPatch::processorBoundaryPatch
(
const word& name,
@ -67,10 +67,10 @@ processorBoundaryPatch::processorBoundaryPatch
myProcNo_(readLabel(dict.lookup("myProcNo"))),
neighbProcNo_(readLabel(dict.lookup("neighbProcNo")))
{
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionary processorBoundaryPatch::dict() const
{
dictionary dict;
@ -92,7 +92,7 @@ void processorBoundaryPatch::write(Ostream& os) const
void processorBoundaryPatch::writeDict(Ostream& os) const
{
}
Ostream& processorBoundaryPatch::operator<<(Ostream& os) const

View file

@ -52,7 +52,7 @@ class polyMeshGen
dictionary metaDict_;
public:
// Constructors
//- Null constructor
polyMeshGen(const Time& t);
@ -77,7 +77,7 @@ public:
const labelList& patchStart,
const labelList& nFacesInPatch
);
// Destructor
~polyMeshGen();
@ -97,13 +97,13 @@ public:
// Read mesh
void read();
// Write mesh
void write() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -39,12 +39,12 @@ namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const faceListPMG& polyMeshGenFaces::faces() const
{
return faces_;
}
inline label polyMeshGenFaces::nInternalFaces() const
{
if( !(ownerPtr_ && neighbourPtr_) )
@ -79,7 +79,7 @@ inline const labelList& polyMeshGenFaces::owner() const
calculateOwnersAndNeighbours();
}
return *ownerPtr_;
}
@ -98,7 +98,7 @@ inline const labelList& polyMeshGenFaces::neighbour() const
calculateOwnersAndNeighbours();
}
return *neighbourPtr_;
}
@ -122,7 +122,7 @@ inline void polyMeshGenFaces::addFaceToSubset
std::map<label, meshSubset>::iterator it = faceSubsets_.find(setID);
if( it == faceSubsets_.end() )
return;
it->second.addElement(faceI);
}
@ -134,7 +134,7 @@ inline void polyMeshGenFaces::removeFaceFromSubset
std::map<label, meshSubset>::iterator it = faceSubsets_.find(setI);
if( it == faceSubsets_.end() )
return;
it->second.removeElement(faceI);
}
@ -145,7 +145,7 @@ inline void polyMeshGenFaces::faceInSubsets
) const
{
faceSubsets.clear();
std::map<label, meshSubset>::const_iterator it;
for
(
@ -162,7 +162,7 @@ inline void polyMeshGenFaces::faceInSubsets
inline void polyMeshGenFaces::faceSubsetIndices(DynList<label>& indices) const
{
indices.clear();
std::map<label, meshSubset>::const_iterator it;
for
(
@ -181,12 +181,12 @@ inline void polyMeshGenFaces::facesInSubset
) const
{
faceLabels.clear();
std::map<label, meshSubset>::const_iterator it =
faceSubsets_.find(setI);
if( it == faceSubsets_.end() )
return;
it->second.containedElements(faceLabels);
}

View file

@ -76,7 +76,7 @@ polyMeshGenPoints::polyMeshGenPoints
pointSubsets_()
{
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Destructor
polyMeshGenPoints::~polyMeshGenPoints()
@ -93,12 +93,12 @@ label polyMeshGenPoints::addPointSubset(const word& subsetName)
Warning << "Point subset " << subsetName << " already exists!" << endl;
return id;
}
id = 0;
std::map<label, meshSubset>::const_iterator it;
for(it=pointSubsets_.begin();it!=pointSubsets_.end();++it)
id = Foam::max(id, it->first+1);
pointSubsets_.insert
(
std::make_pair
@ -107,7 +107,7 @@ label polyMeshGenPoints::addPointSubset(const word& subsetName)
meshSubset(subsetName, meshSubset::POINTSUBSET)
)
);
return id;
}
@ -115,7 +115,7 @@ void polyMeshGenPoints::removePointSubset(const label subsetID)
{
if( pointSubsets_.find(subsetID) == pointSubsets_.end() )
return;
pointSubsets_.erase(subsetID);
}
@ -128,7 +128,7 @@ word polyMeshGenPoints::pointSubsetName(const label subsetID) const
Warning << "Subset " << subsetID << " is not a point subset" << endl;
return word();
}
return it->second.name();
}
@ -140,7 +140,7 @@ label polyMeshGenPoints::pointSubsetIndex(const word& subsetName) const
if( it->second.name() == subsetName )
return it->first;
}
return -1;
}
@ -158,7 +158,7 @@ void polyMeshGenPoints::read()
)
);
points_ = pts;
//- read point subsets
IOobjectList allSets
(
@ -166,12 +166,12 @@ void polyMeshGenPoints::read()
runTime_.constant(),
"polyMesh/sets"
);
wordList setNames = allSets.names("pointSet");
forAll(setNames, setI)
{
IOobject* obj = allSets.lookup(setNames[setI]);
pointSet pSet(*obj);
labelList content = pSet.toc();
const label id = addPointSubset(setNames[setI]);
@ -183,10 +183,10 @@ void polyMeshGenPoints::read()
void polyMeshGenPoints::write() const
{
points_.write();
std::map<label, meshSubset>::const_iterator setIt;
labelLongList containedElements;
//- write point selections
for(setIt=pointSubsets_.begin();setIt!=pointSubsets_.end();++setIt)
{
@ -202,9 +202,9 @@ void polyMeshGenPoints::write() const
IOobject::AUTO_WRITE
)
);
setIt->second.containedElements(containedElements);
forAll(containedElements, i)
set.insert(containedElements[i]);
set.write();

View file

@ -53,7 +53,7 @@ namespace Foam
class polyMeshGenPoints
{
protected:
// Protected data
//- reference to the Time registry
const Time& runTime_;
@ -63,14 +63,14 @@ protected:
//- map of point subsets
std::map<label, meshSubset> pointSubsets_;
// Disallow bitwise assignment
void operator=(const polyMeshGenPoints&);
polyMeshGenPoints(const polyMeshGenPoints&);
public:
friend class polyMeshGenModifier;
// Constructors
@ -83,23 +83,23 @@ public:
const Time&,
const pointField& points
);
// Destructor
~polyMeshGenPoints();
// Member functions
//- access to Time
inline const Time& returnTime() const;
//- access to points
inline const pointFieldPMG& points() const;
//- non-const access to points
inline pointFieldPMG& points();
//- append a vertex to the end of the list
inline void appendVertex(const point& p);
//- point subsets
label addPointSubset(const word&);
void removePointSubset(const label);
@ -113,10 +113,10 @@ public:
inline void pointsInSubset(const label, ListType&) const;
template<class ListType>
inline void updatePointSubsets(const ListType&);
// Read mesh
void read();
// Write mesh
void write() const;
};

View file

@ -40,7 +40,7 @@ inline const Time& polyMeshGenPoints::returnTime() const
{
return runTime_;
}
inline const pointFieldPMG& polyMeshGenPoints::points() const
{
return points_;
@ -50,7 +50,7 @@ inline pointFieldPMG& polyMeshGenPoints::points()
{
return points_;
}
inline void polyMeshGenPoints::appendVertex(const point& p)
{
points_.append(p);
@ -65,7 +65,7 @@ inline void polyMeshGenPoints::addPointToSubset
std::map<label, meshSubset>::iterator it = pointSubsets_.find(setI);
if( it == pointSubsets_.end() )
return;
it->second.addElement(pointI);
}
@ -78,7 +78,7 @@ inline void polyMeshGenPoints::removePointFromSubset
std::map<label, meshSubset>::iterator it = pointSubsets_.find(setI);
if( it == pointSubsets_.end() )
return;
it->second.removeElement(pointI);
}
@ -89,7 +89,7 @@ inline void polyMeshGenPoints::pointInSubsets
) const
{
pointSubsets.clear();
std::map<label, meshSubset>::const_iterator it;
for
(
@ -106,7 +106,7 @@ inline void polyMeshGenPoints::pointInSubsets
inline void polyMeshGenPoints::pointSubsetIndices(DynList<label>& indices) const
{
indices.clear();
std::map<label, meshSubset>::const_iterator it;
for
(
@ -125,12 +125,12 @@ inline void polyMeshGenPoints::pointsInSubset
) const
{
pointLabels.clear();
std::map<label, meshSubset>::const_iterator it =
pointSubsets_.find(setI);
if( it == pointSubsets_.end() )
return;
it->second.containedElements(pointLabels);
}

View file

@ -126,38 +126,38 @@ class polyMeshGenAddressing
//- Face areas
mutable vectorField* faceAreasPtr_;
// Parallel demand driven data
//- global point labels
mutable labelLongList* globalPointLabelPtr_;
//- global face labels
mutable labelLongList* globalFaceLabelPtr_;
//- global cell labels
mutable labelLongList* globalCellLabelPtr_;
//- global edge labels
mutable labelLongList* globalEdgeLabelPtr_;
// Parallel addressing
//- processors containing a vertex
mutable VRWGraph* pProcsPtr_;
//- global to local point adressing
mutable Map<label>* globalToLocalPointAddressingPtr_;
//- neighbour processors sharing a point with this processor
mutable DynList<label>* pointNeiProcsPtr_;
//- processors containing an edge
mutable VRWGraph* eProcsPtr_;
//- global to local edge addressing
mutable Map<label>* globalToLocalEdgeAddressingPtr_;
//- neighbour processors sharing an edge with the current processor
mutable DynList<label>* edgeNeiProcsPtr_;
@ -186,7 +186,7 @@ class polyMeshGenAddressing
//- Calculate edge-face addressing
void calcEdgeFaces() const;
//- Calculate face-edge addressing
void calcFaceEdges() const;
@ -211,16 +211,16 @@ class polyMeshGenAddressing
void clearOutEdges();
// Parallel calculations
//- calculate global point labels
void calcGlobalPointLabels() const;
//- calculate global face labels
void calcGlobalFaceLabels() const;
//- calculate global cell labels
void calcGlobalCellLabels() const;
//- calculate global edge labels
void calcGlobalEdgeLabels() const;
@ -247,7 +247,7 @@ class polyMeshGenAddressing
//- Calculate edge vectors
void calcEdgeVectors() const;
// Disallow bitwise construct
//- Default constructor
polyMeshGenAddressing();
@ -325,12 +325,12 @@ public:
const VRWGraph& cellPoints() const;
// Parallel addressing
const labelLongList& globalPointLabel() const;
const labelLongList& globalFaceLabel() const;
const labelLongList& globalCellLabel() const;
const labelLongList& globalEdgeLabel() const;
const VRWGraph& pointAtProcs() const;
const Map<label>& globalToLocalPointAddressing() const;
const DynList<label>& pointNeiProcs() const;
@ -355,7 +355,7 @@ public:
//- Clear topological data
void clearAddressing();
//- Clear parallel addressing
void clearParallelAddressing();
@ -364,7 +364,7 @@ public:
//- Clear everything primitive, geometry and addressing
void clearAll();
// Update geometry data
void updateGeometry(const boolList& changedFace);
};

View file

@ -50,7 +50,7 @@ namespace Foam
namespace polyMeshGenChecks
{
// Check geometry
//- Check boundary closedness
bool checkClosedBoundary(const polyMeshGen&, const bool report = false);
@ -193,7 +193,7 @@ bool checkFaceVertices
//- Check mesh topology for correctness. Returns false for no error.
bool checkTopology(const polyMeshGen&, const bool report = false);
//- Check mesh geometry (& implicitly topology) for correctness.
//- Check mesh geometry (& implicitly topology) for correctness.
// Returns false for no error.
bool checkGeometry(const polyMeshGen&, const bool report = false);

View file

@ -44,9 +44,9 @@ void polyMeshGenModifier::addBufferCells()
{
if( !Pstream::parRun() )
return;
Info << "Adding buffer layers" << endl;
const labelList& owner = mesh_.owner();
pointFieldPMG& points = mesh_.points();
faceListPMG& faces = facesAccess();
@ -55,12 +55,12 @@ void polyMeshGenModifier::addBufferCells()
const polyMeshGenAddressing& addressing = mesh_.addressingData();
const labelLongList& globalPointLabel = addressing.globalPointLabel();
const Map<label>& globalToLocal = addressing.globalToLocalPointAddressing();
//- receive vertices
forAll(procBoundaries, patchI)
{
labelHashSet pointsToSend;
label faceI = procBoundaries[patchI].patchStart();
const label end = faceI + procBoundaries[patchI].patchSize();
for(;faceI<end;++faceI)
@ -69,12 +69,12 @@ void polyMeshGenModifier::addBufferCells()
forAll(c, fI)
{
const face& f = faces[c[fI]];
forAll(f, pI)
pointsToSend.insert(f[pI]);
}
}
faceI = 0;
List<labelledPoint> ptsToSend(pointsToSend.size());
forAllConstIter(labelHashSet, pointsToSend, it)
@ -84,16 +84,16 @@ void polyMeshGenModifier::addBufferCells()
globalPointLabel[it.key()],
points[it.key()]
);
OPstream toOtherProc
(
Pstream::blocking,
procBoundaries[patchI].neiProcNo()
);
toOtherProc << ptsToSend;
}
Map<label> globalToLocalReceived;
forAll(procBoundaries, patchI)
{
@ -103,16 +103,16 @@ void polyMeshGenModifier::addBufferCells()
IPstream::blocking,
procBoundaries[patchI].neiProcNo()
);
fromOtherProc >> receivedPoints;
forAll(receivedPoints, i)
{
if( globalToLocal.found(receivedPoints[i].pointLabel()) )
continue;
if( globalToLocalReceived.found(receivedPoints[i].pointLabel()) )
continue;
globalToLocalReceived.insert
(
receivedPoints[i].pointLabel(),
@ -121,62 +121,62 @@ void polyMeshGenModifier::addBufferCells()
points.append(receivedPoints[i].coordinates());
}
}
//- send cells to other processors
forAll(procBoundaries, patchI)
{
labelHashSet cellsToSend;
label faceI = procBoundaries[patchI].patchStart();
const label end = faceI + procBoundaries[patchI].patchSize();
for(;faceI<end;++faceI)
cellsToSend.insert(owner[faceI]);
labelLongList flattenedCells;
forAllConstIter(labelHashSet, cellsToSend, it)
{
const cell& c = cells[it.key()];
//- the number of faces in the cell
flattenedCells.append(c.size());
//- add faces
forAll(c, fI)
{
const face& f = faces[c[fI]];
//- the number of vertices in the face
flattenedCells.append(f.size());
forAll(f, pI)
flattenedCells.append(globalPointLabel[f[pI]]);
}
}
OPstream toOtherProc
(
Pstream::blocking,
procBoundaries[patchI].neiProcNo()
);
toOtherProc << flattenedCells;
}
forAll(procBoundaries, patchI)
{
word subsetName = "processor_";
subsetName += help::scalarToText(procBoundaries[patchI].neiProcNo());
const label subsetID = mesh_.addCellSubset(subsetName);
labelList receivedCells;
IPstream fromOtherProc
(
Pstream::blocking,
procBoundaries[patchI].neiProcNo()
);
fromOtherProc >> receivedCells;
label counter(0);
while( counter < receivedCells.size() )
{
@ -187,7 +187,7 @@ void polyMeshGenModifier::addBufferCells()
forAll(c[fI], pI)
{
const label gpI = receivedCells[counter++];
if( globalToLocal.found(gpI) )
{
c[fI][pI] = globalToLocal[gpI];
@ -198,14 +198,14 @@ void polyMeshGenModifier::addBufferCells()
}
}
}
mesh_.addCellToSubset(subsetID, cells.size());
addCell(c);
}
}
mesh_.clearOut();
Info << "Finished adding buffer layers" << endl;
}

View file

@ -48,12 +48,12 @@ polyMeshGenModifierAddCellByCell::polyMeshGenModifierAddCellByCell
faceListPMG& faces = this->facesAccess();
forAll(faces, faceI)
newFaces_[faceI].transfer(faces[faceI]);
cellListPMG& cells = this->cellsAccess();
forAll(cells, cellI)
newCells_[cellI].transfer(cells[cellI]);
};
// Destructor
polyMeshGenModifierAddCellByCell::~polyMeshGenModifierAddCellByCell()
{
@ -61,46 +61,46 @@ polyMeshGenModifierAddCellByCell::~polyMeshGenModifierAddCellByCell()
faces.setSize(nFaces_);
forAll(faces, faceI)
faces[faceI].transfer(newFaces_[faceI]);
cellListPMG& cells = this->cellsAccess();
cells.setSize(newCells_.size());
forAll(cells, cellI)
cells[cellI].transfer(newCells_[cellI]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void polyMeshGenModifierAddCellByCell::addCell(const faceList& cellFaces)
{
cell c(cellFaces.size());
VRWGraph& pointFaces = this->pointFaces();
forAll(cellFaces, faceI)
{
const face& f = cellFaces[faceI];
const label pointI = f[0];
label fLabel(-1);
forAllRow(pointFaces, pointI, pfI)
{
const label faceI = pointFaces(pointI, pfI);
if( newFaces_[faceI] == f )
{
fLabel = faceI;
break;
}
}
if( fLabel == -1 )
{
newFaces_.append(f);
c[faceI] = nFaces_;
forAll(f, pI)
pointFaces.append(f[pI], nFaces_);
++nFaces_;
}
else
@ -108,7 +108,7 @@ void polyMeshGenModifierAddCellByCell::addCell(const faceList& cellFaces)
c[faceI] = fLabel;
}
}
newCells_.append(c);
++nCells_;
}

View file

@ -51,7 +51,7 @@ class polyMeshGenModifierAddCellByCell
//- number of faces
label nFaces_;
LongList<face> newFaces_;
//- number of cells
label nCells_;
LongList<cell> newCells_;
@ -61,10 +61,10 @@ public:
// Constructors
//- Construct from the reference to the mesh
polyMeshGenModifierAddCellByCell(polyMeshGen& mesh);
// Destructor
~polyMeshGenModifierAddCellByCell();
// Member functions
//- add a single cell (vertices must be added);
void addCell(const faceList& cell);

View file

@ -42,12 +42,12 @@ namespace Foam
void polyMeshGenModifier::zipUpCells()
{
this->clearOut();
Info<< "Zipping up topologically open cells" << endl;
const pointFieldPMG& points = mesh_.points();
const cellListPMG& cells = mesh_.cells();
faceListPMG& faces = mesh_.faces_;
// Algorithm:
@ -67,7 +67,7 @@ void polyMeshGenModifier::zipUpCells()
// pass. It is therefore essential to discard the addressing
// after every pass. The algorithm is completed when the mesh
// stops changing.
//
//
label nChangedFacesInMesh;
label nCycles(0);
@ -77,7 +77,7 @@ void polyMeshGenModifier::zipUpCells()
do
{
nChangedFacesInMesh = 0;
//- calculate pointFaces addressing
# ifdef DEBUG_ZIPUP
Info << "Starting pointFaces addressing " << endl;
@ -90,20 +90,20 @@ void polyMeshGenModifier::zipUpCells()
forAll(f, pI)
++nUsage[f[pI]];
}
VRWGraph pFaces(points.size());
forAll(nUsage, pI)
pFaces.setRowSize(pI, nUsage[pI]);
nUsage = 0;
forAll(faces, fI)
{
const face& f = faces[fI];
forAll(f, pI)
pFaces(f[pI], nUsage[f[pI]]++) = fI;
}
nUsage.clear();
# ifdef DEBUG_ZIPUP
@ -271,7 +271,7 @@ void polyMeshGenModifier::zipUpCells()
// Go through the points and start from the point used twice
// check all the edges to find the edges starting from this point
// add the
// add the
labelListList edgesToInsert(singleEdges.size());
label nEdgesToInsert = 0;
@ -472,7 +472,7 @@ void polyMeshGenModifier::zipUpCells()
// Warning: the ordering must be parametric, because in
// the case of multiple point insertion onto the same edge
// it is possible to get non-cyclic loops
//
//
const labelList& unorderedEdge = edgesToInsert[edgeToInsertI];
@ -552,17 +552,17 @@ void polyMeshGenModifier::zipUpCells()
// point-face addressing in two goes.
const label start = testEdge.start();
const label end = testEdge.end();
labelList facesSharingEdge
(
pFaces.sizeOfRow(start) +
pFaces.sizeOfRow(end)
);
label nfse = 0;
forAllRow(pFaces, start, pfI)
facesSharingEdge[nfse++] = pFaces(start, pfI);
forAllRow(pFaces, end, pfI)
facesSharingEdge[nfse++] = pFaces(end, pfI);
@ -708,7 +708,7 @@ void polyMeshGenModifier::zipUpCells()
nNewFacePoints++;
}
}
forAll(newFace, pI)
pFaces.appendIfNotIn
(
@ -721,7 +721,7 @@ void polyMeshGenModifier::zipUpCells()
<< faces[currentFaceIndex] << nl
<< "newFace: " << newFace << endl;
# endif
// Check for duplicate points in the new face
forAll (newFace, checkI)
{

View file

@ -54,7 +54,7 @@ class Ostream;
class partTet
{
protected:
// Protected data
label data_[4];
@ -89,9 +89,9 @@ public:
inline label c() const;
inline label d() const;
inline label size() const;
// Searches
//- find position of the node in the partTet
inline label whichPosition(const label) const;
@ -115,25 +115,25 @@ public:
//- Return volume
template<class PointField>
inline scalar mag(const PointField&) const;
//- Return circum-centre
template<class PointField>
inline point crcmCentre(const PointField&) const;
template<class PointField>
inline scalar crcmRadius(const PointField&) const;
//- Return centroid of the tetrahedron
template<class PointField>
inline point centroid(const PointField&) const;
//- Return edges
edgeList edges() const;
// Member operators
inline label operator[](const label) const;
inline void operator=(const partTet&);
// IOstream operators

View file

@ -39,7 +39,7 @@ namespace Foam
inline partTet::partTet()
{
}
inline partTet::partTet
(
const label a,
@ -90,7 +90,7 @@ inline label partTet::whichPosition(const label pointI) const
for(label i=0;i<4;++i)
if( data_[i] == pointI )
return i;
return -1;
}
@ -103,7 +103,7 @@ inline vector partTet::Sa(const PointField& points) const
points[data_[2]],
points[data_[3]]
);
return tria.normal();
//return triangle<point, point>(b_, c_, d_).normal();
}
@ -117,7 +117,7 @@ inline vector partTet::Sb(const PointField& points) const
points[data_[3]],
points[data_[2]]
);
return tria.normal();
//return triangle<point, point>(a_, d_, c_).normal();
}
@ -131,7 +131,7 @@ inline vector partTet::Sc(const PointField& points) const
points[data_[1]],
points[data_[3]]
);
return tria.normal();
//return triangle<point, point>(a_, b_, d_).normal();
}
@ -145,7 +145,7 @@ inline vector partTet::Sd(const PointField& points) const
points[data_[2]],
points[data_[1]]
);
return tria.normal();
//return triangle<point, point>(a_, c_, b_).normal();
}
@ -160,7 +160,7 @@ inline scalar partTet::mag(const PointField& points) const
points[data_[2]],
points[data_[3]]
);
return tet.mag();
//return (1.0/6.0)*(((b_ - a_) ^ (c_ - a_)) & (d_ - a_));
}
@ -175,7 +175,7 @@ inline point partTet::crcmCentre(const PointField& points) const
points[data_[2]],
points[data_[3]]
);
return tet.circumCentre();
}
@ -189,7 +189,7 @@ inline scalar partTet::crcmRadius(const PointField& points) const
points[data_[2]],
points[data_[3]]
);
return tet.circumRadius();
}
@ -199,7 +199,7 @@ inline point partTet::centroid(const PointField& points) const
point p = points[data_[0]];
for(label i=1;i<4;++i)
p += points[data_[i]];
p /= 4;
return p;
}

View file

@ -62,131 +62,131 @@ class meshOctreeAddressing
// Private data
//- reference to the octree
const meshOctree& octree_;
//- reference to the dictionary
const dictionary& meshDict_;
//- use DATA boxes
bool useDATABoxes_;
//- number of created octree nodes
mutable label nNodes_;
//- coordinates of octree nodes
mutable pointField* octreePointsPtr_;
//- node labels
mutable VRWGraph* nodeLabelsPtr_;
//- node leaves
mutable FRWGraph<label, 8>* nodeLeavesPtr_;
//- identify which boxes should be used as mesh cells
mutable List<direction>* boxTypePtr_;
//- identify created nodes as OUTERNODE or INNERNODE
mutable List<direction>* nodeTypePtr_;
// Additional addressing useful for some algorithms
//- faces of the octree
mutable VRWGraph* octreeFacesPtr_;
mutable labelLongList* octreeFacesOwnersPtr_;
mutable labelLongList* octreeFacesNeighboursPtr_;
//- octree box-faces addressing
mutable VRWGraph* leafFacesPtr_;
//- node-faces addressing
mutable VRWGraph* nodeFacesPtr_;
//- leaf-leaves addressing
mutable VRWGraph* leafLeavesPtr_;
//- edges of the octree
mutable LongList<edge>* octreeEdgesPtr_;
//- edges-leaves addressing
mutable VRWGraph* edgeLeavesPtr_;
//- leaf-edges addressing
mutable VRWGraph* leafEdgesPtr_;
//- node-edges addressing
mutable VRWGraph* nodeEdgesPtr_;
//- face-edges addressing
mutable VRWGraph* faceEdgesPtr_;
//- edge-faces addressing
mutable VRWGraph* edgeFacesPtr_;
//- global octree point label
mutable labelLongList* globalPointLabelPtr_;
//- global point to local label addressing
mutable Map<label>* globalPointToLocalPtr_;
//- point-processors addressing
mutable VRWGraph* pointProcsPtr_;
//- global octree face label
mutable labelLongList* globalFaceLabelPtr_;
//- global face label to local label addressing
mutable Map<label>* globalFaceToLocalPtr_;
//- face-processors addressing
mutable VRWGraph* faceProcsPtr_;
//- global leaf label
mutable labelLongList* globalLeafLabelPtr_;
//- global leaf label to local label addressing for octree leaves
mutable Map<label>* globalLeafToLocalPtr_;
//- leaf at procs
mutable VRWGraph* leafAtProcsPtr_;
// Private member functions
//- calculate octreePointsPtr_
void createOctreePoints() const;
//- calculate nodeLabelsPtr_
void createNodeLabels() const;
//- calculate nodeLeavesPtr_
void createNodeLeaves() const;
//- assemble boxTypePtr_ list
void findUsedBoxes() const;
//- calculate nodeTypePtr_
void calculateNodeType() const;
//- calculate faces
void createOctreeFaces() const;
//- calculate leaf-faces addressing
void calculateLeafFaces() const;
//- calculate node-faces addressing
void calculateNodeFaces() const;
//- calculate leaf-leaves addressing
void calculateLeafLeaves() const;
//- calculate edges
void createOctreeEdges() const;
//- calculate leaf-edges
void calculateLeafEdges() const;
//- calculate edge-leaves addressing
void calculateEdgeLeaves() const;
//- calculate edge-faces
void calculateEdgeFaces() const;
//- Clear allocated data
void clearOut();
void clearBoxTypes();
@ -194,12 +194,12 @@ class meshOctreeAddressing
void clearOctreeFaces();
void clearAddressing();
void clearParallelAddressing();
//- check if distinct parts are glued together
void checkGluedRegions();
// Private member functions for parallel runs
void calcGlobalPointLabels() const;
void calcGlobalFaceLabels() const;
void calcGlobalLeafLabels() const;
@ -239,9 +239,9 @@ public:
OUTERNODE = 16,
BOUNDARYNODE = 32
};
// Member Functions
//- check if there exist any non-signly connected edges and vertices
//- in the octree mesh. This is primarily needed
//- for the cartesian template
@ -249,7 +249,7 @@ public:
//- return number of octree nodes
inline label numberOfNodes() const;
//- return coordinates of octree vertices
inline const pointField& octreePoints() const;
@ -258,46 +258,46 @@ public:
//- return nodeLeaves
inline const FRWGraph<label, 8>& nodeLeaves() const;
//- return which octree boxes are used for mesh creation
inline const List<direction>& boxType() const;
//- return type of node (INNERNODE,or OUTERNODE)
inline const List<direction>& nodeType() const;
//- set box type
inline void setBoxType(const label boxI, const direction type);
//- return octree faces, created for MESHCELL boxes
inline const VRWGraph& octreeFaces() const;
//- return owners of octree faces
inline const labelLongList& octreeFaceOwner() const;
//- return neighbours of octree faces
inline const labelLongList& octreeFaceNeighbour() const;
//- return octree box-faces addressing
inline const VRWGraph& leafFaces() const;
//- checks if the face is intersected by the surface
bool isIntersectedFace(const label fI) const;
//- return leaf-leaves addressing
inline const VRWGraph& leafLeaves() const;
//- return node-faces addressing
inline const VRWGraph& nodeFaces() const;
//- return octree edges, created for MESHCELL boxes
inline const LongList<edge>& octreeEdges() const;
//- return edge-leaves addressing
inline const VRWGraph& edgeLeaves() const;
//- return leaf-edges addressing
inline const VRWGraph& leafEdges() const;
//- checks if the edge is intersected by the surface
bool isIntersectedEdge(const label eI) const;
void edgeIntersections
@ -305,19 +305,19 @@ public:
const label eI,
DynList<point>& intersections
) const;
//- return node-edges addressing
inline const VRWGraph& nodeEdges() const;
//- return face-edges addressing
inline const VRWGraph& faceEdges() const;
//- return edge-faces addressing
inline const VRWGraph& edgeFaces() const;
//- return const reference to meshOctree
inline const meshOctree& octree() const;
//- find cubes around an edge (cubes must be at the same level)
void cubesAroundEdge
(
@ -325,36 +325,36 @@ public:
const direction eI,
FixedList<label, 4>& edgeCubes
) const;
//- find edge centre if it exists
label findEdgeCentre(const label leafI, const direction eI) const;
// Access to data needed for parallel execution
//- return global point labels
inline const labelLongList& globalPointLabel() const;
//- global point label to local label. Only for processors points
inline const Map<label>& globalToLocalPointAddressing() const;
//- processors which contain an octree point
inline const VRWGraph& pointAtProcs() const;
//- return global labels of octree faces
inline const labelLongList& globalFaceLabel() const;
//- return global face label to face label. Only for processor faces
inline const Map<label>& globalToLocalFaceAddressing() const;
//- return processors which contain each octree face
inline const VRWGraph& faceAtProcs() const;
//- return global labels of octree leaves
inline const labelLongList& globalLeafLabel() const;
//- return processors which contain each octree leaf
inline const VRWGraph& leafAtProcs() const;
//- return global leaf label to local label addressing
inline const Map<label>& globalToLocalLeafAddressing() const;
};

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