Commit 240e0fae authored by franjo_j@hotmail.com's avatar franjo_j@hotmail.com
Browse files

Additional improvements of boundary layer refinement + usage of

constraints in a non-orthogonality check


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@39 fdcce57e-7e00-11e2-b579-49867b4cea03
parent 763da7a6
......@@ -287,11 +287,19 @@ void cartesianMeshGenerator::generateBoundaryLayers()
void cartesianMeshGenerator::refBoundaryLayers()
{
refineBoundaryLayers refLayers(mesh_);
if( meshDict_.isDict("boundaryLayers") )
{
refineBoundaryLayers refLayers(mesh_);
refineBoundaryLayers::readSettings(meshDict_, refLayers);
refineBoundaryLayers::readSettings(meshDict_, refLayers);
refLayers.refineLayers();
refLayers.refineLayers();
meshOptimizer optimizer(mesh_);
optimizer.optimizeLowQualityFaces();
optimizer.untangleMeshFV();
}
}
void cartesianMeshGenerator::optimiseFinalMesh()
......
......@@ -1387,8 +1387,18 @@ void refineBoundaryLayers::generateNewCells()
cell& c = cells[cellI];
//- copy the new faces of this cell
DynList<label, 64> newC;
forAll(c, fI)
c[fI] = facesFromFace_(c[fI], 0);
{
forAllRow(facesFromFace_, c[fI], cfI)
newC.append(facesFromFace_(c[fI], cfI));
}
//- update the cell
c.setSize(newC.size());
forAll(c, fI)
c[fI] = newC[fI];
}
else if( refType[cellI] == 1 )
{
......@@ -1438,9 +1448,7 @@ void refineBoundaryLayers::generateNewCells()
else if( refType[cellI] == 2 )
{
//- generate new cell from a hex cell where two layers intersect
//- generate mostly hex cells
//DynList<DynList<DynList<label, 4>, 6>, 256> cellsFromCell;
//generateNewCellsEdgeHex(cellI, cellsFromCell);
//- generate mostly hex cells;
refineEdgeHexCell refEdgeHex(cellI, *this);
const DynList<DynList<DynList<label, 4>, 6>, 256>& cellsFromCell =
refEdgeHex.newCells();
......@@ -1497,7 +1505,6 @@ void refineBoundaryLayers::generateNewCells()
refineCornerHexCell refCell(cellI, *this);
const DynList<DynList<DynList<label, 4>, 6>, 256>& cellsFromCell =
refCell.newCells();
//generateNewCellsCornerHex(cellI, cellsFromCell);
//- new points have been generated
pointNewFaces.setSize(mesh_.points().size());
......@@ -1629,9 +1636,7 @@ void refineBoundaryLayers::generateNewCells()
//- point-faces addressing is not needed any more
pointNewFaces.setSize(0);
//- copy the newFaces to the mesh
//- copy newFaces to the mesh
# ifdef DEBUGLayer
Pout << "Copying internal faces " << endl;
Pout << "Original number of internal faces " << nOrigInternalFaces << endl;
......@@ -1851,6 +1856,7 @@ void refineBoundaryLayers::generateNewCells()
<< faces[c[fI]] << endl;
Pout << "Cell edges " << edges << endl;
Pout << "nAppearances " << nAppearances << endl;
::exit(1);
}
}
}
......@@ -1860,6 +1866,7 @@ void refineBoundaryLayers::generateNewCells()
const labelList& owner = mesh_.owner();
const labelList& neighbour = mesh_.neighbour();
const label nInternalFaces = mesh_.nInternalFaces();
for(label procI=0;procI<Pstream::nProcs();++procI)
{
......@@ -1867,6 +1874,13 @@ void refineBoundaryLayers::generateNewCells()
{
forAll(faces, faceI)
{
if( faceI < nInternalFaces && neighbour[faceI] < 0 )
{
Pout << "Num interface faces " << nInternalFaces
<< " current face " << faceI
<< " face points " << faces[faceI] << endl;
::exit(1);
}
Pout << "Face " << faceI << " owner " << owner[faceI]
<< " neighbour " << neighbour[faceI]
<< " face points " << faces[faceI] << endl;
......
......@@ -63,8 +63,42 @@ void refineBoundaryLayers::refineFace
//- direction 1 represents edges 1 and 3
if( (nLayersInDirection[0] <= 1) && (nLayersInDirection[1] <= 1) )
{
//- this face may comprise of some split edges
DynList<label, 64> newF;
forAll(f, eI)
{
const edge e = f.faceEdge(eI);
//- add the current point label
newF.append(f[eI]);
//- check if a split edge matches this face edge
forAllRow(splitEdgesAtPoint_, f[eI], peI)
{
const label seI = splitEdgesAtPoint_(f[eI], peI);
const edge& se = splitEdges_[seI];
if( e == se )
{
//- check the orientation and add new vertices created
//- on this edge
const label s = newVerticesForSplitEdge_.sizeOfRow(seI) - 1;
if( e.start() == se.start() )
{
for(label pI=1;pI<s;++pI)
newF.append(newVerticesForSplitEdge_(seI, pI));
}
else
{
for(label pI=s-1;pI>0;--pI)
newF.append(newVerticesForSplitEdge_(seI, pI));
}
}
}
}
newFaces.setSize(1);
newFaces[0] = f;
newFaces[0] = newF;
return;
}
......
......@@ -404,7 +404,7 @@ void refineBoundaryLayers::analyseLayers()
continue;
label maxNumLayers(1);
bool found(false);
forAll(patchesInLayer_[layerI], lpI)
{
const word pName = patchesInLayer_[layerI][lpI];
......@@ -414,8 +414,6 @@ void refineBoundaryLayers::analyseLayers()
if( it != numLayersForPatch_.end() )
{
found = true;
//- check if the layer is interrupted at this patch
if(
discontinuousLayersForPatch_.find(pName) !=
......@@ -434,8 +432,11 @@ void refineBoundaryLayers::analyseLayers()
}
}
if( !found )
if( maxNumLayers == 1 )
{
//- apply global settings to the patches which are not overriden
maxNumLayers = globalNumLayers_;
}
//- set the number of layer to all patches which are not protected
forAll(patchesInLayer_[layerI], lpI)
......
......@@ -29,7 +29,9 @@ License
#include "pyramidPointFaceRef.H"
#include "tetrahedron.H"
# ifdef USE_OMP
#include <omp.h>
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -662,6 +664,9 @@ bool checkFaceDotProduct
# endif
for(label faceI=0;faceI<nInternalFaces;++faceI)
{
if( changedFacePtr && !(*changedFacePtr)[faceI] )
continue;
const vector d = centres[nei[faceI]] - centres[own[faceI]];
const vector& s = areas[faceI];
......@@ -768,6 +773,8 @@ bool checkFaceDotProduct
# endif
forAll(otherCentres, faceI)
{
if( changedFacePtr && !(*changedFacePtr)[start+faceI] )
continue;
const point& cOwn = centres[own[start+faceI]];
const point& cNei = otherCentres[faceI];
const vector d = cNei - cOwn;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment