From 510a35b85245d2d081795cd810cd2e6f1a545df3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Feb 2009 13:12:05 +0000 Subject: [PATCH] distribution of triSurfaces --- .../autoHexMeshDriver/autoHexMeshDriver.C | 8 +- .../autoHexMeshDriver/autoRefineDriver.C | 9 +- .../refinementSurfaces/refinementSurfaces.C | 4 +- src/meshTools/Make/options | 2 + .../distributedTriSurfaceMesh.C | 415 +++++++++++++----- .../distributedTriSurfaceMesh.H | 87 ++-- .../searchableSurface/searchableSurfaces.C | 9 + 7 files changed, 391 insertions(+), 143 deletions(-) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C index 7a3152b494..0438fa276d 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C @@ -223,10 +223,10 @@ Foam::autoHexMeshDriver::autoHexMeshDriver ( IOobject ( - "abc", // dummy name - mesh_.time().timeName(), // directory - "triSurface", // instance - mesh_.time(), // registry + "abc", // dummy name + mesh_.time().findInstance("triSurface", word::null),// inst + "triSurface", // local + mesh_.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE ), diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index e53c4e041a..e891cf761c 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -77,10 +77,11 @@ Foam::label Foam::autoRefineDriver::readFeatureEdges ( IOobject ( - featFileName, // name - mesh.time().constant(), // directory - "triSurface", // instance - mesh.time(), // registry + featFileName, // name + mesh.time().findInstance("triSurface", featFileName), + // instance + "triSurface", // local + mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE, false diff --git a/src/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C index 2566a66e21..a626103cd1 100644 --- a/src/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C @@ -522,8 +522,8 @@ void Foam::refinementSurfaces::setMinLevelFields IOobject ( "minLevel", - triMesh.objectRegistry::time().constant(),// directory - "triSurface", // instance + triMesh.objectRegistry::time().timeName(), // instance + "triSurface", // local triMesh, IOobject::NO_READ, IOobject::AUTO_WRITE diff --git a/src/meshTools/Make/options b/src/meshTools/Make/options index ef1033b0e8..d550c78e4c 100644 --- a/src/meshTools/Make/options +++ b/src/meshTools/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude LIB_LIBS = \ -ltriSurface \ + -ldecompositionMethods \ -llagrangian diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C index 0f44333b6e..0602046703 100644 --- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C +++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C @@ -31,38 +31,56 @@ License #include "triangleFuncs.H" #include "matchPoints.H" #include "globalIndex.H" -#include "PackedBoolList.H" #include "Time.H" +#include "IFstream.H" +#include "decompositionMethod.H" +#include "vectorList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(distributedTriSurfaceMesh, 0); - addToRunTimeSelectionTable - ( - searchableSurface, - distributedTriSurfaceMesh, - dict - ); - scalar distributedTriSurfaceMesh::mergeDist_ = SMALL; +defineTypeNameAndDebug(distributedTriSurfaceMesh, 0); +addToRunTimeSelectionTable(searchableSurface, distributedTriSurfaceMesh, dict); + } +template<> +const char* +Foam::NamedEnum::names[] = +{ + "follow", + "independent", + "frozen" +}; + +const Foam::NamedEnum + Foam::distributedTriSurfaceMesh::distributionTypeNames_; + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Read my additional data from the dictionary bool Foam::distributedTriSurfaceMesh::read() { - // Get bb of all domains + // Get bb of all domains. procBb_.setSize(Pstream::nProcs()); procBb_[Pstream::myProcNo()] = List(dict_.lookup("bounds")); Pstream::gatherList(procBb_); Pstream::scatterList(procBb_); + // Distribution type + distType_ = distributionTypeNames_.read(dict_.lookup("distributionType")); + + if (dict_.found("mergeDistance")) + { + dict_.lookup("mergeDistance") >> mergeDist_; + } + return true; } @@ -86,7 +104,69 @@ bool Foam::distributedTriSurfaceMesh::isLocal } -void Foam::distributedTriSurfaceMesh::splitSegment +//void Foam::distributedTriSurfaceMesh::splitSegment +//( +// const label segmentI, +// const point& start, +// const point& end, +// const treeBoundBox& bb, +// +// DynamicList& allSegments, +// DynamicList