STYLE: Remove trailing whitespace systematically

This commit is contained in:
Henrik Rusche 2015-08-11 11:19:57 +02:00 committed by Hrvoje Jasak
parent a9ef31fa39
commit 8ac5840737
104 changed files with 1036 additions and 1036 deletions

View file

@ -4,7 +4,7 @@ body {
margin: 0px;
font-family: verdana, arial, helvetica, sans-serif;
text-decoration: none;
font-size: 12px;
font-size: 12px;
}
a:link { text-decoration: none; color: #0000ff ; }
a:link:hover { text-decoration: none; color: #0000ff ; }
@ -21,7 +21,7 @@ td.leftmenu {
text-align: left;
font-size: 14px;
height: 20px;
width: 200px;
width: 200px;
}
a.menuTopoff { color: #000000; font-size: 14px; }
@ -33,7 +33,7 @@ td.topmenu {
text-align: center;
font-size: 16px;
width: 150px;
font-weight: bold;
font-weight: bold;
}
h1 { font-size: 18px; }
h2 { font-size: 16px; }

View file

@ -39,7 +39,7 @@ export PROGRAMS_HOME=/c/Programs
# {{{ DEFINE USER EDITABLE FUNCTIONS
set_system_paths() {
echo "Setting environment variables for user-defined installed system tools and utilities ..."
echo "Setting environment variables for user-defined installed system tools and utilities ..."
export CMAKE_HOME=$PROGRAMS_HOME/cmake-3.2.3-win32-x86
export GIT_HOME=$PROGRAMS_HOME/Git
export MINGW_HOME=$PROGRAMS_HOME/mingw64
@ -55,7 +55,7 @@ set_system_paths() {
add_to_path() {
echo
echo "Adding user-defined installed system tools to PATH ..."
echo "Adding user-defined installed system tools to PATH ..."
export PATH=$ZIP_HOME:$PATH
export PATH=$WGET_HOME/bin:$PATH
export PATH=$PYTHON_HOME:$PATH

View file

@ -756,14 +756,14 @@ fi
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARAVIEW_DIR is initialized to: $PARAVIEW_DIR"
# Load llvm
# Load llvm
# ~~~~~~~~~~~~~~~~~~~~~~
[ -z "$LLVM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_LLVM_360 ] && [ -e $WM_THIRD_PARTY_DIR/packages/llvm-3.6.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/llvm-3.6.0/platforms/$WM_OPTIONS/etc/llvm-3.6.0.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " LLVM_DIR is initialized to: $LLVM_DIR"
# Load mesa
# Load mesa
# ~~~~~~~~~~~~~~~~~~~~~~
[ -z "$MESA_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_MESA_GIT ] && [ -e $WM_THIRD_PARTY_DIR/packages/mesa-git/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/mesa-git/platforms/$WM_OPTIONS/etc/mesa-git.sh

View file

@ -239,7 +239,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
// If the dot-product is negative, cell is marked for use with the
// Gauss gradient, which is unconditionally positive
// HJ, 21/Apr/2015
// First loop: detect cells with bad least squares vectors
// Use Gauss Gradient field: set to 1 if Gauss is needed

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

@ -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 " << 0
<< " and " << nRows_ << abort(FatalError);
}
if( (j < 0) || (j >= width) )
FatalErrorIn
(
@ -158,7 +158,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;
}
@ -173,7 +173,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;
}
@ -188,7 +188,7 @@ inline const T& Foam::FRWGraph<T,width>::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[i * width + j];
}
@ -201,7 +201,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

@ -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

@ -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

@ -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

@ -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:
@ -299,7 +299,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,16 +55,16 @@ 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
(
@ -80,29 +80,29 @@ class partTetMeshSimplex
const DynList<partTet, 128>& tets,
const label pointI
);
// 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

@ -50,7 +50,7 @@ partTriMeshSimplex::partTriMeshSimplex
const LongList<labelledTri>& trias = tm.triangles();
const VRWGraph& pt = tm.pointTriangles();
const LongList<direction>& pType = tm.pointType();
//trias_.setSize(pt.sizeOfRow(pI));
label counter(0);
@ -69,11 +69,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 )
@ -132,7 +132,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

@ -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

@ -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

@ -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

@ -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;
};

View file

@ -37,7 +37,7 @@ inline label meshOctreeAddressing::numberOfNodes() const
{
if( !nodeLabelsPtr_ )
createNodeLabels();
return nNodes_;
}
@ -45,15 +45,15 @@ inline const pointField& meshOctreeAddressing::octreePoints() const
{
if( !octreePointsPtr_ )
createOctreePoints();
return *octreePointsPtr_;
}
inline const VRWGraph& meshOctreeAddressing::nodeLabels() const
{
if( !nodeLabelsPtr_ )
createNodeLabels();
return *nodeLabelsPtr_;
}
@ -61,15 +61,15 @@ inline const FRWGraph<label, 8>& meshOctreeAddressing::nodeLeaves() const
{
if( !nodeLeavesPtr_ )
createNodeLeaves();
return *nodeLeavesPtr_;
}
inline const List<direction>& meshOctreeAddressing::boxType() const
{
if( !boxTypePtr_ )
findUsedBoxes();
return *boxTypePtr_;
}
@ -95,7 +95,7 @@ inline const List<direction>& meshOctreeAddressing::nodeType() const
{
if( !nodeTypePtr_ )
calculateNodeType();
return *nodeTypePtr_;
}
@ -103,7 +103,7 @@ inline const VRWGraph& meshOctreeAddressing::octreeFaces() const
{
if( !octreeFacesPtr_ )
createOctreeFaces();
return *octreeFacesPtr_;
}
@ -111,7 +111,7 @@ inline const labelLongList& meshOctreeAddressing::octreeFaceOwner() const
{
if( !octreeFacesOwnersPtr_ )
createOctreeFaces();
return *octreeFacesOwnersPtr_;
}
@ -119,7 +119,7 @@ inline const labelLongList& meshOctreeAddressing::octreeFaceNeighbour() const
{
if( !octreeFacesNeighboursPtr_ )
createOctreeFaces();
return *octreeFacesNeighboursPtr_;
}
@ -127,7 +127,7 @@ inline const VRWGraph& meshOctreeAddressing::leafFaces() const
{
if( !leafFacesPtr_ )
calculateLeafFaces();
return *leafFacesPtr_;
}
@ -135,7 +135,7 @@ inline const VRWGraph& meshOctreeAddressing::leafLeaves() const
{
if( !leafLeavesPtr_ )
calculateLeafLeaves();
return *leafLeavesPtr_;
}
@ -143,7 +143,7 @@ inline const VRWGraph& meshOctreeAddressing::nodeFaces() const
{
if( !nodeFacesPtr_ )
calculateNodeFaces();
return *nodeFacesPtr_;
}
@ -151,7 +151,7 @@ inline const LongList<edge>& meshOctreeAddressing::octreeEdges() const
{
if( !octreeEdgesPtr_ )
createOctreeEdges();
return *octreeEdgesPtr_;
}
@ -159,7 +159,7 @@ inline const VRWGraph& meshOctreeAddressing::edgeLeaves() const
{
if( !edgeLeavesPtr_ )
calculateEdgeLeaves();
return *edgeLeavesPtr_;
}
@ -167,7 +167,7 @@ inline const VRWGraph& meshOctreeAddressing::leafEdges() const
{
if( !leafEdgesPtr_ )
calculateLeafEdges();
return *leafEdgesPtr_;
}
@ -175,7 +175,7 @@ inline const VRWGraph& meshOctreeAddressing::nodeEdges() const
{
if( !nodeEdgesPtr_ )
createOctreeEdges();
return *nodeEdgesPtr_;
}
@ -183,7 +183,7 @@ inline const VRWGraph& meshOctreeAddressing::faceEdges() const
{
if( !faceEdgesPtr_ )
createOctreeEdges();
return *faceEdgesPtr_;
}
@ -191,7 +191,7 @@ inline const VRWGraph& meshOctreeAddressing::edgeFaces() const
{
if( !edgeFacesPtr_ )
calculateEdgeFaces();
return *edgeFacesPtr_;
}
@ -199,57 +199,57 @@ inline const labelLongList& meshOctreeAddressing::globalPointLabel() const
{
if( !globalPointLabelPtr_ )
calcGlobalPointLabels();
return *globalPointLabelPtr_;
}
inline const Map<label>& meshOctreeAddressing::
globalToLocalPointAddressing() const
{
if( !globalPointToLocalPtr_ )
calcGlobalPointLabels();
return *globalPointToLocalPtr_;
}
inline const VRWGraph& meshOctreeAddressing::pointAtProcs() const
{
if( !pointProcsPtr_ )
calcGlobalPointLabels();
return *pointProcsPtr_;
}
inline const labelLongList& meshOctreeAddressing::globalFaceLabel() const
{
if( !globalFaceLabelPtr_ )
calcGlobalFaceLabels();
return *globalFaceLabelPtr_;
}
inline const Map<label>& meshOctreeAddressing::
globalToLocalFaceAddressing() const
{
if( !globalFaceToLocalPtr_ )
calcGlobalFaceLabels();
return *globalFaceToLocalPtr_;
}
inline const VRWGraph& meshOctreeAddressing::faceAtProcs() const
{
if( !faceProcsPtr_ )
calcGlobalFaceLabels();
return *faceProcsPtr_;
}
inline const labelLongList& meshOctreeAddressing::globalLeafLabel() const
{
if( !globalLeafLabelPtr_ )
calcGlobalLeafLabels();
return *globalLeafLabelPtr_;
}
@ -257,7 +257,7 @@ inline const VRWGraph& meshOctreeAddressing::leafAtProcs() const
{
if( !leafAtProcsPtr_ )
calcGlobalLeafLabels();
return *leafAtProcsPtr_;
}
@ -266,7 +266,7 @@ globalToLocalLeafAddressing() const
{
if( !globalLeafToLocalPtr_ )
calcGlobalLeafLabels();
return *globalLeafToLocalPtr_;
}

View file

@ -49,60 +49,60 @@ namespace Foam
class meshOctreeInsideOutside
{
// Private data
//- meshOctreeAddressing
meshOctreeModifier octreeModifier_;
//- group for a given leaf
labelLongList cubeGroup_;
//- cubes belonging to each group of octree boxes
VRWGraph cubesInGroup_;
//- type for a group
std::map<label, direction> groupType_;
//- boundary DATA boxes for a given group
VRWGraph boundaryDATACubes_;
//- flag for DATA boxes next to the OUTSIDE boxes
boolList hasOutsideNeighbour_;
//- label of cubes at processor boundaries
labelLongList communicationCubes_;
//- labels of cubes marked by different threads
VRWGraph neighbouringGroups_;
// Private member functions
//- initialise octree boxes
void initialiseBoxes();
//- frontal marking algorithm
void frontalMarking();
//- mark OUTSIDE octree boxes
void markOutsideCubes();
//- revise DATA boxes
void reviseDataBoxes();
//- mark INSIDE octree boxes
void markInsideCubes();
public:
// Constructor
//- Construct from octree
meshOctreeInsideOutside
(
meshOctree& octree
);
// Destructor
~meshOctreeInsideOutside();
};

View file

@ -55,7 +55,7 @@ class boxRefinement
// Private data
//- centre of the box
point centre_;
//- length of box sides
scalar lengthX_;
scalar lengthY_;
@ -86,7 +86,7 @@ public:
//- Construct from dictionary
boxRefinement(const word& name, const dictionary& dict);
//- Construct and return a clone
virtual autoPtr<objectRefinement> clone
(
@ -107,12 +107,12 @@ public:
)
);
}
// Member Functions
//- check if a boundBox intersects or is inside the object
bool intersectsObject(const boundBox&) const;
//- Return as dictionary of entries
dictionary dict(bool ignoreType = false) const;
@ -123,7 +123,7 @@ public:
//- Write dictionary
void writeDict(Ostream&, bool subDict = true) const;
// Member Operators
//- assign from dictionary

View file

@ -85,22 +85,22 @@ bool coneRefinement::intersectsObject(const boundBox& bb) const
{
//- check if the centre is inside the cone
const point c = (bb.max() + bb.min()) / 2.0;
const vector v = p1_ - p0_;
const scalar d = magSqr(v);
if( d < VSMALL )
return false;
const scalar t = ((c - p0_) & v) / d;
if( (t > 1.0) || (t < 0.0) )
return false;
const scalar r = r0_ + (r1_ - r0_) * t;
if( mag(p0_ + t * v - c) < r )
return true;
return false;
}
@ -144,7 +144,7 @@ void coneRefinement::writeDict(Ostream& os, bool subDict) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
}
if( additionalRefinementLevels() == 0 && cellSize() >= 0.0 )
{
os.writeKeyword("cellSize") << cellSize() << token::END_STATEMENT << nl;
@ -166,7 +166,7 @@ void coneRefinement::writeDict(Ostream& os, bool subDict) const
os.writeKeyword("radius0") << r0_ << token::END_STATEMENT << nl;
os.writeKeyword("p1") << p1_ << token::END_STATEMENT << nl;
os.writeKeyword("radius1") << r1_ << token::END_STATEMENT << nl;
if( subDict )
{
os << decrIndent << indent << token::END_BLOCK << endl;
@ -210,7 +210,7 @@ void coneRefinement::operator=(const dictionary& d)
) << "Entry radius0 is not specified!" << exit(FatalError);
r0_ = -1.0;
}
// unspecified centre is (0 0 0)
if( dict.found("p1") )
{
@ -251,9 +251,9 @@ Ostream& coneRefinement::operator<<(Ostream& os) const
write(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -56,7 +56,7 @@ class coneRefinement
//- start point and the radius
point p0_;
scalar r0_;
//- end point and the radius
point p1_;
scalar r1_;
@ -86,7 +86,7 @@ public:
//- Construct from dictionary
coneRefinement(const word& name, const dictionary& dict);
//- Construct and return a clone
virtual autoPtr<objectRefinement> clone
(
@ -107,12 +107,12 @@ public:
)
);
}
// Member Functions
//- check if a boundBox intersects or is inside the object
bool intersectsObject(const boundBox&) const;
//- Return as dictionary of entries
dictionary dict(bool ignoreType = false) const;
@ -123,7 +123,7 @@ public:
//- Write dictionary
void writeDict(Ostream&, bool subDict = true) const;
// Member Operators
//- assign from dictionary

View file

@ -93,23 +93,23 @@ bool hollowConeRefinement::intersectsObject(const boundBox& bb) const
{
//- check if the centre is inside the cone
const point c = (bb.max() + bb.min()) / 2.0;
const vector v = p1_ - p0_;
const scalar d = magSqr(v);
if( d < VSMALL )
return false;
const scalar t = ((c - p0_) & v) / d;
if( (t > 1.0) || (t < 0.0) )
return false;
const scalar rOuter = r0Outer_ + (r1Outer_ - r0Outer_) * t;
const scalar rInner = r0Inner_ + (r1Inner_ - r0Inner_) * t;
if(( mag(p0_ + t * v - c) < rOuter ) && ( mag(p0_ + t * v - c) > rInner ))
return true;
return false;
}
@ -157,7 +157,7 @@ void hollowConeRefinement::writeDict(Ostream& os, bool subDict) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
}
if( additionalRefinementLevels() == 0 && cellSize() >= 0.0 )
{
os.writeKeyword("cellSize") << cellSize() << token::END_STATEMENT << nl;
@ -181,7 +181,7 @@ void hollowConeRefinement::writeDict(Ostream& os, bool subDict) const
os.writeKeyword("p1") << p1_ << token::END_STATEMENT << nl;
os.writeKeyword("radius1_Outer") << r1Outer_ << token::END_STATEMENT << nl;
os.writeKeyword("radius1_Inner") << r1Inner_ << token::END_STATEMENT << nl;
if( subDict )
{
os << decrIndent << indent << token::END_BLOCK << endl;
@ -240,7 +240,7 @@ void hollowConeRefinement::operator=(const dictionary& d)
r0Inner_ = -1.0;
}
// unspecified centre is (0 0 0)
if( dict.found("p1") )
{
@ -295,9 +295,9 @@ Ostream& hollowConeRefinement::operator<<(Ostream& os) const
write(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -57,7 +57,7 @@ class hollowConeRefinement
point p0_;
scalar r0Outer_;
scalar r0Inner_;
//- end point and the radii
point p1_;
scalar r1Outer_;
@ -90,7 +90,7 @@ public:
//- Construct from dictionary
hollowConeRefinement(const word& name, const dictionary& dict);
//- Construct and return a clone
virtual autoPtr<objectRefinement> clone
(
@ -113,12 +113,12 @@ public:
)
);
}
// Member Functions
//- check if a boundBox intersects or is inside the object
bool intersectsObject(const boundBox&) const;
//- Return as dictionary of entries
dictionary dict(bool ignoreType = false) const;
@ -129,7 +129,7 @@ public:
//- Write dictionary
void writeDict(Ostream&, bool subDict = true) const;
// Member Operators
//- assign from dictionary

View file

@ -79,7 +79,7 @@ bool lineRefinement::intersectsObject(const boundBox& bb) const
{
//- check if the cube contains start point or end point
const scalar l = bb.max().x() - bb.min().x();
const point min = bb.min() - l * vector(SMALL, SMALL, SMALL);
const point max = bb.max() + l * vector(SMALL, SMALL, SMALL);
@ -240,7 +240,7 @@ void lineRefinement::writeDict(Ostream& os, bool subDict) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
}
if( additionalRefinementLevels() == 0 && cellSize() >= 0.0 )
{
os.writeKeyword("cellSize") << cellSize() << token::END_STATEMENT << nl;
@ -317,9 +317,9 @@ Ostream& lineRefinement::operator<<(Ostream& os) const
write(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -55,7 +55,7 @@ class lineRefinement
// Private data
//- start point of the line
point p0_;
//- end point of the line
point p1_;
@ -82,7 +82,7 @@ public:
//- Construct from dictionary
lineRefinement(const word& name, const dictionary& dict);
//- Construct and return a clone
virtual autoPtr<objectRefinement> clone
(
@ -101,12 +101,12 @@ public:
)
);
}
// Member Functions
//- check if the line intersects the box
bool intersectsObject(const boundBox&) const;
//- Return as dictionary of entries
dictionary dict(bool ignoreType = false) const;
@ -117,7 +117,7 @@ public:
//- Write dictionary
void writeDict(Ostream&, bool subDict = true) const;
// Member Operators
//- assign from dictionary

View file

@ -78,10 +78,10 @@ sphereRefinement::sphereRefinement
bool sphereRefinement::intersectsObject(const boundBox& bb) const
{
const point& c = (bb.max() + bb.min()) / 2.0;
if( magSqr(c - centre_) < sqr(radius_) )
return true;
return false;
}
@ -121,7 +121,7 @@ void sphereRefinement::writeDict(Ostream& os, bool subDict) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
}
if( additionalRefinementLevels() == 0 && cellSize() >= 0.0 )
{
os.writeKeyword("cellSize") << cellSize() << token::END_STATEMENT << nl;
@ -198,9 +198,9 @@ Ostream& sphereRefinement::operator<<(Ostream& os) const
write(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -55,7 +55,7 @@ class sphereRefinement
// Private data
//- centre of the sphere
point centre_;
//- radius of the sphere
scalar radius_;
@ -82,7 +82,7 @@ public:
//- Construct from dictionary
sphereRefinement(const word& name, const dictionary& dict);
//- Construct and return a clone
virtual autoPtr<objectRefinement> clone
(
@ -101,12 +101,12 @@ public:
)
);
}
// Member Functions
//- check if a boundBox intersects or is inside the object
bool intersectsObject(const boundBox&) const;
//- Return as dictionary of entries
dictionary dict(bool ignoreType = false) const;
@ -117,7 +117,7 @@ public:
//- Write dictionary
void writeDict(Ostream&, bool subDict = true) const;
// Member Operators
//- assign from dictionary

View file

@ -35,53 +35,53 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Private member functions
scalar knuppMetric::evaluateMetric() const
{
scalar val(0.0);
forAll(normals_, nI)
{
const scalar fx = (normals_[nI] & (p_ - centres_[nI])) - beta_;
val += Foam::sqr(mag(fx) - fx);
}
return val;
}
scalar knuppMetric::evaluateMetricNoBeta() const
{
scalar val(0.0);
forAll(normals_, nI)
{
const scalar fx = (normals_[nI] & (p_ - centres_[nI]));
val += Foam::sqr(mag(fx) - fx);
}
return val;
}
void knuppMetric::evaluateGradients(vector& grad, tensor& gradGrad) const
{
grad = vector::zero;
gradGrad = tensor::zero;
forAll(normals_, nI)
{
const scalar fx = (normals_[nI] & (p_ - centres_[nI])) - beta_;
const vector gfx = (Foam::sign(fx) - 1) * normals_[nI];
grad += (Foam::mag(fx) - fx) * gfx;
gradGrad += gfx * gfx;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
knuppMetric::knuppMetric(partTetMeshSimplex& simplex)
:
simplexSmoother(simplex),
@ -99,20 +99,20 @@ knuppMetric::knuppMetric(partTetMeshSimplex& simplex)
points_[pt.b()],
points_[pt.c()]
);
const vector n = tri.normal();
const scalar d = mag(n);
if( d > VSMALL )
{
centres_.append(tri.centre());
normals_.append(n/d);
}
}
beta_ = 0.01 * bb_.mag();
}
knuppMetric::~knuppMetric()
{
@ -134,7 +134,7 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
tensor gradGradF;
scalar func, lastFunc;
# ifdef DEBUGSmooth
forAll(normals_, nI)
{
@ -145,14 +145,14 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
Info << "BoundBox size " << (bb_.max() - bb_.min()) << endl;
Info << "Tolerance " << tol << endl;
# endif
bool finished;
do
{
finished = true;
lastFunc = evaluateMetric();
iterI = 0;
do
{
@ -160,19 +160,19 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
Info << "Iteration " << iterI << endl;
Info << "Initial metric value " << lastFunc << endl;
# endif
//- store previous value
const point pOrig = p_;
//- evaluate gradients
evaluateGradients(gradF, gradGradF);
//- calculate displacement
const scalar determinant = det(gradGradF);
if( determinant > SMALL )
{
disp = (inv(gradGradF, determinant) & gradF);
for(direction i=0;i<vector::nComponents;++i)
{
const scalar& val = disp[i];
@ -182,11 +182,11 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
break;
}
}
p_ -= disp;
func = evaluateMetric();
# ifdef DEBUGSmooth
Info << "Second grad " << gradGradF << endl;
Info << "inv(gradGradF, determinant) " << inv(gradGradF, determinant) << endl;
@ -195,7 +195,7 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
Info << "Displacement " << disp << endl;
Info << "New metric value " << func << endl;
# endif
scalar relax(0.8);
label nLoops(0);
@ -204,10 +204,10 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
p_ = pOrig - relax * disp;
relax *= 0.5;
func = evaluateMetric();
if( func < lastFunc )
continue;
//- it seems that this direction is wrong
if( ++nLoops == 5 )
{
@ -216,7 +216,7 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
func = 0.0;
}
}
lastFunc = func;
}
else
@ -224,15 +224,15 @@ void knuppMetric::optimizeNodePosition(const scalar tolObsolete)
disp = vector::zero;
}
} while( (magSqr(disp) > tol) && (++iterI < 10) );
if( (lastFunc < VSMALL) && (evaluateMetricNoBeta() > VSMALL) )
{
beta_ /= 2.0;
finished = false;
}
} while( !finished && (++outerIter < 5) );
# ifdef DEBUGSmooth
Info << "Last value " << lastFunc << endl;
Info << "Beta " << beta_ << endl;

View file

@ -42,7 +42,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
class partTetMeshSimplex;
@ -58,21 +58,21 @@ class knuppMetric
// Private data
//- free vertex
point& p_;
//- normals of triangles forming the outer hull
DynList<vector, 64> normals_;
//- centres of triangles forming the outer hull
DynList<point, 64> centres_;
//- control parameter. It helps the point get inside the feasible region
scalar beta_;
// Private member functions
//- evaluate the value of the metric
scalar evaluateMetric() const;
scalar evaluateMetricNoBeta() const;
//- evaluate metric gradients
void evaluateGradients(vector& grad, tensor& gradGrad) const;

View file

@ -40,7 +40,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
meshUntangler::meshUntangler
@ -62,9 +62,9 @@ void meshUntangler::optimizeNodePosition(const scalar tol)
# ifdef DEBUGSmooth
Info << "Untangling point " << pointI_ << endl;
# endif
cutRegion cr(bb_);
forAll(tets_, tetI)
{
const partTet& tet = tets_[tetI];
@ -73,41 +73,41 @@ void meshUntangler::optimizeNodePosition(const scalar tol)
(points_[tet.b()] - points_[tet.a()]) ^
(points_[tet.c()] - points_[tet.a()])
);
if( mag(n) < VSMALL ) continue;
plane pl(points_[tet.a()], n);
# ifdef DEBUGSmooth
Info << "tet.a() " << tet.a() << endl;
Info << "Cutting plane ref point " << pl.refPoint() << endl;
Info << "Cutting plane normal " << pl.normal() << endl;
# endif
cr.planeCut(pl);
}
if( cr.points().size() )
{
point p(vector::zero);
const DynList<point, 64>& pts = cr.points();
forAll(pts, pI)
p += pts[pI];
p /= pts.size();
# ifdef DEBUGSmooth
Info << "Corners of the feasible region " << pts << endl;
# endif
for(direction i=0;i<vector::nComponents;++i)
{
const scalar& val = p[i];
if( (val != val) || ((val - val) != (val - val)) )
return;
}
points_[pointI_] = p;
}
}

View file

@ -51,48 +51,48 @@ class partTetMeshSimplex;
/*---------------------------------------------------------------------------*\
Class meshUntangler Declaration
\*---------------------------------------------------------------------------*/
class meshUntangler
:
public simplexSmoother
{
// Private nested classes
class cutRegion
{
// Private data
DynList<point, 64>* pointsPtr_;
DynList<edge, 128>* edgesPtr_;
DynList<DynList<label, 8>, 64>* facesPtr_;
//- helper data
DynList<point, 64>* cPtsPtr_;
DynList<edge, 128>* cEdgesPtr_;
DynList<DynList<label, 8>, 64>* cFacesPtr_;
DynList<label, 64> newVertexLabel_;
DynList<scalar, 64> vertexDistance_;
DynList<direction, 64> vertexTypes_;
DynList<label, 128> newEdgeLabel_;
label origNumVertices_;
scalar tol_;
bool valid_;
// Private member functions
bool findNewVertices(const plane& plane);
void findNewEdges();
void findNewFaces();
//- tie break to resolve problems due to truncation
//- errors
void tieBreak(const DynList<label, 8>& f);
//- remove coincident vertices to improve tie breaking
void removeCoincidentVertices();
void createInitialConfiguration(const boundBox&);
// Enumerations
enum vTypes
{
@ -101,39 +101,39 @@ class meshUntangler
INPLANE = 2,
USED = 4
};
public:
// Constructor
//- Construct from boundBox
cutRegion(const boundBox&);
// Destructor
~cutRegion();
// Member functions
//- return the vertices of the feasible region
inline const DynList<point, 64>& points() const
{
return *pointsPtr_;
}
//- cut the region woth the plane
void planeCut(const plane& plane);
//- export the feasible region as polyMeshGen
void createPolyMeshFromRegion(polyMeshGen&) const;
};
public:
// Constructor
//- Construct from partTetMeshSimplex
meshUntangler(partTetMeshSimplex& simplex);
// Destructor
~meshUntangler();
// Member functions
//- improve the position the the node by putting it
//- into the feasible region

View file

@ -34,7 +34,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void meshUntangler::cutRegion::findNewEdges()
@ -42,13 +42,13 @@ void meshUntangler::cutRegion::findNewEdges()
#ifdef DEBUGSmooth
Info << "Creating new edgesPtr_" << endl;
#endif
cEdgesPtr_ = new DynList<edge, 128>();
DynList<edge, 128>& cEdges = *cEdgesPtr_;
const DynList<point, 64>& pts = *pointsPtr_;
const DynList<edge, 128>& edges = *edgesPtr_;
newEdgeLabel_.setSize(edges.size());
newEdgeLabel_ = -1;
@ -59,7 +59,7 @@ void meshUntangler::cutRegion::findNewEdges()
const label end = e.end();
const label newStartLabel = newVertexLabel_[start];
const label newEndLabel = newVertexLabel_[end];
if( (newStartLabel != -1) && (newEndLabel != -1) )
{
newEdgeLabel_[eI] = cEdges.size();
@ -70,11 +70,11 @@ void meshUntangler::cutRegion::findNewEdges()
//- start edge vertex is not visible, but the other one is
newEdgeLabel_[eI] = cEdges.size();
cEdges.append(edge(newEndLabel, cPtsPtr_->size()));
const scalar t =
-vertexDistance_[start] /
(vertexDistance_[end] - vertexDistance_[start]);
const point newP = (1.0 - t) * pts[start] + t * pts[end];
cPtsPtr_->append(newP);
}
@ -83,15 +83,15 @@ void meshUntangler::cutRegion::findNewEdges()
//- end edge vertex is not visible, but the other one is
newEdgeLabel_[eI] = cEdges.size();
cEdges.append(edge(newStartLabel, cPtsPtr_->size()));
const scalar t =
-vertexDistance_[end] /
(vertexDistance_[start] - vertexDistance_[end]);
const point newP = (1.0 - t) * pts[end] + t * pts[start];
cPtsPtr_->append(newP);
}
# ifdef DEBUGSmooth
if( newEdgeLabel_[eI] != -1 )
{
@ -105,7 +105,7 @@ void meshUntangler::cutRegion::findNewEdges()
}
# endif
}
#ifdef DEBUGSmooth
Info << "Found " << cEdges.size() << " new edges" << endl;
#endif

View file

@ -45,50 +45,50 @@ SourceFiles
namespace Foam
{
// Forward declarations
class partTetMeshSimplex;
/*---------------------------------------------------------------------------*\
Class simplexSmoother Declaration
\*---------------------------------------------------------------------------*/
//- class for volume optimizer
class simplexSmoother
{
protected:
// Protected data
//- mesh points
DynList<point, 128>& points_;
//- list tets around the given vertex
const DynList<partTet, 128>& tets_;
//- label of the point
const label pointI_;
//- bound box
boundBox bb_;
private:
// Private member functions
//- Disallow default bitwise copy construct
simplexSmoother(const simplexSmoother&);
//- Disallow default bitwise assignment
void operator=(const simplexSmoother&);
public:
// Constructor
//- construct from partTetMeshSimplex
simplexSmoother(partTetMeshSimplex& simplex);
// Destructor
virtual ~simplexSmoother();
// Member functions
//- improve the position of the centre node
virtual void optimizeNodePosition(const scalar tol = 0.001) = 0;

View file

@ -46,7 +46,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
class meshSurfaceEngine;
@ -59,39 +59,39 @@ class checkBoundaryFacesSharingTwoEdges
// Private data
//- Reference to polyMeshGen
polyMeshGen& mesh_;
//- pointer to meshSurfaceEngine
mutable meshSurfaceEngine* meshSurfacePtr_;
//- number of boundary faces attached to a boundary vertex
labelList nBndFacesAtBndPoint_;
//- a list of boundary points which can be removed from the mesh
boolList removeBndPoint_;
// Private member functions
//- creates meshSurfaceEngine
void createMeshSurface() const;
//- returns mesh surface
inline const meshSurfaceEngine& meshSurface() const
{
if( !meshSurfacePtr_ )
createMeshSurface();
return *meshSurfacePtr_;
}
//- find the faces connected to each boundary edge
//- mark the points which can be removed
void findFacesAtBndEdge();
//- find the number of faces connected to the boundary vertex
void findBndFacesAtBndVertex();
//- remove vertices from the faces
void removeExcessiveVertices();
//- find boundary faces which shall be decomposed into triangles
label findBndFacesForDecomposition(boolList& decomposeFace);

View file

@ -52,7 +52,7 @@ checkIrregularSurfaceConnections::checkIrregularSurfaceConnections
checkIrregularSurfaceConnections::~checkIrregularSurfaceConnections()
{
clearMeshEngine();
mesh_.clearAddressingData();
}
@ -64,41 +64,41 @@ void checkIrregularSurfaceConnections::checkIrregularVertices
)
{
checkAndFixCellGroupsAtBndVertices(badVertices, false);
checkEdgeFaceConnections(badVertices, false);
checkFaceGroupsAtBndVertices(badVertices, false);
}
bool checkIrregularSurfaceConnections::checkAndFixIrregularConnections()
{
Info << "Checking for irregular surface connections" << endl;
bool finished;
labelHashSet badVertices;
do
{
finished = true;
while( checkAndFixCellGroupsAtBndVertices(badVertices, true) )
finished = false;
while( checkEdgeFaceConnections(badVertices, true) )
finished = false;
if( checkFaceGroupsAtBndVertices(badVertices, true) )
finished = false;
} while( !finished );
polyMeshGenModifier(mesh_).removeUnusedVertices();
Info << "Finished checking for irregular surface connections" << endl;
if( returnReduce(badVertices.size(), sumOp<label>()) != 0 )
return true;
return false;
}

View file

@ -54,7 +54,7 @@ class checkIrregularSurfaceConnections
// Private data
//- Reference to polyMeshGen
polyMeshGen& mesh_;
//- pointer to meshSurfaceEngine
mutable meshSurfaceEngine* meshSurfacePtr_;
@ -64,16 +64,16 @@ class checkIrregularSurfaceConnections
{
if( !meshSurfacePtr_ )
meshSurfacePtr_ = new meshSurfaceEngine(mesh_);
return *meshSurfacePtr_;
}
//- clear meshSurfaceEngine. Used in case if the mesh is modified
inline void clearMeshEngine()
{
deleteDemandDrivenData(meshSurfacePtr_);
}
//- check if there exist vertices with more than one groups of cells
//- attached to it
bool checkAndFixCellGroupsAtBndVertices
@ -81,7 +81,7 @@ class checkIrregularSurfaceConnections
labelHashSet& badVertices,
const bool removeConnections = false
);
//- check if all boundary edges are connected
//- to two boundary faces, only!
bool checkEdgeFaceConnections
@ -89,7 +89,7 @@ class checkIrregularSurfaceConnections
labelHashSet& badVertices,
const bool removeCells = false
);
//- check if all boundary face connected to a boundary vertex
//- are connected into a single group of faces that can be visited
//- over edges

View file

@ -56,12 +56,12 @@ class checkNonMappableCellConnections
// Private data
//- Reference to polyMeshGen
polyMeshGen& mesh_;
//- type of cell
labelList cellType_;
// Enumerations
enum cellTypes_
{
NONE = 0,

View file

@ -52,22 +52,22 @@ class topologicalCleaner
{
// Private data
polyMeshGen& mesh_;
bool changed_;
boolList decomposeCell_;
// Private member functions
//- check and fix incorrectly connected faces
void checkNonConsecutiveBoundaryVertices();
//- check and fix non-mappable faces
void checkNonMappableFaces();
//- check and fix non-mappable cells
void checkNonMappableCells();
//- decompose marked cells
void decomposeCells();
@ -99,7 +99,7 @@ public:
(
labelHashSet* irregularNodes = NULL
);
//- check and fix vertices where two or more groups of faces meet
void checkInvalidConnectionsForVerticesFaces
(

View file

@ -59,17 +59,17 @@ class meshSurfaceCheckInvertedVertices
// Private data
//- mesh surface partitioner
const meshSurfacePartitioner& surfacePartitioner_;
//- active surface points
const boolList* activePointsPtr_;
//- set of inverted vertices
labelHashSet invertedVertices_;
// Private member functions
//- check vertices by calculating dot products
void checkVertices();
//- Disallow default bitwise copy construct
meshSurfaceCheckInvertedVertices
(

View file

@ -56,11 +56,11 @@ class meshSurfaceEdgeExtractor
// Private data
//- mesh
polyMeshGen& mesh_;
label nPoints_;
boolList boundaryCell_;
List<direction> nFacesInCell_;
//- reference to the octree
@ -72,10 +72,10 @@ class meshSurfaceEdgeExtractor
// Private member functions
//- remove old boundary faces
void removeOldBoundaryFaces();
//- create vertices on surface edges
void createEdgeVertices();
//- create new boundary faces
void createBoundaryFaces();

View file

@ -59,7 +59,7 @@ class meshSurfaceEngineModifier
void operator=(const meshSurfaceEngineModifier&);
public:
// Constructors
//- Construct from reference to meshSurfaceEngine
@ -73,25 +73,25 @@ public:
~meshSurfaceEngineModifier();
// Member Functions
//- relocate the selected boundary vertex
void moveBoundaryVertexNoUpdate(const label bpI, const point& newP);
//- relocate the selected boundary vertex and update geometry data
void moveBoundaryVertex(const label bpI, const point& newP);
//- update normals of boundary vertices at processor boundaries
inline void updateVertexNormals()
{
if( surfaceEngine_.pointNormalsPtr_ )
surfaceEngine_.updatePointNormalsAtProcBoundaries();
}
//- updates faceCentres, face normal, and point normals
//- of the boundary faces attached to the selected boundary points
void updateGeometry(const labelLongList&);
void updateGeometry();
//- makes sure that all surface vertices at parallel boundaries
//- have the same coordinates
void syncVerticesAtParallelBoundaries();

View file

@ -39,7 +39,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void meshSurfaceMapper::createMeshSurfacePartitioner() const
@ -51,7 +51,7 @@ void meshSurfaceMapper::createTriSurfacePartitioner() const
{
surfPartitionerPtr_ = new triSurfacePartitioner(meshOctree_.surface());
}
void meshSurfaceMapper::clearOut()
{
if( deletePartitioner_ )

View file

@ -56,9 +56,9 @@ class parMapperHelper
scalar movingDist_;
label globalLabel_;
label patch_;
public:
// Constructors
explicit inline parMapperHelper()
:
@ -67,7 +67,7 @@ class parMapperHelper
globalLabel_(-1),
patch_(-1)
{};
explicit inline parMapperHelper
(
const point& p,
@ -81,7 +81,7 @@ class parMapperHelper
globalLabel_(globalLabel),
patch_(patchLabel)
{}
// Destructor
~parMapperHelper()
{};
@ -92,27 +92,27 @@ class parMapperHelper
{
return p_;
}
//- return moving distance
inline const scalar& movingDistance() const
{
return movingDist_;
}
//- return global label
inline label globalLabel() const
{
return globalLabel_;
}
//- return patch the point is mapped to
inline label pointPatch() const
{
return patch_;
}
// Operators
inline void operator=(const parMapperHelper& h)
{
p_ = h.p_;
@ -120,15 +120,15 @@ class parMapperHelper
globalLabel_ = h.globalLabel_;
patch_ = h.patch_;
}
inline bool operator!=(const parMapperHelper& h) const
{
if( globalLabel_ != h.globalLabel_ )
return true;
return false;
}
// Friend operators
friend Ostream& operator<<(Ostream& os, const parMapperHelper& h)
{
@ -142,23 +142,23 @@ class parMapperHelper
os.check("operator<<(Ostream&, const parMapperHelper&");
return os;
}
friend Istream& operator>>(Istream& is, parMapperHelper& h)
{
// Read beginning of parMapperHelper
is.readBegin("parMapperHelper");
is >> h.p_;
is >> h.movingDist_;
is >> h.globalLabel_;
is >> h.patch_;
// Read end of parMapperHelper
is.readEnd("parMapperHelper");
// Check state of Istream
is.check("operator>>(Istream&, parMapperHelper");
return is;
}
};

View file

@ -54,14 +54,14 @@ class renameBoundaryPatches
// Private data
//- mesh
polyMeshGen& mesh_;
//- dictionary containing relevant information
const IOdictionary& meshDict_;
// Private member functions
//- calculate new boundary and replace the existing one
void calculateNewBoundary();
//- Disallow default bitwise copy construct
renameBoundaryPatches(const renameBoundaryPatches&);

View file

@ -57,18 +57,18 @@ class surfaceMorpherCells
//- number of internal faces
label nIntFaces_;
//- true for vertices which are at the boundary
boolList boundaryVertex_;
//- true for cells which are at the boundary
List<direction> cellFlags_;
//- new boundary faces and owner cells
VRWGraph newBoundaryFaces_;
labelLongList newBoundaryOwners_;
labelLongList newBoundaryPatches_;
// Private enumerators
enum cellTypes
{
@ -80,19 +80,19 @@ class surfaceMorpherCells
// Private member functions
//- find surface vertices
void findBoundaryVertices();
//- find boundary cells
void findBoundaryCells();
//- remove cells with all vertices at the boundary
bool removeCellsWithAllVerticesAtTheBoundary();
//- morph boundary faces
bool morphBoundaryFaces();
//- morph internal faces
bool morphInternalFaces();
//- replace the boundary of the mesh with the newly created one
void replaceMeshBoundary();

View file

@ -35,9 +35,9 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const meshOctreeCubeCoordinates tetCreatorOctree::edgeCoordinates_[12][4]=
{
{ //- edge 0
@ -113,7 +113,7 @@ const meshOctreeCubeCoordinates tetCreatorOctree::edgeCoordinates_[12][4]=
meshOctreeCubeCoordinates(0, 1, 0, 0)
}
};
const label tetCreatorOctree::faceCentreHelper_[3][4] =
{
{3, 5, 2, 4},
@ -124,18 +124,18 @@ const label tetCreatorOctree::faceCentreHelper_[3][4] =
void tetCreatorOctree::createTets()
{
createPointsAndAddressing();
createTetsFromFacesWithCentreNode();
createTetsAroundSplitEdges();
createTetsAroundEdges();
createTetsFromSplitFaces();
clearOut();
sortedLeaves_.setSize(0);
created_ = true;
}
@ -166,7 +166,7 @@ tetCreatorOctree::tetCreatorOctree
created_(false)
{
createTets();
clearOut();
}

View file

@ -56,65 +56,65 @@ class tetCreatorOctree
// Private data
//- helper for searching coordinates of cubes around an edge
static const meshOctreeCubeCoordinates edgeCoordinates_[12][4];
//- helper for finding face centres of cubes sharing an edge
static const label faceCentreHelper_[3][4];
//- reference to the octree
meshOctreeAddressing octreeCheck_;
//- points of the tetrahedrisation
LongList<point> tetPoints_;
//- tetrahedra
LongList<partTet> tets_;
//- octree leaves sorted according to their level
List<labelLongList> sortedLeaves_;
//- node labels of vertices created inside split-hex boxes
VRWGraph* subNodeLabelsPtr_;
//- cube centre label
labelList* cubeLabelPtr_;
//- cube face label
VRWGraph* faceCentreLabelPtr_;
//- are tets created or not
bool created_;
// Private member functions
//- deletes all pointer data
void clearOut();
//- find elements which will be used as mesh cells
void selectElements();
// Private member functions for creating tetrahedra
//- create tetPoints_ and necessary addressing
void createPointsAndAddressing();
//- create faceCentreLabelPtr_
void createFaceCentreLabels();
//- create tetrahedra from faces, owner and neighbour
void createTetsAroundEdges();
//- create tetrahedra from split faces
void createTetsFromSplitFaces();
//- create tetrahedra from faces which share at least one edge
//- with a refined cube
void createTetsFromFacesWithCentreNode();
//- create tetrahedra from faces with split edges
void createTetsAroundSplitEdges();
//- helper funtion which checks validity of a created tet and appends
//- it if valid
inline void checkAndAppendTet(const partTet);
//- function containing the workflow
void createTets();
@ -149,10 +149,10 @@ public:
(
"const LongList<point>& tetPoints() const"
) << "Tets are not created!" << exit(FatalError);
return tetPoints_;
}
const LongList<partTet>& tets() const
{
if( !created_ )
@ -160,7 +160,7 @@ public:
(
"const LongList<point>& tets() const"
) << "Tets are not created!" << exit(FatalError);
return tets_;
}
};

View file

@ -34,67 +34,67 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void tetCreatorOctree::createTetsFromFacesWithCentreNode()
{
Info << "Creating tets from faces with centre node" << endl;
const labelList& cubeLabel = *cubeLabelPtr_;
const VRWGraph& nodeLabels = octreeCheck_.nodeLabels();
const VRWGraph& subNodeLabels = *subNodeLabelsPtr_;
const FRWGraph<label, 8>& pointLeaves = octreeCheck_.nodeLeaves();
if( !faceCentreLabelPtr_ )
faceCentreLabelPtr_ = new VRWGraph(cubeLabel.size());
VRWGraph& faceCentreLabel = *faceCentreLabelPtr_;
//- start creating tets
forAll(pointLeaves, pointI)
{
label pl[8];
bool create(true);
for(label plI=0;plI<8;++plI)
{
pl[plI] = pointLeaves(pointI, plI);
if( pl[plI] == -1 )
if( pl[plI] == -1 )
{
create = false;
break;
}
}
if( !create )
continue;
//- create 6 tets for each possible combination
//- there are 12 possible combinations
for(label fI=0;fI<6;++fI)
{
const label* fEdges = meshOctreeCubeCoordinates::faceEdges_[fI];
for(label feI=0;feI<2;++feI)
{
const label feJ = feI + 2;
//- the are two possible combinations of edges for each face
const label* sEdge =
meshOctreeCubeCoordinates::edgeNodes_[fEdges[feI]];
const label* eEdge =
meshOctreeCubeCoordinates::edgeNodes_[fEdges[feJ]];
const label sp = sEdge[0];
const label ep = eEdge[0];
if( pl[sp] == pl[ep] )
continue;
if( pl[sp] != pl[sEdge[1]] )
continue;
if( pl[ep] != pl[eEdge[1]] )
continue;
# ifdef DEBUGTets
Info << "Octree node " << pointI << " has leaves";
for(label plI=0;plI<8;++plI)
@ -103,7 +103,7 @@ void tetCreatorOctree::createTetsFromFacesWithCentreNode()
Info << "Searching face " << fI << endl;
Info << "Searching face edge " << feI << endl;
# endif
//- allocate face centre labels
if( faceCentreLabel.sizeOfRow(pl[sp]) == 0 )
{
@ -119,22 +119,22 @@ void tetCreatorOctree::createTetsFromFacesWithCentreNode()
}
//- create centre labels
label fs, fe;
fs = meshOctreeCubeCoordinates::edgeFaces_[fEdges[feJ]][0];
if( fs == fI )
fs = meshOctreeCubeCoordinates::edgeFaces_[fEdges[feJ]][1];
fe = meshOctreeCubeCoordinates::edgeFaces_[fEdges[feI]][0];
if( fe == fI )
fe = meshOctreeCubeCoordinates::edgeFaces_[fEdges[feI]][1];
# ifdef DEBUGTets
Info << "Face for the cube at edge " << feI << " is "
<< fs << endl;
Info << "Face for the cube at edge " << feJ << " is "
<< fe << endl;
#endif
//- create face centre point
if( faceCentreLabel(pl[sp], fs) == -1 )
{
@ -147,7 +147,7 @@ void tetCreatorOctree::createTetsFromFacesWithCentreNode()
p /= 4;
tetPoints_.append(p);
}
//- create tets connecting centroids
checkAndAppendTet
(
@ -169,17 +169,17 @@ void tetCreatorOctree::createTetsFromFacesWithCentreNode()
cubeLabel[pl[sp]]
)
);
FixedList<label, 4> subNodes;
subNodes[0] = subNodeLabels(pl[sp], 7-sEdge[1]);
subNodes[1] = subNodeLabels(pl[sp], 7-sEdge[0]);
subNodes[2] = subNodeLabels(pl[ep], 7-eEdge[0]);
subNodes[3] = subNodeLabels(pl[ep], 7-eEdge[1]);
# ifdef DEBUGTets
Info << "Sub nodes are " << subNodes << endl;
# endif
forAll(subNodes, nodeI)
{
checkAndAppendTet

View file

@ -39,11 +39,11 @@ inline void tetCreatorOctree::checkAndAppendTet(const partTet pt)
valid = false;
break;
}
if( valid )
{
tets_.append(pt);
# ifdef DEBUGTets
Info << "Added tet " << (tets_.size()-1) << " is "
<< tets_[tets_.size()-1] << endl;

View file

@ -34,31 +34,31 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void tetCreatorOctree::createTetsFromSplitFaces()
{
Info << "Creating tets from split faces" << endl;
const labelList& cubeLabel = *cubeLabelPtr_;
const VRWGraph& subNodeLabels = *subNodeLabelsPtr_;
const FRWGraph<label, 8>& pLeaves = octreeCheck_.nodeLeaves();
forAll(pLeaves, pointI)
{
for(label i=0;i<6;++i)
{
const label* fNodes =
meshOctreeCubeCoordinates::faceNodes_[i];
const label cLabel = pLeaves(pointI, fNodes[0]);
if( cLabel < 0 )
continue;
if( cubeLabel[cLabel] < 0 )
continue;
if(
(cLabel == pLeaves(pointI, fNodes[1])) &&
(cLabel == pLeaves(pointI, fNodes[2])) &&

View file

@ -47,7 +47,7 @@ anisotropicSources
scaleY 1;
scaleZ 0.3;
}
/*
planeUpper
{
@ -57,7 +57,7 @@ anisotropicSources
scalingDistance 125;
scalingFactor 0.5;
}
planeLower
{
type plane;
@ -68,7 +68,7 @@ anisotropicSources
}
*/
}
boundaryLayers
{
@ -80,7 +80,7 @@ boundaryLayers
thicknessRatio 1.1;
}
}
optimiseLayer 1;
optimisationParameters

View file

@ -2,7 +2,7 @@ cfMesh Example Case
Date: 02 October 2014
Application: cartesianMesh
Goal: Demonstration of the regular expressions feature available within
Goal: Demonstration of the regular expressions feature available within
cfMesh for specifying patch names in the meshDict file.
STL File: singleOrifice.stl

View file

@ -27,7 +27,7 @@ minCellSize 0.50;
anisotropicSources
{
Plane
Plane
{
type plane;
origin (0 0 -20);

View file

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/

View file

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/

View file

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/

View file

@ -2,7 +2,7 @@ cfMesh Example Case
Date: 08 June 2015
Application: pMesh
Goal: Demonstration of the regular expressions feature available within
Goal: Demonstration of the regular expressions feature available within
cfMesh for specifying patch names in the meshDict file.
STL File: multipleOrifices.stl

View file

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/

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