Commit a73c80a7 authored by Franjo's avatar Franjo
Browse files

Merge remote-tracking branch 'publicRepo/development' into development

Conflicts:
	executables/cartesianMesh/Make/files
	executables/cartesianMesh/Make/options
	executables/tetMesh/Make/files
	executables/tetMesh/Make/options
	meshLibrary/Make/files
	meshLibrary/cartesian2DMesh/cartesian2DMeshGenerator/cartesian2DMeshGenerator.C
	meshLibrary/cartesianMesh/cartesianMeshGenerator/cartesianMeshGenerator.C
	meshLibrary/tetMesh/tetMeshExtractorOctree/tetMeshExtractorOctree.C
	meshLibrary/tetMesh/tetMeshGenerator/tetMeshGenerator.C
	meshLibrary/utilities/boundaryLayers/boundaryLayerCells.C
	meshLibrary/utilities/boundaryLayers/boundaryLayers.C
	meshLibrary/utilities/boundaryLayers/boundaryLayers.H
	meshLibrary/utilities/boundaryLayers/boundaryLayersI.H
	meshLibrary/utilities/boundaryLayers/refineBoundaryLayers.C
	meshLibrary/utilities/boundaryLayers/refineBoundaryLayersCells.C
	meshLibrary/utilities/boundaryLayers/refineBoundaryLayersFaces.C
	meshLibrary/utilities/checkMeshDict/checkMeshDict.C
	meshLibrary/utilities/checkMeshDict/checkMeshDict.H
	meshLibrary/utilities/helperFunctions/helperFunctionsGeometryQueries.H
	meshLibrary/utilities/helperFunctions/helperFunctionsGeometryQueriesI.H
	meshLibrary/utilities/meshes/partTriMesh/partTriMesh.C
	meshLibrary/utilities/meshes/partTriMesh/partTriMeshParallelAddressing.C
	meshLibrary/utilities/meshes/polyMeshGen/boundaryPatch/boundaryPatch.C
	meshLibrary/utilities/meshes/polyMeshGen/polyMeshGenFaces.C
	meshLibrary/utilities/meshes/polyMeshGen/polyMeshGenFaces.H
	meshLibrary/utilities/meshes/triSurf/triSurfFacets.C
	meshLibrary/utilities/meshes/triSurf/triSurfFacets.H
	meshLibrary/utilities/octrees/meshOctree/meshOctreeAddressing/meshOctreeAddressingCreation.C
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreator.C
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreator.H
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorAdjustOctreeToSurface.C
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCube.H
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeI.H
	meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeRecursiveFunctions.C
	meshLibrary/utilities/octrees/meshOctree/meshOctreeModifier/meshOctreeModifier.H
	meshLibrary/utilities/octrees/meshOctree/meshOctreeModifier/meshOctreeModifierRefineSelectedBoxes.C
	meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/objectRefinement.C
	meshLibrary/utilities/octrees/meshOctree/refinementControls/objectRefinement/objectRefinement.H
	meshLibrary/utilities/smoothers/geometry/meshOptimizer/meshOptimizer.C
	meshLibrary/utilities/smoothers/geometry/meshOptimizer/meshOptimizer.H
	meshLibrary/utilities/smoothers/geometry/meshOptimizer/meshOptimizerOptimizeSurface.C
	meshLibrary/utilities/smoothers/geometry/meshOptimizer/optimizeMeshFV.C
	meshLibrary/utilities/smoothers/geometry/meshSurfaceOptimizer/meshSurfaceOptimizer.C
	meshLibrary/utilities/smoothers/geometry/meshSurfaceOptimizer/meshSurfaceOptimizer.H
	meshLibrary/utilities/smoothers/geometry/meshSurfaceOptimizer/meshSurfaceOptimizerI.H
	meshLibrary/utilities/smoothers/geometry/meshSurfaceOptimizer/meshSurfaceOptimizerOptimizePointParallel.C
	meshLibrary/utilities/smoothers/geometry/meshSurfaceOptimizer/meshSurfaceOptimizerOptimizeSurface.C
	meshLibrary/utilities/surfaceTools/edgeExtraction/edgeExtractor/edgeExtractor.C
	meshLibrary/utilities/surfaceTools/edgeExtraction/edgeExtractor/edgeExtractorCorners.C
	meshLibrary/utilities/surfaceTools/meshSurfaceMapper2D/meshSurfaceMapper2DMapVertices.C
	meshLibrary/utilities/surfaceTools/renameBoundaryPatches/renameBoundaryPatches.C
	meshLibrary/utilities/tetrahedra/tetCreatorOctree/tetCreatorOctreePointsAndAddressing.C
	meshLibrary/utilities/triSurfaceTools/triSurfaceDetectFeatureEdges/triSurfaceDetectFeatureEdges.C
	meshLibrary/utilities/triSurfaceTools/triSurfaceDetectFeatureEdges/triSurfaceDetectFeatureEdges.H
	meshLibrary/utilities/triSurfaceTools/triSurfaceDetectFeatureEdges/triSurfaceDetectFeatureEdgesFunctions.C
	meshLibrary/utilities/triSurfaceTools/triSurfacePatchManipulator/triSurfacePatchManipulatorFunctions.C
	utilities/FLMAToSurface/FLMAToSurface.C
	utilities/FLMAToSurface/Make/options
	utilities/patchesToSubsets/patchesToSubsets.C
	utilities/preparePar/Make/options
	utilities/preparePar/preparePar.C
	utilities/subsetToPatch/Make/options
parents 457facb6 2aebbcdb
......@@ -40,6 +40,7 @@ removeCellsInSelectedDomains = $(nonManifoldMeshing)/removeCellsInSelectedDomain
meshOptimizer = utilities/smoothers/geometry/meshOptimizer
tetMeshOptimisation = $(meshOptimizer)/tetMeshOptimisation
symmetryPlaneOptimisation = $(meshOptimizer)/symmetryPlaneOptimisation
simplexSmoother = $(tetMeshOptimisation)/advancedSmoothers/simplexSmoother
knuppMetric = $(tetMeshOptimisation)/advancedSmoothers/knuppMetric
meshUntangler = $(tetMeshOptimisation)/advancedSmoothers/meshUntangler
......@@ -50,6 +51,7 @@ meshSurfaceOptimizer = utilities/smoothers/geometry/meshSurfaceOptimizer
surfaceOptimizer = $(meshSurfaceOptimizer)/advancedSurfaceSmoothers/surfaceOptimizer
surfaceMorpherCells = utilities/surfaceTools/surfaceMorpherCells
triangulateNonPlanarBoundaryFaces = utilities/surfaceTools/triangulateNonPlanarBoundaryFaces
utilitiesOctrees = utilities/octrees
meshOctree = utilities/octrees/meshOctree
meshOctreeCube = utilities/octrees/meshOctree/meshOctreeCube
......@@ -60,12 +62,15 @@ meshOctreeModifier = utilities/octrees/meshOctree/meshOctreeModifier
meshOctreeAutoRef = utilities/octrees/meshOctree/meshOctreeAutomaticRefinement
patchRefinement = utilities/octrees/meshOctree/refinementControls/patchRefinement
objectRefinement = utilities/octrees/meshOctree/refinementControls/objectRefinement
surfaceIntersectionsOctree = utilities/octrees/surfaceIntersectionsOctree
surfaceIntersectionsOctreeCube = utilities/octrees/surfaceIntersectionsOctree/surfaceIntersectionsOctreeCube
helperFunctions = utilities/helperFunctions
createFacesFromChain = utilities/helperClasses/createFacesFromChain
sortEdgesIntoChains = utilities/helperClasses/sortEdgesIntoChains
trianglePlaneIntersections = utilities/helperClasses/trianglePlaneIntersections
tetrahedra = utilities/tetrahedra/tetTessellation
tetPointsCreator = utilities/tetrahedra/tetPointsCreator
tetCreatorOctree = utilities/tetrahedra/tetCreatorOctree
......
......@@ -312,8 +312,6 @@ cartesian2DMeshGenerator::cartesian2DMeshGenerator(const Time& time)
//- delete the old surface and assign the new one
deleteDemandDrivenData(surfacePtr_);
surfacePtr_ = surfaceWithPatches;
surfacePtr_->writeSurface("surfWithPatches.fms");
}
octreePtr_ = new meshOctree(*surfacePtr_, true);
......
......@@ -109,7 +109,6 @@ void cartesianMeshGenerator::surfacePreparation()
rCells.removeCells();
}
//- removes unnecessary cells and morph the boundary
//- such that there is only one boundary face per cell
//- It also checks topology of cells after morphing is performed
......
......@@ -29,8 +29,7 @@ Description
#include "meshOctree.H"
#include "triSurface.H"
#include "polyMeshGenModifierAddCellByCell.H"
#include "tessellationElement.H"
#include "tessellationDimSpace.H"
#include "demandDrivenData.H"
# ifdef USE_OMP
......@@ -104,23 +103,53 @@ void tetMeshExtractorOctree::createPolyMesh()
const partTet& elmt = tets[elmtI];
tessellationElement telmt(elmt[0], elmt[1], elmt[2], elmt[3]);
label faceI = 4 * elmtI;
for(label i=0;i<4;++i)
{
cells[elmtI][i] = faceI;
face& f = faces[faceI];
f.setSize ( 3 );
//- first face
cells[elmtI][0] = faceI;
const triFace tf = telmt.face(i);
f[0] = tf[0];
f[1] = tf[2];
f[2] = tf[1];
face& f0 = faces[faceI];
f0.setSize(3);
++faceI;
}
f0[0] = elmt.a();
f0[1] = elmt.c();
f0[2] = elmt.b();
++faceI;
//- second face
cells[elmtI][1] = faceI;
face& f1 = faces[faceI];
f1.setSize(3);
f1[0] = elmt.a();
f1[1] = elmt.b();
f1[2] = elmt.d();
++faceI;
//- third face
cells[elmtI][2] = faceI;
face& f2 = faces[faceI];
f2.setSize ( 3 );
f2[0] = elmt.b();
f2[1] = elmt.c();
f2[2] = elmt.d();
++faceI;
//- fourth face
cells[elmtI][3] = faceI;
face& f3 = faces[faceI];
f3.setSize ( 3 );
f3[0] = elmt.c();
f3[1] = elmt.a();
f3[2] = elmt.d();
}
# ifdef USE_OMP
......
......@@ -641,6 +641,10 @@ void boundaryLayers::createLayerCells(const labelList& patchLabels)
//- delete meshSurfaceEngine
this->clearOut();
# ifdef DEBUGLayer
mesh_.addressingData().checkMesh(true);
# endif
Info << "Finished creating layer cells" << endl;
}
......
......@@ -164,6 +164,7 @@ void boundaryLayers::findPatchesToBeTreatedTogether()
const face& f1 = bFaces[eFaces(eI, 0)];
const face& f2 = bFaces[eFaces(eI, 1)];
if
(
!help::isSharedEdgeConvex(points, f1, f2) ||
......@@ -216,6 +217,7 @@ void boundaryLayers::findPatchesToBeTreatedTogether()
continue;
const edge& e = edges[beI];
if
(
!is2DMesh_ &&
......@@ -263,6 +265,7 @@ void boundaryLayers::findPatchesToBeTreatedTogether()
{
const label beI =
globalToLocal[receivedData[counter++].pointLabel()];
DynList<label> f(receivedData[counter++].pointLabel());
forAll(f, pI)
{
......@@ -294,6 +297,7 @@ void boundaryLayers::findPatchesToBeTreatedTogether()
}
const face& bf = bFaces[eFaces(beI, 0)];
const label patch0 = boundaryFacePatches[eFaces(beI, 0)];
const label patch1 = otherProcPatches[beI];
......@@ -463,7 +467,8 @@ void boundaryLayers::findPatchesToBeTreatedTogether()
if( usedPatch[patchI] || (boundaries[patchI].patchSize() == 0) )
continue;
Info << "Adding layer subset " << layerI << " for patch " << patchI << endl;
Info << "Adding layer subset " << layerI
<< " for patch " << patchI << endl;
usedPatch[patchI] = true;
subsetId = mesh_.addFaceSubset("layer_"+help::scalarToText(layerI));
++layerI;
......
......@@ -47,7 +47,6 @@ label boundaryLayers::findNewNodeLabel
if( it != otherVrts_.end() )
{
const std::map<std::pair<label, label>, label>& m = it->second;
std::map<std::pair<label, label>, label>::const_iterator mit;
......@@ -276,7 +275,6 @@ inline void boundaryLayers::createNewCellFromNode
const label p12 = m.find(pr)->second;
//- create the cell and append it
//- F0
cellFaces[0][0] = pointI;
cellFaces[0][1] = p02;
......
......@@ -156,7 +156,12 @@ void refineBoundaryLayers::setNumberOfLayersForPatch
return;
}
numLayersForPatch_[patchName] = nLayers;
labelList matchedIDs = mesh_.findPatches(patchName);
forAll(matchedIDs, matchI)
{
numLayersForPatch_[mesh_.getPatchName(matchedIDs[matchI])] = nLayers;
}
}
void refineBoundaryLayers::setThicknessRatioForPatch
......@@ -177,7 +182,13 @@ void refineBoundaryLayers::setThicknessRatioForPatch
return;
}
thicknessRatioForPatch_[patchName] = thicknessRatio;
const labelList matchedIDs = mesh_.findPatches(patchName);
forAll(matchedIDs, matchI)
{
const word pName = mesh_.getPatchName(matchedIDs[matchI]);
thicknessRatioForPatch_[pName] = thicknessRatio;
}
}
void refineBoundaryLayers::setMaxThicknessOfFirstLayerForPatch
......@@ -198,12 +209,22 @@ void refineBoundaryLayers::setMaxThicknessOfFirstLayerForPatch
return;
}
maxThicknessForPatch_[patchName] = maxThickness;
const labelList matchedIDs = mesh_.findPatches(patchName);
forAll(matchedIDs, matchI)
{
maxThicknessForPatch_[mesh_.getPatchName(matchedIDs[matchI])] = maxThickness;
}
}
void refineBoundaryLayers::setInteruptForPatch(const word& patchName)
{
discontinuousLayersForPatch_.insert(patchName);
const labelList matchedIDs = mesh_.findPatches(patchName);
forAll(matchedIDs, matchI)
{
discontinuousLayersForPatch_.insert(mesh_.getPatchName(matchedIDs[matchI]));
}
}
void refineBoundaryLayers::refineLayers()
......
......@@ -278,7 +278,7 @@ void partTriMesh::createBufferLayers()
std::make_pair(neiProcs[procI], LongList<parTriFace>())
);
//- lop over triangles and add the ones having vertices at parallel
//- loop over triangles and add the ones having vertices at parallel
//- boundaries for sending
forAll(surf_, triI)
{
......@@ -440,8 +440,6 @@ void partTriMesh::createBufferLayers()
void partTriMesh::updateBufferLayers()
{
returnReduce(1, sumOp<label>());
const pointField& points = surf_.points();
const labelLongList& bufferLayerPoints = this->bufferLayerPoints();
const VRWGraph& pProcs = this->pointAtProcs();
......@@ -489,8 +487,6 @@ void partTriMesh::updateBufferLayers()
lp.coordinates()
);
}
returnReduce(1, sumOp<label>());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -56,8 +56,7 @@ boundaryPatch::boundaryPatch
boundaryPatch::boundaryPatch(const word& name, const dictionary& dict)
:
boundaryPatchBase(name, dict)
{
}
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -80,7 +79,7 @@ void boundaryPatch::write(Ostream& os) const
void boundaryPatch::writeDict(Ostream& os) const
{
this->operator<<(os);
}
Ostream& boundaryPatch::operator<<(Ostream& os) const
......@@ -96,7 +95,6 @@ Ostream& boundaryPatch::operator<<(Ostream& os) const
Istream& boundaryPatch::operator>>(Istream& is)
{
Info << "Here" << endl;
token t;
is >> name_ >> t;
is >> t >> type_ >> t;
......
......@@ -31,6 +31,7 @@ Description
#include "IOobjectList.H"
#include "faceSet.H"
#include "demandDrivenData.H"
#include "stringListOps.H"
namespace Foam
{
......@@ -42,7 +43,7 @@ void polyMeshGenFaces::clearOut() const
deleteDemandDrivenData(ownerPtr_);
deleteDemandDrivenData(neighbourPtr_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Constructors
//- Null constructor
......@@ -118,7 +119,7 @@ polyMeshGenFaces::polyMeshGenFaces
runTime.constant(),
"polyMesh",
runTime
),
),
faces
),
procBoundaries_(),
......@@ -139,7 +140,7 @@ polyMeshGenFaces::polyMeshGenFaces
"const labelList& patchStart,"
"const labelList& nFacesInPatch)"
) << "Cannot do this in parallel!" << exit(FatalError);
boundaries_.setSize(patchNames.size());
forAll(patchNames, patchI)
{
......@@ -156,7 +157,7 @@ polyMeshGenFaces::polyMeshGenFaces
);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Destructor
polyMeshGenFaces::~polyMeshGenFaces()
......@@ -180,7 +181,7 @@ label polyMeshGenFaces::faceIsInProcPatch(const label faceLabel) const
)
)
return -1;
forAllReverse(procBoundaries_, patchI)
if( faceLabel >= procBoundaries_[patchI].patchStart() )
return patchI;
......@@ -193,7 +194,7 @@ label polyMeshGenFaces::faceIsInPatch(const label faceLabel) const
const label i = boundaries_.size() - 1;
if( faceLabel >= (boundaries_[i].patchStart()+boundaries_[i].patchSize()) )
return -1;
forAllReverse(boundaries_, patchI)
if( faceLabel >= boundaries_[patchI].patchStart() )
return patchI;
......@@ -201,6 +202,65 @@ label polyMeshGenFaces::faceIsInPatch(const label faceLabel) const
return -1;
}
wordList polyMeshGenFaces::patchNames() const
{
wordList t(boundaries_.size());
forAll(boundaries_, patchI)
{
t[patchI] = boundaries_[patchI].patchName();
}
return t;
}
label polyMeshGenFaces::getPatchID(const word& patchName) const
{
forAll(boundaries_, patchI)
{
if(boundaries_.set(patchI))
{
if(boundaries_[patchI].patchName() == patchName)
{
return patchI;
}
}
}
// If the code gets here, it implies that the patch was not found.
// return a -1 in this case
return -1;
}
word polyMeshGenFaces::getPatchName(const label patchID) const
{
if((patchID < 0) || (patchID >= boundaries_.size()))
{
FatalErrorIn
(
"polyMeshGenFaces::getPatchName(const label patchID) const"
) << "invalid patch ID supplied"
<< abort(FatalError);
}
return boundaries_[patchID].patchName();
}
labelList polyMeshGenFaces::findPatches(const word& patchName) const
{
wordList allPatches = patchNames();
labelList patchIDs = findStrings(patchName, allPatches);
if(patchIDs.empty())
{
WarningIn("polyMeshGenFaces::findPatches(const word&)")
<< "Cannot find any patch names matching " << patchName << endl;
}
return patchIDs;
}
label polyMeshGenFaces::addFaceSubset(const word& setName)
{
label id = faceSubsetIndex(setName);
......@@ -209,7 +269,7 @@ label polyMeshGenFaces::addFaceSubset(const word& setName)
Warning << "Face subset " << setName << " already exists!" << endl;
return id;
}
id = 0;
for
(
......@@ -218,7 +278,7 @@ label polyMeshGenFaces::addFaceSubset(const word& setName)
++it
)
id = Foam::max(id, it->first+1);
faceSubsets_.insert
(
std::make_pair
......@@ -227,7 +287,7 @@ label polyMeshGenFaces::addFaceSubset(const word& setName)
meshSubset(setName, meshSubset::FACESUBSET)
)
);
return id;
}
......@@ -235,7 +295,7 @@ void polyMeshGenFaces::removeFaceSubset(const label setI)
{
if( faceSubsets_.find(setI) == faceSubsets_.end() )
return;
faceSubsets_.erase(setI);
}
......@@ -248,7 +308,7 @@ word polyMeshGenFaces::faceSubsetName(const label setI) const
Warning << "Subset " << setI << " is not a face subset" << endl;
return word();
}
return it->second.name();
}
......@@ -260,14 +320,14 @@ label polyMeshGenFaces::faceSubsetIndex(const word& setName) const
if( it->second.name() == setName )
return it->first;
}
return -1;
}
void polyMeshGenFaces::read()
{
polyMeshGenPoints::read();
faceIOList fcs
(
IOobject
......@@ -280,10 +340,10 @@ void polyMeshGenFaces::read()
)
);
faces_ = fcs;
deleteDemandDrivenData(ownerPtr_);
deleteDemandDrivenData(neighbourPtr_);
ownerPtr_ =
new labelIOList
(
......@@ -296,7 +356,7 @@ void polyMeshGenFaces::read()
IOobject::MUST_READ
)
);
neighbourPtr_ =
new labelIOList
(
......@@ -309,10 +369,10 @@ void polyMeshGenFaces::read()
IOobject::MUST_READ
)
);
if( neighbourPtr_->size() != ownerPtr_->size() )
neighbourPtr_->setSize(ownerPtr_->size(), -1);
//- read boundary information
IOPtrList<boundaryPatchBase> patches
(
......@@ -325,15 +385,15 @@ void polyMeshGenFaces::read()
IOobject::MUST_READ
)
);
label i(0);
forAll(patches, patchI)
if( patches[patchI].type() == "processor" )
++i;
procBoundaries_.setSize(i);
boundaries_.setSize(patches.size()-i);
i=0;
forAll(patches, patchI)
if( patches[patchI].type() != "processor" )
......@@ -351,7 +411,7 @@ void polyMeshGenFaces::read()
);
++i;
}
i = 0;
forAll(patches, patchI)
if( patches[patchI].type() == "processor" )
......@@ -368,7 +428,7 @@ void polyMeshGenFaces::read()
}
nIntFaces_ = boundaries_[0].patchStart();
//- read face subsets
IOobjectList allSets
(
......@@ -376,12 +436,12 @@ void polyMeshGenFaces::read()
runTime_.constant(),
"polyMesh/sets"
);
wordList setNames = allSets.names("faceSet");
forAll(setNames, setI)
{
IOobject* obj = allSets.lookup(setNames[setI]);
faceSet fSet(*obj);
labelList content = fSet.toc();
const label id = addFaceSubset(setNames[setI]);
......@@ -393,22 +453,22 @@ void polyMeshGenFaces::read()
void polyMeshGenFaces::write() const
{
polyMeshGenPoints::write();
faces_.write();
if( !ownerPtr_ || !neighbourPtr_ )
calculateOwnersAndNeighbours();
ownerPtr_->write();
neighbourPtr_->write();
//- write boundary data
PtrList<boundaryPatchBase> ptchs
(
procBoundaries_.size() + boundaries_.size()
);
label i(0);
//- ordinary patches come first
forAll(boundaries_, patchI)