diff --git a/applications/test/stringList/stringListTest.C b/applications/test/stringList/stringListTest.C index 98391ef5be..13718be6f0 100644 --- a/applications/test/stringList/stringListTest.C +++ b/applications/test/stringList/stringListTest.C @@ -27,6 +27,7 @@ Description \*---------------------------------------------------------------------------*/ #include "stringListOps.H" +#include "IStringStream.H" #include "IOstreams.H" using namespace Foam; @@ -36,21 +37,59 @@ using namespace Foam; int main(int argc, char *argv[]) { - stringList sl(3); - sl[0] = "hello"; - sl[1] = "heello"; - sl[2] = "heeello"; + stringList strLst + ( + IStringStream + ( + "(" + "\"hello\"" + "\"heello\"" + "\"heeello\"" + "\"bye\"" + "\"bbye\"" + "\"bbbye\"" + "\"okey\"" + "\"okkey\"" + "\"okkkey\"" + ")" + )() + ); - labelList matches = findStrings(".*ee.*", sl); + wordReList reLst(IStringStream("( okey \"[hy]e+.*\" )")()); - Info<< "matches found for regexp .*ee.* : "; + Info<< "stringList " << strLst << nl; + + labelList matches = findStrings(".*ee.*", strLst); + + Info<< "matches found for regexp .*ee.* :" << nl << matches << nl; forAll(matches, i) { - Info<< " " << sl[matches[i]]; + Info<< " -> " << strLst[matches[i]] << nl; } Info<< endl; - Info << "End\n" << endl; + matches = findStrings(reLst, strLst); + + Info<< "matches found for " << reLst << nl << matches << nl; + forAll(matches, i) + { + Info<< " -> " << strLst[matches[i]] << nl; + } + Info<< endl; + + stringList subLst = subsetStrings(".*ee.*", strLst); + Info<< "subset stringList: " << subLst << nl; + + subLst = subsetStrings(reLst, strLst); + Info<< "subset stringList: " << subLst << nl; + + inplaceSubsetStrings(reLst, strLst); + Info<< "subsetted stringList: " << strLst << nl; + + inplaceSubsetStrings(".*l.*", strLst); + Info<< "subsetted stringList: " << strLst << nl; + + Info<< "\nEnd\n" << endl; return 0; } diff --git a/applications/utilities/mesh/generation/blockMesh/Make/files b/applications/utilities/mesh/generation/blockMesh/Make/files index 81f5f36749..74840e9732 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/files +++ b/applications/utilities/mesh/generation/blockMesh/Make/files @@ -1,31 +1,3 @@ -curvedEdges = curvedEdges - -$(curvedEdges)/curvedEdge.C -$(curvedEdges)/lineEdge.C -$(curvedEdges)/polyLine.C -$(curvedEdges)/polyLineEdge.C -$(curvedEdges)/arcEdge.C -$(curvedEdges)/spline.C -$(curvedEdges)/BSpline.C -$(curvedEdges)/simpleSplineEdge.C -$(curvedEdges)/polySplineEdge.C -$(curvedEdges)/lineDivide.C - -blockMesh.C -blockDescriptor.C -setEdge.C -block.C -createTopology.C -checkBlockMesh.C -createBlockOffsets.C -createMergeList.C -createPoints.C -createCells.C -createPatches.C -blockPoints.C -blockCells.C -blockBoundary.C - blockMeshApp.C EXE = $(FOAM_APPBIN)/blockMesh diff --git a/applications/utilities/mesh/generation/blockMesh/Make/options b/applications/utilities/mesh/generation/blockMesh/Make/options index a5b85e4298..2e07c477da 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/options +++ b/applications/utilities/mesh/generation/blockMesh/Make/options @@ -1,8 +1,9 @@ EXE_INC = \ - -I$(curvedEdges) \ + -I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ + -lblockMesh \ -lmeshTools \ -ldynamicMesh diff --git a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C b/applications/utilities/mesh/generation/blockMesh/blockBoundary.C deleted file mode 100644 index 8086aeea54..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C +++ /dev/null @@ -1,209 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates boundary patches for the block - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockBoundary() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - // x-direction - - label wallLabel = 0; - label wallCellLabel = 0; - - // x-min - boundaryPatches_[wallLabel].setSize(nj*nk); - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(0, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(0, j, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(0, j + 1, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(0, j + 1, k); - - // update the counter - wallCellLabel++; - } - } - - // x-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(nj*nk); - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(ni, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(ni, j+1, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(ni, j+1, k+1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(ni, j, k+1); - - // update the counter - wallCellLabel++; - } - } - - // y-direction - - // y-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, 0, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, 0, k + 1); - - // update the counter - wallCellLabel++; - } - } - - // y-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, nj, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, nj, k); - - // update the counter - wallCellLabel++; - } - } - - // z-direction - - // z-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, 0); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, j, 0); - - // update the counter - wallCellLabel++; - } - } - - // z-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, nk); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, j + 1, nk); - - // update the counter - wallCellLabel++; - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/blockMesh/blockCells.C b/applications/utilities/mesh/generation/blockMesh/blockCells.C deleted file mode 100644 index acecc71700..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockCells.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates cells for the block. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockCells() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - label cellNo = 0; - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - for (label i = 0; i <= ni - 1; i++) - { - cells_[cellNo].setSize(8); - - cells_[cellNo][0] = vtxLabel(i, j, k); - cells_[cellNo][1] = vtxLabel(i+1, j, k); - cells_[cellNo][2] = vtxLabel(i+1, j+1, k); - cells_[cellNo][3] = vtxLabel(i, j+1, k); - cells_[cellNo][4] = vtxLabel(i, j, k+1); - cells_[cellNo][5] = vtxLabel(i+1, j, k+1); - cells_[cellNo][6] = vtxLabel(i+1, j+1, k+1); - cells_[cellNo][7] = vtxLabel(i, j+1, k+1); - cellNo++; - } - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C b/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C deleted file mode 100644 index 7d40c4d7cb..0000000000 --- a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C +++ /dev/null @@ -1,248 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "blockDescriptor.H" -#include "scalarList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void blockDescriptor::makeBlockEdges() -{ - // for all edges check the list of curved edges. If the edge is curved, - // add it to the list. If the edge is not found, create is as a line - - setEdge(0, 0, 1, n_.x()); - setEdge(1, 3, 2, n_.x()); - setEdge(2, 7, 6, n_.x()); - setEdge(3, 4, 5, n_.x()); - - setEdge(4, 0, 3, n_.y()); - setEdge(5, 1, 2, n_.y()); - setEdge(6, 5, 6, n_.y()); - setEdge(7, 4, 7, n_.y()); - - setEdge(8, 0, 4, n_.z()); - setEdge(9, 1, 5, n_.z()); - setEdge(10, 2, 6, n_.z()); - setEdge(11, 3, 7, n_.z()); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// from components -blockDescriptor::blockDescriptor -( - const cellShape& bshape, - const pointField& blockMeshPoints, - const curvedEdgeList& edges, - const Vector