Commit 82d09444 authored by Mark Olesen's avatar Mark Olesen

Merge branch 'develop' into 'master'

Final content for 1806 release

Closes #4

See merge request !4
parents 3bc78e5b 288f05e0
#!/bin/sh
# Compile mesh library
wclean libso meshLibrary
cd ${0%/*} || exit 1 # Run from this directory
# Compile executables
wclean all executables
#------------------------------------------------------------------------------
# Compile utilities
wclean libso meshLibrary
wclean all executables
wclean all utilities
#------------------------------------------------------------------------------
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
......@@ -13,13 +14,8 @@ echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
# Compile mesh library
wmake libso meshLibrary
# Compile executables
wmake all executables
# Compile utilities
wmake all utilities
# Some summary information
......
......@@ -36,8 +36,6 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
#include "setRootCase.H"
......@@ -45,11 +43,10 @@ int main(int argc, char *argv[])
Module::cartesianMeshGenerator cmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
cmg.writeMesh();
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
return 0;
}
......
......@@ -46,11 +46,10 @@ int main(int argc, char *argv[])
Module::voronoiMeshGenerator pmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << endl;
pmg.writeMesh();
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
return 0;
}
......
......@@ -36,23 +36,20 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
// tetrahedral mesher cannot be run in parallel yet
// Tetrahedral mesher cannot be run in parallel yet
argList::noParallel();
Module::tetMeshGenerator tmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << endl;
tmg.writeMesh();
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
return 0;
}
......
......@@ -210,7 +210,7 @@ Foam::point Foam::Module::boundaryLayers::createNewVertex
bool found(true);
forAll(otherPatches, opI)
{
if (!pPatches.contains(bpJ, otherPatches[opI]))
if (!pPatches.found(bpJ, otherPatches[opI]))
{
found = false;
break;
......@@ -940,7 +940,7 @@ void Foam::Module::boundaryLayers::createNewEdgeVerticesParallel
bool found(true);
forAll(otherPatches, opI)
{
if (!pPatches.contains(bpJ, otherPatches[opI]))
if (!pPatches.found(bpJ, otherPatches[opI]))
{
found = false;
break;
......
......@@ -122,7 +122,7 @@ Foam::Module::extrudeLayer::addressingCalculator::faceSharingEdge
continue;
}
if (pointExtruded_.contains(nextI, currFaceI))
if (pointExtruded_.found(nextI, currFaceI))
{
if (otherFace != -1)
{
......@@ -152,7 +152,7 @@ inline void Foam::Module::extrudeLayer::addressingCalculator::facesSharingEdge
{
const label currFaceI = pointExtruded_(start, pfI);
if (pointExtruded_.contains(end, currFaceI))
if (pointExtruded_.found(end, currFaceI))
{
edgeFaces.append(currFaceI);
}
......
......@@ -487,7 +487,7 @@ void Foam::Module::refineBoundaryLayers::sortFacePoints
{
const label nfI = facesFromFace_(faceI, i);
if ((numSplitsI == 1) && newFaces_.contains(nfI, f.nextLabel(pos)))
if ((numSplitsI == 1) && newFaces_.found(nfI, f.nextLabel(pos)))
{
numSplitsI = i + 1;
break;
......@@ -584,7 +584,7 @@ void Foam::Module::refineBoundaryLayers::sortFacePoints
{
const label nfI = facesFromFace_(faceI, j);
if ((numSplitsJ == 1) && newFaces_.contains(nfI, f.prevLabel(pos)))
if ((numSplitsJ == 1) && newFaces_.found(nfI, f.prevLabel(pos)))
{
numSplitsJ = j + 1;
break;
......@@ -735,7 +735,7 @@ void Foam::Module::refineBoundaryLayers::sortFaceFaces
{
const label nfI = facesFromFace_(faceI, i);
if ((numSplitsI == 1) && newFaces_.contains(nfI, f.nextLabel(pos)))
if ((numSplitsI == 1) && newFaces_.found(nfI, f.nextLabel(pos)))
{
numSplitsI = i + 1;
break;
......@@ -789,7 +789,7 @@ void Foam::Module::refineBoundaryLayers::sortFaceFaces
{
const label nfI = facesFromFace_(faceI, j);
if ((numSplitsJ == 1) && newFaces_.contains(nfI, f.prevLabel(pos)))
if ((numSplitsJ == 1) && newFaces_.found(nfI, f.prevLabel(pos)))
{
numSplitsJ = j + 1;
break;
......
......@@ -2,9 +2,12 @@
========= |
\\ / F ield | cfMesh: A library for mesh generation
\\ / O peration |
\\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
\\/ M anipulation | Copyright (C) Creative Fields, Ltd.
\\ / A nd | Copyright (C) 2014-2017 Creative Fields, Ltd.
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
License
This file is part of OpenFOAM.
......@@ -27,45 +30,53 @@ License
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, Foam::label staticSize>
Foam::Module::DynList<T, staticSize>::DynList(Istream&)
template<class T, int SizeMin>
Foam::Module::DynList<T, SizeMin>::DynList(Istream& is)
:
dataPtr_(nullptr),
nAllocated_(0),
staticData_(),
nextFree_(0)
UList<T>(),
shortList_(),
heapList_(),
capacity_(0)
{
NotImplemented;
is >> *this;
}
template<class T, Foam::label staticSize>
template<class T, int SizeMin>
Foam::Ostream& Foam::Module::operator<<
(
Foam::Ostream& os,
const Foam::Module::DynList<T, staticSize>& DL
Ostream& os,
const Foam::Module::DynList<T, SizeMin>& list
)
{
UList<T> helper(DL.dataPtr_, DL.nextFree_);
os << helper;
os << static_cast<const UList<T>&>(list);
return os;
}
template<class T, Foam::label staticSize>
template<class T, int SizeMin>
Foam::Istream& Foam::Module::operator>>
(
Foam::Istream& is,
Foam::Module::DynList<T, staticSize>& DL
Istream& is,
Foam::Module::DynList<T, SizeMin>& list
)
{
NotImplemented;
list.clearStorage();
List<T> input(is);
const label newLen = input.size();
if (newLen <= SizeMin)
{
list.shortList_ = input;
}
else
{
list.heapList_.transfer(input);
}
UList<T> helper(DL.dataPtr_, DL.nextFree_);
//is >> static_cast<List<T>&>(DL);
is >> helper;
DL.nextFree_ = helper.size();
list.setSize(newLen);
return is;
}
......
......@@ -140,7 +140,6 @@ public:
inline void setRow(const label rowI, const FixedList<T, width>& l);
//- check if the element is in the given row (takes linear time)
inline bool contains(const label rowI, const T& e) const;
inline bool found(const label rowI, const T& e) const;
inline label find(const label rowI, const T& e) const;
......
......@@ -155,17 +155,6 @@ inline void Foam::Module::FRWGraph<T, width>::setRow
}
template<class T, Foam::label width>
inline bool Foam::Module::FRWGraph<T, width>::contains
(
const label rowI,
const T& e
) const
{
return (this->find(rowI, e) >= 0);
}
template<class T, Foam::label width>
inline bool Foam::Module::FRWGraph<T, width>::found
(
......
......@@ -178,7 +178,6 @@ public:
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 bool found(const T& e) const;
inline label find(const T& e) const;
......
......@@ -296,13 +296,6 @@ inline void Foam::Module::LongList<T, Offset>::appendIfNotIn(const T& e)
}
template<class T, int Offset>
inline bool Foam::Module::LongList<T, Offset>::contains(const T& e) const
{
return (this->find(e) >= 0);
}
template<class T, int Offset>
inline bool Foam::Module::LongList<T, Offset>::found(const T& e) const
{
......
......@@ -261,7 +261,6 @@ public:
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 bool found(const label rowI, const label e) const;
inline label find(const label rowI, const label e) const;
......
......@@ -574,16 +574,6 @@ inline void Foam::Module::VRWGraph::reverseAddressing
}
inline bool Foam::Module::VRWGraph::contains
(
const label rowI,
const label e
) const
{
return (this->find(rowI, e) >= 0);
}
inline bool Foam::Module::VRWGraph::found
(
const label rowI,
......
......@@ -101,7 +101,6 @@ public:
// Member Operators
//- check if the element is in the given row (takes linear time)
inline bool contains(const label e) const;
inline bool found(const label e) const;
inline label find(const label e) const;
......
......@@ -70,16 +70,6 @@ inline Foam::label Foam::Module::graphConstRow<graphType>::size() const
}
template<class graphType>
inline bool Foam::Module::graphConstRow<graphType>::contains
(
const label e
) const
{
return data_.contains(rowI_, e);
}
template<class graphType>
inline bool Foam::Module::graphConstRow<graphType>::found(const label e) const
{
......
......@@ -105,7 +105,6 @@ public:
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 bool found(const label e) const;
inline label find(const label e) const;
......
......@@ -83,13 +83,6 @@ inline void Foam::Module::graphRow<graphType>::appendIfNotIn(const label el)
}
template<class graphType>
inline bool Foam::Module::graphRow<graphType>::contains(const label e) const
{
return data_.contains(rowI_, e);
}
template<class graphType>
inline bool Foam::Module::graphRow<graphType>::found(const label e) const
{
......
......@@ -112,7 +112,6 @@ public:
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 bool found(const label rowI, const label e) const;
inline label find(const label rowI, const label e) const;
......
......@@ -105,17 +105,6 @@ inline void Foam::Module::subGraph<graphType>::appendIfNotIn
}
template<class graphType>
inline bool Foam::Module::subGraph<graphType>::contains
(
const label rowI,
const label e
) const
{
return data_.contains(start_ + rowI, e);
}
template<class graphType>
inline bool Foam::Module::subGraph<graphType>::found
(
......
......@@ -248,7 +248,7 @@ void Foam::Module::decomposeCells::decomposeCellIntoPyramids(const label cellI)
{
const edge e(f[eI], f[(eI + 1)%f.size()]);
const label pos = cEdges.contains(e);
const label pos = cEdges.find(e);
if (pos < 0)
{
......
......@@ -75,7 +75,7 @@ inline void Foam::Module::polyMeshGenCells::cellInSubsets
forAllConstIters(cellSubsets_, it)
{
if (it->second.contains(cellI))
if (it->second.found(cellI))
{
cellSubsets.append(it->first);
}
......
......@@ -29,7 +29,7 @@ License
#include "IOobjectList.H"
#include "faceSet.H"
#include "demandDrivenData.H"
#include "stringListOps.H"
#include "ListOps.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
......@@ -268,17 +268,15 @@ Foam::labelList Foam::Module::polyMeshGenFaces::findPatches
const word& patchName
) const
{
wordList allPatches = patchNames();
const labelList ids = findIndices(patchNames(), patchName);
labelList patchIDs = findStrings(patchName, allPatches);
if (patchIDs.empty())
if (ids.empty())
{
WarningInFunction
<< "Cannot find any patch names matching " << patchName << endl;
}
return patchIDs;
return ids;
}
......
......@@ -153,7 +153,7 @@ inline void Foam::Module::polyMeshGenFaces::faceInSubsets
forAllConstIters(faceSubsets_, it)
{
if (it->second.contains(faceI))
if (it->second.found(faceI))
{
faceSubsets.append(it->first);
}
......
......@@ -93,7 +93,7 @@ inline void Foam::Module::polyMeshGenPoints::pointInSubsets
forAllConstIters(pointSubsets_, it)
{
if (it->second.contains(pointI))
if (it->second.found(pointI))
{
pointSubsets.append(it->first);
}
......
......@@ -164,7 +164,7 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalPointLabels() const
for (label i = 0; i < nProcs; ++i)
{
const label neiProc = receivedData[counter++];
if (!pProcs.contains(f[pI], neiProc))
if (!pProcs.found(f[pI], neiProc))
{
pProcs.append(f[pI], neiProc);
finished = false;
......@@ -618,7 +618,7 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalEdgeLabels() const
for (label i = 0; i < nProcs; ++i)
{
const label neiProc = receivedData[counter++];
if (!eProcs.contains(edgeI, neiProc))
if (!eProcs.found(edgeI, neiProc))
{
eProcs.append(edgeI, neiProc);
finished = false;
......
......@@ -152,7 +152,7 @@ public:
// Searches
//- find if the element exists in the subset
inline bool contains(const label) const;
inline bool found(const label) const;
// operators
......
......@@ -162,7 +162,7 @@ inline void Foam::Module::meshSubset::updateSubset(const VRWGraph& newLabels)
}
inline bool Foam::Module::meshSubset::contains(const label elmt) const
inline bool Foam::Module::meshSubset::found(const label elmt) const
{
return (data_.find(elmt) != data_.end());
}
......
......@@ -27,7 +27,7 @@ License
#include "pointIOField.H"
#include "IOobjectList.H"
#include "pointSet.H"
#include "stringListOps.H"
#include "ListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -89,19 +89,17 @@ Foam::labelList Foam::Module::triSurfFacets::findPatches
const word& patchName
) const
{
const wordList allPatches = patchNames();
const labelList patchIDs = findStrings(patchName, allPatches);
const labelList ids = findIndices(patchNames(), patchName);
# ifdef DEBUGtriSurf
if (patchIDs.empty())
if (ids.empty())
{
WarningInFunction
<< "Cannot find any patch names matching " << patchName << endl;
}
# endif
return patchIDs;
return ids;
}
......
......@@ -100,7 +100,7 @@ inline void Foam::Module::triSurfFacets::facetInSubsets
forAllConstIters(facetSubsets_, it)
{
if (it().contains(triI))
if (it().found(triI))
{
facetSubsets.append(it.key());
}
......
......@@ -91,7 +91,7 @@ inline void Foam::Module::triSurfFeatureEdges::edgeInSubsets
forAllConstIters(featureEdgeSubsets_, it)
{
if (it().contains(eI))
if (it().found(eI))
{
edgeSubsets.append(it.key());
}
......
......@@ -87,7 +87,7 @@ inline void Foam::Module::triSurfPoints::pointInSubsets
forAllConstIters(pointSubsets_, it)
{
if (it().contains(pointI))
if (it().found(pointI))
{
pointSubsets.append(it.key());
}
......
......@@ -668,7 +668,7 @@ void Foam::Module::meshOctreeAddressing::calcGlobalLeafLabels() const
continue;
}
if (!leafAtProcs.contains(leafI, it->first))
if (!leafAtProcs.found(leafI, it->first))
{
FatalError << "Problem!!" << leafI
<< " does not contain processor " << it->first
......
......@@ -83,7 +83,7 @@ void Foam::Module::meshOptimizer::laplaceSmoother::laplacianParallel
forAllRow(pointAtProcs, nei, procI)
{
const label procJ = pointAtProcs(nei, procI);
if ((procJ < pMin) && pointAtProcs.contains(pointI, procJ))
if ((procJ < pMin) && pointAtProcs.found(pointI, procJ))
pMin = procJ;
}
......
......@@ -86,7 +86,7 @@ void Foam::Module::meshSurfaceOptimizer::nodeDisplacementLaplacianParallel
forAllRow(bpAtProcs, nei, procI)
{
const label procJ = bpAtProcs(nei, procI);
if ((procJ < pMin) && bpAtProcs.contains(bpI, procJ))
if ((procJ < pMin) && bpAtProcs.found(bpI, procJ))
pMin = procJ;
}
......
......@@ -110,7 +110,7 @@ checkAndFixCellGroupsAtBndVertices
if (cellGroup.found(neiCell))
continue;
if (pointCells.contains(pointI, neiCell))
if (pointCells.found(pointI, neiCell))
{
cellGroup.insert(neiCell, nGroup);
frontCells.append(neiCell);
......@@ -644,7 +644,7 @@ checkFaceGroupsAtBndVertices
if (faceGroup.found(neiFace))
continue;
if (pointFaces.contains(bpI, neiFace))
if (pointFaces.found(bpI, neiFace))
{
front.append(neiFace);
faceGroup.insert(neiFace, nGroup);
......
......@@ -154,7 +154,7 @@ void Foam::Module::meshSurfaceEngine::calcGlobalBoundaryPointLabels() const
for (label i = 0; i < nProcs; ++i)
{
const label neiProc = receivedData[counter++];
if (!bpAtProcs.contains(bp[f[pI]], neiProc))
if (!bpAtProcs.found(bp[f[pI]], neiProc))
{
bpAtProcs.append(bp[f[pI]], neiProc);
finished = false;
......@@ -473,7 +473,7 @@ void Foam::Module::meshSurfaceEngine::calcGlobalBoundaryEdgeLabels() const
for (label i = 0; i < nProcs; ++i)
{
const label neiProc = receivedData[counter++];
if (!beAtProcs.contains(edgeI, neiProc))
if (!beAtProcs.found(edgeI, neiProc))
{
facesWithProcBndEdges[patchI].insert
(
......
......@@ -407,7 +407,7 @@ void Foam::Module::meshSurfaceMapper2D::mapCorners
DynList<label> ePatches;
forAllRow(pPatches, bps, i)
{
if (pPatches.contains(bpe, pPatches(bps, i)))
if (pPatches.found(bpe, pPatches(bps, i)))
ePatches.append(pPatches(bps, i));
}
......
......@@ -75,7 +75,7 @@ void Foam::Module::voronoiMeshExtractor::createAddressing() const
{
const label tetJ = pointTets(start, ptI);
if (!endTets.contains(tetJ))
if (!endTets.found(tetJ))
continue;
if (tetJ < tetI)
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
<